/* T1 cyan is an accent. All dark surfaces are neutral graphite, never saturated blue. */
:root[data-theme="dark"]{color-scheme:dark;--ink:#edf2f5;--muted:#a1abb3;--paper:#151718;--white:#1b1e20;--card:#202426;--soft:#282d30;--line:#373f44;--accent:#58caff;--accent-light:#183744;--brand:#1daff7;--nav:#1a1d1f;--nav-muted:#aeb9c1;--warning:#edbc6d;--good:#77d6a4;--shadow:0 14px 50px #0006}
html[data-theme="dark"] body{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] .sidebar{border-right:1px solid #30363a;background:var(--nav)}
html[data-theme="dark"] .nav-item.active{background:#1daff715;color:#f5faff;border-left-color:#1daff7}
html[data-theme="dark"] .space-switch,html[data-theme="dark"] .side-note{background:#ffffff03;border-color:var(--line)}
html[data-theme="dark"] .topbar{background:var(--white);border-color:var(--line)}
html[data-theme="dark"] .brand-mark{background:#1daff7;color:#102732}
html[data-theme="dark"] .btn.primary{background:#1daff7;border-color:#1daff7;color:#092433}
html[data-theme="dark"] .btn.primary:hover{background:#68ccff;border-color:#68ccff;color:#092433}
html[data-theme="dark"] .btn,html[data-theme="dark"] .icon-btn,html[data-theme="dark"] select,html[data-theme="dark"] input,html[data-theme="dark"] textarea{color:var(--ink);border-color:var(--line)}
html[data-theme="dark"] .btn:not(.primary):not(.ghost):not(.soft){background:var(--soft)}
html[data-theme="dark"] input,html[data-theme="dark"] textarea,html[data-theme="dark"] select{background:#202426}
html[data-theme="dark"] select option{background:#202426;color:#edf2f5}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#9aa6af}
html[data-theme="dark"] .column{background:#1a1d1f;border:1px solid #30363a;border-radius:8px}
html[data-theme="dark"] .column-head{background:#1a1d1f;color:var(--ink)}
html[data-theme="dark"] .card{background:#232729;border-color:#384146}
html[data-theme="dark"] .card:hover{border-color:#6b8e9e;background:#282e31}
html[data-theme="dark"] .card-epic{color:#a7b5bf}
html[data-theme="dark"] .card-tags,html[data-theme="dark"] .tiny,html[data-theme="dark"] .muted{color:var(--muted)}
html[data-theme="dark"] .tag,html[data-theme="dark"] .pill,html[data-theme="dark"] .source-chip{background:#2c3338;color:#c3ced5;border-color:#404c54}
html[data-theme="dark"] .tag.teal,html[data-theme="dark"] .pill.good{color:#96dfbd;background:#233c32}
html[data-theme="dark"] .pill.warning,html[data-theme="dark"] .tag.amber{color:#f2c78a;background:#443523}
html[data-theme="dark"] .pill.alert,html[data-theme="dark"] .overdue,html[data-theme="dark"] .form-error{color:#ffabad}
html[data-theme="dark"] .status-tag{color:#c6d0d7;background:transparent}
html[data-theme="dark"] .status-tag.done{color:#81d6ac}html[data-theme="dark"] .status-tag.caveat{color:#f0c381}
html[data-theme="dark"] .status-tag.active,html[data-theme="dark"] .status-tag.ready{color:#65caff}
html[data-theme="dark"] .status-tag.review{color:#c6b2f5}
html[data-theme="dark"] .task-table th{background:#1c2022;color:#b9c4cc}
html[data-theme="dark"] .task-table td,html[data-theme="dark"] .task-table th{border-color:var(--line)}
html[data-theme="dark"] .task-table tbody tr:hover{background:#293034}
html[data-theme="dark"] .drawer,html[data-theme="dark"] .form-dialog,html[data-theme="dark"] .reason-dialog{background:var(--card);color:var(--ink);border:1px solid #48535a}
html[data-theme="dark"] .drawer-head,html[data-theme="dark"] .drawer-section,html[data-theme="dark"] .form-head,html[data-theme="dark"] .form-footer,html[data-theme="dark"] .form-body{background:var(--card);border-color:var(--line)}
html[data-theme="dark"] .comment,html[data-theme="dark"] .task-description,html[data-theme="dark"] .source-panel,html[data-theme="dark"] pre{background:#1b1f21;color:#e0e8ee;border-color:var(--line)}
html[data-theme="dark"] .checklist-item,html[data-theme="dark"] .detail-field,html[data-theme="dark"] .detail-label{color:var(--ink)}
html[data-theme="dark"] .calendar-day{background:#222729;color:#edf2f5;border-color:#3d474d}
html[data-theme="dark"] .calendar-day.off{background:#191c1e;color:#a9b1b7}
html[data-theme="dark"] .calendar-day.holiday{background:#392f26;color:#f3c98c}
html[data-theme="dark"] .calendar-day.today{outline-color:#1daff7}
html[data-theme="dark"] .calendar-day:hover{background:#2c363b}
html[data-theme="dark"] .league-intro{background:#202426;border:1px solid #3b4449}
html[data-theme="dark"] .rank-top{background:#403b28;color:#f5d982}
html[data-theme="dark"] .achievement{color:#8be1bd}
html[data-theme="dark"] .login{background:var(--paper)}
html[data-theme="dark"] .login-card{background:var(--card);border-color:var(--line);color:var(--ink)}
html[data-theme="dark"] .storage-warning{background:#40311f;color:#f7d296;border-color:#846332}
html[data-theme="dark"] .toast{background:#303a40;color:#edf2f5;border-color:#51616b}
html[data-theme="dark"] .nonwork-band{background:#ffffff08}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:2px solid #1daff7;outline-offset:3px}
/* Source reporting: compact headings and quiet surfaces; data provide hierarchy. */
.source-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.source-tabs{display:flex;gap:4px;flex-wrap:wrap;border-bottom:1px solid var(--line);margin-bottom:20px}
.source-tabs button{background:none;border:0;border-bottom:2px solid transparent;padding:11px 14px;color:var(--muted);font:inherit;cursor:pointer}
.source-tabs button.active{color:var(--accent);border-bottom-color:var(--brand)}
.source-meta{display:flex;align-items:center;gap:10px;flex-wrap:wrap;color:var(--muted);font-size:12px;line-height:1.6}
.source-meta code{color:var(--accent);font-size:12px}
.source-live-label{font-size:10px;letter-spacing:1px;text-transform:uppercase;color:var(--muted)}
.source-hero{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:28px;align-items:center;border:1px solid var(--line);border-radius:10px;padding:24px 26px;background:var(--card);margin-bottom:20px}
.source-hero h2{font-size:24px;font-weight:550;letter-spacing:-.6px;margin:8px 0 12px}
.source-hero p{line-height:1.65;font-size:13px;color:var(--muted);max-width:780px}
.source-volume{border-left:1px solid var(--line);padding-left:28px}.source-volume strong{font-weight:550;font-size:42px;line-height:1.2;letter-spacing:-1.8px}.source-volume small{display:block;color:var(--muted);margin-top:5px}
.source-progress{display:flex;overflow:hidden;height:7px;border-radius:2px;margin:18px 0 10px;background:var(--soft)}
.source-progress .seg-done{background:#60bf98}.source-progress .seg-caveat{background:#d7ac66}.source-progress .seg-in_progress{background:#1daff7}.source-progress .seg-planned{background:#5c6b75}
.source-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));border:1px solid var(--line);border-radius:8px;background:var(--card);margin-bottom:22px}
.source-kpi{padding:18px 20px;border-right:1px solid var(--line)}.source-kpi:last-child{border-right:0}.source-kpi label{color:var(--muted);font-size:12px}.source-kpi strong{display:block;font-weight:550;font-size:31px;line-height:1.25;margin:6px 0}.source-kpi small{color:var(--muted);font-size:11px}.source-kpi .positive{color:var(--good)}.source-kpi .caveat{color:var(--warning)}.source-kpi .active{color:var(--accent)}
.source-columns{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,1fr);gap:18px}.source-panel{padding:20px 22px;border:1px solid var(--line);background:var(--card);border-radius:8px}.source-panel h2{font-size:16px;font-weight:600;margin:0 0 6px}.source-panel>p{font-size:12px;line-height:1.6;color:var(--muted);margin:0 0 16px}
.change-row{display:flex;align-items:flex-start;gap:14px;padding:13px 0;border-top:1px solid var(--line)}.change-row code{min-width:60px;color:var(--accent)}.change-row p{font-size:12px;line-height:1.5;margin:4px 0 0;color:var(--muted)}.change-row strong{font-size:12px;font-weight:500}.change-row .change-mark{font-size:12px;white-space:nowrap}.change-row button{border:0;background:none;text-align:left;padding:0;color:var(--ink);cursor:pointer;flex:1}
.epic-remain{display:grid;grid-template-columns:minmax(0,1fr) 90px 42px;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--line);font-size:12px}.epic-remain .track{height:4px;background:var(--soft)}.epic-remain .track span{display:block;height:100%;background:var(--brand)}.epic-remain strong{font-size:12px;text-align:right;font-weight:500}
.source-note{font-size:12px;color:var(--muted);line-height:1.7;padding:14px 0}.source-note.attention{border-left:2px solid var(--warning);padding-left:13px;color:var(--warning)}
.branch-label{display:inline-flex;font-family:ui-monospace,"Cascadia Code",monospace;font-size:11px;color:var(--accent);background:var(--accent-light);padding:3px 6px;border-radius:3px;margin:2px 5px 2px 0;max-width:100%;overflow-wrap:anywhere;text-decoration:none}
.source-chip{display:inline-block;padding:2px 5px;font-size:10px;line-height:1.4;color:var(--muted);border:1px solid var(--line);border-radius:3px;margin:3px 4px 2px 0}.source-chip.conflict{color:var(--warning);border-color:var(--warning)}
.branch-table td:first-child{width:110px}.branch-table .branch-title{max-width:620px;line-height:1.6}.branch-table button{background:none;border:0;color:var(--accent);font:inherit;text-align:left;padding:0;cursor:pointer}.branch-table th{white-space:normal}.source-import-options{display:flex;gap:14px;align-items:center;margin:8px 0}.source-fulltext{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65;max-height:65vh;overflow:auto}.source-empty{padding:35px;max-width:700px;margin:auto;text-align:center;line-height:1.7;color:var(--muted)}
@media(min-width:1200px){.source-panel .epic-remain:last-child{border-bottom:0}}
@media(max-width:1050px){.source-columns{grid-template-columns:1fr}.source-kpi{padding:14px 12px}.source-hero{grid-template-columns:1fr 220px}.source-volume{padding-left:20px}.source-meta{font-size:11px}.sidebar .nav-item{padding-top:8px;padding-bottom:8px}}
@media(max-width:700px){.source-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.source-kpi{border-bottom:1px solid var(--line)}.source-kpi:last-child{grid-column:1/-1;border-bottom:0}.source-hero{grid-template-columns:1fr;padding:20px}.source-volume{border-left:0;border-top:1px solid var(--line);padding:15px 0 0}.source-columns{display:block}.source-panel{margin-bottom:14px;padding:16px}.source-kpi strong{font-size:26px}.source-tabs button{padding:10px}.source-volume strong{font-size:35px}.source-toolbar{align-items:flex-start}.source-toolbar .row{flex-wrap:wrap}.source-meta{overflow-wrap:anywhere}.epic-remain{grid-template-columns:minmax(0,1fr) 65px 36px}}
@media print{:root[data-theme="dark"]{color-scheme:light;--ink:#17252d;--muted:#4d606d;--paper:#fff;--white:#fff;--card:#fff;--soft:#edf1f4;--line:#c4cdd2;--accent:#006a98;--good:#175a3c;--warning:#80530a}.source-tabs,.source-toolbar .btn{display:none}.source-hero,.source-panel,.source-kpis{break-inside:avoid}.source-columns{display:block}.source-kpi strong{font-size:24px}}

html[data-theme="dark"] .search input:not([type="checkbox"]){background:#202426;color:#edf2f5;border-color:#48535a}

/* Match the legacy input selector's specificity, including its two :not(). */
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] textarea, html[data-theme="dark"] select,
html[data-theme="dark"] .input{background:#202426;color:#edf2f5;border-color:#48535a}
html[data-theme="dark"] input:disabled,html[data-theme="dark"] textarea:disabled,
html[data-theme="dark"] select:disabled{color:#a1abb3;background:#191c1e;opacity:1}
