:root{--surface:#fff;--surface-soft:#edf3ef;--app-header-height:102px;--alert-red:#a2322d;--alert-yellow:#806000;--theme-accent:#215e54;color-scheme:light}
html[data-theme=sea]{--bg:#edf4f6;--surface:#fafdff;--surface-soft:#dceef2;--ink:#173b50;--muted:#4c6978;--line:#c5dce3;--theme-accent:#176879;--navy:#1c5165;--teal:#176879}
html[data-theme=minimal]{--bg:#f4f4f2;--surface:#fff;--surface-soft:#e9e9e5;--ink:#292d2e;--muted:#616766;--line:#d6d8d4;--theme-accent:#343b39;--navy:#343b39;--teal:#343b39}
html[data-theme=dark]{--bg:#111e29;--surface:#1b2c39;--surface-soft:#263e4c;--ink:#e4edf2;--muted:#afc1ca;--line:#405563;--theme-accent:#92d1c2;--navy:#315f70;--teal:#92d1c2;--alert-red:#ffb3a9;--alert-yellow:#f5d07c;color-scheme:dark}
@media(prefers-color-scheme:dark){html[data-theme=system]{--bg:#111e29;--surface:#1b2c39;--surface-soft:#263e4c;--ink:#e4edf2;--muted:#afc1ca;--line:#405563;--theme-accent:#92d1c2;--navy:#315f70;--teal:#92d1c2;--alert-red:#ffb3a9;--alert-yellow:#f5d07c;color-scheme:dark}}
body,body.captainSimple{background:var(--bg);color:var(--ink)}
body header,body.captainSimple header{z-index:90;background:var(--surface);color:var(--ink);border-color:var(--line);height:auto;min-height:102px}
header .top #user{grid-column:3;max-width:100%}header{grid-template-columns:minmax(0,1fr) auto auto 48px}
#appSettingsButton{grid-column:4;grid-row:1;justify-self:end;display:grid;place-items:center;border:1px solid var(--line);background:var(--surface);color:var(--ink);width:44px;min-height:44px;border-radius:12px;font-size:24px}
@media(max-width:650px){header{grid-template-columns:minmax(0,1fr) auto 44px;gap:8px;padding-left:3%;padding-right:3%}header .top #user{grid-column:2;padding:8px;max-width:145px}header .top #headerDate{grid-column:1/-1;grid-row:2}#appSettingsButton{grid-column:3}header .brand{font-size:20px;letter-spacing:.1em}header .brand small{font-size:10px}}
.deskBack{top:var(--app-header-height);z-index:40;background:var(--surface);border-color:var(--line);backdrop-filter:none;margin:0 0 12px;padding:6px 0}
.deskBack button{display:grid;place-items:center;width:48px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--theme-accent)}
.deskSymbol{font-size:30px;font-family:'Segoe UI Symbol','Apple Symbols',sans-serif;line-height:1}
[data-desk-tile],[data-desk-tile] *,[data-desk-rename-key],.deskRename{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.deskTile{touch-action:pan-y}
.deskTile,.deskMessages,.deskList,.deskRow,.nextList,.nextRow,.card,.option,input,select,textarea,dialog,.formActions,.user,#captainBottom,.notice,.returnReason{background:var(--surface);color:var(--ink);border-color:var(--line)}
.deskTitle,.deskTile,.deskRow,.deskMessages,.nextRow,.deskGroup,.task h3,.task p{color:var(--ink)}
.deskTile small,.deskRow small,.nextRow small,.nextHeading p,.nextEmpty,.deskContext,.deskGroup{color:var(--muted)}
.deskTile:hover,.deskMessages:hover,.deskRow:hover,.nextRow:hover,.option.selected{background:var(--surface-soft)}
.deskTile small.deskTone-red{color:var(--alert-red);font-weight:650}.deskTile small.deskTone-yellow{color:var(--alert-yellow);font-weight:650}
.deskRename{color:var(--muted)}#captainBottom button{color:var(--muted)}#captainBottom button[aria-current=page]{color:var(--theme-accent);background:var(--surface-soft)}
.btn{background:var(--surface);color:var(--ink);border-color:var(--line)}.btn.primary{background:var(--navy);color:#fff}.btn.danger{color:var(--alert-red)}.quiet{color:var(--muted)}
.settingsSection{border-top:1px solid var(--line);margin-top:24px;padding-top:12px}.settingsSection h3{font-size:17px}.settingsSection .nextList{margin-top:12px}#flowDialog:has(.settingsSection){width:min(760px,94vw);max-height:90dvh;overflow:auto;border:1px solid var(--line);border-radius:18px;padding:24px}
html[data-theme=dark] :is(.task-red,.task-yellow,.task-green,.task-approved,.taskTabs .btn,.notice,.tag,.good,.late,.pill,.receipt){background:var(--surface-soft);color:var(--ink)}
@media(prefers-color-scheme:dark){html[data-theme=system] :is(.task-red,.task-yellow,.task-green,.task-approved,.taskTabs .btn,.notice,.tag,.good,.late,.pill,.receipt){background:var(--surface-soft);color:var(--ink)}}
html[data-text=large] body{font-size:18px}html[data-text=large] :is(.sub,.deskRow small,.nextRow small,.task p){font-size:16px}html[data-text=large] :is(.deskTile strong,.deskRow strong,.nextRow strong){font-size:20px}
html[data-motion=reduced] *,html[data-motion=reduced] *::before,html[data-motion=reduced] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
@media print{#appSettingsButton,.deskBack{display:none!important}body{background:#fff!important;color:#000!important}}

.deskTile small.deskTone-green{color:var(--theme-accent)}
.deskBadge{background:var(--surface-soft);color:var(--ink)}.deskBadge.hasUnread{background:#b44037;color:#fff}
#flowDialog .nextRow{background:var(--surface);color:var(--ink);border-color:var(--line)}#flowDialog .nextRow:hover{background:var(--surface-soft)}

/* One compact section card, sharing the tile identity; content stays under header. */
.deskBack{display:flex;align-items:center;gap:4px;padding:8px 0}
.deskBack .deskMiniTile{display:flex;align-items:center;gap:12px;width:auto;min-width:150px;max-width:calc(100% - 52px);min-height:62px;padding:12px 18px;border-radius:14px;font:inherit;background:var(--surface);color:var(--ink);text-align:left}
.deskMiniTile .deskSymbol{font-size:26px;color:var(--theme-accent)}.deskMiniTile strong{font-size:16px;line-height:1.3}
.deskBack .deskRenameMini{border:0;width:44px;font-size:25px;color:var(--muted)}
.deskHolding{outline:2px solid var(--theme-accent);outline-offset:3px}
#app{touch-action:pan-y pinch-zoom}
[data-desk-rename-key] *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.deskFilters{display:grid;grid-template-columns:2fr 1fr 1fr;gap:10px;margin:18px 0}.deskFilters label{margin:0}.deskFilters select,.deskFilters input{margin-top:7px;min-width:0}
@media(max-width:680px){.deskFilters{grid-template-columns:1fr}.deskBack .deskMiniTile{min-height:56px;padding:10px 14px}}

/* Phase is neutral; urgency and overdue flags retain their own text and color. */
.task-open,.task-neutral{background:var(--surface,#fff);border-color:var(--line);border-left:4px solid var(--line)}
.taskManagement{margin-top:22px;border-top:1px solid var(--line);padding-top:12px}.taskManagement>summary,.deskActions summary{padding:12px 0;cursor:pointer;font-weight:600}
.auditTable{width:100%;border-collapse:collapse;font-size:14px}.auditTable th,.auditTable td{text-align:left;border-bottom:1px solid var(--line);padding:10px 8px}.auditTableWrap{overflow-x:auto}.auditReportActions{display:flex;gap:12px;flex-wrap:wrap;margin:18px 0}
