/* DermanAI Experience 2.1 — accessible, persistent dark theme.
   All overrides are scoped to html[data-theme="dark"] and loaded last. */
:root { color-scheme: light; }
html[data-theme="dark"] {
  color-scheme: dark;
  --ink:#edf7ff;
  --muted:#acc1d3;
  --paper:#091321;
  --white:#101d30;
  --dark:#061323;
  --line:#273c51;
  --shadow:0 22px 65px rgba(0,6,16,.38);
}

/* The same compact control appears on all three pages. */
.theme-toggle {
  appearance:none;
  position:relative;
  display:inline-flex;align-items:center;justify-content:center;
  gap:9px;
  flex:0 0 auto;
  min-height:41px;
  padding:8px 12px;
  border:1px solid #d6e5f0;
  border-radius:999px;
  color:#38586c;
  background:linear-gradient(145deg,rgba(255,255,255,.95),rgba(231,244,250,.92));
  box-shadow:0 5px 15px rgba(21,65,106,.07);
  font-size:11px;font-weight:800;line-height:1;
  transition:background .25s, color .25s, border-color .25s, transform .2s, box-shadow .25s;
  white-space:nowrap;
}
.theme-toggle:hover { transform:translateY(-2px);border-color:#37b7d4;box-shadow:0 8px 23px rgba(11,137,170,.14); }
.theme-toggle:focus-visible { outline:3px solid #0db4d5;outline-offset:3px; }
.theme-toggle svg {width:19px;height:19px;stroke:currentColor;stroke-width:1.9;fill:none;stroke-linecap:round;stroke-linejoin:round;flex:none;}
.theme-toggle .theme-sun {display:none;}
html[data-theme="dark"] .theme-toggle .theme-moon {display:none;}
html[data-theme="dark"] .theme-toggle .theme-sun {display:block;}
html[data-theme="dark"] .theme-toggle {
  color:#ffe9a1;
  background:linear-gradient(140deg,#162e47,#101d32);
  border-color:#41617b;
  box-shadow:0 6px 18px #0005, inset 0 1px 0 #a9d9ff12;
}
html[data-theme="dark"] .theme-toggle:hover {background:#214461;border-color:#84bedb;}
@media(max-width:1190px){.theme-toggle{width:41px;height:41px;padding:0}.theme-toggle [data-theme-label]{display:none}}
@media(max-width:420px){.nav-actions{gap:9px!important}.theme-toggle{width:39px;height:39px;min-height:39px}.nav-inner{gap:7px}.logo-name{font-size:19px}}

/* Global page, navigation, typography */
html[data-theme="dark"] body {
  background:radial-gradient(ellipse 70% 30% at 88% 1%,rgba(26,90,139,.18),transparent 75%),
             radial-gradient(ellipse 65% 34% at 0% 50%,rgba(70,45,132,.12),transparent 75%),
             linear-gradient(180deg,#07131f 0%,#0a1727 50%,#07111f 100%);
  color:var(--ink);
}
html[data-theme="dark"] p {color:var(--muted);}
html[data-theme="dark"] .site-nav {background:rgba(9,22,38,.93);border-bottom-color:#233a51;box-shadow:0 9px 40px #030b1699;}
html[data-theme="dark"] .nav-links>a {color:#a6bed0;}
html[data-theme="dark"] .nav-links>a:hover,
html[data-theme="dark"] .nav-links>a.active,
html[data-theme="dark"] .nav-login {color:#f3fbff;}
html[data-theme="dark"] .logo-name small {color:#8fb2c9;}
html[data-theme="dark"] .menu-toggle {background:#172b41;border-color:#375670;}
html[data-theme="dark"] .menu-toggle span {background:#e4f3ff;}
html[data-theme="dark"] .btn-dark {background:#294760;color:#effaff;border:1px solid #45657d;}
html[data-theme="dark"] .btn-soft {background:#1c354c;color:#e7f7ff;border-color:#3c5a70;}
html[data-theme="dark"] .gradient-text {background-image:linear-gradient(95deg,#53e2f4 4%,#7cacff 58%,#baa6ff 95%);}
html[data-theme="dark"] .section-overline {color:#93b4c9;}
html[data-theme="dark"] .section-overline.light {color:#afe6f0;}
html[data-theme="dark"] .footer-bottom {border-top-color:#2e455b;color:#91aabd;}
html[data-theme="dark"] .footer-links a {color:#c3d9e7;}
html[data-theme="dark"] .footer-links a:hover {color:#78e3f6;}
html[data-theme="dark"] .trust-ticker {background:#122538;border-color:#2a4358;}
html[data-theme="dark"] .ticker-track>span {color:#a5c4d4;}

/* Hero: preserve 3D scene with cooler illumination and sharper dark controls. */
html[data-theme="dark"] .hero-wash {opacity:.36;filter:hue-rotate(22deg);}
html[data-theme="dark"] .hero .eyebrow {background:#132a40;border-color:#335a71;color:#a8e5f0;}
html[data-theme="dark"] .hero .hero-sub {color:#b0c5d7;}
html[data-theme="dark"] .social-proof small {color:#90afc4;}
html[data-theme="dark"] .social-proof .proof-line {background:#345368;}
html[data-theme="dark"] .hero-live-strip span {background:#14283d;border-color:#355069;color:#c3d9e8;}
html[data-theme="dark"] .holo-panel {border-color:#62dcf369;box-shadow:0 39px 92px #0009,0 0 55px #287cb31c,inset 0 0 0 1px #93e7ff25;}
html[data-theme="dark"] .holo-mode-switch button {background:linear-gradient(150deg,#162b44,#102237);border-color:#2c4b65;color:#dfedf8;box-shadow:0 10px 28px #0003;}
html[data-theme="dark"] .holo-mode-switch button.active {background:linear-gradient(135deg,#134768,#182b60);border-color:#30b4da;color:#fff;box-shadow:0 12px 30px #0483c338;}
html[data-theme="dark"] .holo-mode-switch small {color:#a5bfd1;}
html[data-theme="dark"] .holo-mode-switch .active small {color:#bfedff;}

/* Ecosystem strip and interactive home feature cards. */
html[data-theme="dark"] .mission-kicker {color:#98b8ce;}
html[data-theme="dark"] .mission-item {background:linear-gradient(145deg,#14283d,#101e32);border-color:#2a435b;box-shadow:0 12px 34px #01081555;}
html[data-theme="dark"] .mission-item:hover {border-color:#39c8de;box-shadow:0 15px 38px #0091c122;}
html[data-theme="dark"] .mission-item small {color:#a5bdcf;}
html[data-theme="dark"] .mission-item em {color:#79cfe8;}
html[data-theme="dark"] .feature-card {border-color:#304860;box-shadow:0 17px 44px #0004;}
html[data-theme="dark"] .feature-card:hover {border-color:#51bcd5;box-shadow:0 22px 55px #0008;}
html[data-theme="dark"] .feature-supp {background:linear-gradient(125deg,#123447,#142b47 65%,#232646);}
html[data-theme="dark"] .feature-atlas {background:linear-gradient(145deg,#282443,#1b2540 68%,#141e32);}
html[data-theme="dark"] .feature-food {background:linear-gradient(133deg,#263f36,#1c312b 65%,#233c31);}
html[data-theme="dark"] .feature-activity {background:linear-gradient(135deg,#123e46,#143047 74%);}
html[data-theme="dark"] .feature-plan {background:linear-gradient(135deg,#382b45,#26304a);color:#f5faff;border-color:#625376;}
html[data-theme="dark"] .feature-card h3 {color:#eff8ff;}
html[data-theme="dark"] .feature-card p,
html[data-theme="dark"] .feature-plan p {color:#b6cada;}
html[data-theme="dark"] .feature-num,
html[data-theme="dark"] .feature-plan .feature-num {color:#9fbcd0;}
html[data-theme="dark"] .feature-arrow {color:#d7f4ff;border-color:#58748c;}
html[data-theme="dark"] .feature-link {color:#7ce4f8;}
html[data-theme="dark"] .feature-atlas .atlas-caption {color:#c4b7fb;}
html[data-theme="dark"] .chart-grid {opacity:.23;}

/* Search on home: use a softly illuminated input even on dark surfaces. */
html[data-theme="dark"] .quick-search {background:#16283d;border-color:#55708a;}
html[data-theme="dark"] .field-caption {color:#acc3d2;}
html[data-theme="dark"] .search-field {border-color:#3d586c;}
html[data-theme="dark"] .field-body input,
html[data-theme="dark"] .field-body select {color:#edf7ff;background:transparent;}
html[data-theme="dark"] .field-body input::placeholder {color:#91a9bd;}
html[data-theme="dark"] .popular-terms button {background:#22394e;color:#cee5f0;}
html[data-theme="dark"] .popular-terms button:hover {background:#2b5365;color:#fff;}

/* Nutrient atlas (the graphic card retains its own luminous dark colors). */
html[data-theme="dark"] .atlas-section {background:radial-gradient(circle at 82% 32%,#241f49,#102b38 58%,#0d1d34);border-color:#304058;}
html[data-theme="dark"] .atlas-interactive-note {color:#a7cadd;}
html[data-theme="dark"] .nutrient-selector button {background:#1c3148;border-color:#38576b;color:#cde3f0;}
html[data-theme="dark"] .nutrient-selector button.selected,
html[data-theme="dark"] .nutrient-selector button:hover {background:#15617c;border-color:#45d4e4;color:#fff;}
html[data-theme="dark"] .nutrient-display {box-shadow:0 30px 75px #0008;border:1px solid #36728a;}

/* Chat area: input, bubbles, chips and conversation panels. */
html[data-theme="dark"] .chat-window {background:#14263b;border:1px solid #305168;color:#ebf8ff;box-shadow:0 35px 75px #0008;}
html[data-theme="dark"] .chat-header {border-bottom-color:#2d475e;}
html[data-theme="dark"] .chat-header small {color:#a6c0cf;}
html[data-theme="dark"] .chat-options {color:#9fb8ca;}
html[data-theme="dark"] .chat-bubble.ai {background:#1b3b50;color:#dcf2ff;}
html[data-theme="dark"] .chat-bubble.user {background:#23567b;color:#fff;}
html[data-theme="dark"] .chat-bubble a {color:#7ee3f8;}
html[data-theme="dark"] .chat-chips button {background:#1b3349;border-color:#376079;color:#d4e9f6;}
html[data-theme="dark"] .chat-chips button:hover {background:#254966;}
html[data-theme="dark"] .chat-form {background:#0e2135;border-color:#39536a;}
html[data-theme="dark"] .chat-form input {background:transparent;color:#effbff;}
html[data-theme="dark"] .chat-form input::placeholder {color:#8caabc;}
html[data-theme="dark"] .chat-caption {color:#9eb5c6;}

/* Supplement page: all form and catalog surfaces. */
html[data-theme="dark"] .inner-chips span {background:#173248;color:#b5ddec;border:1px solid #355d75;}
html[data-theme="dark"] .workspace-primary,
html[data-theme="dark"] .results-content,
html[data-theme="dark"] .catalog-card {background:#12263a;border-color:#2f4860;color:#edf7ff;box-shadow:var(--shadow);}
html[data-theme="dark"] .form-label {color:#a9c7d9;}
html[data-theme="dark"] .mega-input {background:#0e1f31;border-color:#36546c;}
html[data-theme="dark"] .mega-input:focus-within {border-color:#28c8e7;box-shadow:0 0 0 3px #10a4cd22;}
html[data-theme="dark"] .mega-input input {color:#edf7ff;}
html[data-theme="dark"] .mega-input input::placeholder {color:#91a8b9;}
html[data-theme="dark"] .search-suggestions>span,
html[data-theme="dark"] .form-bottom>span {color:#a6bacb;}
html[data-theme="dark"] .search-suggestions button {background:#193349;color:#add9ec;border-color:#385d73;}
html[data-theme="dark"] .search-suggestions button:hover {background:#23516a;color:#ecffff;}
html[data-theme="dark"] .country-picker button,
html[data-theme="dark"] .filter-tabs button {background:#1a3146;border-color:#35546a;color:#bad2e3;}
html[data-theme="dark"] .country-picker button.selected,
html[data-theme="dark"] .country-picker button:hover,
html[data-theme="dark"] .filter-tabs button.selected,
html[data-theme="dark"] .filter-tabs button:hover {background:#17627a;border-color:#4cd6e6;color:#fff;}
html[data-theme="dark"] .tiny-counter {background:#173e4f;color:#8decfa;}
html[data-theme="dark"] .store-option {background:#1a3045;border-color:#355268;color:#e5f6ff;}
html[data-theme="dark"] .store-option:hover,
html[data-theme="dark"] .store-option:has(input:checked) {background:#203e53;border-color:#4bc3da;}
html[data-theme="dark"] .store-option small {color:#b0c4d6;}
html[data-theme="dark"] .store-picker-tools {color:#b4c9d9;}
html[data-theme="dark"] .store-picker-tools button {background:#1a364e;border-color:#3b5e76;color:#ccebf5;}
html[data-theme="dark"] .store-picker-tools button:hover {background:#24516b;}
html[data-theme="dark"] .compare-select {background:linear-gradient(110deg,#19384a,#252948);border-color:#36566c;}
html[data-theme="dark"] .compare-select strong {color:#e2f4ff;}
html[data-theme="dark"] .compare-select span {color:#b4c8da;}
html[data-theme="dark"] .compare-select select {background:#0f263b;border-color:#40627c;color:#e7f7ff;}
html[data-theme="dark"] .compare-store-wrap {background:#10293d;border-color:#39566d;}
html[data-theme="dark"] .results-empty {background:#132b42;border-color:#3c647a;}
html[data-theme="dark"] .result-store {background:#182e43;border-color:#304e63;}
html[data-theme="dark"] .result-store:hover {border-color:#4ad3e8;}
html[data-theme="dark"] .result-store strong {color:#f1fcff;}
html[data-theme="dark"] .result-store small {color:#abc7d8;}
html[data-theme="dark"] .result-store .store-initial {background:#16445a;color:#8ae7fb;}
html[data-theme="dark"] .result-disclaimer {border-top-color:#385367;color:#b3c6d5;}
html[data-theme="dark"] .catalog-toolbar input,
html[data-theme="dark"] .recipe-toolbar input {background:#142b41;border-color:#3e5f73;color:#f1f9ff;}
html[data-theme="dark"] .catalog-toolbar input::placeholder,
html[data-theme="dark"] .recipe-toolbar input::placeholder {color:#9bb3c5;}
html[data-theme="dark"] .catalog-card .catalog-icon {background:linear-gradient(135deg,#20506b,#313d72);color:#a2f1ff;}
html[data-theme="dark"] .catalog-card .catalog-type {color:#a4bccc;}
html[data-theme="dark"] .catalog-card button,
html[data-theme="dark"] .text-button {color:#7ce2f5;}
html[data-theme="dark"] .faq-list details {border-bottom-color:#35536a;}
html[data-theme="dark"] .faq-list summary {color:#dceefb;}

/* NutriCook recipe tiles, filters, recipe pop-up and nutrition table. */
html[data-theme="dark"] .cook-hero-art {background:radial-gradient(circle at 30% 15%,#235e67,#1b4956 40%,#182d55 75%,#1a284b);border-color:#3e6d83;box-shadow:0 25px 65px #0006;}
html[data-theme="dark"] .cook-float {background:#162b40;color:#d5edf8;border:1px solid #416580;}
html[data-theme="dark"] .cook-surprise small,
html[data-theme="dark"] .cook-metrics small {color:#afc7d5;}
html[data-theme="dark"] .cook-metrics>div {border-left-color:#41566b;}
html[data-theme="dark"] .recipe-card {background:#14273b;border-color:#2d455d;box-shadow:0 12px 32px #0003;}
html[data-theme="dark"] .recipe-card:hover {border-color:#4ac2d6;box-shadow:0 20px 45px #0007;}
html[data-theme="dark"] .recipe-content h3 {color:#f0faff;}
html[data-theme="dark"] .recipe-content .recipe-country {color:#65dbea;}
html[data-theme="dark"] .recipe-meta {border-top-color:#354e61;color:#aac2d2;}
html[data-theme="dark"] .recipe-meta strong {color:#deeffa;}
html[data-theme="dark"] .recipe-content>button {background:#1c4358;color:#a1eeff;}
html[data-theme="dark"] .recipe-content>button:hover {background:#26546a;}
html[data-theme="dark"] .recipe-favorite {background:#25374d;color:#f2c1d8;border-color:#617086;}
html[data-theme="dark"] .recipe-favorite[aria-pressed="true"] {background:#b82368;color:white;border-color:#ed78a6;}
html[data-theme="dark"] .filter-tabs button[data-cuisine="favorites"] {background:#35283e;border-color:#754968;color:#ffc0df;}
html[data-theme="dark"] .filter-tabs button[data-cuisine="favorites"].selected {background:#b72b72;border-color:#f16eac;color:#fff;}
html[data-theme="dark"] .recipe-modal {background:#102438;color:#edf7ff;border:1px solid #375b70;}
html[data-theme="dark"] .modal-close {background:#1e4057;color:#e7f7ff;border:1px solid #507a95;}
html[data-theme="dark"] .modal-image {background:#152f3e;}
html[data-theme="dark"] .modal-metadata {color:#aac4d2;}
html[data-theme="dark"] .portion-control button {background:#1a4256;color:#b1edfc;border:1px solid #42718a;}
html[data-theme="dark"] .macro-box {background:#1b3a4e;border:1px solid #365f74;}
html[data-theme="dark"] .macro-box strong {color:#9ceeff;}
html[data-theme="dark"] .macro-box small {color:#b2c7d3;}
html[data-theme="dark"] .ingredient-list li {color:#afc6d6;border-bottom-color:#375267;}
html[data-theme="dark"] .ingredient-list li strong {color:#dff5ff;}
html[data-theme="dark"] .step-list {color:#c3d7e6;}
html[data-theme="dark"] .modal-detail h2,
html[data-theme="dark"] .modal-detail h3 {color:#eaf9ff;}

@media(max-width:990px){
  html[data-theme="dark"] .nav-links {background:rgba(12,28,45,.97);box-shadow:0 22px 33px #0009;border-bottom:1px solid #29465c;}
}
@media(prefers-reduced-motion:reduce){
  .theme-toggle {transition:none!important;}
}
