:root{color-scheme:light}
:root[data-theme="dark"]{color-scheme:dark;--ink:#e2edf4;--muted:#a3b6c5;--teal:#57d4c9;--teal-dark:#88e3da;--teal-light:#183b40;--blue:#223954;--line:#334657;--bg:#111c29;--shadow:0 8px 32px #0002}
[data-theme="dark"] :is(.card,.sidebar,.topbar,.modal,.siti-panel,.siti-home-strip,.phase-card,.dropdown,.calendar-day,.calendar-event,.method-card,.method-bsc,.method-harada,.training-today-card,.search-button,.user-switch,.view-tabs,.ha-config,.ha-review,.ha-config-indicator){background:#1b2b3b;color:var(--ink);border-color:var(--line)}
[data-theme="dark"] :is(input,select,textarea,.btn.soft,.btn.secondary,.icon-btn,.date-chip,.trend-summary>div,.ha-score,.ha-gap,.team-home-link a,.routine-check,.day-cell){background:#243849;color:var(--ink);border-color:#496070}
[data-theme="dark"] :is(th,.table-header,.calendar-header,.modal-header,.modal-footer,.trend-period-badge){background:#203343;color:var(--ink)}
[data-theme="dark"] :is(h1,h2,h3,h4,strong,label,.breadcrumb,.stat-number,.ha-link,.link-btn,.nav-item,.trend-title-row,.method-card-title){color:var(--ink)}
[data-theme="dark"] :is(.caption,.muted,.trend-description,.trend-footnote,.stat-label,.stat-foot,.page-footer,small){color:var(--muted)}
[data-theme="dark"] :is(.view-tabs button.active,.nav-item.active){background:#215457;color:#b6fff3}
[data-theme="dark"] .harada-radar>rect{fill:#1b2b3b}
[data-theme="dark"] .harada-radar text{fill:#c7dae6}
[data-theme="dark"] .harada-radar line,[data-theme="dark"] .harada-radar polygon[stroke="#dce8ec"]{stroke:#425b6c}
[data-theme="dark"] .trend-grid{stroke:#425b6c}
[data-theme="dark"] .trend-axis{fill:#b1c6d5}
[data-theme="dark"] .trend-point{fill:#203343;stroke:#57d4c9}
[data-theme="dark"] :is(.badge.success,.banner.success){background:#173f37;color:#a1edd2}
[data-theme="dark"] :is(.badge.warning,.banner.warning){background:#483b24;color:#ffdc91}
[data-theme="dark"] :is(.badge.danger,.banner.danger){background:#4c2c38;color:#ffb6be}
[data-theme="dark"] .modal-overlay{background:#0009}
#harada-home-host>.harada-analytics{border:0;border-top:1px solid var(--line);box-shadow:none;border-radius:0;margin:0}
#target-month-table input{min-width:80px;width:100%}
#target-month-table th{min-width:100px}
.theme-toggle{white-space:nowrap}
/* Calendar surfaces and event states, including week/day views. */
[data-theme="dark"] .hc-weekdays{background:#203343;border-color:var(--line)}
[data-theme="dark"] :is(.hc-cell,.hc-week-col){border-color:var(--line)}
[data-theme="dark"] .hc-cell.outside{background:#152331}
[data-theme="dark"] :is(.hc-cell.today,.hc-week-col.today){background:#193e40}
[data-theme="dark"] :is(.hc-date,.hc-week-date,.hc-agenda-time,.hc-weekdays span){color:#bdcfdb}
[data-theme="dark"] .hc-cell.outside .hc-date{color:#8199ab}
[data-theme="dark"] .hc-cell.today .hc-date{background:#57d4c9;color:#102d31}
[data-theme="dark"] .hc-date:hover{background:#2b5055;color:#b6fff3}
[data-theme="dark"] .hc-event{background:#1c4547;color:#b6eee5;border-color:#57d4c9}
[data-theme="dark"] .hc-event.routine{background:#433b29;color:#f4dca4;border-color:#d9b96c}
[data-theme="dark"] .hc-event.complete{background:#2a3d4d;color:#c1d4df;border-color:#8caab9}
[data-theme="dark"] .hc-event :is(strong,small){color:inherit}
[data-theme="dark"] .hc-event:hover{filter:brightness(1.13)}
/* Athlete achievement rows must not retain the light theme's white canvas. */
[data-theme="dark"] :is(.achievement-list,.athlete-achievement){background:#1b2b3b;color:var(--ink);border-color:var(--line)}
[data-theme="dark"] .athlete-achievement:hover{background:#263f50}
[data-theme="dark"] :is(.chart-scale,.achievement-scroll-hint,.achievement-note){background:#203343;color:var(--muted);border-color:var(--line)}
[data-theme="dark"] :is(.athlete-values,.athlete-assessment,.athlete-achievement-head small){color:#aec3d1}
[data-theme="dark"] .athlete-values b{color:#e2edf4}
[data-theme="dark"] .progress-number{color:#9acbfa}
[data-theme="dark"] .progress-number.achieved{color:#69ddc8}
[data-theme="dark"] .athlete-bar{background:repeating-linear-gradient(90deg,#304858 0,#304858 calc(25% - 1px),#496274 calc(25% - 1px),#496274 25%)}
[data-theme="dark"] .athlete-bar>i{border-color:#bfd3e1}
/* Persona picker: normal, selected, hovered and keyboard-focused states. */
[data-theme="dark"] .persona-card{background:#243849;border-color:#496070;color:#e2edf4}
[data-theme="dark"] .modal .persona-card.active{background:#1c4547;border-color:#57d4c9}
[data-theme="dark"] .modal .persona-card:hover{background:#304b5e;border-color:#8eb6c8}
[data-theme="dark"] .modal .persona-card.active:hover{background:#245658}
[data-theme="dark"] .persona-card strong{color:#e2edf4}
[data-theme="dark"] .persona-card small{color:#b7cbd8}
[data-theme="dark"] .persona-card .avatar{background:#354d52;color:#c2e9d9}
[data-theme="dark"] .modal .filter-input{background:#243849;border-color:#496070}
[data-theme="dark"] .modal .filter-input input{background:transparent;color:#e2edf4}
[data-theme="dark"] .modal .filter-input input::placeholder{color:#adc1cf;opacity:1}
[data-theme="dark"] .banner:not(.warning):not(.danger):not(.success){background:#1c3b3d;border-color:#366366;color:#b6ded7}
[data-theme="dark"] :is(.persona-card,.hc-event,.hc-date,.athlete-achievement):focus-visible{outline:2px solid #79e5db;outline-offset:-3px}
@media(max-width:700px){.theme-toggle{font-size:11px;padding:6px}.trend-toolbar .view-tabs{flex-wrap:wrap}}
@media print{[data-theme="dark"] .harada-radar>rect{fill:white}[data-theme="dark"] .harada-radar text{fill:#183d4b}}

[data-theme="dark"] :is(.nav-group-toggle,.brand,.brand strong,.view-tabs button,.language){color:#b8cbd8}

[data-theme="dark"] :is(.btn:not(.primary),.module-tile,.filter-input,.filter-select,.calc-box,.persona-card,.detail-tabs,.ow-cell){background:#243849;color:var(--ink);border-color:var(--line)}
[data-theme="dark"] :is(.nav-group-btn,.nav-group-label,.brand-name,.view-tabs button){color:#bfd1dd}
[data-theme="dark"] .sidebar button,[data-theme="dark"] .sidebar .brand strong{color:#bfd1dd}
@media(max-width:700px){.topbar{padding:0 12px;gap:6px}.top-actions{gap:6px}.topbar .demo-pill{display:none}.topbar .user-switch{padding-left:6px}.harada-analytics .card-heading{flex-wrap:wrap;gap:10px}.harada-analytics .card-heading>div{width:100%}}

.hc-event.planned{background:#fff4dc;color:#735518;border-color:#c19b47}[data-theme="dark"] .hc-event.planned{background:#433b29;color:#f4dca4;border-color:#d9b96c}

/* Coach routine summary and SITI use the same dark surface palette. */
[data-theme="dark"] .coach-routine-counts>span{background:#243849;color:#b8cbd8}
[data-theme="dark"] .coach-routine-counts strong{color:#e2edf4}
[data-theme="dark"] .coach-routine-counts>span:first-child strong{color:#69ddc8}
[data-theme="dark"] .coach-routine-counts>span:nth-child(2) strong{color:#ffdc91}
[data-theme="dark"] .coach-routine-person{background:#1b2b3b;color:#d5e6ed;border-color:#334657}
[data-theme="dark"] .coach-routine-person:hover{background:#263f50}
[data-theme="dark"] .coach-routine-status{background:#304858;color:#d5e6ed}
[data-theme="dark"] .coach-routine-status.attention{background:#483b24;color:#ffdc91}
[data-theme="dark"] .coach-routine-status.completed{background:#173f37;color:#a1edd2}
[data-theme="dark"] .siti-header{background:#203343;border-color:#334657}
[data-theme="dark"] .siti-avatar{background:#304b48}
[data-theme="dark"] .siti-header strong{color:#e2edf4}
[data-theme="dark"] .siti-messages{background:#152331;scrollbar-color:#496070 #152331}
[data-theme="dark"] .chat-msg{background:#243849;border-color:#3c5363;color:#d5e6ed}
[data-theme="dark"] .chat-msg.user{background:#57d4c9;color:#102d31}
[data-theme="dark"] .chat-msg .sources{border-color:#496070;color:#b8cbd8}
[data-theme="dark"] .chat-msg .sources a{color:#88e3da}
[data-theme="dark"] :is(.chat-hint,.siti-disclaimer,.siti-loading){color:#adc1cf}
[data-theme="dark"] :is(.siti-prompts,.siti-input){background:#1b2b3b}
[data-theme="dark"] .siti-prompts button{background:#243849;border-color:#496070;color:#d5e6ed}
[data-theme="dark"] .siti-prompts button:hover{background:#215457;color:#b6fff3}
[data-theme="dark"] .siti-input input::placeholder{color:#adc1cf;opacity:1}
[data-theme="dark"] :is(.coach-routine-person,.siti-prompts button):focus-visible{outline:2px solid #79e5db;outline-offset:-3px}

/* Shared module, workflow and modal surfaces. Screen-only: printed reports stay light. */
@media screen{
 [data-theme="dark"]{--brand-ink:#e2edf4}
 [data-theme="dark"] :is(.calendar-col,.perspective,.welcome-card,.error-state,.side-help,.training-qr-paper){background:#1b2b3b;color:var(--ink);border-color:var(--line)}
 [data-theme="dark"] :is(.upload-zone,.training-camera,.training-guide,.training-harada,.training-scan-intro,.team-event-date,.team-jersey,.area-tabs button,.action-slot .slot-no,.skip-link){background:#243849;color:#d5e6ed;border-color:#496070}
 [data-theme="dark"] :is(.form-field input,.form-field select,.form-field textarea,.ha-controls select,.ha-controls input,.ha-config select,.team-filter select,.trend-filters select,.coach-routine-filters input,.coach-routine-filters select){background:#243849;color:var(--ink);border-color:#496070}
 [data-theme="dark"] :is(input,textarea)::placeholder{color:#adc1cf;opacity:1}
 [data-theme="dark"] :is(option,optgroup){background:#243849;color:var(--ink)}
 [data-theme="dark"] :is(.method-card.bsc-method,.method-card.harada-method,.method-cards>.training-today){background:#1b2b3b}
 [data-theme="dark"] :is(.nav-item:hover,.nav-group:hover,tr[data-record]:hover td,.btn:not(.primary):hover){background:#2b4355;color:#e2edf4}
 [data-theme="dark"] :is(.area-tabs button.active,.team-level.selected,.ow-cell.area,.state-step.past){background:#1c4547;color:#b6eee5;border-color:#57d4c9}
 [data-theme="dark"] .ow-cell.goal{background:#215e56;color:#e2fff5;border-color:#57d4c9}
 [data-theme="dark"] :is(.btn.primary,.state-step.current,.routine-check.done,.siti-fab,.brand-mark){background:#57d4c9;color:#102d31;border-color:#57d4c9}
 [data-theme="dark"] .btn.primary:hover{background:#88e3da}
 [data-theme="dark"] :is(.badge,.phase-dot){background:#304858;color:#d5e6ed}
 [data-theme="dark"] :is(.badge.good,.badge.success,.toast){background:#173f37;color:#a1edd2;border-color:#366356}
 [data-theme="dark"] :is(.badge.blue,.stat-icon.blue,.task-symbol,.method-icon,.perspective-tags span){background:#253e59;color:#bddbff}
 [data-theme="dark"] :is(.badge.warning,.demo-pill,.stat-icon.orange,.task-symbol.orange,.ha-gap.warning){background:#483b24;color:#ffdc91;border-color:#78623c}
 [data-theme="dark"] :is(.badge.danger,.form-error,.toast.error,.ha-gap.danger){background:#4c2c38;color:#ffb6be;border-color:#805163}
 [data-theme="dark"] :is(.btn.danger,.form-field .error,.scan-error){color:#ffb6be}
 [data-theme="dark"] :is(.stat-icon,.task-symbol.green,.harada-method .method-icon,.harada-steps span,.nav-item .count,.hc-mobile-count){background:#1c4547;color:#b6eee5}
 [data-theme="dark"] .stat-icon.purple{background:#3d3454;color:#d7c8ff}
 [data-theme="dark"] :is(.avatar,.mini-avatar,.siti-fab .mini-mascot){background:#354d52;color:#c2e9d9}
 [data-theme="dark"] :is(.progress,.bar-track,.wizard-progress span){background:#304858}
 [data-theme="dark"] .wizard-progress span.done{background:#57d4c9}
 [data-theme="dark"] .team-level:not(:last-child):after{background:#111c29;color:#b8cbd8}
 [data-theme="dark"] .hc-event.training{background:#433b29;color:#f4dca4;border-color:#d9b96c}
 [data-theme="dark"] :is(.form-field label,.team-score,.team-stat strong,.training-times b,.calendar-head strong,.welcome-copy h2){color:var(--ink)}
 [data-theme="dark"] :is(.calc-box .big,.training-clock,.training-counts b,.training-phase,.training-qr-paper>strong,.training-code summary,.training-guide svg,.training-harada>svg,.training-scan-intro>svg,.training-receipt>svg){color:#88e3da}
 [data-theme="dark"] :is(.calc-box p,.diary-card p,.welcome-copy p,.side-help p,.siti-tag,.goal-card .goal-line,.team-stat>span,.training-times,.field-note,.perspective span,.welcome-copy .eyebrow){color:#b8cbd8}
 [data-theme="dark"] :is(td,.task-row,.routine-row,.team-action,.team-event,.team-player,.training-session,.training-person,.record-tabs,.action-slot,.nav-children){border-color:var(--line)}
 [data-theme="dark"] .overlay{background:#080f1bb3}
 [data-theme="dark"] .siti-header>div:nth-child(2){min-width:0;flex:1}
 [data-theme="dark"] .siti-avatar{flex-shrink:0}
 /* Keep the QR bitmap's quiet zone white for scanners; labels use the dark card. */
 [data-theme="dark"] .training-qr-paper canvas{background:white}
}
