/* Complete app palettes. Product photography and semantic warnings retain their identity. */
:root,[data-theme=blue]{color-scheme:dark;--bg:#040810;--surface:#0b1322;--surface2:#101d2e;--stroke:#294459;--stroke2:#3c708c;--primary:#24d3ff;--primary2:#6f9dff;--pale:#cef7ff;--text:#f0faff;--muted:#a6bbcf;--muted2:#8aa1b7;--glow:#123b54;--accent-surface:#10374b;--on-accent:#04101e;--grad:linear-gradient(105deg,#21e1ff,#527cff);--reader:#f5faff;--reader-panel:#e7f1f8;--reader-text:#162e41;--reader-muted:#405d73;--reader-accent:#09618a;--reader-border:#acc8dc;--danger:#ffa3a3;--warn-bg:#221e17;--warn-text:#e5cfa2;--warn-border:#80673f}
[data-theme=violet]{--bg:#0d0713;--surface:#190f24;--surface2:#281937;--stroke:#49315c;--stroke2:#8857a0;--primary:#f2a4ff;--primary2:#b89bff;--pale:#fce6ff;--text:#fcf3ff;--muted:#c8b2d5;--muted2:#b59cc5;--glow:#4a205e;--accent-surface:#3b2250;--on-accent:#210d30;--grad:linear-gradient(105deg,#f59ce9,#b098ff);--reader:#fcf7ff;--reader-panel:#f0e6f8;--reader-text:#301d41;--reader-muted:#634477;--reader-accent:#71329c;--reader-border:#d4b8e5}
[data-theme=gold]{--bg:#0d0a05;--surface:#1b160d;--surface2:#2a2214;--stroke:#57462a;--stroke2:#9c7b44;--primary:#f2c980;--primary2:#dd9f56;--pale:#ffedd0;--text:#fff7e9;--muted:#cbbda5;--muted2:#b7a588;--glow:#4b3515;--accent-surface:#3c2c15;--on-accent:#211608;--grad:linear-gradient(105deg,#ffe2a3,#d6a059);--reader:#fffbf2;--reader-panel:#f5ecda;--reader-text:#392b13;--reader-muted:#6e5a35;--reader-accent:#795108;--reader-border:#dcc9a3}
[data-theme=white]{color-scheme:light;--bg:#f3f3f3;--surface:#fff;--surface2:#eaeaea;--stroke:#c9c9c9;--stroke2:#777;--primary:#171717;--primary2:#494949;--pale:#292929;--text:#151515;--muted:#505050;--muted2:#626262;--glow:#dedede;--accent-surface:#e2e2e2;--on-accent:#fff;--grad:linear-gradient(105deg,#171717,#444);--reader:#fff;--reader-panel:#eee;--reader-text:#171717;--reader-muted:#505050;--reader-accent:#171717;--reader-border:#c9c9c9;--danger:#b12038;--warn-bg:#fff3d7;--warn-text:#654407;--warn-border:#b68b37}
[data-theme=pink]{color-scheme:light;--bg:#fff4f9;--surface:#fff;--surface2:#ffe3ef;--stroke:#e9b2ca;--stroke2:#bb5c88;--primary:#b90058;--primary2:#d21672;--pale:#7d1649;--text:#351025;--muted:#744258;--muted2:#87536b;--glow:#ffc2de;--accent-surface:#ffd9ea;--on-accent:#fff;--grad:linear-gradient(105deg,#b90058,#cc166b);--reader:#fff8fc;--reader-panel:#ffe9f3;--reader-text:#351025;--reader-muted:#744258;--reader-accent:#ad0053;--reader-border:#e9b2ca;--danger:#ae153b;--warn-bg:#fff3d7;--warn-text:#654407;--warn-border:#b68b37}
html,body{background:var(--bg);color:var(--text)}
/* Category labels keep their natural width instead of shrinking into each other. */
#categoryFilters{gap:10px;max-width:100%;padding:4px 3px 12px;scroll-padding-inline:3px;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scrollbar-color:var(--stroke2) transparent}
#categoryFilters>.pill{flex:0 0 auto;width:max-content;min-height:44px;padding:10px 16px;font-size:12px;line-height:1.4;white-space:nowrap;scroll-margin-inline:3px}
#categoryFilters::-webkit-scrollbar{display:block;height:3px}
#categoryFilters::-webkit-scrollbar-thumb{background:var(--stroke2);border-radius:3px}
body:before{background:radial-gradient(ellipse,var(--glow),transparent 65%)}
.header,.bottomnav{background:var(--bg);border-color:var(--stroke)}
.mark,.install-mark{background:linear-gradient(145deg,var(--accent-surface),var(--surface));border-color:var(--stroke2);color:var(--primary);box-shadow:0 0 20px color-mix(in srgb,var(--primary) 15%,transparent)}
.livebadge,.tool-icon{background:var(--accent-surface);border-color:var(--stroke2);color:var(--pale)}
.hero,.detail-banner,.product-stage{background:radial-gradient(ellipse at 80% 25%,var(--glow),var(--surface2) 45%,var(--bg));border-color:var(--stroke2)}
.hero:after,.product-glow{background:linear-gradient(120deg,color-mix(in srgb,var(--primary) 5%,transparent),transparent 60%)}
.hero-lines,.detail-banner:before{border-color:var(--stroke2);box-shadow:0 0 0 55px color-mix(in srgb,var(--primary) 4%,transparent)}
.hero-orb,.spotlight:before{background:radial-gradient(circle,color-mix(in srgb,var(--primary) 20%,transparent),transparent 67%)}
.hero .hero-copy h1,.hero .hero-copy p{text-shadow:none}
.hero-photo{mask-image:linear-gradient(to right,transparent 1%,#000 35%)}
.meta-strip,.spotlight,.category,.tool-tile,.lib-card,.note-card,.calc-panel,.guide-card,.install-panel{background:linear-gradient(135deg,var(--surface2),var(--surface));border-color:var(--stroke);color:var(--text)}
.searchbar,.input-wrap,.empty,.outlinebutton,.theme-choice,.tracker-switch,.calendar-head button,.cal-cell,.cal-out,.scheduled-entry,.schedule-line,.journal-form,.language-picker,.vial-variant-picker{background:var(--surface);border-color:var(--stroke);color:var(--text)}
.pill,.entry-actions button,.week-picks label,.reading-controls button,.install-secondary,.tiny.active{background:var(--accent-surface);border-color:var(--stroke2);color:var(--pale)}
.btn-primary,.fullbutton:not(.outlinebutton),.pill.active,.tracker-switch button.active,.new-plan,.install-primary,.language-picker button.active{background:var(--grad);color:var(--on-accent);border-color:transparent;box-shadow:none}
.tracker-action{background:var(--accent-surface);color:var(--primary);border-color:var(--stroke2)}
.theme-choice.active{border-color:var(--primary);background:var(--accent-surface)}
.theme-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(100px,1fr));gap:10px}
.theme-choice{min-height:82px;min-width:0}
.hero p,.hero small,.spotlight .foot,.detail-label,.detail-section p,.note-card p,.field,.input-wrap span,.calc-result h2 small,.result-row,.guide-card p,.nav-button,.tracker-switch button,.cal-week span,.cal-legend,.calendar-day small,.scheduled-entry small,.schedule-line small,.journal-form label,.product-description p,.reading-controls,.how-grid small,.guide-result small,.install-head p,.install-steps p,.install-storage,.language-picker button{color:var(--muted)}
.category:after,.product-description>span,.toc-dot,.protocol-kicker,.highlight-grid span,.how-grid b,.guide-result strong,.vial-variant-picker strong,.install-head>span,.nav-button.active{color:var(--primary)}
.searchbar input,.input-wrap input,.result-row b,.empty b{color:var(--text)}
input::placeholder,textarea::placeholder,.searchbar input::placeholder,.input-wrap input::placeholder{color:var(--muted2)}
.lib-card .kind,.product-refcode{color:var(--pale);border-color:var(--stroke2)}
.lib-card footer,.install-steps,.result-row{border-color:var(--stroke)}
.calc-result{background:radial-gradient(ellipse at 95% 0,var(--glow),var(--surface) 70%);border-color:var(--stroke2)}
.nav-button.active .nav-icon{filter:drop-shadow(0 0 6px color-mix(in srgb,var(--primary) 45%,transparent))}
.floatingtoast{color:var(--text);background:var(--surface2);border-color:var(--stroke2);white-space:normal;text-align:center}
.cal-cell.today{border-color:var(--primary)}
.cal-cell.chosen{background:var(--grad);border-color:var(--primary);color:var(--on-accent)}
.cal-cell.chosen .cal-dots i{background:var(--on-accent)}
.journal-form input:not([type=checkbox]),.journal-form select,.journal-form textarea,.protocol-calc input{background:var(--bg);color:var(--text);border-color:var(--stroke2)}
.danger-text,.calc-error{color:var(--danger)}
.notice{background:var(--warn-bg);color:var(--warn-text);border-color:var(--warn-border)}
.notice p{color:var(--warn-text)}
/* Reader uses the same selected palette; optional light reading stays tinted to it. */
.protocol-toc,.protocol-panel,.report-panel{background:var(--surface);color:var(--text);border-color:var(--stroke)}
.toc-icon{background:var(--accent-surface);color:var(--primary)}
.toc-arrow{color:var(--muted)}
.toc-rail,.toc-rail a,.warning-list p,.how-grid>div,.protocol-table-wrap,.protocol-table td,.guide-result>div{border-color:var(--stroke)}
.toc-rail a:active{color:var(--primary)}
.highlight-grid>div,.protocol-callout,.reading-note,.report-status{background:var(--accent-surface);border-color:var(--stroke2);color:var(--text)}
.protocol-callout,.reading-note{border-left-color:var(--primary)}
.protocol-table th,.report-panel .protocol-table th{background:var(--surface2);color:var(--pale)}
.protocol-table td,.report-panel .protocol-table td{background:var(--surface);color:var(--text)}
.protocol-table tr:nth-child(even) td,.report-panel .protocol-table tr:nth-child(even) td{background:var(--surface2);color:var(--text)}
.report-panel .data-notice,.report-panel .data-note{color:var(--muted)}
.report-panel .protocol-table{color:var(--text)}
.guide-result{background:var(--surface2);color:var(--text)}
.protocol-calc input:focus{outline-color:var(--primary)}
.protocol-light{--surface:var(--reader);--surface2:var(--reader-panel);--text:var(--reader-text);--muted:var(--reader-muted);--pale:var(--reader-text);--primary:var(--reader-accent);--stroke:var(--reader-border);--stroke2:var(--reader-border);--accent-surface:var(--reader-panel)}
.protocol-light .protocol-panel,.protocol-light .protocol-toc,.protocol-light .report-panel{background:var(--surface);color:var(--text);border-color:var(--stroke)}
.protocol-light .highlight-grid>div,.protocol-light .protocol-callout,.protocol-light .reading-note,.protocol-light .report-status{background:var(--surface2);color:var(--text);border-color:var(--stroke)}
.protocol-light .toc-dot,.protocol-light .highlight-grid span{color:var(--primary)}
.protocol-light .toc-rail,.protocol-light .protocol-table-wrap,.protocol-light .protocol-table td,.protocol-light .warning-list p,.protocol-light .how-grid>div{border-color:var(--stroke)}
.protocol-light .protocol-table th,.protocol-light .report-panel .protocol-table th{background:var(--surface2);color:var(--text)}
.protocol-light .protocol-table td,.protocol-light .report-panel .protocol-table td{background:var(--surface);color:var(--text)}
.protocol-light .protocol-table tr:nth-child(even) td,.protocol-light .report-panel .protocol-table tr:nth-child(even) td{background:var(--surface2);color:var(--text)}
.protocol-light .how-grid small,.protocol-light .report-panel .data-notice,.protocol-light .report-panel .data-note{color:var(--muted)}
.protocol-light .protocol-calc input{background:var(--surface2);color:var(--text);border-color:var(--stroke)}
.variant-options .pill.active{box-shadow:none}
html[data-theme=white] .hero-photo,html[data-theme=pink] .hero-photo{opacity:.22}
@media(prefers-reduced-motion:no-preference){body,.header,.bottomnav{transition:background-color .18s ease,color .18s ease}}
.done-label,.day-dot.is-done{color:var(--primary)}
.cal-dots .logged,.cal-legend .logged{background:var(--primary2)}
.cal-cell.chosen .cal-dots .logged{background:var(--on-accent)}
/* Benefit notes use the active VEYRA finish and the existing reading layout. */
.benefit-panel{border-top:2px solid var(--primary)}
.benefit-evidence{display:inline-block;padding:8px 12px;border:1px solid var(--primary);border-radius:8px;font-size:12px;line-height:1.5}
.benefit-components{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:20px 0}
.benefit-component{padding:18px;border:1px solid var(--primary);border-radius:14px;min-width:0}
.benefit-component h3{margin-top:0}.benefit-component small{opacity:.8}.benefit-sources{font-size:13px;line-height:1.8;overflow-wrap:anywhere}.benefit-sources a{text-decoration:underline;text-underline-offset:3px}
@media(max-width:640px){.benefit-components{grid-template-columns:1fr}}
