:root{--app-text-scale:1;--app-accent:#15766c;--app-danger:#b52d40;color-scheme:light dark}
html{font-size:calc(16px * var(--app-text-scale))}
button,input,select,textarea,a.btn{font:inherit}
button,a.btn{min-height:44px;min-width:44px;touch-action:manipulation}
input,select,textarea{font-size:max(16px,1rem)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--app-accent);outline-offset:3px}
.overlay-body,.harness-body{padding-bottom:calc(32px + env(safe-area-inset-bottom));max-width:920px;width:100%;margin-inline:auto;box-sizing:border-box}
.card{border-radius:18px;overflow-wrap:anywhere}
.app-field{display:flex;flex-direction:column;gap:8px;margin:16px 0;color:var(--text)}
.app-field input,.app-field textarea,.app-field select{width:100%;box-sizing:border-box;padding:12px;border:1px solid var(--border,#b5b9b8);border-radius:12px;color:inherit;background:var(--surface,var(--bg,#fff))}
.app-field textarea{min-height:112px;resize:vertical}
.app-field input[type=checkbox]{width:24px;height:24px;accent-color:var(--app-accent)}
.app-state{padding:24px 16px;border:1px solid var(--border,#ccd3d1);border-radius:16px;background:var(--surface,var(--bg));line-height:1.6}
.app-state[data-state=loading]{opacity:.8}.app-state[data-state=error],[data-state=error]{color:var(--app-danger)}
.app-offline{position:fixed;top:env(safe-area-inset-top);left:12px;right:12px;z-index:20000;padding:12px;border-radius:12px;background:#713a00;color:white;text-align:center}
.app-offline[hidden]{display:none}
.upload-progress{display:grid;grid-template-columns:1fr auto;gap:8px;padding:10px 12px;border:1px solid var(--border,#ccd3d1);border-radius:12px;margin-block:8px;overflow-wrap:anywhere;background:var(--bg)}
.upload-progress>div{grid-column:1/-1}.upload-progress progress{width:100%;height:12px;align-self:center;accent-color:var(--app-accent)}
.upload-progress[data-phase=complete]{border-color:var(--app-accent)}.upload-progress[data-phase=error]{border-color:var(--app-danger)}
.sbf-upload-queue{max-height:28dvh;overflow:auto}.sbf-compose-tools{flex-wrap:wrap}
.attachment-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding-block:16px;border-bottom:1px solid var(--border,#ccd3d1)}
.attachment-row>div{flex:1;min-width:150px}.attachment-row small,.card>small{display:block;color:var(--text2);line-height:1.6}
.attachment-preview{width:100%;height:auto;max-height:70dvh;object-fit:contain}.attachment-pdf{width:100%;height:65dvh;border:0}
.source-link{display:block;padding:12px 0;text-decoration:underline;color:var(--app-accent)}.digest-content{line-height:1.75;white-space:pre-wrap}
.menu-group{display:grid;grid-template-columns:1fr 1fr;gap:8px}.menu-group h2{grid-column:1/-1;margin:24px 4px 4px;font-size:.85rem;color:var(--text2);font-weight:600}.menu-group button{margin:0;text-align:left}
[data-stale=true]{opacity:.78;border-style:dashed}
html[data-theme=night]{--app-accent:#75d4c5;--app-danger:#ff9cac;color-scheme:dark}html[data-theme=day]{color-scheme:light}
html[data-reduce-motion=true] *,html[data-reduce-motion=true] *::before,html[data-reduce-motion=true] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(max-width:420px){.menu-group{grid-template-columns:1fr}.card .btn{margin:4px 4px 4px 0}.overlay-body{padding-inline:12px}}
