html[data-locus-theme="gzhel"],.theme-choice[data-theme-choice="gzhel"]{--lc-bg:#F1F6FE;--lc-panel:#FFFFFF;--lc-text:#173567;--lc-muted:#4F6791;--lc-line:#C5D6EF;--lc-side:#102D68;--lc-side2:#2253A0;--lc-accent:#174EAD;--lc-soft:#E1ECFC;--lc-on:#FFFFFF;--lc-side-ink:#F0F6FF;--lc-mode:light;}
html[data-locus-theme="khokhloma"],.theme-choice[data-theme-choice="khokhloma"]{--lc-bg:#15110E;--lc-panel:#231C16;--lc-text:#FFF3D5;--lc-muted:#CAB9A0;--lc-line:#5B4932;--lc-side:#1B0B09;--lc-side2:#781C23;--lc-accent:#E8BC55;--lc-soft:#3D2B1D;--lc-on:#23170B;--lc-side-ink:#F6D78C;--lc-mode:dark;}
html[data-locus-theme="northern-teal"],.theme-choice[data-theme-choice="northern-teal"]{--lc-bg:#EDF5F5;--lc-panel:#FFFFFF;--lc-text:#17333C;--lc-muted:#526F78;--lc-line:#D0E2E4;--lc-side:#102F39;--lc-side2:#194550;--lc-accent:#087F8C;--lc-soft:#D9EFF0;--lc-on:#FFFFFF;--lc-side-ink:#D7E5EE;--lc-mode:light;}
html[data-locus-theme="cobalt"],.theme-choice[data-theme-choice="cobalt"]{--lc-bg:#EDF2FC;--lc-panel:#FFFFFF;--lc-text:#182B50;--lc-muted:#526581;--lc-line:#D4DFF2;--lc-side:#13254E;--lc-side2:#1C3970;--lc-accent:#2858D8;--lc-soft:#DFE8FF;--lc-on:#FFFFFF;--lc-side-ink:#D7E5EE;--lc-mode:light;}
html[data-locus-theme="copper-sand"],.theme-choice[data-theme-choice="copper-sand"]{--lc-bg:#F5F0E8;--lc-panel:#FFFEFB;--lc-text:#3C3028;--lc-muted:#77675A;--lc-line:#E5D8C8;--lc-side:#342E2A;--lc-side2:#504238;--lc-accent:#A74F2B;--lc-soft:#F4E1D4;--lc-on:#FFFFFF;--lc-side-ink:#D7E5EE;--lc-mode:light;}
html[data-locus-theme="iris"],.theme-choice[data-theme-choice="iris"]{--lc-bg:#F2EFFA;--lc-panel:#FFFFFF;--lc-text:#30264D;--lc-muted:#726484;--lc-line:#DED5EE;--lc-side:#2B2145;--lc-side2:#44315F;--lc-accent:#7650C5;--lc-soft:#EAE0FA;--lc-on:#FFFFFF;--lc-side-ink:#D7E5EE;--lc-mode:light;}
html[data-locus-theme="night-graphite"],.theme-choice[data-theme-choice="night-graphite"]{--lc-bg:#111A23;--lc-panel:#202E3B;--lc-text:#EDF4FA;--lc-muted:#B1C1D0;--lc-line:#354858;--lc-side:#0A121A;--lc-side2:#142633;--lc-accent:#6CE0C4;--lc-soft:#203F40;--lc-on:#102A2C;--lc-side-ink:#D7E5EE;--lc-mode:dark;}
html[data-locus-theme="forest"],.theme-choice[data-theme-choice="forest"]{--lc-bg:#EEF2E9;--lc-panel:#FFFFFC;--lc-text:#203C2E;--lc-muted:#526C5B;--lc-line:#D2DDCC;--lc-side:#153C2C;--lc-side2:#24583D;--lc-accent:#247247;--lc-soft:#DEEDD8;--lc-on:#FFFFFF;--lc-side-ink:#D7E5EE;--lc-mode:light;}
html[data-locus-theme="bordeaux"],.theme-choice[data-theme-choice="bordeaux"]{--lc-bg:#F8F0F2;--lc-panel:#FFFEFF;--lc-text:#432832;--lc-muted:#7C5C69;--lc-line:#E8D5DD;--lc-side:#3B192A;--lc-side2:#60253E;--lc-accent:#A12C52;--lc-soft:#F6DFE7;--lc-on:#FFFFFF;--lc-side-ink:#D7E5EE;--lc-mode:light;}
html[data-locus-theme="white-architecture"],.theme-choice[data-theme-choice="white-architecture"]{--lc-bg:#F1F5FA;--lc-panel:#FFFFFF;--lc-text:#23324D;--lc-muted:#53647E;--lc-line:#D6E0ED;--lc-side:#E4EDF8;--lc-side2:#FFFFFF;--lc-accent:#284DE0;--lc-soft:#E4EAFF;--lc-on:#FFFFFF;--lc-side-ink:#263C60;--lc-mode:light;}
html[data-locus-theme="amber-anthracite"],.theme-choice[data-theme-choice="amber-anthracite"]{--lc-bg:#1A1917;--lc-panel:#282723;--lc-text:#F5F0E5;--lc-muted:#C0B8A7;--lc-line:#474238;--lc-side:#11110F;--lc-side2:#23221D;--lc-accent:#F2BD50;--lc-soft:#40351F;--lc-on:#29210F;--lc-side-ink:#D7E5EE;--lc-mode:dark;}
html[data-locus-theme="ocean-coral"],.theme-choice[data-theme-choice="ocean-coral"]{--lc-bg:#EFF6F8;--lc-panel:#FFFFFF;--lc-text:#223B4B;--lc-muted:#526E7E;--lc-line:#D2E1E9;--lc-side:#11364B;--lc-side2:#1C5069;--lc-accent:#BE4B3A;--lc-soft:#FBE5DF;--lc-on:#FFFFFF;--lc-side-ink:#D7E5EE;--lc-mode:light;}
/* Only palette colours change. Layout, custom column colours and semantic statuses survive. */
:root {--lc-bg:#f2f4f7;--lc-panel:#fff;--lc-text:#24344b;--lc-muted:#58687d;--lc-line:#d5deea;--lc-side:#263340;--lc-side2:#3b4858;--lc-accent:#315c91;--lc-soft:#eaf0f7;--lc-on:#fff;--lc-side-ink:#d7e5ee;--lc-mode:light}
/* The default palette follows the OS; explicit user palettes remain authoritative. */
@media(prefers-color-scheme:dark){
 html:not([data-locus-theme]){--lc-bg:#111a23;--lc-panel:#202e3b;--lc-text:#edf4fa;--lc-muted:#b1c1d0;--lc-line:#354858;--lc-side:#0a121a;--lc-side2:#142633;--lc-accent:#6ce0c4;--lc-soft:#203f40;--lc-on:#102a2c;--lc-side-ink:#d7e5ee;--lc-mode:dark}
}
.theme-toggle {display:inline-grid;place-items:center;width:40px;height:40px;min-width:40px;padding:9px;border:1px solid #d5deea;border-radius:13px;background:#fff;color:#34465c;cursor:pointer;flex-shrink:0}
.theme-toggle svg {width:21px;height:21px}.theme-toggle:disabled {opacity:.5;cursor:wait}
.theme-dialog {box-sizing:border-box;width:min(880px,calc(100vw - 28px));max-width:880px;max-height:calc(100dvh - 28px);padding:24px;border:1px solid var(--lc-line);border-radius:24px;background:var(--lc-panel)!important;color:var(--lc-text)!important;box-shadow:0 20px 80px #07192755;color-scheme:var(--lc-mode)}
.theme-dialog::backdrop {background:#081a2b88}.theme-dialog>header {display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.theme-dialog h2 {margin:0;color:var(--lc-text)!important;font-size:24px}.theme-dialog header p {margin:8px 0 18px;color:var(--lc-muted);font-size:var(--ui-secondary);line-height:1.5;max-width:650px}
.theme-dialog[open] {display:flex;flex-direction:column;overflow:hidden}.theme-dialog>header,.theme-dialog>footer,.theme-dialog>.theme-status {flex-shrink:0}.theme-dialog>.theme-grid {overflow:auto;min-height:0;padding:5px;margin:-5px;scrollbar-color:var(--lc-muted) var(--lc-panel)}
.theme-dialog button {font:inherit;cursor:pointer}.theme-close {flex:0 0 44px;min-height:44px;border:1px solid var(--lc-line);border-radius:12px;background:var(--lc-panel)!important;color:var(--lc-text)!important;font-size:25px!important}
.theme-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:max-content;align-content:start;gap:12px}.theme-choice {min-width:0;text-align:left;display:flex;flex-direction:column;gap:7px;border:2px solid var(--lc-line)!important;background:var(--lc-panel)!important;color:var(--lc-text)!important;border-radius:15px;padding:12px;position:relative;box-shadow:none!important;color-scheme:var(--lc-mode)}
.theme-choice[aria-pressed=true] {outline:3px solid var(--lc-accent);outline-offset:2px}.theme-choice[aria-pressed=true]::after {content:'✓';position:absolute;top:15px;right:17px;border-radius:50%;height:24px;width:24px;display:grid;place-items:center;background:var(--lc-accent);color:var(--lc-on);font-weight:700}
.theme-sample {display:flex;flex:0 0 44px;overflow:hidden;border:1px solid var(--lc-line);height:44px;border-radius:8px;width:100%}.theme-sample i:nth-child(1){width:24%;background:var(--lc-side)}.theme-sample i:nth-child(2){width:24%;background:var(--lc-accent)}.theme-sample i:nth-child(3){width:52%;background:var(--lc-bg)}
.theme-choice-title {font-weight:700;font-size:var(--ui-control);line-height:1.3}.theme-choice-note {font-size:var(--ui-secondary);line-height:1.4;color:var(--lc-muted)}
.theme-dialog>footer {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:20px;flex-wrap:wrap}.theme-dialog footer button {min-height:44px;border-radius:12px;padding:10px 16px;border:1px solid var(--lc-line)!important;background:var(--lc-panel)!important;color:var(--lc-text)!important}.theme-dialog footer .primary {background:var(--lc-accent)!important;color:var(--lc-on)!important;border-color:var(--lc-accent)!important}.theme-reset[aria-pressed=true]{box-shadow:inset 0 0 0 2px var(--lc-accent)}
.theme-status {font-size:var(--ui-secondary);line-height:1.5;color:var(--lc-muted);min-height:18px;margin-bottom:0}.theme-profile {margin-top:24px;padding:24px;display:flex;gap:20px;align-items:center;justify-content:space-between;flex-wrap:wrap}.theme-profile h2 {margin:0 0 8px}.theme-profile p{font-size:var(--ui-secondary);line-height:1.5;margin:6px 0}.theme-profile-current{color:var(--lc-muted)}
.theme-dialog button:focus-visible,.theme-toggle:focus-visible {outline:3px solid var(--lc-accent);outline-offset:3px}
html:root {color-scheme:var(--lc-mode);--bg:var(--lc-bg);--panel:var(--lc-panel);--paper:var(--lc-panel);--ink:var(--lc-text);--text:var(--lc-text);--muted:var(--lc-muted);--line:var(--lc-line);--border:var(--lc-line);--glass:var(--lc-panel);--mobile-bg:var(--lc-bg);--mobile-panel:var(--lc-panel);--mobile-ink:var(--lc-text);--mobile-muted:var(--lc-muted);--mobile-line:var(--lc-line);--mobile-accent:var(--lc-accent)}
html:root,html:root body,html:root .shell,html:root .main {background:var(--lc-bg)!important;color:var(--lc-text)!important}
html:root body::before,html:root body::after {display:none}
html:root .sidebar {background:linear-gradient(155deg,var(--lc-side2),var(--lc-side))!important;border-color:var(--lc-line)!important}
html:root .sidebar .brand,html:root .sidebar .brand small,html:root .sidebar nav a,html:root .sidebar-bottom a {color:var(--lc-side-ink)!important}
html:root .sidebar nav a[aria-current] {background:var(--lc-accent)!important;color:var(--lc-on)!important;border-color:var(--lc-accent)!important;box-shadow:none!important}
html:root .topbar {border-color:var(--lc-line)!important;background:transparent!important}
html:root .topbar a,html:root .topbar button,html:root .mobile-shortcuts button {background:var(--lc-panel)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important;box-shadow:none!important}
html:root h1,html:root h2,html:root h3,html:root strong,html:root .ib-title,html:root .hub-card-title {color:var(--lc-text)!important}
html:root a {color:var(--lc-accent)}
html:root .muted,html:root small,html:root .help,html:root .eyebrow,html:root .ib-hint,html:root .ib-sync,html:root .ib-meta,html:root .ib-overview-label,html:root .ib-col-current {color:var(--lc-muted)!important}
html:root input,html:root textarea,html:root select,html:root button,html:root .button,html:root summary {background-color:var(--lc-panel)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important}
html:root input::placeholder,html:root textarea::placeholder {color:var(--lc-muted)!important}
html:root .button.primary,html:root .hub-create>summary,html:root .mobile-context-create {background:var(--lc-accent)!important;color:var(--lc-on)!important;border-color:var(--lc-accent)!important}
html:root .panel,html:root .asset-passport,html:root .stats,html:root .stat,html:root .work-card,html:root .hub-project,html:root .hub-card,html:root .hub-metrics>a,html:root .hub-nav,html:root .hub-toolbar,html:root .work-filters,html:root .ib-toolbar,html:root .ib-personal,html:root .ib-overview,html:root .mobile-result,html:root .mobile-upload-preview {background:var(--lc-panel)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important}
html:root .hub-nav a,html:root .hub-nav summary,html:root .work-tabs a {color:var(--lc-muted)!important}
html:root .hub-nav a[aria-current=page] {background:var(--lc-soft)!important;color:var(--lc-accent)!important;box-shadow:none!important}
html:root .work-tabs a {border-color:var(--lc-line)!important}
html:root .ib-chips {background:var(--lc-bg)!important;border-color:var(--lc-line)!important}
html:root .ib-chips button[aria-pressed=true] {background:var(--lc-accent)!important;color:var(--lc-on)!important;border-color:var(--lc-accent)!important;box-shadow:none!important}
html:root .ib-views {border-color:var(--lc-line)!important}
html:root .ib-column {--ib-surface:color-mix(in srgb,var(--ib-accent) 9%,var(--lc-bg));--ib-heading:color-mix(in srgb,var(--ib-accent) 20%,var(--lc-panel));background:var(--ib-surface)!important;border-color:color-mix(in srgb,var(--ib-accent) 30%,var(--lc-line))!important;border-top-color:var(--ib-accent)!important}
html:root .ib-column>header,html:root .ib-column[data-collapsed=true] {background:var(--ib-heading)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important}
html:root .ib-column h2,html:root .ib-column>header small,html:root .ib-column>header .ib-icon {color:var(--lc-text)!important}
html:root .ib-count {background:var(--lc-panel)!important;color:var(--lc-text)!important}
html:root .ib-card {background:var(--lc-panel)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important;border-left-color:var(--ib-accent)!important}
html:root .ib-column .ib-empty {background:var(--lc-panel)!important;color:var(--lc-muted)!important;border-color:var(--lc-line)!important}
html:root .ib-add {background:transparent!important;color:var(--lc-accent)!important;border-color:var(--lc-line)!important}
html:root .ib-avatar {background:var(--lc-soft)!important;color:var(--lc-accent)!important}
html:root .ib-person,html:root .ib-views label,html:root .ib-search>span {color:var(--lc-muted)!important}
html:root .ib-menu,html:root .ib-drawer,html:root .ib-dialog,html:root .ib-photo,html:root .hub-drawer,html:root .hub-form-dialog,html:root .hub-card-detail,html:root .hub-more>div,html:root .hub-create>div,html:root .mobile-filter-sheet {background:var(--lc-panel)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important}
html:root .ib-drawer-bar,html:root .hub-drawer>header,html:root .hub-form-dialog>header,html:root .mobile-filter-sheet>header {background:var(--lc-panel)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important}
html:root .work-table-wrap td,html:root .work-table-wrap th,html:root th,html:root td {background:var(--lc-panel)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important}
html:root .profile-identity,html:root .profile-details,html:root .profile-access,html:root .profile-security {background:var(--lc-panel)!important;border-color:var(--lc-line)!important;color:var(--lc-text)!important}
html:root .profile-identity p,html:root .profile-section-heading p,html:root .profile-facts dt,html:root .profile-footnote,html:root .profile-kicker {color:var(--lc-muted)!important}
html:root .profile-identity h2,html:root .profile-facts dd {color:var(--lc-text)!important}
/* Each picker card keeps its own swatch and contrast even under a different active theme. */
html:root .theme-choice {background:var(--lc-panel)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important}
html:root .theme-choice-title {color:var(--lc-text)!important}
@media(max-width:700px){.theme-toggle{min-width:36px;width:36px;height:36px;padding:7px}.theme-dialog{padding:16px;width:calc(100vw - 20px);max-height:calc(100dvh - 20px);border-radius:20px}.theme-grid{grid-template-columns:1fr}.theme-dialog h2{font-size:21px}.theme-profile{padding:20px}.theme-dialog>footer{padding-bottom:env(safe-area-inset-bottom,0px)}html:root .sidebar{background:transparent!important}html:root .sidebar .brand,html:root .sidebar .brand small{color:var(--lc-text)!important}html:root .sidebar nav{background:var(--lc-side)!important;border-color:var(--lc-line)!important}html:root .sidebar nav a{color:var(--lc-side-ink)!important}html:root .sidebar nav a[aria-current]{background:var(--lc-accent)!important;color:var(--lc-on)!important}}
@media(prefers-reduced-motion:reduce){.theme-dialog *,.theme-toggle{animation:none!important;transition:none!important}}
@media(forced-colors:active){.theme-dialog,.theme-choice,.theme-toggle{forced-color-adjust:auto}.theme-choice[aria-pressed=true]{outline:3px solid Highlight}.theme-choice[aria-pressed=true]::after{background:Highlight;color:HighlightText}}

/* Shared module surfaces use the same palette; no photo, video or AR canvas filtering. */
html:root{--surface:var(--lc-panel);--accent:var(--lc-accent);--accent-dark:var(--lc-accent);--soft:var(--lc-soft);--nav:var(--lc-side);--glass-strong:var(--lc-panel);--glass-border:var(--lc-line)}
html:root .ar-note,html:root .billing .card,html:root .messenger-layout,html:root .messenger-rail,html:root .conversation,html:root .task-details,html:root .chat-compose,html:root .chat-message,html:root .chat-room,html:root .dialog-row{background:var(--lc-panel)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important}
html:root .ar-note p,html:root .passport-rows dt,html:root .billing-heading p{color:var(--lc-muted)!important}
html:root .ar-note a,html:root .overview-copy h1 em{color:var(--lc-accent)!important}
html:root .billing .card p,html:root .billing-price,html:root .profile-action small,html:root .passport-rows dd{color:var(--lc-text)!important}

/* Published board stickers: neutral surfaces follow the palette, semantic edge colours stay intact. */
html:root .sticker-chip:not([data-sticker-color]),html:root .sticker-native span{background:var(--lc-soft)!important;color:var(--lc-text)!important}
html:root .sticker-chip[data-sticker-color]{border-color:var(--sticker-color,var(--lc-line))!important}
html:root .sticker-column-sum,html:root .sticker-column-sums,html:root .sticker-native small{color:var(--lc-muted)!important}
html:root .sticker-native,html:root .sticker-option,html:root .sticker-board-tools details{border-color:var(--lc-line)!important}
html:root label{color:var(--lc-muted)!important}

/* Khokhloma: readable ordinary dates/counts; overdue child status retains its own colour. */
html[data-locus-theme="khokhloma"] .ib-card-footer{color:var(--lc-muted)!important}

/* Neutral labels must follow their actual panel, including automatic dark mode. */
html:root .asset-code{color:var(--lc-text)}
html:root .ws-switch{background:var(--lc-soft);border-color:var(--lc-line)}
html:root .ws-switch a{color:var(--lc-muted)}
html:root .ws-switch a[aria-current]{background:var(--lc-panel);color:var(--lc-text)}
html:root .ws-column-empty{color:var(--lc-muted)}

html:root .row-title,html:root .ws-title{color:var(--lc-text)!important}
html:root .ws-context,html:root .ws-tile-bottom,html:root .profile-optional{color:var(--lc-muted)}
html:root .profile-action>span:last-child{color:var(--lc-accent)}
html:root .back-link{color:var(--lc-accent)}
html:root .empty-icon{background:var(--lc-soft);color:var(--lc-muted)}
/* No white inset glare when a panel is dark. */
html:root .panel{box-shadow:0 5px 18px -12px #1922361a}

/* List rows are neutral panels too: never mix dark text tokens with white glass. */
html:root .hub-item{background:var(--lc-panel)!important;color:var(--lc-text)!important;border-color:var(--lc-line)!important}
html:root .hub-item .hub-pill{background:var(--lc-soft)!important;color:var(--lc-text)!important}
html:root .hub-item .hub-assignee,html:root .hub-item time{color:var(--lc-muted)!important}
html:root .hub-item .hub-route,html:root .hub-item .hub-open{color:var(--lc-accent)!important}

/* Preserve a recognisable palette in OS high-contrast mode. */
@media(forced-colors:active){.theme-toggle .theme-palette-body{fill:Canvas;stroke:ButtonText}.theme-toggle .theme-palette circle{fill:ButtonText}}
