/* ============================================================
   TOG Guide — design tokens & screen styles
   Ported from Claude Design handoff (sleep-tog project).
   Theme scoped via [data-theme]; warmth via [data-warmth].
   ============================================================ */

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: oklch(0.168 0.008 75);
  min-height: 100dvh;
}

/* ============================================================
   Root token block — .tog is the screen root
   ============================================================ */
.tog {
  /* ---- font ---- */
  --font: "Nunito Sans", -apple-system, system-ui, sans-serif;

  /* ---- spacing (4pt scale) ---- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px;

  /* ---- radii ---- */
  --r-sm:   12px;
  --r-md:   18px;
  --r-lg:   26px;
  --r-pill: 999px;

  /* ---- warmth hue/chroma (overridden per band) ---- */
  --h: 200; --c: 0.055;

  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- warmth bands ---- */
.tog[data-warmth="cold"]     { --h: 256; --c: 0.060; }
.tog[data-warmth="cool"]     { --h: 232; --c: 0.058; }
.tog[data-warmth="mild"]     { --h: 200; --c: 0.052; }
.tog[data-warmth="moderate"] { --h: 158; --c: 0.058; }
.tog[data-warmth="warm"]     { --h: 78;  --c: 0.080; }
.tog[data-warmth="hot"]      { --h: 32;  --c: 0.115; }

/* ---- DARK theme (default) ---- */
.tog[data-theme="dark"] {
  --bg:         oklch(0.168 0.008 75);
  --bg-glow:    oklch(0.80 var(--c) var(--h) / 0.10);
  --surface:    oklch(0.222 0.009 75);
  --surface-2:  oklch(0.278 0.010 75);
  --text:       oklch(0.965 0.006 80);
  --muted:      oklch(0.735 0.010 80);
  --faint:      oklch(0.625 0.010 80);
  --hairline:   oklch(1 0 0 / 0.09);
  --accent:     oklch(0.825 var(--c) var(--h));
  --accent-ink: oklch(0.885 var(--c) var(--h));
  --chip:       oklch(0.825 var(--c) var(--h) / 0.16);
  --card:       color-mix(in oklab, oklch(0.222 0.009 75), oklch(0.80 var(--c) var(--h)) 18%);
  --card-edge:  oklch(0.82 var(--c) var(--h) / 0.24);
  --btn:        oklch(0.278 0.010 75);
  --btn-edge:   oklch(1 0 0 / 0.08);
  --track:      oklch(1 0 0 / 0.12);
  --shadow:     0 10px 34px rgba(0,0,0,0.42);
  --shadow-sm:  0 2px 10px rgba(0,0,0,0.30);
}

/* ---- LIGHT theme ---- */
.tog[data-theme="light"] {
  --bg:         oklch(0.967 0.007 85);
  --bg-glow:    oklch(0.70 var(--c) var(--h) / 0.10);
  --surface:    oklch(0.998 0.003 85);
  --surface-2:  oklch(0.935 0.008 85);
  --text:       oklch(0.305 0.012 75);
  --muted:      oklch(0.475 0.012 75);
  --faint:      oklch(0.520 0.012 75);
  --hairline:   oklch(0 0 0 / 0.08);
  --accent:     oklch(0.560 var(--c) var(--h));
  --accent-ink: oklch(0.470 calc(var(--c) * 1.1) var(--h));
  --chip:       oklch(0.620 var(--c) var(--h) / 0.16);
  --card:       color-mix(in oklab, oklch(0.998 0.003 85), oklch(0.62 var(--c) var(--h)) 15%);
  --card-edge:  oklch(0.55 var(--c) var(--h) / 0.20);
  --btn:        oklch(0.955 calc(var(--c) * 0.6) var(--h));
  --btn-edge:   oklch(0 0 0 / 0.06);
  --track:      oklch(0 0 0 / 0.10);
  --shadow:     0 8px 26px rgba(40,35,30,0.10);
  --shadow-sm:  0 2px 10px rgba(40,35,30,0.07);
}

/* ============================================================
   Screen shell
   ============================================================ */
.tog {
  position: relative;
  min-height: 100dvh;
  box-sizing: border-box;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background 0.4s ease;
}

.tog__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  padding: max(74px, calc(env(safe-area-inset-top) + 20px)) var(--s6)
           max(40px, env(safe-area-inset-bottom));
  padding-left:  max(var(--s6), env(safe-area-inset-left));
  padding-right: max(var(--s6), env(safe-area-inset-right));
  gap: var(--s5);
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

/* warmth glow behind the hero */
.tog__glow {
  position: fixed;
  top: -8%;
  left: 50%;
  width: 130%;
  max-width: 640px;
  height: 360px;
  transform: translateX(-50%);
  background: radial-gradient(60% 70% at 50% 0%, var(--bg-glow), transparent 72%);
  pointer-events: none;
  transition: background 0.5s ease;
  z-index: 0;
}
.tog__scroll > * { position: relative; z-index: 1; }

/* ============================================================
   Header
   ============================================================ */
.tog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--s1);
}
.tog__brand { display: flex; align-items: center; gap: var(--s3); }
.tog__mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--chip);
  color: var(--accent-ink);
  flex-shrink: 0;
  transition: background 0.4s ease, color 0.4s ease;
}
.tog__wordmark {
  font-size: 17px; font-weight: 800; letter-spacing: 0.2px;
  color: var(--text); white-space: nowrap;
}
.tog__wordmark small {
  display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.4px;
  color: var(--faint); margin-top: 1px;
}

/* ============================================================
   Hero — temperature control
   ============================================================ */
.tog__hero {
  display: flex; flex-direction: column;
  align-items: center; gap: var(--s4);
  padding-top: var(--s2);
}
.tog__herolabel {
  font-size: 12px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--faint);
}
.tog__stepper {
  display: grid;
  grid-template-columns: 66px 1fr 66px;
  align-items: center;
  width: 100%;
}

/* Stepper buttons — 66px touch targets */
.tog__step {
  width: 66px; height: 66px;
  border-radius: var(--r-pill);
  border: 1px solid var(--btn-edge);
  background: var(--btn);
  color: var(--text);
  display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, background 0.2s, opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}
.tog__step svg { width: 24px; height: 24px; }
.tog__step:active { transform: scale(0.9); background: var(--surface-2); }
.tog__step:disabled { opacity: 0.4; cursor: default; }
.tog__step:disabled:active { transform: none; }

/* Temperature readout */
.tog__readout {
  display: flex; align-items: flex-start; justify-content: center;
}
.tog__value {
  font-size: 104px; line-height: 0.9; font-weight: 300;
  letter-spacing: -3px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.tog__unit {
  font-size: 30px; font-weight: 500;
  color: var(--muted);
  margin-top: 12px; margin-left: 2px;
}

/* Slider */
.tog__sliderrow { width: 100%; }
.tog__slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 26px;
  background: transparent; cursor: pointer;
  margin-top: var(--s1);
}
.tog__slider::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px; background: var(--track);
}
.tog__slider::-moz-range-track {
  height: 4px; border-radius: 2px; background: var(--track);
}
.tog__slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  margin-top: -9px;
  box-shadow: var(--shadow-sm);
  transition: background 0.25s;
}
.tog__slider::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: var(--shadow-sm);
}
.tog__scalehint {
  display: flex; justify-content: space-between;
  font-size: 11px; font-weight: 600;
  color: var(--faint);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Recommendation card
   ============================================================ */
.tog__card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--r-lg);
  padding: var(--s6);
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: var(--s4);
  transition: background 0.5s ease, border-color 0.5s ease;
}
.tog__cardtop {
  display: flex; align-items: center;
  justify-content: space-between; gap: var(--s3);
}
.tog__caption {
  font-size: 12px; font-weight: 700; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--faint);
}
.tog__rating {
  font-size: 13px; font-weight: 800; letter-spacing: 0.2px;
  color: var(--accent-ink);
  background: var(--chip);
  padding: 6px 12px; border-radius: var(--r-pill);
  transition: background 0.4s ease, color 0.4s ease;
  white-space: nowrap;
}
.tog__tog {
  font-size: 40px; font-weight: 800; letter-spacing: -1px;
  line-height: 1; color: var(--text);
  display: flex; align-items: baseline; gap: 8px;
}
.tog__tog span {
  font-size: 18px; font-weight: 700;
  color: var(--accent-ink); letter-spacing: 0.5px;
  transition: color 0.4s ease;
}
.tog__wear {
  font-size: 16.5px; line-height: 1.45;
  font-weight: 600; color: var(--text);
  text-wrap: pretty;
}
.tog__cardfoot {
  display: flex; align-items: center; gap: var(--s2);
  padding-top: var(--s3);
  border-top: 1px solid var(--hairline);
}
.tog__band {
  font-size: 13px; font-weight: 700; color: var(--muted);
  background: var(--surface); border: 1px solid var(--btn-edge);
  padding: 6px 11px; border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}

/* Warning variant */
.tog__card--warn { gap: var(--s3); }

/* Warning banner — sits where the caption row would be */
.tog__warnbanner {
  display: flex; align-items: center; gap: var(--s3);
  font-size: 15px; font-weight: 800; color: var(--accent-ink);
}
.tog__warnicon {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--chip); display: grid; place-items: center;
  flex-shrink: 0;
}

/* Bag-removal layer — visually distinct */
.tog__layer--remove .tog__layerlabel {
  font-size: 14px;
  color: var(--accent-ink);
  line-height: 1.4;
}
.tog__layericon--warn {
  background: var(--chip);
  color: var(--accent-ink);
}

/* Source rationale footnote in each card */
.tog__rationale {
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--faint);
  font-weight: 600;
  padding-top: var(--s3);
  border-top: 1px solid var(--hairline);
}

/* Note line */
.tog__note {
  display: flex; align-items: center; gap: var(--s2);
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  padding: 0 var(--s1);
}
.tog__notedot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  transition: background 0.4s ease;
}

/* ============================================================
   Safety (collapsible)
   ============================================================ */
.tog__safety {
  background: var(--surface);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-md);
  overflow: hidden;
}
.tog__safetyhdr {
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; padding: 15px var(--s4);
  background: none; border: none; cursor: pointer;
  font-family: var(--font); color: var(--text); text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.tog__shield { color: var(--muted); display: grid; place-items: center; }
.tog__safetytitle { flex: 1; font-size: 15px; font-weight: 800; }
.tog__chev {
  color: var(--faint);
  transition: transform 0.25s ease;
  display: grid; place-items: center;
}
.tog__safety[data-open="true"] .tog__chev { transform: rotate(180deg); }
.tog__safetybody {
  max-height: 0; overflow: hidden;
  transition: max-height 0.32s ease;
}
.tog__safety[data-open="true"] .tog__safetybody { max-height: 360px; }
.tog__safetylist {
  list-style: none;
  padding: 0 var(--s4) var(--s4);
  display: flex; flex-direction: column; gap: var(--s3);
}
.tog__safetylist li {
  display: flex; gap: var(--s3); align-items: flex-start;
  font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--muted);
}
.tog__tick {
  width: 18px; height: 18px; border-radius: 50%;
  flex-shrink: 0; margin-top: 1px;
  background: var(--chip); color: var(--accent-ink);
  display: grid; place-items: center;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Reference footnote */
.tog__ref {
  text-align: center; font-size: 12px; font-weight: 600;
  color: var(--faint); letter-spacing: 0.1px;
  padding-top: var(--s3); margin-top: auto;
}

/* ============================================================
   Overnight drop predictor
   ============================================================ */
.tog__dip {
  background: var(--surface);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-md);
  overflow: hidden;
}
.tog__dipheader {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 11px var(--s4);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
  background: var(--surface-2);
}
.tog__dipheader strong { color: var(--text); }
.tog__dipbody {
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.tog__diprow {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}
.tog__dipbagicn {
  display: inline-flex;
  color: var(--accent-ink);
  transition: color 0.4s ease;
}
.tog__dipbagicn svg { width: 16px; height: 22px; }
.tog__diptog {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
}
.tog__dipband {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--btn-edge);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.tog__dip .tog__layer {
  /* Slightly smaller layers in the dip card */
}
.tog__dip .tog__layericon {
  width: 30px; height: 30px;
}
.tog__dip .tog__layerlabel {
  font-size: 14px;
}
.tog__diptip {
  font-size: 12px;
  font-weight: 600;
  color: var(--faint);
  line-height: 1.5;
  padding-top: var(--s2);
  border-top: 1px solid var(--hairline);
}
.tog__diptip strong { color: var(--muted); }

/* ============================================================
   Footer — disclaimer & sources
   ============================================================ */
.tog__footer {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  padding-top: var(--s2);
  border-top: 1px solid var(--hairline);
}
.tog__disclaimer {
  font-size: 12px;
  line-height: 1.55;
  color: var(--faint);
  font-weight: 600;
}
.tog__disclaimer strong {
  color: var(--muted);
  font-weight: 700;
}
.tog__sourcestitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: var(--s2);
}
.tog__sourceslist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.tog__sourceslist li {
  font-size: 12px;
  font-weight: 600;
}
.tog__sourceslist a {
  color: var(--accent);
  text-decoration: none;
  opacity: 0.8;
}
.tog__sourceslist a:hover { opacity: 1; }

/* ============================================================
   Advanced / Simple mode toggle
   ============================================================ */
.tog__advbtn {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--btn-edge);
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tog__advbtn[aria-pressed="true"] {
  background: var(--chip);
  color: var(--accent-ink);
  border-color: var(--card-edge);
}

/* ============================================================
   Clothing section (advanced mode)
   ============================================================ */
.tog__clothing {
  background: var(--surface);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-md);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.tog__clothinghint {
  font-size: 12px;
  color: var(--faint);
  font-weight: 600;
  line-height: 1.45;
}
.tog__clothingchips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s2);
}
.tog__clothingchip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--btn-edge);
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tog__clothingchip:active { transform: scale(0.95); }
.tog__clothingchip--on {
  background: var(--chip);
  color: var(--accent-ink);
  border-color: var(--card-edge);
}
.tog__chipico {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}
.tog__chipico svg { width: 20px; height: 20px; }

/* Dimmed layer row = not in wardrobe */
.tog__layer--dim {
  opacity: 0.35;
}
.tog__wardrobetag {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--faint);
  margin-top: 2px;
  text-transform: uppercase;
}

/* ============================================================
   Sleeping bag selector
   ============================================================ */
.tog__bags {
  background: var(--surface);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-md);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.tog__bagsheader {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tog__bagslabel {
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--faint);
}
.tog__bagsunit {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--faint);
  background: var(--surface-2);
  padding: 2px 8px; border-radius: var(--r-pill);
}
.tog__bagchips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.tog__bagchip {
  height: 40px;
  min-width: 48px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--btn-edge);
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tog__bagchip:active { transform: scale(0.93); }
.tog__bagchip--on {
  background: var(--chip);
  color: var(--accent-ink);
  border-color: var(--card-edge);
}

/* ============================================================
   Clothing layer display (inside card)
   ============================================================ */
.tog__layers {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}
.tog__layer {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tog__layericon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: var(--chip);
  color: var(--accent-ink);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background 0.4s ease, color 0.4s ease;
}
.tog__layericon svg {
  width: 20px; height: 20px;
}
.tog__layerlabel {
  font-size: 15px; font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

/* Bag icon inside the TOG number row */
.tog__bagicn {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
  color: var(--accent-ink);
  vertical-align: middle;
  transition: color 0.4s ease;
}
.tog__bagicn svg {
  width: 22px; height: 30px;
}

/* Ideal TOG chip in card footer */
.tog__idealchip {
  font-size: 12px; font-weight: 700;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--btn-edge);
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}

/* (tog__warntog removed — warning card now uses the shared .tog__tog layout) */

/* ============================================================
   Header icon buttons (theme toggle, unit toggle)
   ============================================================ */
.tog__headerbtns {
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.tog__iconbtn {
  width: 34px; height: 34px;
  border-radius: var(--r-sm);
  border: 1px solid var(--btn-edge);
  background: var(--btn);
  color: var(--muted);
  font-family: var(--font);
  font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tog__iconbtn:active { background: var(--surface-2); }

/* ============================================================
   Ideal range marker on slider
   ============================================================ */
.tog__sliderrow { position: relative; width: 100%; }

/* Thin coloured bar overlaid on the track between 16°C and 20°C.
   Slider range is 10–30°C (20°C span):
   16°C = (16-10)/20 = 30% · 20°C = (20-10)/20 = 50% */
.tog__idealmark {
  position: absolute;
  top: calc(13px - 2px); /* aligns with the 4px track at half the thumb height (26px/2 - 2px) */
  left: 30%;
  width: 20%;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.45;
  pointer-events: none;
  transition: background 0.4s ease;
}

.tog__scalehint {
  display: flex; justify-content: space-between;
  align-items: center;
  font-size: 11px; font-weight: 600;
  color: var(--faint);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.tog__idealrangelabel {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.3px;
  color: var(--accent);
  opacity: 0.7;
  transition: color 0.4s ease;
}

/* ============================================================
   Sources toggle button (inside card footer)
   ============================================================ */
.tog__srcbtn {
  margin-left: auto;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.3px;
  padding: 4px 9px;
  border-radius: var(--r-pill);
  border: 1px solid var(--btn-edge);
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--font);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 3px;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.tog__srcbtn:active { background: var(--chip); color: var(--accent-ink); }

/* ============================================================
   Age / size selector
   ============================================================ */
.tog__agesection {
  display: flex;
  align-items: center;
  gap: var(--s3);
  flex-wrap: wrap;
}
.tog__agelabel {
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
}
.tog__agechips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.tog__agechip {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--btn-edge);
  background: var(--surface-2);
  color: var(--faint);
  font-family: var(--font);
  font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tog__agechip:active { transform: scale(0.93); }
.tog__agechip--on {
  background: var(--chip);
  color: var(--accent-ink);
  border-color: var(--card-edge);
}

/* ============================================================
   Overnight dip — wardrobe gap note
   ============================================================ */
.tog__dipgapnote {
  font-size: 12px; font-weight: 600;
  color: var(--accent-ink);
  background: var(--chip);
  border-radius: var(--r-sm);
  padding: 8px 11px;
  line-height: 1.45;
}

/* ============================================================
   Version label
   ============================================================ */
.tog__version {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--faint);
  opacity: 0.5;
  letter-spacing: 0.3px;
  padding-bottom: var(--s2);
}

/* ============================================================
   Service worker update banner
   ============================================================ */
.tog__swbanner {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: var(--s3);
  background: oklch(0.222 0.009 75);
  border: 1px solid oklch(1 0 0 / 0.15);
  border-radius: var(--r-pill);
  padding: 10px 16px;
  font-size: 13px; font-weight: 700;
  color: oklch(0.965 0.006 80);
  box-shadow: 0 8px 28px rgba(0,0,0,0.5);
  font-family: "Nunito Sans", -apple-system, system-ui, sans-serif;
  white-space: nowrap;
}
.tog__swbanner button {
  background: oklch(0.825 0.055 200);
  color: oklch(0.168 0.008 75);
  border: none;
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 13px; font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

/* ============================================================
   Accessibility — visually-hidden text & focus rings
   ============================================================ */
.tog__sronly {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Visible keyboard focus for every interactive control */
.tog :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tog a:focus-visible {
  outline-offset: 3px;
  border-radius: 3px;
}
.tog__slider:focus-visible {
  outline: none;
}
.tog__slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent);
}
.tog__slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent);
}

/* ============================================================
   Daytime / heating rise predictor (mirrors the dip)
   ============================================================ */
.tog__dip--rise .tog__dipheader { background: var(--surface-2); }

/* ============================================================
   Local weather
   ============================================================ */
.tog__weather {
  background: var(--surface);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-md);
  padding: var(--s4);
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.tog__weatherhdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
}
.tog__weathertitle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--faint);
}
.tog__weathertitle svg { color: var(--accent-ink); }
.tog__weatherhint {
  font-size: 12px;
  color: var(--faint);
  font-weight: 600;
  line-height: 1.45;
}
.tog__weatherbody {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}
.tog__weatherrow {
  display: flex;
  gap: var(--s2);
}
.tog__weatherstat {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--btn-edge);
  border-radius: var(--r-sm);
  padding: var(--s3);
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.tog__weathernum {
  font-size: 21px; font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.tog__weatherlbl {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.3px; text-transform: uppercase;
  color: var(--faint);
  text-align: center;
}
.tog__weatherchart {
  width: 100%;
  position: relative;
}
.tog__chartreadout {
  text-align: right;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-ink);
  font-variant-numeric: tabular-nums;
  min-height: 16px;
  margin-bottom: 2px;
}
.tog__chartsvg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  cursor: crosshair;
  touch-action: none;
}
.tog__chartarea {
  fill: var(--chip);
  opacity: 0.6;
}
.tog__chartline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.tog__chartguide {
  stroke: var(--accent-ink);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.5;
  vector-effect: non-scaling-stroke;
}
.tog__chartdot {
  fill: var(--accent);
  stroke: var(--surface);
  stroke-width: 2;
}
.tog__chartx {
  fill: var(--faint);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
}

.tog__weathernote {
  font-size: 13px; font-weight: 600;
  line-height: 1.5;
  color: var(--muted);
}
.tog__weathernote--warn {
  color: var(--accent-ink);
  background: var(--chip);
  border-radius: var(--r-sm);
  padding: 8px 11px;
}
.tog__weathermeta {
  font-size: 11px; font-weight: 600;
  color: var(--faint);
}

/* ============================================================
   Share / print actions
   ============================================================ */
.tog__actions {
  display: flex;
  gap: var(--s2);
}
.tog__actionbtn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 44px;
  border-radius: var(--r-pill);
  border: 1px solid var(--btn-edge);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font);
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tog__actionbtn svg { flex-shrink: 0; }
.tog__actionbtn:active { transform: scale(0.97); background: var(--surface-2); }

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Print — clean recommendation summary
   ============================================================ */
@media print {
  body { background: #fff; }
  .tog {
    background: #fff;
    color: #000;
    min-height: auto;
    overflow: visible;
  }
  .tog__glow,
  .tog__headerbtns,
  .tog__step,
  .tog__sliderrow,
  .tog__bags,
  .tog__clothing,
  .tog__advbtn,
  .tog__srcbtn,
  .tog__actions,
  .tog__weatherhdr button,
  .tog__weatherhint,
  .tog__agesection,
  .tog__swbanner,
  .tog__version {
    display: none !important;
  }
  .tog__scroll {
    padding: 16px;
    max-width: none;
    overflow: visible;
  }
  .tog__card,
  .tog__dip,
  .tog__weather,
  .tog__safety {
    box-shadow: none;
    border: 1px solid #bbb;
    break-inside: avoid;
  }
  .tog__safetybody { max-height: none !important; }
  .tog__value { color: #000; }
  a { color: #000; text-decoration: underline; }
}
