/* bapsang (오늘의 밥상) — styles. DESIGN.md frontmatter themes/categories/typography
 * mirrored 1:1 into :root[data-theme="light"] and :root[data-theme="dark"].
 * Base :root = no-JS light fallback. Warm-paper neutrals only; accent = 장-tone terracotta.
 */

:root {
  /* ===== no-JS fallback (light values) ===== */
  --bg:          oklch(0.985 0.006 75);
  --surface:     oklch(0.995 0.004 75);
  --surface-2:   oklch(0.965 0.008 75);
  --ink:         oklch(0.22 0.012 50);
  --muted:       oklch(0.50 0.012 55);
  --faint:       oklch(0.62 0.010 60);
  --line:        rgba(60, 40, 20, .10);
  --accent:      oklch(0.56 0.135 40);
  --accent-deep: oklch(0.46 0.150 38);
  --accent-ink:  oklch(0.99 0.005 75);
  --danger:      oklch(0.55 0.165 25);

  /* category tokens (light defaults) */
  --cat-vegetable:      #7fa05c;
  --cat-meat-fish:      #a86b4a;
  --cat-dairy-egg:      #c89a3e;
  --cat-seasoning:      #b15d40;
  --cat-frozen:         #5a534a;
  --cat-staple:         #d6c9b3;
  --cat-kimchi-pickled: #c75a3a;
  --cat-fruit:          #a8c674;

  /* typography */
  --font-display: "Cabinet Grotesk", "Pretendard Variable", "Pretendard", sans-serif;
  --font-body:    "Pretendard Variable", "Pretendard", "Geist", system-ui, -apple-system, "Apple SD Gothic Neo", sans-serif;
  --fs-display: 34px; --lh-display: 1.10; --fw-display: 700;
  --fs-h1:      22px; --lh-h1:      1.25; --fw-h1:      700;
  --fs-h2:      17px; --lh-h2:      1.35; --fw-h2:      600;
  --fs-body:    15.5px; --lh-body:  1.65;
  --fs-small:   13px; --lh-small:   1.45; --fw-small:   500;
  --fs-metric:  30px; --lh-metric:  1.0;  --fw-metric:  700;

  /* spacing / radius / motion */
  --sp-xs: 6px; --sp-sm: 10px; --sp-md: 14px; --sp-lg: 22px; --sp-xl: 32px;
  --r-sm: 10px; --r-base: 16px; --r-lg: 22px; --r-pill: 999px;
  --t-base: 200ms; --t-fast: 120ms; --ease: cubic-bezier(.2,.8,.2,1);

  /* decor + elevation (light) */
  --grad-bg-glow: radial-gradient(900px 540px at 86% -10%, rgba(177,93,64,.05) 0%, transparent 60%), radial-gradient(720px 460px at -6% 110%, rgba(200,154,62,.04) 0%, transparent 55%);
  --grad-accent: linear-gradient(150deg, var(--accent), var(--accent-deep));
  --shadow-sm:    0 1px 2px rgba(60,40,20,.06);
  --shadow-md:    0 10px 26px -14px rgba(60,40,20,.20);
  --shadow-focus: 0 0 0 3px rgba(177,93,64,.20);

  /* i18n + theme switch bridges */
  --i18n-switch-bg:          var(--surface-2);
  --i18n-switch-border:      var(--line);
  --i18n-switch-fg:          var(--ink);
  --i18n-switch-active-bg:   color-mix(in oklch, var(--accent) 18%, transparent);
  --i18n-switch-active-fg:   var(--accent);
  --i18n-switch-menu-bg:     var(--surface);
  --i18n-switch-menu-border: var(--line);
  --i18n-switch-shadow:      0 8px 24px rgba(0,0,0,.18);

  --theme-switch-bg:        var(--surface);
  --theme-switch-border:    var(--line);
  --theme-switch-fg:        var(--muted);
  --theme-switch-active-bg: var(--accent);
  --theme-switch-active-fg: var(--accent-ink);
  --theme-switch-radius:    10px;
}

:root[data-theme="light"] {
  --bg:          oklch(0.985 0.006 75);
  --surface:     oklch(0.995 0.004 75);
  --surface-2:   oklch(0.965 0.008 75);
  --ink:         oklch(0.22 0.012 50);
  --muted:       oklch(0.50 0.012 55);
  --faint:       oklch(0.62 0.010 60);
  --line:        rgba(60, 40, 20, .10);
  --accent:      oklch(0.56 0.135 40);
  --accent-deep: oklch(0.46 0.150 38);
  --accent-ink:  oklch(0.99 0.005 75);
  --danger:      oklch(0.55 0.165 25);

  --cat-vegetable:      #7fa05c;
  --cat-meat-fish:      #a86b4a;
  --cat-dairy-egg:      #c89a3e;
  --cat-seasoning:      #b15d40;
  --cat-frozen:         #5a534a;
  --cat-staple:         #d6c9b3;
  --cat-kimchi-pickled: #c75a3a;
  --cat-fruit:          #a8c674;

  --grad-bg-glow: radial-gradient(900px 540px at 86% -10%, rgba(177,93,64,.05) 0%, transparent 60%), radial-gradient(720px 460px at -6% 110%, rgba(200,154,62,.04) 0%, transparent 55%);
  --shadow-sm:    0 1px 2px rgba(60,40,20,.06);
  --shadow-md:    0 10px 26px -14px rgba(60,40,20,.20);
  --shadow-focus: 0 0 0 3px rgba(177,93,64,.20);

  --i18n-switch-bg:          var(--surface-2);
  --i18n-switch-border:      var(--line);
  --i18n-switch-fg:          var(--ink);
  --i18n-switch-active-bg:   color-mix(in oklch, var(--accent) 18%, transparent);
  --i18n-switch-active-fg:   var(--accent);
  --i18n-switch-menu-bg:     var(--surface);
  --i18n-switch-menu-border: var(--line);
  --i18n-switch-shadow:      0 8px 24px rgba(0,0,0,.18);

  --theme-switch-bg:        var(--surface);
  --theme-switch-border:    var(--line);
  --theme-switch-fg:        var(--muted);
  --theme-switch-active-bg: var(--accent);
  --theme-switch-active-fg: var(--accent-ink);
}

:root[data-theme="dark"] {
  --bg:          oklch(0.18 0.008 55);
  --surface:     oklch(0.22 0.010 55);
  --surface-2:   oklch(0.26 0.012 55);
  --ink:         oklch(0.94 0.008 75);
  --muted:       oklch(0.70 0.012 60);
  --faint:       oklch(0.55 0.010 55);
  --line:        rgba(255, 230, 200, .12);
  --accent:      oklch(0.68 0.120 42);
  --accent-deep: oklch(0.58 0.135 40);
  --accent-ink:  oklch(0.18 0.008 55);
  --danger:      oklch(0.62 0.150 25);

  --cat-vegetable:      #9bb876;
  --cat-meat-fish:      #c08664;
  --cat-dairy-egg:      #d9b156;
  --cat-seasoning:      #c87855;
  --cat-frozen:         #948b7e;
  --cat-staple:         #b8ac95;
  --cat-kimchi-pickled: #d97256;
  --cat-fruit:          #c2d990;

  --grad-bg-glow: radial-gradient(900px 540px at 86% -10%, rgba(200,120,85,.07) 0%, transparent 60%), radial-gradient(720px 460px at -6% 110%, rgba(216,177,86,.05) 0%, transparent 55%);
  --shadow-sm:    0 1px 2px rgba(0,0,0,.30);
  --shadow-md:    0 14px 32px -16px rgba(0,0,0,.55);
  --shadow-focus: 0 0 0 3px rgba(200,120,85,.22);

  --i18n-switch-bg:          var(--surface-2);
  --i18n-switch-border:      var(--line);
  --i18n-switch-fg:          var(--ink);
  --i18n-switch-active-bg:   color-mix(in oklch, var(--accent) 22%, transparent);
  --i18n-switch-active-fg:   var(--accent);
  --i18n-switch-menu-bg:     var(--surface);
  --i18n-switch-menu-border: var(--line);
  --i18n-switch-shadow:      0 8px 24px rgba(0,0,0,.45);

  --theme-switch-bg:        var(--surface);
  --theme-switch-border:    var(--line);
  --theme-switch-fg:        var(--muted);
  --theme-switch-active-bg: var(--accent);
  --theme-switch-active-fg: var(--accent-ink);
}

/* ===== reset ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--grad-bg-glow), var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, .font-display { font-family: var(--font-display); }
h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; }
button { font-family: inherit; }
a { color: var(--accent); }

/* ===== topbar ===== */
.topbar {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--sp-lg) clamp(16px, 5vw, 28px) var(--sp-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-sm);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: baseline; gap: var(--sp-sm); min-width: 0; }
.brand-mark {
  display: inline-grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: var(--r-sm);
  background: var(--grad-accent);
  color: var(--accent-ink);
  box-shadow: var(--shadow-sm);
  flex: none;
}
.brand-mark svg { width: 22px; height: 22px; }
.brand-text { min-width: 0; }
.brand h1 {
  font-size: 22px;
  line-height: 1.1;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
:root[data-theme="light"] .brand h1 { color: var(--ink); -webkit-text-fill-color: var(--ink); }
.brand p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.privacy-badge {
  font-size: 11px; font-weight: 600;
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 14%, transparent);
  padding: 6px 10px; border-radius: var(--r-pill);
  white-space: nowrap;
}

/* ===== main layout ===== */
main { max-width: 720px; margin: 0 auto; padding: var(--sp-sm) clamp(16px,5vw,28px) 96px; }
section { scroll-margin-top: 16px; }

/* ===== hero ===== */
.hero {
  padding: var(--sp-lg) 0 var(--sp-md);
  border-bottom: 1px solid var(--line);
  margin-bottom: var(--sp-lg);
}
.hero-title {
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  font-weight: var(--fw-display);
  margin-bottom: var(--sp-xs);
  color: var(--ink);
}
.hero-tag { font-size: var(--fs-body); color: var(--muted); margin-bottom: var(--sp-md); }
.hero-tag .accent { color: var(--accent); font-weight: 600; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--sp-sm); align-items: center; }
.hero-metrics { display: flex; gap: var(--sp-md); margin-top: var(--sp-md); flex-wrap: wrap; }
.hero-metric {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--sp-sm) var(--sp-md);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-base);
}
.hero-metric .num { font-family: var(--font-display); font-size: var(--fs-metric); font-weight: var(--fw-metric); color: var(--accent); line-height: 1; }
.hero-metric .lbl { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; min-height: 44px;
  padding: 0 var(--sp-lg);
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font: 600 14px var(--font-body);
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background var(--t-base) var(--ease), border-color var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.btn:hover { border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.btn.sm { min-height: 36px; padding: 0 var(--sp-md); font-size: 12.5px; }
.btn.primary {
  background: var(--grad-accent);
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}
.btn.primary:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in oklch, var(--danger) 40%, transparent); }
.btn.danger:hover { background: color-mix(in oklch, var(--danger) 10%, transparent); }
.icon-btn {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 34px; padding: 0 var(--sp-sm);
  border: 1px solid var(--line); background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-sm);
  font: 600 12.5px var(--font-body);
  cursor: pointer; transition: border-color var(--t-base), background var(--t-base);
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* ===== section heading ===== */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: var(--sp-md); margin-bottom: var(--sp-md); flex-wrap: wrap;
}
.section-head h2 { font-size: var(--fs-h1); line-height: var(--lh-h1); }
.section-head .sub { font-size: var(--fs-small); color: var(--muted); margin-top: 4px; max-width: 46ch; }
.section-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== bapsang-card (top-down 도면) ===== */
.bapsang-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-base);
  padding: var(--sp-md);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: var(--sp-md);
  position: relative;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.bapsang-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in oklch, var(--accent) 30%, var(--line)); }
.bapsang-card.flash { animation: flash-up var(--t-base) var(--ease); }
@keyframes flash-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .bapsang-card.flash { animation: none; } .bapsang-card:hover { transform: none; } }

.card-score {
  position: absolute; top: var(--sp-sm); right: var(--sp-sm);
  font: 600 11px var(--font-body);
  padding: 4px 9px;
  border-radius: var(--r-pill);
  background: color-mix(in oklch, var(--accent) 15%, transparent);
  color: var(--accent);
}
.card-title {
  font: 600 var(--fs-body) var(--font-body);
  padding-right: 60px;
}
.bapsang-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-sm);
  padding: var(--sp-sm);
  background: var(--surface-2);
  border-radius: var(--r-base);
}
.bowl {
  border-radius: 50%;
  background: color-mix(in oklch, var(--bowl-cat, var(--cat-staple)) 22%, var(--surface));
  border: 1.5px solid color-mix(in oklch, var(--bowl-cat, var(--cat-staple)) 45%, transparent);
  display: grid; place-items: center;
  position: relative;
  aspect-ratio: 1;
  color: var(--ink);
}
.bowl.rice, .bowl.soup { /* row 1 large */ }
.bowl.small { /* side dishes */ }
.bowl svg { width: 60%; height: 60%; stroke: var(--ink); opacity: .85; }
.bowl-row-2 {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-xs);
}
.bowl-row-2 .bowl { aspect-ratio: 1; }
.card-meta {
  display: flex; gap: var(--sp-sm); flex-wrap: wrap;
  font-size: var(--fs-small); color: var(--muted);
  align-items: center;
}
.card-meta .tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--ink);
}
.card-meta .cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.card-source {
  font-size: 11px; color: var(--muted);
  padding: 2px 8px; border-radius: var(--r-pill);
  background: color-mix(in oklch, var(--accent) 8%, transparent);
  align-self: flex-start;
}
.card-actions { display: flex; gap: var(--sp-xs); margin-top: 2px; }

/* today grid */
.today-grid {
  display: grid; gap: var(--sp-md);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .today-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 720px) { .today-grid { grid-template-columns: repeat(3, 1fr); } }

/* ===== pantry / chip ===== */
.pantry-tabs { display: flex; gap: 6px; margin-bottom: var(--sp-md); flex-wrap: wrap; }
.pantry-tab {
  padding: 8px 14px; min-height: 38px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted);
  border-radius: var(--r-pill);
  font: 600 13px var(--font-body);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  display: inline-flex; align-items: center; gap: 6px;
}
.pantry-tab .cat-dot { width: 8px; height: 8px; border-radius: 50%; }
.pantry-tab[aria-selected="true"] {
  background: color-mix(in oklch, var(--accent) 16%, transparent);
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 50%, transparent);
}
.pantry-custom-add { display: flex; gap: 6px; margin-bottom: var(--sp-sm); }
.custom-ing-input {
  flex: 1; min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--fs-small);
  font-family: inherit;
}
.custom-ing-input:focus { outline: none; border-color: var(--accent); }
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: var(--sp-xs); }
.chip {
  display: flex; align-items: center; gap: 6px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--r-sm);
  font: 500 13px var(--font-body);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  text-align: left;
  position: relative;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] {
  background: color-mix(in oklch, var(--cat, var(--accent)) 22%, transparent);
  border-color: color-mix(in oklch, var(--cat, var(--accent)) 50%, transparent);
  transform: scale(1.02);
}
.chip .cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.chip .chip-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .star {
  font-size: 12px; color: var(--faint);
  flex: none;
  background: transparent; border: 0; cursor: pointer; padding: 2px;
}
.chip .star.on { color: var(--accent); }
.chip.essential { border-style: dashed; }

.pantry-summary {
  display: flex; align-items: center; gap: var(--sp-sm);
  margin-top: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--surface-2);
  border-radius: var(--r-base);
  font-size: var(--fs-small);
  color: var(--muted);
}
.pantry-summary strong { color: var(--ink); }

/* ===== taste profile ===== */
.taste-panel { display: grid; gap: var(--sp-lg); }
.slider-row { display: grid; gap: 6px; }
.slider-row .slider-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: var(--fs-small); color: var(--ink);
}
.slider-row .slider-label .lbl { font-weight: 600; }
.slider-row .slider-label .lvl { color: var(--muted); }
.slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px;
  background: var(--line);
  border-radius: var(--r-pill);
  outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast);
}
.slider::-webkit-slider-thumb:hover { border-color: var(--accent); transform: scale(1.06); }
.slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer;
}
.slider:focus-visible { outline: none; }
.slider:focus-visible::-webkit-slider-thumb { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.shape-radio { display: flex; gap: var(--sp-xs); flex-wrap: wrap; }
.shape-radio label {
  flex: 1; min-width: 140px;
  display: flex; align-items: center; gap: 8px;
  padding: var(--sp-sm) var(--sp-md);
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-base);
  font-size: var(--fs-small);
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.shape-radio input { accent-color: var(--accent); }
.shape-radio label:has(input:checked) {
  border-color: color-mix(in oklch, var(--accent) 50%, transparent);
  background: color-mix(in oklch, var(--accent) 12%, transparent);
}

/* ===== week calendar ===== */
.week-grid {
  display: grid; gap: var(--sp-sm);
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .week-grid { grid-template-columns: repeat(7, 1fr); } }
.week-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-base);
  padding: var(--sp-sm);
  min-height: 130px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}
.week-cell:hover { border-color: color-mix(in oklch, var(--accent) 35%, transparent); }
.week-cell.empty { border-style: dashed; background: transparent; }
.week-cell.today { border-color: var(--accent); box-shadow: var(--shadow-focus); }
.week-cell .day-label { font: 600 12px var(--font-body); color: var(--muted); }
.week-cell.today .day-label { color: var(--accent); }
.week-cell .cell-mini-board {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin-top: 4px;
}
.week-cell .mini-bowl {
  aspect-ratio: 1; border-radius: 50%;
  background: color-mix(in oklch, var(--bowl-cat, var(--cat-staple)) 24%, transparent);
  border: 1px solid color-mix(in oklch, var(--bowl-cat, var(--cat-staple)) 40%, transparent);
}
.week-cell .mini-side {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
}
.week-cell .mini-side .mini-bowl { aspect-ratio: 1; }
.week-cell .cell-source {
  font-size: 10.5px; color: var(--muted);
  align-self: flex-start; margin-top: auto;
  padding: 2px 7px; border-radius: var(--r-pill);
  background: var(--surface-2);
}
.week-cell .cell-empty-cta { font-size: 11.5px; color: var(--faint); margin-top: auto; }

.week-link-arrow {
  font-size: 11px; color: var(--accent);
  opacity: .7; padding: 4px 6px; margin-top: var(--sp-xs);
  border-top: 1px dashed color-mix(in oklch, var(--accent) 50%, transparent);
  display: flex; align-items: center; gap: 4px;
}

/* ===== grocery list ===== */
.grocery-list { display: flex; flex-direction: column; gap: 6px; }
.grocery-row {
  display: grid; grid-template-columns: 22px 1fr auto; align-items: center;
  gap: var(--sp-sm);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: var(--fs-body);
}
.grocery-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.grocery-row .g-name { display: flex; align-items: center; gap: 8px; }
.grocery-row .g-name .cat-dot { width: 8px; height: 8px; border-radius: 50%; }
.grocery-row .g-days { font-size: 11px; color: var(--muted); }
.grocery-row.checked .g-name { color: var(--faint); text-decoration: line-through; }

/* ===== modal ===== */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(20, 12, 6, .55);
  display: grid; place-items: end center;
  padding: 0;
  z-index: 90;
  animation: fade-in var(--t-fast) var(--ease);
}
@media (min-width: 600px) { .modal-backdrop { place-items: center; padding: var(--sp-md); } }
.modal {
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  width: 100%; max-width: 560px;
  max-height: 90vh;
  overflow: auto;
  padding: var(--sp-lg);
  box-shadow: var(--shadow-md);
  animation: slide-up var(--t-base) var(--ease);
}
@media (min-width: 600px) { .modal { border-radius: var(--r-lg); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-md); margin-bottom: var(--sp-md); }
.modal-head h3 { font-size: var(--fs-h1); }
.modal-body { display: grid; gap: var(--sp-md); }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: var(--sp-sm); }
.modal .bapsang-board { max-width: 280px; margin: 0 auto; }
.recipe-photo {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: block;
  margin-top: 6px;
}
.recipe-meta-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-sm);
  font-size: var(--fs-small);
}
.recipe-meta-grid .meta-cell {
  background: var(--surface-2);
  border-radius: var(--r-sm);
  padding: var(--sp-sm) var(--sp-md);
}
.recipe-meta-grid .meta-cell .k { color: var(--muted); display: block; font-size: 11px; }
.recipe-meta-grid .meta-cell .v { color: var(--ink); font-weight: 600; }
.recipe-ingredients { display: flex; flex-direction: column; gap: 6px; }
.recipe-ingredients li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px var(--sp-sm);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  list-style: none;
}
.recipe-ingredients .cat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.recipe-ingredients .qty { margin-left: auto; color: var(--muted); font-size: 12px; }
.recipe-taste-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.recipe-taste-tags .tag { font-size: 11.5px; padding: 3px 9px; border-radius: var(--r-pill); background: color-mix(in oklch, var(--accent) 12%, transparent); color: var(--accent); }
.disclaimer {
  font-size: 11.5px; color: var(--muted);
  padding: var(--sp-sm);
  background: var(--surface-2);
  border-radius: var(--r-sm);
  line-height: 1.55;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal { animation: none; }
}

/* ===== onboard ===== */
.onboard-dots { display: flex; gap: 6px; justify-content: center; }
.onboard-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background var(--t-fast); }
.onboard-dots .dot.on { background: var(--accent); }

/* ===== roulette ===== */
.roulette-wrap {
  text-align: center; padding: var(--sp-lg) 0;
}
.roulette-wheel {
  width: 180px; height: 180px;
  margin: 0 auto var(--sp-md);
  border-radius: 50%;
  background: var(--grad-accent);
  display: grid; place-items: center;
  color: var(--accent-ink);
  font: 700 18px var(--font-display);
  box-shadow: var(--shadow-md);
  transition: transform 800ms var(--ease);
}
.roulette-result {
  font: 600 var(--fs-h2) var(--font-body);
  margin-bottom: var(--sp-sm);
  color: var(--ink);
}

/* ===== toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 60px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--surface);
  padding: 10px var(--sp-md);
  border-radius: var(--r-pill);
  font: 600 13px var(--font-body);
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-base), transform var(--t-base);
  z-index: 80;
  max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== empty ===== */
.empty {
  text-align: center; padding: var(--sp-xl) var(--sp-md);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--r-base);
}
.empty .emoji { font-size: 30px; margin-bottom: var(--sp-sm); }
.empty .title { font-size: var(--fs-h2); font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.empty .sub { font-size: var(--fs-small); color: var(--muted); margin-bottom: var(--sp-md); }

/* ===== footer ===== */
.foot {
  text-align: center; padding: var(--sp-xl) 0 var(--sp-md);
  color: var(--muted); font-size: 12px;
}
.foot a { color: var(--accent); text-decoration: none; }
.foot p { margin-top: 6px; }

/* ===== help modal list ===== */
.help-list { padding-left: 18px; display: grid; gap: 6px; font-size: var(--fs-small); color: var(--ink); }
.help-foot { margin-top: var(--sp-md); font-size: 12px; color: var(--muted); }

/* ===== onboard steps ===== */
.onboard-step h3 { font-size: var(--fs-h2); margin-bottom: var(--sp-sm); color: var(--accent); }
.onboard-step p { color: var(--ink); line-height: 1.65; }

/* RTL safety */
[dir="rtl"] .toast { transform: translate(50%, 20px); }
[dir="rtl"] .toast.show { transform: translate(50%, 0); }

/* ===== nutrition (v2) ===== */
.age-band-picker { display: flex; gap: var(--sp-xs); flex-wrap: wrap; margin-bottom: var(--sp-md); }
.band-btn {
  flex: 1; min-width: 96px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: var(--sp-sm) var(--sp-md);
  min-height: 48px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--r-base);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast);
}
.band-btn:hover { border-color: var(--accent); }
.band-btn .band-label { font: 600 13px var(--font-body); }
.band-btn .band-range { font-size: 11px; color: var(--faint); }
.band-btn.on {
  background: color-mix(in oklch, var(--accent) 14%, transparent);
  border-color: color-mix(in oklch, var(--accent) 50%, transparent);
  color: var(--accent);
}
.band-btn.on .band-range { color: var(--accent); }

.target-summary {
  margin-bottom: var(--sp-md);
  padding: var(--sp-sm) var(--sp-md);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-base);
}
.target-summary .target-head { font-size: var(--fs-small); color: var(--muted); margin-bottom: var(--sp-sm); }
.nutrient-target-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important; }
.nutrient-target-grid .meta-cell .v { font-family: var(--font-display); }

.card-meta .tag.accent {
  background: color-mix(in oklch, var(--accent) 16%, transparent);
  color: var(--accent);
}

/* custom meal cards */
.custom-meal-grid {
  display: grid; gap: var(--sp-sm);
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .custom-meal-grid { grid-template-columns: 1fr 1fr; } }
.custom-meal-card {
  position: relative;
  padding: var(--sp-md);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-base);
  cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast);
}
.custom-meal-card:hover { border-color: color-mix(in oklch, var(--accent) 40%, transparent); }
.custom-meal-card.on {
  border-color: var(--accent);
  background: color-mix(in oklch, var(--accent) 8%, transparent);
}
.custom-meal-card .cm-name { font: 600 var(--fs-body) var(--font-body); padding-right: 24px; }
.custom-meal-card .cm-count { font-size: 12px; color: var(--muted); margin-top: 2px; }
.custom-meal-card .cm-verdict { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.custom-meal-card .cm-del {
  position: absolute; top: var(--sp-sm); right: var(--sp-sm);
  width: 24px; height: 24px;
  border: 0; background: transparent;
  color: var(--faint);
  border-radius: var(--r-pill);
  cursor: pointer; font-size: 13px;
}
.custom-meal-card .cm-del:hover { color: var(--danger); background: color-mix(in oklch, var(--danger) 12%, transparent); }

.custom-meal-detail {
  margin-top: var(--sp-md);
  padding: var(--sp-md);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-base);
  display: flex; flex-direction: column; gap: var(--sp-md);
}
.select-hint { color: var(--muted); font-size: var(--fs-small); }
.cm-recipes { display: flex; flex-wrap: wrap; gap: var(--sp-xs); }
.cm-recipe-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 8px 6px 12px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
}
.cm-recipe-chip .cm-r-rm {
  width: 20px; height: 20px;
  border: 0; background: transparent;
  color: var(--faint); cursor: pointer; font-size: 12px;
  border-radius: var(--r-pill);
}
.cm-recipe-chip .cm-r-rm:hover { color: var(--danger); }

/* nutrient gauge bars */
.nutrient-bars { display: flex; flex-direction: column; gap: var(--sp-sm); }
.nutrient-bars .nb-head { font-size: var(--fs-small); color: var(--muted); margin-bottom: 2px; }
.nutrient-row {
  display: grid;
  grid-template-columns: 64px 1fr auto auto;
  align-items: center;
  gap: var(--sp-sm);
}
@media (max-width: 420px) {
  .nutrient-row { grid-template-columns: 56px 1fr auto; }
  .nutrient-row .nr-val { grid-column: 1 / -1; font-size: 11px; color: var(--muted); }
}
.nutrient-row .nr-label { font-size: var(--fs-small); color: var(--ink); font-weight: 500; }
.nutrient-row .nr-val { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gauge-track {
  position: relative;
  height: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: visible;
}
.gauge-fill {
  position: absolute; top: 0; bottom: 0; left: 0;
  border-radius: var(--r-pill);
  transition: width var(--t-base) var(--ease), background var(--t-base);
}
.gauge-mark {
  position: absolute; top: -3px; bottom: -3px;
  width: 2px;
  background: var(--accent);
  opacity: .55;
}
/* status → color (reuses warm palette tokens, no new hues) */
.nutrient-row.status-ok .gauge-fill { background: var(--cat-vegetable); }
.nutrient-row.status-low .gauge-fill { background: var(--cat-dairy-egg); }
.nutrient-row.status-high .gauge-fill { background: var(--danger); }

.pill {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font: 600 11px var(--font-body);
  white-space: nowrap;
}
.pill.is-ok { background: color-mix(in oklch, var(--cat-vegetable) 20%, transparent); color: var(--cat-vegetable); }
.pill.is-warn { background: color-mix(in oklch, var(--cat-dairy-egg) 22%, transparent); color: var(--cat-dairy-egg); }
.pill.is-high { background: color-mix(in oklch, var(--danger) 16%, transparent); color: var(--danger); }

/* ===== tab navigation (v2) ===== */
.tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 2px;
  background: color-mix(in oklch, var(--bg) 90%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
  margin: 0 calc(-1 * clamp(16px, 5vw, 28px)) var(--sp-md);
  padding: var(--sp-xs) clamp(16px, 5vw, 28px);
}
.tab {
  flex: 1;
  min-width: 0;
  padding: var(--sp-sm) var(--sp-xs);
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 600 13px var(--font-body);
  cursor: pointer;
  border-radius: var(--r-sm);
  white-space: nowrap;
  position: relative;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.tab:hover { color: var(--ink); background: var(--surface-2); }
.tab:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.tab[aria-selected="true"] {
  color: var(--accent);
  background: color-mix(in oklch, var(--accent) 12%, transparent);
}
.tab[aria-selected="true"]::after {
  content: '';
  position: absolute;
  left: 22%; right: 22%; bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: var(--r-pill);
}

/* 모바일 6탭 가로 스크롤 (탭 개수 늘어도 안 깨짐) */
.tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 1 0 auto; min-width: 54px; }

/* ===== recipe catalog (도감) ===== */
.catalog-search {
  min-width: 0; flex: 1; max-width: 200px;
  min-height: 36px; padding: 0 var(--sp-md);
  border: 1px solid var(--line); border-radius: var(--r-pill);
  background: var(--surface); color: var(--ink);
  font: 500 13px var(--font-body);
}
.catalog-search:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-focus); }
.catalog-filters { display: flex; gap: var(--sp-xs); margin-bottom: var(--sp-md); flex-wrap: wrap; }
.filter-chip {
  padding: 7px 14px; min-height: 34px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted);
  border-radius: var(--r-pill);
  font: 600 12.5px var(--font-body);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.filter-chip:hover { border-color: var(--accent); }
.filter-chip[aria-selected="true"] {
  background: color-mix(in oklch, var(--accent) 16%, transparent);
  color: var(--accent);
  border-color: color-mix(in oklch, var(--accent) 50%, transparent);
}
.catalog-grid { display: grid; gap: var(--sp-md); grid-template-columns: 1fr; }
@media (min-width: 480px) { .catalog-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 720px) { .catalog-grid { grid-template-columns: repeat(3, 1fr); } }
.catalog-card { padding: var(--sp-sm) var(--sp-md); }
.catalog-card .card-title { padding-right: 0; font-size: 14.5px; }
