:root{--theme-bg:#f9fafb;--theme-surface:#fff;--theme-ink:#111827;--theme-muted:#6b7280;--theme-line:#e5e7eb;--theme-primary:#2563eb;--theme-hover:#1d4ed8;--theme-soft:#eff6ff;--theme-success-bg:#ecfdf5;--theme-success:#065f46;--theme-warning-bg:#fffbeb;--theme-warning:#92400e;--theme-error-bg:#fef2f2;--theme-error:#991b1b}
:root[data-theme=dark]{color-scheme:dark;--theme-bg:#141b24;--theme-surface:#1e2936;--theme-ink:#eef2f7;--theme-muted:#b2bfce;--theme-line:#3a495b;--theme-primary:#376bc1;--theme-hover:#2d5eaf;--theme-soft:#253b59;--theme-success-bg:#193b30;--theme-success:#a0e0bb;--theme-warning-bg:#42351e;--theme-warning:#f2d191;--theme-error-bg:#42282a;--theme-error:#ffb6b1}
:root[data-theme=green]{--theme-bg:#edf4ef;--theme-surface:#fbfdfb;--theme-ink:#18392b;--theme-muted:#506b5b;--theme-line:#cdded2;--theme-primary:#286548;--theme-hover:#1d5037;--theme-soft:#deeee2;--theme-success-bg:#deeee2;--theme-success:#245c3b;--theme-warning-bg:#f6edd8;--theme-warning:#765216;--theme-error-bg:#fbe8e5;--theme-error:#923d35}
:root[data-theme]{--navy:var(--theme-ink);--blue:var(--theme-primary);--bright-blue:var(--theme-primary);--ink:var(--theme-ink);--muted:var(--theme-muted);--line:var(--theme-line);--canvas:var(--theme-bg);--surface:var(--theme-surface)}
html[data-theme],html[data-theme] body{background:var(--theme-bg);color:var(--theme-ink)}
[data-theme] :is(.topbar,.portal-nav.compact-nav,.sidebar-brand,.portal-card,.registry-card,.role-card,.task-card,.metric,.calendar-panel,.person-card,.overview,.progress-card,.message-bubble,.ticket-row,.community-empty,.save-dock,.dialog-head,.squad-dialog,.compact-nav .nav-group-panel,.compact-nav .nav-group-panel .button){background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line)}
[data-theme] :is(input,select,textarea){background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line)}
[data-theme] :is(input,select,textarea):focus{border-color:var(--theme-primary);box-shadow:0 0 0 2px var(--theme-soft)}
[data-theme] :is(h1,h2,h3,h4,label,.compact-brand,.sidebar-brand,.metric strong,.overview strong,.task-progress strong){color:var(--theme-ink)}
[data-theme] :is(.subtitle,.subtle,.eyebrow,.login-note,.brand-lockup span,.overview span,.progress-card p,.account span,.task-card .multiline,.task-progress,.person-details span,.metric span,.calendar-day>span,.message-bubble>div span,.nav-current){color:var(--theme-muted)}
[data-theme] .button.primary{background:var(--theme-primary);color:#fff;border-color:var(--theme-primary)}
[data-theme] .button.primary:hover{background:var(--theme-hover);border-color:var(--theme-hover)}
[data-theme] .button.ghost{background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line)}
[data-theme] :is(.button.ghost:hover,tbody tr:hover,thead th,.weekday,.calendar-day.blank,.message-bubble.from-staff){background:var(--theme-bg);color:var(--theme-ink)}
[data-theme] :is(th,td,.overview>div,.task-progress,.role-card-head,.person-card,.ticket-row,.assignment-list>div){border-color:var(--theme-line)}
[data-theme] :is(.portal-nav .button,.compact-nav summary,.compact-nav .nav-group-panel .button){color:var(--theme-muted);background:transparent}
[data-theme] :is(.portal-nav .button:hover,.compact-nav summary:hover,.compact-nav .nav-group[open]>summary){background:var(--theme-bg);color:var(--theme-ink)}
[data-theme] :is(.portal-nav .button[aria-current=page],.compact-nav summary[aria-current=page],.compact-nav .nav-group-panel .button[aria-current=page],.calendar-event){background:var(--theme-soft);color:var(--theme-ink)}
[data-theme] :is(.text-link,.person-details a){color:var(--theme-primary)}
[data-theme=dark] :is(a,.text-link,.person-details a){color:#aacaff}
[data-theme] :is(.status-pill,.season-badge){background:var(--theme-bg);color:var(--theme-muted);border-color:var(--theme-line)}
[data-theme] .status-pill.late,[data-theme] .privacy-note{background:var(--theme-warning-bg);color:var(--theme-warning);border-color:var(--theme-line)}
[data-theme] .privacy-badge{background:var(--theme-success-bg);color:var(--theme-success);border-color:var(--theme-line)}
[data-theme] .form-message.error{color:var(--theme-error)}
[data-theme] #portal-message:not(:empty){background:var(--theme-soft);color:var(--theme-ink);border-color:var(--theme-line)}
[data-theme] .report-section-nav .button{background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line)}
[data-theme] .login-screen{background:var(--theme-bg)}
[data-theme] .login-screen .login-panel{background:var(--theme-surface);border-color:var(--theme-line)}
[data-theme] .login-screen input{background:var(--theme-surface);color:var(--theme-ink);border-color:var(--theme-line)}
[data-theme] .login-screen a{color:var(--theme-ink)}
.theme-control{display:flex;align-items:center;gap:8px;font-size:14px;white-space:nowrap}.theme-control select{width:112px;font-size:14px;min-height:36px;padding:6px 10px}.topbar{justify-content:flex-end;gap:20px}.account-role-empty{display:none!important}
@media(max-width:1000px){.topbar .sidebar-toggle{margin-right:auto}.topbar{gap:12px}}
@media(max-width:600px){.theme-control>span{display:none}.theme-control select{width:96px;font-size:13px}.topbar{gap:8px}.account>div{max-width:115px}.account strong{max-width:115px}.account{gap:8px}}
@media(max-width:380px){.account>div{max-width:80px}.account strong{max-width:80px}.topbar{padding:0 10px}.sidebar-toggle{padding:8px 10px!important}}
.theme-icons{display:flex;gap:4px;align-items:center}.theme-icons button{display:grid;place-items:center;width:40px;height:40px;padding:8px;border:1px solid transparent;border-radius:8px;background:transparent;color:var(--theme-muted);cursor:pointer}.theme-icons button:hover{background:var(--theme-bg);color:var(--theme-ink)}.theme-icons button[aria-pressed=true]{background:var(--theme-soft);border-color:var(--theme-line);color:var(--theme-ink)}.theme-icons svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}@media(max-width:380px){.theme-icons{gap:0}.theme-icons button{width:36px}.account>div{max-width:68px}.account strong{max-width:68px}}
.theme-picker{position:relative}.theme-picker summary{list-style:none;width:40px;height:40px;display:grid;place-items:center;border:1px solid var(--theme-line);border-radius:8px;color:var(--theme-ink);background:var(--theme-surface);cursor:pointer}.theme-picker summary::-webkit-details-marker{display:none}.theme-picker svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.theme-picker .theme-icons{position:absolute;top:calc(100% + 8px);right:0;padding:8px;background:var(--theme-surface);border:1px solid var(--theme-line);border-radius:10px;box-shadow:0 4px 12px #00000020;z-index:30;flex-direction:column}.theme-picker .theme-icons button{width:44px;height:44px}

/* Sidebar links keep the same borderless appearance as the original buttons. */
[data-theme] .portal-nav a.button[href]{border:0;box-shadow:none;margin-top:0}
.portal-nav :is(a,button,summary):focus:not(:focus-visible){outline:none;box-shadow:none}
