/* Seven project themes. Field backgrounds/fonts remain inline and take precedence. */
:root[data-colour-theme="chalk-olive"],.theme-option[data-colour-theme="chalk-olive"]{--sb-nav:#414b3e;--sb-nav-ink:#fbf7ee;--sb-nav-selected:#5b6655;--sb-page:#f3eee5;--sb-top:#e7dfd1;--sb-top-ink:#343a31;--sb-paper:#fffdf8;--sb-ink:#343a31;--sb-muted:#625f54;--sb-line:#d4ccbc;--sb-accent:#6f684b;--sb-soft:#e6e8dc;--sb-panel:#e7dfd1;--sb-media:#f3eee5;--sb-focus:#6f684b;--sb-on-accent:#fffaf3;--sb-selection:#6f684b22;--sb-backdrop:#211e1baa;--sb-heading-font:Georgia,serif;}
:root[data-colour-theme="sand-walnut"],.theme-option[data-colour-theme="sand-walnut"]{--sb-nav:#57443a;--sb-nav-ink:#fff7ec;--sb-nav-selected:#70594c;--sb-page:#f5eee3;--sb-top:#e9ddcc;--sb-top-ink:#41362e;--sb-paper:#fffcf6;--sb-ink:#41362e;--sb-muted:#6b5d4f;--sb-line:#d8cbbb;--sb-accent:#7d6041;--sb-soft:#eee3d1;--sb-panel:#e9ddcc;--sb-media:#f5eee3;--sb-focus:#7d6041;--sb-on-accent:#fffaf3;--sb-selection:#7d604122;--sb-backdrop:#211e1baa;--sb-heading-font:Georgia,serif;}
:root[data-colour-theme="clay-linen"],.theme-option[data-colour-theme="clay-linen"]{--sb-nav:#805b4a;--sb-nav-ink:#fff7f0;--sb-nav-selected:#69493c;--sb-page:#f5eee8;--sb-top:#e9d9cf;--sb-top-ink:#44372f;--sb-paper:#fffcf8;--sb-ink:#44372f;--sb-muted:#705e53;--sb-line:#dac9be;--sb-accent:#855c46;--sb-soft:#f0e0d6;--sb-panel:#e9d9cf;--sb-media:#f5eee8;--sb-focus:#855c46;--sb-on-accent:#fffaf3;--sb-selection:#855c4622;--sb-backdrop:#211e1baa;--sb-heading-font:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;}
:root[data-colour-theme="ivory-brass"],.theme-option[data-colour-theme="ivory-brass"]{--sb-nav:#e6dcc8;--sb-nav-ink:#413d31;--sb-nav-selected:#d1c2a6;--sb-page:#faf6ed;--sb-top:#535c42;--sb-top-ink:#fffbed;--sb-paper:#fffdf7;--sb-ink:#3f3b2f;--sb-muted:#686050;--sb-line:#d8cdb8;--sb-accent:#79602e;--sb-soft:#eee5ce;--sb-panel:#e9e1cf;--sb-media:#faf6ed;--sb-focus:#79602e;--sb-on-accent:#fffaf3;--sb-selection:#79602e22;--sb-backdrop:#211e1baa;--sb-heading-font:Georgia,serif;}
:root[data-colour-theme="petrol-copper"],.theme-option[data-colour-theme="petrol-copper"]{--sb-nav:#263f43;--sb-nav-ink:#faf5ec;--sb-nav-selected:#3b5a5b;--sb-page:#f4ece2;--sb-top:#d7e4e1;--sb-top-ink:#253e3f;--sb-paper:#fffaf3;--sb-ink:#2f3c3b;--sb-muted:#5e635b;--sb-line:#cbd5cb;--sb-accent:#8a4e34;--sb-soft:#e9ddd0;--sb-panel:#d7e4e1;--sb-media:#f4ece2;--sb-focus:#8a4e34;--sb-on-accent:#fffaf3;--sb-selection:#8a4e3422;--sb-backdrop:#211e1baa;--sb-heading-font:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;}
:root[data-colour-theme="plum-pearl"],.theme-option[data-colour-theme="plum-pearl"]{--sb-nav:#51404f;--sb-nav-ink:#fbf4f5;--sb-nav-selected:#705970;--sb-page:#f5eef0;--sb-top:#e5d7df;--sb-top-ink:#3f3440;--sb-paper:#fffbfc;--sb-ink:#3f3440;--sb-muted:#695967;--sb-line:#d8c8d2;--sb-accent:#79546b;--sb-soft:#eadce4;--sb-panel:#e5d7df;--sb-media:#f5eef0;--sb-focus:#79546b;--sb-on-accent:#fffaf3;--sb-selection:#79546b22;--sb-backdrop:#211e1baa;--sb-heading-font:Georgia,serif;}

:root[data-colour-theme]{--nav:var(--sb-nav);--ink:var(--sb-ink);--muted:var(--sb-muted);--line:var(--sb-line);--bg:var(--sb-page);--brand:var(--sb-accent);--soft:var(--sb-soft);color-scheme:light}
html[data-colour-theme] body{background:var(--sb-page);color:var(--sb-ink)}
html[data-colour-theme] :is(h1,h2,h3,h4){font-family:var(--sb-heading-font)}
html[data-colour-theme] #sidebar,html[data-colour-theme] #sidebar .brand{background:var(--sb-nav);color:var(--sb-nav-ink)}
html[data-colour-theme] #sidebar :is(h1,button,small,.meta,.eyebrow,.sidefoot,.side-version){color:var(--sb-nav-ink)}
html[data-colour-theme] #sidebar .brand{border-color:color-mix(in srgb,var(--sb-nav-ink) 18%,transparent)}
html[data-colour-theme] #sidebar .sidefoot{background:var(--sb-nav-selected);border-radius:7px}
html[data-colour-theme] #sidebar .btn{border-color:color-mix(in srgb,var(--sb-nav-ink) 35%,transparent)}
html[data-colour-theme] #nav button:hover,html[data-colour-theme] #nav button.active{background:var(--sb-nav-selected);color:var(--sb-nav-ink)}
html[data-colour-theme] .topbar{background:var(--sb-top);color:var(--sb-top-ink)}
html[data-colour-theme] .topbar :is(h1,#menu,.menu-toggle){color:var(--sb-top-ink)}
html[data-colour-theme] .topbar :is(#menu,.menu-toggle){background:transparent}
html[data-colour-theme] dialog{background:var(--sb-paper)}
html[data-colour-theme] input{accent-color:var(--sb-accent)}
/* Keep measured plans and document paper neutral; material colours carry meaning. */
html[data-colour-theme] :is(.overview-plan-image,#dts-plan,.document-surface){background:#fff}
.theme-description{font-size:13px;margin:0 0 12px;color:var(--muted)}
.theme-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.theme-option{display:block;position:relative;margin:0;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--sb-page);color:var(--sb-ink);cursor:pointer;min-width:0}
.theme-option:has(input:checked){outline:2px solid var(--brand);outline-offset:2px}
.theme-option:focus-within{outline:3px solid var(--brand);outline-offset:2px}
.theme-option input{position:absolute;top:10px;right:10px;z-index:1;width:18px;height:18px;margin:0;accent-color:var(--brand)}
.theme-sample{display:grid;grid-template-columns:31% 1fr;height:104px;border-bottom:1px solid var(--sb-line)}
.theme-sample-nav{display:flex;flex-direction:column;gap:7px;background:var(--sb-nav);color:var(--sb-nav-ink);padding:10px 8px;font:600 12px/1.3 system-ui}
.theme-sample-nav i{display:block;width:80%;height:4px;border-radius:2px;background:currentColor;opacity:.55}
.theme-sample-main{background:var(--sb-page);min-width:0}
.theme-sample-top{height:31px;padding:6px 8px;background:var(--sb-top);color:var(--sb-top-ink);font:600 12px/1.5 var(--sb-heading-font)}
.theme-sample-content{padding:10px 8px;font:500 15px/1.3 var(--sb-heading-font)}
.theme-sample-lines{height:4px;width:80%;margin-top:8px;background:var(--sb-muted);opacity:.45}
.theme-option-name{display:block;padding:10px 11px 3px;font:600 14px/1.35 system-ui}
.theme-option-description{display:block;padding:0 11px 12px;font:400 12px/1.45 system-ui;color:var(--sb-muted)}
#theme-status{font-size:12px;margin:12px 0 0;color:var(--muted)}
@media(max-width:480px){.theme-options{grid-template-columns:1fr}.theme-sample{height:87px}.theme-sample-content{padding-top:8px}}
@media print{html[data-colour-theme] body{background:#fff;color:#172f43}}


/* Classic uses the unchanged legacy fallbacks on the application root. */
.theme-option[data-colour-theme="classic"]{--sb-nav:#2e2768;--sb-nav-ink:#f6f4ff;--sb-nav-selected:#241e54;--sb-page:#f2f5f8;--sb-top:#ffffff;--sb-top-ink:#172f43;--sb-paper:#ffffff;--sb-ink:#172f43;--sb-muted:#52677a;--sb-line:#d7e0e8;--sb-accent:#12677a;--sb-soft:#e9f1f5;--sb-heading-font:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;}
.theme-option[data-colour-theme="classic"] .theme-sample-nav{background:linear-gradient(#2e2768,#241e54)}
