/* Full palette tokens across public components. Never change the selected template. */
html[data-theme-key]{color-scheme:dark}
html[data-theme-key][data-theme=dark]{--window:#111f32;--surface:#0b1627;--shadow:0 16px 42px #02071053;--danger:#ff8e98}
html[data-theme-key][data-theme=blue]{--window:#122a45;--surface:#0b1e34;--shadow:0 16px 42px #03101f66;--danger:#ff9ba8}
html[data-theme-key][data-theme=gold]{--window:#201b15;--surface:#16130f;--shadow:0 14px 36px #0005;--danger:#ffaba2}
html[data-theme-key][data-theme=light]{color-scheme:light;--window:#fff;--surface:#f1f6fa;--danger:#b32b3e;--shadow:0 10px 30px #182b4512}
html[data-theme-key][data-theme=green]{color-scheme:light;--window:#fff;--surface:#f4faf6;--shadow:0 10px 30px #244e3614;--danger:#a92c35}
html[data-theme-key][data-theme=red]{color-scheme:light;--window:#fffaf6;--surface:#fff5ef;--shadow:0 10px 30px #743d2418;--danger:#a52a26}
html[data-theme-key][data-theme=paper]{color-scheme:light;--window:#fff7e5;--surface:#f8efd9;--gold:#89611e;--danger:#a62e23;--shadow:0 10px 30px #56391c1a}
html[data-theme-key][data-theme=ocean]{color-scheme:light;--window:#fff;--surface:#eef7fb;--gold:#916415;--danger:#b12d43;--shadow:0 10px 30px #174a6914}
html[data-theme-key] .premium{color:var(--ink);background:radial-gradient(ellipse at 65% 0%,color-mix(in srgb,var(--accent) 7%,transparent),transparent 50%),var(--bg)}
html[data-theme-key] .premium .brandmark{background:linear-gradient(145deg,var(--accent),var(--accent2));color:var(--primaryInk);border-color:color-mix(in srgb,var(--accent) 45%,var(--line));box-shadow:0 5px 16px color-mix(in srgb,var(--accent) 20%,transparent)}
html[data-theme-key] .premium .premium-intro{background:radial-gradient(ellipse at 87% 0%,color-mix(in srgb,var(--accent) 14%,transparent),transparent 54%),linear-gradient(125deg,var(--panel),var(--panel2))}
html[data-theme-key] .premium .draw-tab.selected{box-shadow:0 4px 14px color-mix(in srgb,var(--accent) 20%,transparent)}
html[data-theme-key] .premium .ledger-row,html[data-theme-key] .premium .analytics-panel,html[data-theme-key] .premium .history-model-card,html[data-theme-key] .premium .frequency-tile{color:var(--ink)}
html[data-theme-key] .premium .history-model-card .local-card-title{background:linear-gradient(110deg,color-mix(in srgb,var(--accent) 14%,transparent),transparent),var(--panel2)}
html[data-theme-key] .premium .next-icon,html[data-theme-key] .premium .lot-tabs a.active,html[data-theme-key] .premium .linkcard .tileicon{background:color-mix(in srgb,var(--accent) 10%,var(--panel));color:var(--accent)}
html[data-theme-key] .premium .ml-idle{background:radial-gradient(ellipse at 84% 5%,color-mix(in srgb,var(--accent) 18%,var(--panel)),transparent 65%),var(--window);color:var(--ink)}
html[data-theme-key] .premium .ml-idle h4,html[data-theme-key] .premium .ml-schedule b,html[data-theme-key] .premium .ml-drawtime b{color:var(--ink)}
html[data-theme-key] .premium .ml-tag,html[data-theme-key] .premium .ml-idle-links a{color:var(--accent)}
html[data-theme-key] .premium .ml-timezone,html[data-theme-key] .premium .ml-schedule,html[data-theme-key] .premium .ml-drawtime,html[data-theme-key] .premium .ml-message{color:var(--muted)}
html[data-theme-key] .premium .ml-idle-links a{background:var(--panel2);border-color:var(--line)}
/* Template-specific layout and typography, independent of the colour switch. */
html[data-theme-key][data-template=classic] .premium .draw-window,html[data-theme-key][data-template=classic] .premium .ledger{border:1px solid var(--accent);border-radius:9px}
html[data-theme-key][data-template=classic] .premium .window-heading,html[data-theme-key][data-template=classic] .premium .ledger-title{background:var(--panel2);border-bottom:1px solid var(--line)}
html[data-theme-key][data-template=classic] .premium .draw-tab{border-radius:5px}
html[data-theme-key][data-template=classic] .premium .number-stage{padding-block:15px}
html[data-theme-key][data-template=data_dark] .premium .draw-window{border-color:color-mix(in srgb,var(--accent) 32%,var(--line))}
html[data-theme-key][data-template=data_dark] .premium .window-heading{background:linear-gradient(115deg,var(--panel2),var(--panel));border-bottom:1px solid var(--line)}
html[data-theme-key][data-template=light] .premium .draw-window,html[data-theme-key][data-template=light] .premium .card{border-radius:22px;box-shadow:var(--shadow)}
html[data-theme-key][data-template=light] .premium .draw-tab{border-radius:999px}
html[data-theme-key][data-template=gallery] .premium .gallerygrid{grid-template-columns:repeat(auto-fit,minmax(min(100%,210px),1fr));gap:12px}
html[data-theme-key][data-template=gallery] .premium .gallerycard img{aspect-ratio:3/4;object-fit:contain;background:var(--surface)}
html[data-theme-key][data-template=gallery] .premium .gallerycard{border-color:var(--line);border-radius:16px}
html[data-theme-key][data-template=overview] .premium .draw-switcher{display:grid;grid-template-columns:repeat(auto-fit,minmax(96px,1fr))}
html[data-theme-key][data-template=overview] .premium .draw-tab{white-space:normal;min-width:0;text-align:center}
html[data-theme-key][data-template=single] .premium .data-layout{grid-template-columns:minmax(0,1fr);max-width:920px;margin-inline:auto}
html[data-theme-key][data-template=single] .premium .draw-switcher{justify-content:flex-start}
html[data-theme-key][data-template=single] .premium .number-stage{padding-block:20px}
html[data-theme-key][data-template=analytics] .premium .draw-window,html[data-theme-key][data-template=analytics] .premium .analytics-panel{border-radius:10px}
html[data-theme-key][data-template=analytics] .premium .window-heading,html[data-theme-key][data-template=analytics] .premium .analytics-heading{border-bottom:1px solid var(--line)}
html[data-theme-key][data-template=analytics] .premium .draw-tab{font-variant-numeric:tabular-nums;border-radius:7px}
html[data-theme-key][data-template=directory] .premium .linkcard{border-radius:16px;min-height:100px}
html[data-theme-key][data-template=directory] .premium .directory{grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr))}
html[data-theme-key][data-template=mobile] .premium .shell{max-width:1100px}
html[data-theme-key][data-template=mobile] .premium .draw-window{border-radius:18px}
html[data-theme-key][data-template=mobile] .premium .premium-shortcuts{gap:5px}
html[data-theme-key] .premium .topactions{flex-shrink:0}
html[data-theme-key] .premium .main-data,html[data-theme-key] .premium .draw-panels,html[data-theme-key] .premium .draw-panel{min-width:0}
html[data-theme-key] .premium .topbar,html[data-theme-key] .premium .mobilebar{background:var(--panel)}
html[data-theme-key] .premium .next-clock strong{font-variant-numeric:tabular-nums}
html[data-theme-key] .premium .gallerycard img{max-width:100%}
html[data-theme-key] .premium .theme-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
@media(max-width:650px){
 html[data-theme-key] .premium .shell{padding-inline:10px}
 html[data-theme-key] .premium .v30-mobile-nav{min-width:0;scrollbar-width:none}
 html[data-theme-key] .premium .mobilebar{max-width:100%;overflow-x:auto;justify-content:flex-start;scrollbar-width:none}
 html[data-theme-key] .premium .mobilebar a{flex:1 0 54px;min-width:54px}
 html[data-theme-key] .premium .mobilebar a span{max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 html[data-theme-key] .premium .draw-actions{gap:6px}
 html[data-theme-key] .premium .draw-actions>a{min-height:36px;white-space:normal}
 html[data-theme-key][data-template=overview] .premium .draw-switcher{grid-template-columns:repeat(3,minmax(0,1fr))}
 html[data-theme-key][data-template=gallery] .premium .gallerygrid{grid-template-columns:repeat(2,minmax(0,1fr))}
 html[data-theme-key][data-template=directory] .premium .directory{grid-template-columns:repeat(2,minmax(0,1fr))}
 html[data-theme-key][data-template=mobile] .premium .premium-shortcuts{grid-template-columns:repeat(4,minmax(0,1fr))}
 html[data-theme-key][data-template=mobile] .premium .mobilebar{border-radius:16px 16px 0 0}
 html[data-theme-key][data-template=light] .premium .draw-window,html[data-theme-key][data-template=light] .premium .card{border-radius:16px}
}
@media(max-width:360px){
 html[data-theme-key] .premium .shell{padding-inline:7px}
 html[data-theme-key][data-template=mobile] .premium .premium-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))}
}
/* Secondary pages: consistent spacing, accessible controls and compact H5 cards. */
html[data-theme-key] .premium .shell{min-width:0}
html[data-theme-key] .premium .card{min-width:0}
html[data-theme-key] .premium :is(.gallerycard,.linkcard,.articlebody,.card.empty){overflow-wrap:anywhere}
html[data-theme-key] .premium :is(.filter,.analytics-filter) :is(input,select){min-width:0;max-width:100%;box-sizing:border-box}
html[data-theme-key] .premium .gallerycard img{display:block;width:100%;object-fit:contain;background:var(--surface)}
html[data-theme-key] .premium .gallerycard h3{font-size:clamp(13px,2vw,17px);line-height:1.4}
html[data-theme-key] .premium a:focus-visible,html[data-theme-key] .premium button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
html[data-theme-key] .premium .linkcard{min-width:0}
html[data-theme-key] .premium .linkcard>div{min-width:0}
html[data-theme-key] .premium .linkcard small{overflow-wrap:anywhere}
html[data-theme-key] .premium .articlebody{line-height:1.8;white-space:pre-wrap}
html[data-theme-key] .premium .mobilebar{padding-bottom:max(7px,env(safe-area-inset-bottom))}
@media(max-width:650px){
 html[data-theme-key] .premium .shell{padding-bottom:calc(80px + env(safe-area-inset-bottom))}
 html[data-theme-key] .premium .sectionhead{gap:8px;flex-wrap:wrap;align-items:center}
 html[data-theme-key] .premium .sectionhead h2{font-size:clamp(16px,4.6vw,20px)}
 html[data-theme-key] .premium .v30-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 html[data-theme-key] .premium .gallerycard img{aspect-ratio:3/4}
 html[data-theme-key] .premium .gallerycard p{font-size:12px}
 html[data-theme-key] .premium .directory{grid-template-columns:minmax(0,1fr)}
 html[data-theme-key] .premium .linkcard{padding:12px}
 html[data-theme-key] .premium .lot-tabs{max-width:100%;overflow-x:auto;scrollbar-width:none}
 html[data-theme-key] .premium .lot-tabs a{flex-shrink:0}
 html[data-theme-key] .premium .v30-ad-item img{max-width:100%;height:auto}
 html[data-theme-key] .premium .v30-gallery-dialog{max-width:calc(100vw - 12px);max-height:calc(100dvh - 16px)}
}
@media(prefers-reduced-motion:reduce){html[data-theme-key] .premium :is(.draw-tab,.linkcard,.gallerycard,.theme-toggle){transition:none}}
/* Clear full-width research groups. Different hues denote content type, not predictive confidence. */
.premium .history-model-list:is([data-research-layout="5"],[data-research-layout="6"],[data-research-layout="7"]){display:grid;grid-template-columns:minmax(0,1fr);gap:14px}
.premium .v44-wide-card{--category:var(--accent);overflow:hidden;border:1px solid color-mix(in srgb,var(--category) 45%,var(--line));border-radius:12px}
.premium [data-tone=jade]{--category:#2fb78f}.premium [data-tone=blue]{--category:#4588db}.premium [data-tone=violet]{--category:#a47bd8}.premium [data-tone=amber]{--category:#c58a3a}.premium [data-tone=mixed]{--category:#27a2bb}
.premium .v44-wide-title{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 15px;border-left:5px solid var(--category);background:linear-gradient(100deg,color-mix(in srgb,var(--category) 22%,var(--panel2)),var(--panel));border-bottom:1px solid var(--line)}
.premium .v44-wide-title small{display:block;color:var(--muted);font-size:11px}
.premium .v44-wide-title h4{margin:3px 0 0;font-size:19px;color:var(--ink);font-weight:800}
.premium .v44-wide-title a{color:var(--accent);font-size:12px;white-space:nowrap}
.premium .v44-wide-period{padding:0 10px;border-bottom:1px solid var(--line)}
.premium .v44-wide-period:last-child{border-bottom:0}
.premium .v44-wide-period h5,.premium .v44-wide-period summary{margin:0;padding:9px 4px;color:var(--ink);font-size:13px;font-weight:750;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
.premium .v44-wide-period summary{cursor:pointer;color:var(--muted)}
.premium .v44-wide-entry .local-period{border-bottom:1px solid var(--line);padding:9px 4px}
.premium .v44-wide-entry:last-child .local-period{border:0}
.premium .v44-wide-entry .local-period-head strong{border-left:3px solid var(--category);padding-left:7px;color:var(--ink)}
.premium .v44-wide-entry .local-chips>span:not(.local-hit){background:color-mix(in srgb,var(--category) 12%,var(--panel));border-color:color-mix(in srgb,var(--category) 33%,var(--line))}
.premium .v44-style-6 .v44-wide-title{background:color-mix(in srgb,var(--category) 58%,#142131);color:white}
.premium .v44-style-6 .v44-wide-title :is(h4,small,a){color:#fff;text-shadow:0 1px 2px #0008}
.premium .v44-style-6 .v44-wide-entry .local-period{padding-block:6px}
.premium .v44-style-6 .local-generated{display:none}
.premium .v44-style-6 .local-chips>span:not(.local-hit){background:none;border:0;min-width:auto;padding:2px 3px;font-size:15px}
.premium .v44-style-7 .v44-wide-period[open] summary{color:var(--ink)}
@media(max-width:650px){
 .premium .v44-wide-title{padding:10px 11px}.premium .v44-wide-title h4{font-size:17px}
 .premium .v44-wide-entry .local-period-head{margin-bottom:6px}.premium .v44-wide-period{padding:0 7px}
 .premium .v44-wide-entry .local-chips>span{min-width:25px;padding:4px 5px;font-size:13px}
 .premium .v44-style-6 .local-chips>span:not(.local-hit){min-width:auto;padding:1px 3px}
}
