:root {
  color-scheme: light;
  --bg: #f3f5f7; --surface: #fff; --surface-2: #edf1f5;
  --text: #20272d; --muted: #606e79; --line: #dfe5ea; --line-strong: #aebdc9;
  --brand: #f8c63d; --critical: #bf493f; --critical-soft: #fff;
  --shadow: 0 20px 45px rgba(35,54,70,.15);
}
.icon { width:18px; height:18px; stroke-width:1.8; flex:0 0 auto; }
button { transition:background .16s,transform .16s,box-shadow .16s; }
button:active { transform:translateY(1px); }
button:disabled { opacity:.5; cursor:wait; }
.app-shell { width:100%; max-width:none; padding-left:82px; }
.nav-rail { position:fixed; inset:0 auto 0 0; width:82px; z-index:15; display:flex; flex-direction:column; align-items:center; gap:14px; padding:20px 0; background:white; border-right:1px solid var(--line); box-shadow:8px 0 28px rgba(35,54,70,.04); }
.nav-rail img { width:50px; height:50px; object-fit:contain; border:1px solid var(--line); border-radius:8px; margin-bottom:26px; }
.rail-action { width:46px; height:46px; display:grid; place-items:center; background:transparent; border:1px solid transparent; border-radius:8px; color:var(--muted); }
.rail-action:hover { background:var(--surface-2); transform:translateY(-2px); }
.rail-action.is-active { background:#fff4cf; border-color:#ecd589; color:#755710; box-shadow:0 5px 12px rgba(151,115,14,.1); }
.topbar { min-height:76px; padding:14px 26px; }
.brand-block .brand-logo { display:none; }
.brand-block .eyebrow { font-size:10px; }
.brand-block h1 { font-size:19px; }
.icon-button { border-radius:8px; box-shadow:0 2px 3px rgba(35,54,70,.04); }
.icon-button:hover { transform:translateY(-2px); box-shadow:0 6px 12px rgba(35,54,70,.09); }
#create-task-button { background:var(--brand); border-color:#deb132; }
.summary-band { padding:26px; background:transparent; border:0; }
.week-label { color:#806019; font-size:11px; }
.week-heading p { margin-top:10px; font-size:24px; font-weight:750; color:var(--text); }
.metrics { border-left:0; border-right:0; background:white; }
.metric { background:rgba(255,255,255,.7); min-height:85px; padding:16px; }
.metric strong { font-size:28px; }
.metric:first-child { background:var(--brand); }
.metric.is-alert strong { color:var(--text); }
.view-tabs { margin:0 26px; padding:4px; width:fit-content; max-width:calc(100% - 52px); background:#e9edf1; border:1px solid #dde3e9; border-radius:8px; gap:4px; }
.view-tab { min-height:36px; border:0; border-radius:6px; padding:0 15px; font-size:12px; }
.view-tab.is-active { background:white; box-shadow:0 3px 8px rgba(35,54,70,.1); }
.view-tab span { color:#806019; }
.toolbar { padding:18px 26px; flex-wrap:wrap; }
.search-field { border-radius:8px; padding-left:12px; flex-basis:260px; }
.filters { flex-wrap:wrap; }
.filters select { border-radius:8px; font-size:12px; max-width:200px; }
.board { padding:0 26px 32px; gap:18px; }
.lane { border-top:0; }
.lane-header { border-bottom:1px solid var(--line); min-height:46px; margin-bottom:12px; }
.lane-header h2 { font-size:13px; display:flex; align-items:center; gap:8px; }
.lane-header h2::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--distribution); }
.lane[data-tone="critical"] h2::before { background:var(--critical); }
.lane[data-tone="waiting"] h2::before { background:#147b6b; }
.lane[data-tone="normal"] h2::before { background:#82919c; }
.lane[data-tone="hold"] h2::before { background:#aa7927; }
.lane-empty { padding:16px 0; color:var(--muted); font-size:12px; }
.board[data-view="current"][data-team-receipts="true"] { grid-template-columns:repeat(4,minmax(0,1fr)); }
.lane-list { gap:14px; }
.work-item { border-radius:8px; border-left:3px solid #7ca4d9; background:white; box-shadow:0 7px 16px rgba(35,54,70,.07),0 2px 3px rgba(35,54,70,.04); transition:transform .18s,box-shadow .18s,border-color .18s; }
.work-item[data-priority="P0"] { border-left:3px solid #c96b60; background:white; }
.work-item:hover { transform:translateY(-4px); box-shadow:0 17px 28px rgba(35,54,70,.13),0 3px 5px rgba(35,54,70,.04); }
.work-item-open { padding:17px 16px 14px; }
.work-item h3 { font-size:14px; }
.work-item p { font-size:12px; -webkit-line-clamp:2; min-height:37px; }
.priority { background:#f2f5f8; padding:3px 6px; border-radius:4px; }
.work-item[data-priority="P1"] .priority { color:#316dcc; }
.work-item[data-priority="P2"] .priority { color:#606e79; }
.decision-mark { position:static; display:inline-block; padding:2px 6px; margin-bottom:8px; border-radius:4px; }
.quick-actions { display:flex; background:#f8fafb; }
.quick-actions button { display:flex; align-items:center; justify-content:center; gap:4px; flex:1; min-width:0; min-height:39px; font-size:10px; }
.quick-actions .icon { width:16px; height:16px; }
.restore-action { display:flex; align-items:center; justify-content:center; gap:7px; margin:10px; width:calc(100% - 20px); min-height:39px; background:var(--brand); border:1px solid #deb132; border-radius:7px; color:#3d3210; font-size:12px; font-weight:700; }
.detail-dialog { border:1px solid var(--line); }
#detail-dialog { position:fixed; inset:0 0 0 auto; margin:0; width:min(620px,100vw); max-width:100vw; height:100dvh; max-height:100dvh; border-radius:0; }
.detail-dialog::backdrop { background:rgba(46,59,71,.22); backdrop-filter:blur(4px); }
#detail-dialog .dialog-frame { display:flex; flex-direction:column; height:100%; overflow:auto; }
#detail-dialog .dialog-content { overflow:visible; max-height:none; }
#detail-dialog .dialog-header { position:sticky; top:0; background:white; z-index:2; }
.dialog-actions { padding-bottom:24px; }
.task-edit { margin:14px 0 22px; padding:0 14px 14px; border:1px solid #c8d9e8; border-radius:7px; background:#f7fbfd; }
.task-edit summary { display:flex; align-items:center; gap:8px; padding:14px 0; cursor:pointer; color:#23658e; font-size:13px; font-weight:700; }
.task-edit summary .icon { width:16px; height:16px; }
.dialog-header h2 { font-size:20px; }
.decision-note,.task-form-grid input,.task-form-grid textarea,.task-form-grid select,.command-content textarea { border-radius:7px; background:#f7f9fb; }
.decision-button,.secondary-command,.primary-inline-command { border-radius:7px; }
.history-entry { border-bottom:1px solid var(--line); }
.history-entry > summary { padding:16px 12px; cursor:pointer; }
.history-row { width:100%; }
.history-content { padding:0 16px 18px; line-height:1.7; color:var(--muted); }
.history-content section { border-left:2px solid var(--line); padding:10px 15px; margin:10px 0; }
.history-content p { margin:5px 0; font-size:13px; }
.history-list h2,.stats-view h2 { font-size:18px; }
.stats-view { grid-column:1 / -1; }
.stats-view table { border-collapse:collapse; width:100%; background:white; }
.stats-view th,.stats-view td { padding:14px; text-align:left; border-bottom:1px solid var(--line); }
.owner-stats { display:flex; gap:12px; flex-wrap:wrap; }
.owner-stats button { display:grid; gap:8px; flex:1; min-width:130px; text-align:left; padding:16px; background:white; border:1px solid var(--line); border-radius:8px; }
.owner-stats span { color:var(--muted); font-size:12px; }
.board-controls { display:flex; align-items:center; flex-wrap:wrap; gap:10px; padding:0 26px 16px; }
.focus-tabs { display:flex; gap:2px; padding:3px; background:#e9edf1; border:1px solid var(--line); border-radius:8px; }
.focus-tabs button { border:0; background:transparent; min-height:32px; padding:0 12px; border-radius:5px; font-size:12px; color:var(--muted); }
.focus-tabs button[aria-pressed="true"] { background:white; color:var(--text); box-shadow:0 2px 4px #23364612; }
#filter-summary { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
#sort-order { margin-left:auto; max-width:160px; min-height:36px; padding:0 8px; border:1px solid var(--line); background:white; border-radius:7px; font-size:12px; }
.latest-progress { margin-top:12px; padding-top:10px; border-top:1px solid var(--line); }
.latest-progress > span { display:flex; align-items:center; gap:6px; color:#63756e; font-size:10px; }
.latest-progress .icon { width:13px; height:13px; }
.latest-progress p { color:#425d52; margin:6px 0 0; min-height:0; font-size:11px; }
.empty-state .secondary-command { display:block; margin:16px auto 0; }
.toast { display:flex; gap:20px; align-items:center; max-width:calc(100vw - 32px); pointer-events:none; }
.toast.is-visible { pointer-events:auto; }
.toast button { background:transparent; border:0; border-left:1px solid #aab7c4; padding-left:16px; color:#ffe28b; font-weight:700; min-height:36px; white-space:nowrap; }
button:focus-visible,summary:focus-visible { outline:2px solid #316dcc; outline-offset:3px; }
@media(min-width:1100px) and (max-width:1390px) { .quick-actions button span { display:none; } }
@media(min-width:1100px) and (max-width:1580px) { .board[data-team-receipts="true"] .quick-actions button span { display:none; } }
@media(max-width:1099px) { .board[data-view="current"][data-team-receipts="true"] { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:1040px) { .user-menu > span { display:none; } }
@media(max-width:720px) {
  .app-shell { padding-left:0; padding-bottom:72px; }
  .nav-rail { inset:auto 0 0; width:100%; height:64px; padding:8px 14px; flex-direction:row; justify-content:space-around; gap:4px; border-top:1px solid var(--line); box-shadow:0 -6px 20px rgba(35,54,70,.08); }
  .nav-rail img { width:40px; height:40px; margin:0; }
  .rail-action { width:42px; height:42px; }
  .topbar { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:8px; padding:12px 16px; min-height:64px; }
  .brand-block h1 { font-size:15px; }
  .brand-block .eyebrow { display:none; }
  .topbar-actions { justify-content:flex-end; gap:4px; }
  .topbar-actions .icon-button { width:32px; height:36px; }
  .week-heading { gap:6px; margin-bottom:10px; }
  .week-heading p { font-size:17px; margin-top:5px; }
  .summary-band { padding:12px 16px; }
  .view-tabs { margin:0 16px; max-width:calc(100% - 32px); }
  .view-tab { padding:0 8px; font-size:11px; }
  .view-tab span { min-width:0; margin-left:3px; font-size:11px; }
  .toolbar { padding:12px 16px; gap:10px; }
  .search-field { flex:0 0 auto; max-width:none; width:100%; min-height:40px; }
  .metrics { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .metric { min-height:54px; padding:8px 10px; border-right:1px solid var(--line) !important; }
  .metric:nth-child(3n) { border-right:0 !important; }
  .metric strong { font-size:22px; }
  .source-line { font-size:11px; }
  .board { padding:0 16px 24px; }
  .board[data-view="current"][data-team-receipts="true"] { grid-template-columns:1fr; }
  .board-controls { padding:0 16px 16px; gap:8px; }
  #sort-order { margin-left:0; }
  .toast { bottom:82px; }
  .filters { display:grid; grid-template-columns:1fr 1fr; }
  .filters select { max-width:100%; min-width:0; }
  .stats-view th,.stats-view td { padding:12px 7px; font-size:12px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { transition:none !important; } .work-item:hover { transform:none; } }

.toolbar[hidden],.board-controls[hidden] { display:none; }
.board[data-view="mail"] { display:block; }
.mail-view { width:100%; display:grid; gap:22px; padding-bottom:32px; }
.mail-report-head { display:flex; justify-content:space-between; align-items:flex-end; gap:14px; padding:3px 0 7px; border-bottom:1px solid var(--line); }
.mail-report-head h2 { margin:0; font-size:19px; }
.mail-report-head p { margin:7px 0 0; color:var(--muted); font-size:12px; }
.mail-report-head > span { color:var(--muted); font-size:12px; white-space:nowrap; }
.mail-summary { display:grid; gap:6px; background:white; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.mail-summary-row { display:grid; grid-template-columns:1.1fr repeat(7,minmax(0,.9fr)); gap:8px; width:100%; align-items:center; padding:12px 16px; border:0; border-bottom:1px solid var(--line); background:white; color:var(--text); text-align:left; font-size:12px; cursor:pointer; }
.mail-summary-row:last-child { border-bottom:0; }
.mail-summary-row:hover { background:#f4f8f8; }
.mail-summary-row strong { font-size:13px; }
.mail-summary-row span { color:#55636d; }
.mail-audit { border:1px solid var(--line); border-radius:7px; background:white; padding:12px 15px; }
.mail-audit summary { cursor:pointer; font-size:12px; font-weight:700; color:var(--text); }
.mail-audit > p { color:var(--muted); font-size:11px; margin:10px 0; }
.mail-audit-list { max-height:430px; overflow:auto; border-top:1px solid var(--line); }
.mail-audit-row { display:grid; grid-template-columns:84px minmax(0,1fr) 190px; gap:12px; align-items:start; padding:9px 2px; border-bottom:1px solid var(--line); font-size:11px; }
.mail-audit-row time,.mail-audit-row span,.mail-audit-row small { color:var(--muted); }
.mail-audit-row strong { display:block; font-weight:600; overflow-wrap:anywhere; }
.mail-audit-row small { display:block; margin-top:3px; overflow-wrap:anywhere; }
.mail-owner-section { scroll-margin-top:88px; }
.mail-owner-section > header { display:flex; align-items:baseline; justify-content:space-between; padding:0 2px 10px; border-bottom:1px solid var(--line); }
.mail-owner-section h2 { font-size:16px; margin:0; }
.mail-owner-section > header span,.mail-empty { color:var(--muted); font-size:12px; }
.mail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; padding-top:12px; }
.mail-empty { grid-column:1/-1; padding:10px 0; margin:0; }
.mail-item { min-width:0; padding:16px; border:1px solid var(--line); border-left:3px solid #368b81; border-radius:7px; background:white; box-shadow:0 5px 14px rgba(35,54,70,.05); }
.mail-item-head,.mail-item-head > div { display:flex; gap:9px; align-items:center; justify-content:space-between; }
.mail-item-head strong { font-size:14px; }
.mail-item-head span,.mail-contact { font-size:11px; color:var(--muted); }
.mail-item h3 { margin:10px 0 6px; font-size:14px; line-height:1.35; overflow-wrap:anywhere; }
.mail-contact { margin:0; overflow-wrap:anywhere; }
.mail-excerpt { font-size:12px; line-height:1.6; color:#334f56; margin:12px 0; max-height:4.8em; overflow:hidden; }
.mail-thread,.mail-original { margin:8px 0; border-top:1px solid var(--line); }
.mail-thread > summary,.mail-original > summary { padding:9px 0; cursor:pointer; color:#236d69; font-size:11px; font-weight:700; }
.mail-thread-entry { padding:9px 0 12px; border-top:1px solid var(--line); }
.mail-thread-meta { display:flex; justify-content:space-between; gap:8px; margin-bottom:6px; color:var(--muted); font-size:10px; }
.mail-thread-entry > strong { display:block; font-size:11px; line-height:1.4; }
.mail-thread-entry > p { margin:5px 0; color:#354954; font-size:11px; line-height:1.6; }
.mail-thread-entry details summary { cursor:pointer; color:#607483; font-size:10px; }
.mail-thread-entry details p,.mail-original p { max-height:180px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; color:#60707c; font-size:10px; line-height:1.5; }
.mail-status { border-radius:4px; padding:4px 6px; background:#eaf3f1; color:#226b60 !important; white-space:nowrap; }
.mail-status[data-status="pending"] { background:#fff2e6; color:#9d5319 !important; }
.mail-status[data-status="hold"] { background:#f1f2f4; color:#67747c !important; }
.mail-status[data-status="closed"] { background:#eaf1fa; color:#355e95 !important; }
.mail-next { display:block; margin-top:10px; color:var(--muted); font-size:11px; }
.mail-next input { display:block; margin-top:4px; width:100%; min-height:34px; padding:7px 9px; border:1px solid var(--line); border-radius:5px; background:#f9fafb; color:var(--text); font-size:12px; }
.mail-item-actions { display:flex; align-items:end; gap:8px; margin-top:10px; }
.mail-owner { flex:1; min-width:0; color:var(--muted); font-size:11px; }
.mail-item-actions select { display:block; max-width:100%; min-height:34px; padding:0 6px; border:1px solid var(--line); border-radius:5px; background:white; color:var(--text); font-size:12px; }
.mail-item-actions > select { flex:0 0 92px; }
.mail-item-actions button { display:grid; place-items:center; flex:0 0 36px; height:34px; border:1px solid #2c766d; border-radius:5px; background:#2f8277; color:white; cursor:pointer; }
.mail-item-actions .icon { width:16px; height:16px; }
@media(max-width:1050px) { .mail-summary-row { grid-template-columns:1fr repeat(4,1fr); } .mail-summary-row span:nth-last-child(-n+3) { display:none; } }
@media(max-width:720px) { .mail-report-head { align-items:flex-start; flex-direction:column; } .mail-grid { grid-template-columns:1fr; } .mail-summary-row { grid-template-columns:1fr repeat(3,minmax(0,1fr)); padding:10px; font-size:11px; } .mail-summary-row span:nth-child(n+5) { display:none; } .mail-item { padding:13px; } }
@media(max-width:720px) { .mail-audit-row { grid-template-columns:68px minmax(0,1fr); } .mail-audit-row > span { grid-column:2; } }
