:root{color-scheme:light}
html[data-theme="dark"]{color-scheme:dark;--ink:#edf1e9;--muted:#a3ad9f;--line:#364037;--paper:#171c18;--white:#222923;--green:#8caf70;--green-dark:#6f9559;--soft-green:#293329;--shadow:0 10px 34px rgba(0,0,0,.2)}
html[data-theme="dark"] body{background:var(--paper);color:var(--ink)}
html[data-theme="dark"] .sidebar,html[data-theme="dark"] .card,html[data-theme="dark"] .team-picker,html[data-theme="dark"] .rsvp-strip,html[data-theme="dark"] .settings-card,html[data-theme="dark"] .login-card,html[data-theme="dark"] .fixture-dialog,html[data-theme="dark"] .connect-dialog,html[data-theme="dark"] .thread-original-message,html[data-theme="dark"] .thread-reply-form,html[data-theme="dark"] .family-players-card,html[data-theme="dark"] .family-shortcut,html[data-theme="dark"] .player-game-card{background-color:#222923;color:var(--ink);border-color:#364037}
html[data-theme="dark"] .topbar,html[data-theme="dark"] .mobile-nav{background:rgba(31,38,32,.96);border-color:#333d34}
html[data-theme="dark"] .main-nav .nav-item{color:#b5beb1}
html[data-theme="dark"] .mobile-nav a{color:#c7d0c3;font-size:12px}
html[data-theme="dark"] .mobile-nav a span{color:inherit;font-size:18px}
html[data-theme="dark"] .main-nav .nav-item:hover,html[data-theme="dark"] .mobile-nav a:hover{background:#2a342b;color:#f0f3ec}
html[data-theme="dark"] .main-nav .nav-item.active,html[data-theme="dark"] .mobile-nav a.active{background:#344331;color:#d6e9c8}
html[data-theme="dark"] .mobile-nav a.active{background:#3a4a36;color:#e1efd6}
html[data-theme="dark"] .nav-icon,html[data-theme="dark"] .breadcrumb,html[data-theme="dark"] .breadcrumb strong,html[data-theme="dark"] .topbar .account-role{color:#b4beb0}
html[data-theme="dark"] .welcome-row h1,html[data-theme="dark"] .next-copy h2,html[data-theme="dark"] .section-heading h2,html[data-theme="dark"] .tools-heading h2,html[data-theme="dark"] .settings-heading h2,html[data-theme="dark"] .settings-card h3,html[data-theme="dark"] .view-title,html[data-theme="dark"] .coach-dashboard-head h2{color:var(--ink)}
html[data-theme="dark"] .welcome-row h1 span,html[data-theme="dark"] .next-copy h2 span,html[data-theme="dark"] .welcome-sub,html[data-theme="dark"] .next-hint,html[data-theme="dark"] .settings-heading>p,html[data-theme="dark"] .settings-card>p:not(.eyebrow),html[data-theme="dark"] .coach-dashboard-head #team-view-intro{color:#a4aea0}
html[data-theme="dark"] .eyebrow,html[data-theme="dark"] .muted-eyebrow,html[data-theme="dark"] .nav-label{color:#a4ad9f}
html[data-theme="dark"] .profile,html[data-theme="dark"] .coach-panel,html[data-theme="dark"] .admin-panel,html[data-theme="dark"] .team-stats,html[data-theme="dark"] .invitation-row,html[data-theme="dark"] .message-actions{border-color:#364037}
html[data-theme="dark"] .profile strong,html[data-theme="dark"] .coach-team-name,html[data-theme="dark"] .team-stats strong,html[data-theme="dark"] .coach-panel h3,html[data-theme="dark"] .admin-panel h3{color:var(--ink)}
html[data-theme="dark"] .profile small,html[data-theme="dark"] .team-stats small,html[data-theme="dark"] .meta-item small,html[data-theme="dark"] .meta-item em,html[data-theme="dark"] .fixture-subline,html[data-theme="dark"] .draw-updated,html[data-theme="dark"] .page-footer{color:#9ca79a}
html[data-theme="dark"] .team-picker{background:#222923;color:var(--ink)}
html[data-theme="dark"] .team-picker select{color:var(--ink)}
html[data-theme="dark"] .team-emblem,html[data-theme="dark"] .meta-icon,html[data-theme="dark"] .date-block,html[data-theme="dark"] .family-team-mark,html[data-theme="dark"] .family-player-avatar,html[data-theme="dark"] .family-shortcut-icon{background:#354331;color:#d1e3c1}
html[data-theme="dark"] .date-block strong{color:#d0e1c2}
html[data-theme="dark"] .fixture-card.is-selected{border-color:#72975a;box-shadow:0 0 0 2px #344431}
html[data-theme="dark"] .fixture-card.is-selected .card-arrow,html[data-theme="dark"] .card-arrow{background:#303a30;color:#c0d4ae}
html[data-theme="dark"] .coach-dashboard-head,html[data-theme="dark"] .family-team-card,html[data-theme="dark"] .player-detail-heading{background:linear-gradient(120deg,#222923,#293329);border-color:#364037}
html[data-theme="dark"] .coach-note,html[data-theme="dark"] .availability-summary,html[data-theme="dark"] .family-player,html[data-theme="dark"] .family-empty,html[data-theme="dark"] .player-games-empty,html[data-theme="dark"] .fixture-dialog-grid,html[data-theme="dark"] .fixture-edit-form,html[data-theme="dark"] .message-edit form,html[data-theme="dark"] .availability-responses{background:#293129;color:#dce4d7;border-color:#394439}
html[data-theme="dark"] .readiness-card{background:#293329;color:#e3e9df;border:1px solid #394439}
html[data-theme="dark"] .readiness-card small,html[data-theme="dark"] .readiness-card li,html[data-theme="dark"] .coach-note,html[data-theme="dark"] .coach-panel p,html[data-theme="dark"] .invitation-row small{color:#aab5a5}
html[data-theme="dark"] .readiness-card .checklist-item{color:#e0e8dc;font-size:12px}
html[data-theme="dark"] .readiness-card .checklist-item[aria-pressed="true"]{color:#b7c2b2}
html[data-theme="dark"] .family-shortcut:hover,html[data-theme="dark"] .family-player:hover,html[data-theme="dark"] .checklist-item:hover{background:#303a30;border-color:#56684c}
html[data-theme="dark"] .family-player{color:var(--ink)}
html[data-theme="dark"] .family-player small,html[data-theme="dark"] .family-team-card>div:last-child>p:last-child,html[data-theme="dark"] .family-shortcut small,html[data-theme="dark"] .player-game-info small{color:#a6b09f}
html[data-theme="dark"] .family-status{background:#344331;color:#d0e2c2}
html[data-theme="dark"] .player-game-date{background:#354331;color:#d0e2c2}
html[data-theme="dark"] .player-availability-note,html[data-theme="dark"] .player-detail-heading p:last-child{color:#a6b09f}
html[data-theme="dark"] .player-availability button,html[data-theme="dark"] .rsvp-button{background:#252d27;color:#c1cabd;border-color:#3b463c}
html[data-theme="dark"] .player-availability button.selected,html[data-theme="dark"] .rsvp-button.selected,html[data-theme="dark"] .rsvp-button:hover{background:#344331;color:#d7e8c9;border-color:#6d8c56}
html[data-theme="dark"] .player-day-scope{background:#2c352d;color:#d2dbcd}
html[data-theme="dark"] .rsvp-feedback{color:#b0c39f}
html[data-theme="dark"] .rsvp-scope,html[data-theme="dark"] .player-day-scope{color:#bac5b5}
html[data-theme="dark"] .secondary-button,html[data-theme="dark"] .coach-mode{background:#354331;color:#d3e4c5}
html[data-theme="dark"] .secondary-button:hover,html[data-theme="dark"] .coach-mode:hover{background:#41533b}
html[data-theme="dark"] .primary-button{background:#527447;color:#fff}
html[data-theme="dark"] .primary-button:hover{background:#628951}
html[data-theme="dark"] .danger-button{background:#3a2926;color:#f0b5a8;border-color:#65423a}
html[data-theme="dark"] .message-category,html[data-theme="dark"] .pinned-label,html[data-theme="dark"] .message-thread summary span{background:#303a30;color:#d2ddca}
html[data-theme="dark"] .update-item.is-pinned{background:#252d27;border-color:#53634b}
html[data-theme="dark"] .update-item .message-body,html[data-theme="dark"] .thread-original-message>p,html[data-theme="dark"] .message-reply p{color:#d0d8cc}
html[data-theme="dark"] .thread-reply{background:#303a30}
html[data-theme="dark"] .thread-reply strong{color:#dce6d5}
html[data-theme="dark"] input:not([type=checkbox]):not([type=radio]),html[data-theme="dark"] select,html[data-theme="dark"] textarea{background:#1b211c;color:#edf1e9;border-color:#414b41}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#879286}
html[data-theme="dark"] .settings-form label,html[data-theme="dark"] .invite-form label,html[data-theme="dark"] .fixture-edit-form label{color:#c5cec0}
html[data-theme="dark"] .login-form label{color:#c5cec0}
html[data-theme="dark"] .help-card{background:#293129;color:#e2e9dc}
html[data-theme="dark"] .help-card p{color:#aab5a5}
html[data-theme="dark"] .empty-state{background:#222923;color:#dce4d7;border-color:#364037}
html[data-theme="dark"] .settings-card hr{border-color:#364037}
html[data-theme="dark"] .parent-signup-setting,html[data-theme="dark"] .parent-invite-details{background:#293329;border-color:#3e4b3d}
html[data-theme="dark"] .login-intro,html[data-theme="dark"] .dialog-copy,html[data-theme="dark"] .login-message,html[data-theme="dark"] .form-note{color:#a8b1a4}
html[data-theme="dark"] .toast{background:#dce8d2;color:#1a211a}
html[data-theme="dark"] .fixture-dialog::backdrop,html[data-theme="dark"] .connect-dialog::backdrop{background:rgba(0,0,0,.68)}
.appearance-setting{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:16px 0 0;padding:13px 14px;border:1px solid #e8ece3;border-radius:11px;background:#f8faf6}
.appearance-setting>div{display:grid;gap:4px}
.appearance-setting strong{font-size:12px;color:var(--ink)}
.appearance-setting small{font-size:10px;color:#828c7e}
.theme-switch{position:relative;display:inline-flex!important;align-items:center;flex:none;margin:0!important;cursor:pointer}
.theme-switch input{position:absolute;width:1px!important;height:1px;opacity:0}
.theme-switch span{width:45px;height:26px;padding:3px;border-radius:20px;background:#ccd3c8;transition:background .18s}
.theme-switch span:after{content:"";display:block;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0002;transition:transform .18s}
.theme-switch input:checked+span{background:#63884b}
.theme-switch input:checked+span:after{transform:translateX(19px)}
.theme-switch input:focus-visible+span{outline:2px solid #87a96c;outline-offset:3px}
.appearance-system{margin:0;padding:4px 0;border:0;background:transparent;color:#5f7d4c;font-size:10px;font-weight:700;cursor:pointer}
.appearance-system:hover{text-decoration:underline}
html[data-theme="dark"] .appearance-setting{background:#293129;border-color:#3b463c}
html[data-theme="dark"] .appearance-setting small{color:#a6b09f}
html[data-theme="dark"] .appearance-system{color:#b6d19f}
@media(max-width:580px){.appearance-setting{padding:12px}.appearance-setting small{max-width:220px;line-height:1.4}}
html[data-theme="dark"] .appearance-setting small,html[data-theme="dark"] .appearance-system{font-size:12px}
html[data-theme="dark"] .settings-heading>p,html[data-theme="dark"] .settings-card>p:not(.eyebrow){font-size:13px}
html[data-theme="dark"] .page-footer{font-size:10px;color:#b6c0b2}
/* Dark-mode text contrast: cover shared and page-specific copy, including
   small metadata that otherwise keeps its light-theme gray. */
html[data-theme="dark"] body :is(p,small,span,label,li,time,summary,em,strong,a,button,legend,dt,dd,figcaption){color:#d5ded2}
html[data-theme="dark"] :is(.section-kicker,.text-link,.header-action,.coach-auth-hint,.step-number,.family-player-open,.player-detail-back,.message-thread-link,.thread-back,.checklist-reset,.appearance-system){color:#b9d69f}
html[data-theme="dark"] :is(.team-picker small,.section-heading p,.fixture-subline,.fixture-subline span,.upcoming-tag,.empty-state span,.generated-code p,.generated-code code,.roster-empty,.availability-responses>p,.response-status,.coach-auth-hint,.update-item .message-author,.message-author,.message-thread summary,.thread-empty,.message-reply time,.message-reply p,.message-edit>summary,.message-read-state,.thread-reply time,.thread-reply p,.thread-no-replies,.family-player small,.family-team-card>div:last-child>p:last-child,.family-shortcut small,.family-empty,.parent-signup-setting small,.parent-invite-details small,.player-game-info small,.player-games-empty span,.player-availability-note,.player-detail-heading p:last-child,.rsvp-scope,.player-day-scope,.fixture-edit-form label span,.readiness-card small,.readiness-card li,.help-card p,.login-intro,.dialog-copy,.login-message,.form-note,.profile small,.team-stats small,.meta-item small,.meta-item em,.draw-updated,.page-footer){color:#b7c2b4}
html[data-theme="dark"] :is(.message-read-state.is-unread,.response-status.available,.availability-available,.success,.status-available){color:#c5e6a8}
html[data-theme="dark"] :is(.response-status.unavailable,.availability-unavailable,.error,.status-unavailable,.danger-button,.thread-reply-delete){color:#f0b5a8}
html[data-theme="dark"] :is(.response-status.maybe,.availability-maybe,.status-maybe){color:#e8d39a}
html[data-theme="dark"] :is(.primary-button,.toast,.brand-dot,.team-emblem,.meta-icon,.date-block,.family-team-mark,.family-player-avatar,.family-shortcut-icon,.player-game-date,.check-circle){color:inherit}
html[data-theme="dark"] :is(.message-open h3,.update-item.is-unread .message-open h3){color:#eef3e9}
html[data-theme="dark"] .update-item.is-unread .message-open :is(.message-author,.message-body){color:#d5e0d0}
html[data-theme="dark"] :is(.team-picker strong,.team-picker select,.fixture-edit-form input,.fixture-edit-form textarea,input,select,textarea){color:#edf1e9}
html[data-theme="dark"] :is(.mobile-nav a,.main-nav .nav-item){font-size:13px}
html[data-theme="dark"] :is(.page-footer,.brand small,.nav-label,.eyebrow,.muted-eyebrow,.section-kicker,.upcoming-tag,.message-read-state){font-size:11px}
/* Icons are often rendered as spans, so keep them on a brighter, dedicated palette. */
html[data-theme="dark"] :is(.nav-icon,.mobile-nav a span,.main-nav .nav-item span,.brand-mark,.brand-mark svg,.team-emblem,.meta-icon,.date-block,.family-team-mark,.family-player-avatar,.family-shortcut-icon,.player-game-date,.card-arrow,.check-circle,.readiness-head>span,.checklist-item>span,.family-player-check,.family-player-open,.fixture-icon,.icon){color:#c6e2a8}
html[data-theme="dark"] :is(.nav-item.active .nav-icon,.mobile-nav a.active span){color:#e2f3d4}
html[data-theme="dark"] .upcoming-tag{background:#344331;color:#d1e9bd}
html[data-theme="dark"] .brand-mark svg{stroke:currentColor}
html[data-theme="dark"] .readiness-icon{color:#20351d;background:#d9edc6;font-weight:800}
html[data-theme="dark"] .brand-mark{background:#d9edc6}
html[data-theme="dark"] .brand-mark svg{stroke:#35532d}
html[data-theme="dark"] body .rsvp-strip .rsvp-check{color:#294b28!important;background:#d9edc6}
html[data-theme="dark"] body .readiness-card .readiness-icon{color:#294b28!important;background:#d9edc6}
/* Keep the Updates list and conversation readable against dark surfaces. */
html[data-theme="dark"] body #view-updates :is(.view-title,.updates-compose h3,.update-item h3,.message-thread-view>h2,.thread-original-message h3){color:#f0f4ec!important}
html[data-theme="dark"] body #view-updates :is(.update-item .message-body,.thread-original-message>p,.message-reply p,.thread-reply p,.updates-compose .pin-compose,.message-reply strong,.thread-reply strong){color:#dce5d8!important}
html[data-theme="dark"] body #view-updates :is(.message-author,.message-reply time,.thread-reply time,.thread-empty,.thread-no-replies,.message-read-count){color:#bac6b6!important}
html[data-theme="dark"] body #view-updates :is(.message-thread summary,.message-thread summary:after,.message-thread-link,.thread-back,.message-edit>summary,.acknowledge-button,.message-coach-actions button,.thread-reply-delete){color:#c4dfa9!important}
html[data-theme="dark"] body #view-updates :is(.message-category,.pinned-label,.message-thread summary span){color:#e0ead8!important;background:#354132}
html[data-theme="dark"] body #view-updates .category-game{color:#d9edbd!important;background:#34452e}
html[data-theme="dark"] body #view-updates .category-event{color:#e0d0f4!important;background:#40364d}
html[data-theme="dark"] body #view-updates .category-gear{color:#f1c9a8!important;background:#493a2d}
html[data-theme="dark"] body #view-updates .pinned-label{color:#f0dfa6!important;background:#49422a}
html[data-theme="dark"] body #view-updates .message-read-state.is-unread{color:#f0dfa6!important;background:#49422a}
html[data-theme="dark"] body #view-updates .message-read-state.is-read{color:#d9edbd!important;background:#34452e}
html[data-theme="dark"] body #view-updates .message-coach-actions .danger-link,html[data-theme="dark"] body #view-updates .thread-reply-delete{color:#f0b5a8!important}
html[data-theme="dark"] body #view-updates .message-actions{border-color:#435044}
html[data-theme="dark"] body #view-updates .coach-card .coach-note{color:#d5e0d2!important;background:#2a342b}
html[data-theme="dark"] body #view-updates .coach-card .coach-bottom{color:#c4cec0!important}
html[data-theme="dark"] body #view-updates .coach-card .avatar-coach{color:#294b28!important;background:#d9edc6;border-color:#222923}
html[data-theme="dark"] body #view-updates .coach-card .online-dot{background:#9bcc6a;box-shadow:0 0 0 3px #394b32}
html[data-theme="dark"] body #view-updates #message-feed .empty-state{color:#edf1e9}
html[data-theme="dark"] body #view-updates #message-feed .empty-state span{color:#bac6b6!important}
.nav-icon svg,.mobile-nav .message-nav-icon svg,.family-shortcut-icon.updates svg{display:block;width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.unread-count{display:inline-flex;align-items:center;justify-content:center;min-width:17px;height:17px;margin-left:auto;padding:0 5px;border-radius:10px;background:#df835d;color:#fff!important;font-size:10px;font-weight:800;line-height:1}
.unread-count[hidden],.notification-setting[hidden]{display:none!important}
.notification-setting{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:15px 0;padding:13px;border:1px solid #e8ece3;border-radius:10px;background:#f8faf6}
.notification-setting>div{display:grid;gap:4px}
.notification-setting strong{font-size:12px;color:var(--ink)}
.notification-setting small{max-width:330px;color:#6f796c;font-size:11px;line-height:1.4}
.notification-setting button{flex:none;margin:0;font-size:11px}
@media(max-width:760px){.mobile-nav a[data-view-link="updates"]{position:relative}.mobile-nav .unread-count{position:absolute;top:0;right:10px;min-width:16px;height:16px;margin:0;padding:0 4px;font-size:9px}}
html[data-theme="dark"] .notification-setting{background:#293129;border-color:#3b463c}
html[data-theme="dark"] .notification-setting strong{color:#edf1e9}
html[data-theme="dark"] .notification-setting small{color:#bac6b6}
