/* ════════════════════════════════════════════════════════
   Школа кулинарии — стили для TG Play webapp
   Портировано из дизайн-токенов: warm dark + OKLCH + Fraunces/Inter
   ════════════════════════════════════════════════════════ */

:root {
  --hue-brand: 38;        /* warm amber/copper */
  --hue-fresh: 150;       /* basil green */
  --hue-hot: 18;          /* tomato */
  --hue-saffron: 68;

  /* ink — warm near-blacks */
  --ink-0: oklch(0.12 0.012 60);
  --ink-1: oklch(0.16 0.015 60);
  --ink-2: oklch(0.20 0.018 60);
  --ink-3: oklch(0.25 0.020 60);
  --ink-4: oklch(0.32 0.024 60);
  --ink-5: oklch(0.42 0.028 60);

  /* text */
  --t1: oklch(0.98 0.006 70);
  --t2: oklch(0.80 0.018 70);
  --t3: oklch(0.62 0.020 70);
  --t4: oklch(0.48 0.020 70);

  /* brand — warm amber */
  --brand: oklch(0.72 0.18 var(--hue-brand));
  --brand-hi: oklch(0.82 0.15 var(--hue-brand));
  --brand-lo: oklch(0.55 0.18 var(--hue-brand));
  --brand-glow: oklch(0.72 0.18 var(--hue-brand) / 0.4);
  --brand-dim: oklch(0.72 0.18 var(--hue-brand) / 0.14);

  /* accents */
  --fresh: oklch(0.75 0.15 var(--hue-fresh));
  --fresh-dim: oklch(0.75 0.15 var(--hue-fresh) / 0.14);
  --hot: oklch(0.68 0.20 var(--hue-hot));
  --hot-dim: oklch(0.68 0.20 var(--hue-hot) / 0.14);
  --saffron: oklch(0.82 0.16 var(--hue-saffron));

  /* radius */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;

  /* type */
  --f-display: 'Fraunces', 'Playfair Display', Georgia, serif;
  --f-body: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, monospace;

  --tap: cubic-bezier(0.2, 0.9, 0.2, 1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ───────── reset ───────── */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100%; margin: 0; padding: 0;
  background: var(--ink-0); color: var(--t1);
  font-family: var(--f-body); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  user-select: none; -webkit-user-select: none;
}
body {
  position: fixed; inset: 0;
  overflow: hidden;
  /* TGPlay header (внешний скрипт) инжектит свой блок сверху body — мы flex-колонкой
     даём ему естественную высоту, а #app забирает всё остальное место. */
  display: flex;
  flex-direction: column;
}
button { cursor: pointer; border: none; background: none; padding: 0; color: inherit; font: inherit; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ───────── animations ───────── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes rise  { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse-scale { 0%,100%{transform:scale(1)} 50%{transform:scale(1.08)} }

/* ───────── app shell ───────── */
#app {
  flex: 1; min-height: 0;
  position: relative; width: 100%;
  max-width: 480px; margin: 0 auto;
  background-image:
    radial-gradient(80% 50% at 80% -10%, oklch(0.55 0.18 var(--hue-brand) / 0.18), transparent 60%),
    radial-gradient(60% 40% at 0% 0%, oklch(0.55 0.18 calc(var(--hue-brand) + 40) / 0.08), transparent 60%);
  background-color: var(--ink-0);
}

.screen {
  position: absolute; inset: 0;
  opacity: 0; pointer-events: none;
  transition: opacity .25s ease;
  display: flex; flex-direction: column;
  z-index: 0;
}
.screen.active {
  opacity: 1; pointer-events: auto; z-index: 1;
  animation: rise .3s var(--tap);
}

.screen-body {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: calc(20px + var(--safe-bottom));
}
.screen-body::-webkit-scrollbar { display: none; }
.screen.has-tabs .screen-body { padding-bottom: calc(80px + var(--safe-bottom)); }

/* ───────── typography ───────── */
.h-display { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.02em; }
.h-1 { font-family: var(--f-display); font-weight: 600; font-size: 28px; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
.h-2 { font-family: var(--f-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; margin: 0; }
.h-3 { font-family: var(--f-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; line-height: 1.25; margin: 0; }
.t-eye { font-size: 10px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--t3); }
.mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
.t1 { color: var(--t1); } .t2 { color: var(--t2); } .t3 { color: var(--t3); } .t4 { color: var(--t4); }
.t-brand { color: var(--brand); } .t-brand-hi { color: var(--brand-hi); }
.t-fresh { color: var(--fresh); } .t-hot { color: var(--hot); } .t-saffron { color: var(--saffron); }

/* ───────── sub-header ───────── */
.sub-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; flex-shrink: 0;
}
.sub-header__title { font-family: var(--f-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; line-height: 1.2; }
.sub-header__sub { font-size: 11px; color: var(--t3); margin-top: 1px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: oklch(1 0 0 / 0.06); color: var(--t1);
  display: grid; place-items: center; flex-shrink: 0;
  transition: background .15s, transform .15s;
}
.icon-btn:hover { background: oklch(1 0 0 / 0.1); }
.icon-btn:active { transform: scale(0.92); }

/* ───────── buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border-radius: 10px;
  font-weight: 600; font-size: 13px;
  transition: all .15s var(--tap);
  min-height: 40px;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary { background: var(--brand); color: oklch(0.18 0.02 60); box-shadow: 0 8px 20px -8px var(--brand-glow); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hi); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.98); }
.btn-ghost { background: oklch(1 0 0 / 0.08); color: var(--t1); }
.btn-ghost:hover:not(:disabled) { background: oklch(1 0 0 / 0.14); }
.btn-outline { background: transparent; border: 1px solid var(--ink-4); color: var(--t1); }
.btn-fresh { background: var(--fresh); color: oklch(0.18 0.02 60); }
.btn-block { width: 100%; }

/* ───────── card ───────── */
.card {
  background: var(--ink-2); border: 1px solid var(--ink-3);
  border-radius: var(--r-md); padding: 14px;
  transition: border-color .15s, transform .15s;
}
.card-btn { width: 100%; text-align: left; cursor: pointer; }
.card-btn:hover { border-color: var(--ink-4); transform: translateY(-1px); }

/* ───────── progress bar ───────── */
.bar { height: 4px; background: var(--ink-3); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-lo), var(--brand-hi)); border-radius: inherit; transition: width .4s var(--tap); }
.bar.thin { height: 3px; }
.bar.done > span, .bar > span.done { background: linear-gradient(90deg, oklch(0.55 0.15 var(--hue-fresh)), var(--fresh)); }

/* ───────── badges & chips ───────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge--brand { background: var(--brand-dim); color: var(--brand-hi); border-color: oklch(0.5 0.12 var(--hue-brand) / 0.4); }
.badge--fresh { background: var(--fresh-dim); color: var(--fresh); border-color: oklch(0.55 0.12 var(--hue-fresh) / 0.4); }
.badge--hot   { background: var(--hot-dim); color: var(--hot); border-color: oklch(0.55 0.15 var(--hue-hot) / 0.4); }
.badge--mute  { background: oklch(1 0 0 / 0.06); color: var(--t3); border-color: var(--ink-4); }
.badge--filled { background: var(--brand); color: oklch(0.18 0.02 60); font-weight: 800; }
.badge--glass { background: oklch(0 0 0 / 0.45); backdrop-filter: blur(6px); color: white; border-color: oklch(1 0 0 / 0.2); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: oklch(1 0 0 / 0.05); border: 1px solid var(--ink-3); color: var(--t2);
  transition: all .15s;
}
.chip:hover { color: var(--t1); border-color: var(--ink-4); }
.chip.active { background: var(--brand-dim); color: var(--brand-hi); border-color: var(--brand); }
.chip__count { font-size: 10px; color: var(--t4); }

/* ───────── horizontal scroll row ───────── */
.hrow {
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 2px 16px;
}
.hrow::-webkit-scrollbar { display: none; }

/* ───────── list row ───────── */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--r-md);
  background: var(--ink-2); border: 1px solid var(--ink-3);
  transition: all .15s var(--tap);
  text-align: left;
  width: 100%;
}
.list-row:hover { border-color: var(--ink-4); transform: translateY(-1px); }
.list-row.locked { opacity: 0.5; cursor: default; }
.list-row.locked:hover { transform: none; border-color: var(--ink-3); }
.list-row.current { border-color: oklch(0.55 0.18 var(--hue-brand) / 0.5); background: linear-gradient(90deg, oklch(0.72 0.18 var(--hue-brand) / 0.08), var(--ink-2)); }

/* ───────── tabs (bottom nav) ───────── */
.tabs {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: space-around;
  padding: 8px 10px calc(10px + var(--safe-bottom));
  background: oklch(0.13 0.012 60 / 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--ink-3);
  z-index: 5;
}
.tabs__btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px; border-radius: 10px;
  color: var(--t3); font-size: 10px; font-weight: 500;
  transition: color .15s;
}
.tabs__btn.active { color: var(--brand); }
.tabs__btn svg { width: 20px; height: 20px; }

/* ───────── avatar ───────── */
.avatar {
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(0.72 0.18 var(--hue-brand) / 0.18), oklch(0.55 0.18 50 / 0.25));
  border: 1.5px solid oklch(0.72 0.18 var(--hue-brand) / 0.6);
  display: grid; place-items: center;
  box-shadow: 0 0 24px -8px var(--brand-glow);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* ───────── stat chip ───────── */
.stat-chip {
  flex: 1; padding: 10px 8px; border-radius: 14px;
  background: var(--ink-2); border: 1px solid var(--ink-3);
  text-align: center; min-width: 0;
}
.stat-chip__value { font-family: var(--f-display); font-weight: 600; font-size: 22px; color: var(--brand); letter-spacing: -0.02em; line-height: 1.1; }
.stat-chip__label { font-size: 10.5px; color: var(--t3); margin-top: 1px; }

/* ───────── auth screen ───────── */
.auth {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 24px; text-align: center; gap: 6px;
}
.auth__logo { font-size: 64px; animation: pulse-scale 2s ease-in-out infinite; margin-bottom: 8px; }
.auth__title { font-family: var(--f-display); font-weight: 600; font-size: 28px; letter-spacing: -0.02em; }
.auth__sub { font-size: 14px; color: var(--t3); margin-bottom: 24px; }
.auth__spinner { width: 36px; height: 36px; border: 3px solid var(--ink-3); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; margin: 8px 0; }
.auth__status { font-size: 12px; color: var(--t3); }

/* ───────── onboarding ───────── */
.onboard {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  overflow-y: auto;
  scrollbar-width: none;
}
.onboard::-webkit-scrollbar { display: none; }
.onboard__hero {
  flex: 1 0 auto;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; padding: 16px 0;
}
.onboard__circle {
  width: 160px; height: 160px; border-radius: 50%;
  position: relative;
  background: radial-gradient(circle at 30% 30%, var(--brand), oklch(0.45 0.18 25) 70%);
  display: grid; place-items: center;
  box-shadow: 0 30px 60px -20px oklch(0.55 0.2 40 / 0.5);
  flex-shrink: 0;
}
.onboard__rings { position: absolute; inset: 0; opacity: 0.4; }
.onboard__icon { color: oklch(0.18 0.05 40); position: relative; z-index: 1; }
.onboard__text { text-align: center; max-width: 300px; }
.onboard__eye { color: var(--brand-hi); }
.onboard__title { margin-top: 10px; text-wrap: balance; }
.onboard__sub { margin-top: 12px; color: var(--t3); font-size: 14px; line-height: 1.55; }
.onboard__dots { display: flex; gap: 6px; margin-bottom: 14px; }
.onboard__dot { flex: 1; height: 3px; border-radius: 2px; background: var(--ink-3); transition: background .25s; }
.onboard__dot.on { background: var(--brand); }

/* ───────── home: continue card ───────── */
.continue-card {
  display: flex; padding: 0; overflow: hidden; border-radius: var(--r-md);
  background: linear-gradient(135deg, oklch(0.72 0.18 var(--hue-brand) / 0.15), var(--ink-2));
  border: 1px solid oklch(0.5 0.12 var(--hue-brand) / 0.5);
  text-align: left; cursor: pointer;
  width: 100%;
}
.continue-card__cover { width: 90px; flex-shrink: 0; position: relative; }
.continue-card__body { padding: 12px 14px; flex: 1; min-width: 0; }
.continue-card__eye { font-size: 10px; color: var(--brand-hi); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.continue-card__title { margin-top: 2px; font-family: var(--f-display); font-weight: 600; font-size: 17px; letter-spacing: -0.01em; line-height: 1.2; }
.continue-card__meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--t3); }
.continue-card__play { display: grid; place-items: center; padding: 0 14px; color: var(--brand); }

/* ───────── home: tip ───────── */
.tip {
  background: linear-gradient(180deg, oklch(0.75 0.15 80 / 0.12), oklch(0.2 0.018 60 / 0.5));
  border: 1px solid oklch(0.55 0.15 80 / 0.35);
  border-radius: var(--r-md); padding: 14px 16px;
}
.tip__head { display: flex; align-items: center; gap: 8px; color: var(--saffron); }
.tip__text { margin: 8px 0 0; font-size: 13px; line-height: 1.55; color: var(--t2); }

/* ───────── home: quick tile ───────── */
.q-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.q-tile { padding: 14px; text-align: left; background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--r-md); transition: transform .15s, border-color .15s; cursor: pointer; }
.q-tile:hover { transform: translateY(-2px); border-color: var(--ink-4); }
.q-tile__icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.q-tile__icon--brand { background: var(--brand-dim); color: var(--brand); border: 1px solid oklch(0.55 0.15 var(--hue-brand) / 0.4); }
.q-tile__icon--fresh { background: var(--fresh-dim); color: var(--fresh); border: 1px solid oklch(0.55 0.12 var(--hue-fresh) / 0.4); }
.q-tile__icon--saffron { background: oklch(0.78 0.15 var(--hue-saffron) / 0.14); color: var(--saffron); border: 1px solid oklch(0.55 0.15 var(--hue-saffron) / 0.35); }
.q-tile__icon--mute { background: oklch(1 0 0 / 0.05); color: var(--t2); border: 1px solid var(--ink-3); }
.q-tile__label { margin-top: 10px; font-size: 14px; font-weight: 600; }
.q-tile__sub { font-size: 11px; color: var(--t3); margin-top: 2px; }

/* ───────── level card (3 уровня) ───────── */
.level-card {
  display: flex; height: 90px; padding: 0; overflow: hidden;
  text-align: left; cursor: pointer;
}
.level-card.locked { opacity: 0.55; cursor: default; }
.level-card.current { border-color: oklch(0.55 0.18 var(--hue-brand) / 0.6); }
.level-card__cover { width: 90px; flex-shrink: 0; position: relative; }
.level-card__icon { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; }
.level-card__body { padding: 12px 14px; flex: 1; min-width: 0; }
.level-card__head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }

/* ───────── module list item ───────── */
.module-num {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: oklch(1 0 0 / 0.05); border: 1px solid var(--ink-3); color: var(--t3);
  display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 600; font-size: 17px;
}
.module-num.done { background: var(--fresh-dim); border-color: oklch(0.55 0.12 var(--hue-fresh) / 0.4); color: var(--fresh); }
.module-num.current { background: var(--brand-dim); border-color: oklch(0.55 0.12 var(--hue-brand) / 0.4); color: var(--brand); }

/* ───────── lesson list dot ───────── */
.lesson-dot {
  width: 30px; height: 30px; border-radius: 50%;
  background: oklch(1 0 0 / 0.06); color: var(--t3);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.lesson-dot.done { background: var(--fresh-dim); color: var(--fresh); }
.lesson-dot.current { background: var(--brand-dim); color: var(--brand); }

/* ───────── quiz CTA inside lessons screen ───────── */
.quiz-cta {
  border-color: oklch(0.55 0.18 var(--hue-brand) / 0.35);
  background: linear-gradient(135deg, oklch(0.72 0.18 var(--hue-brand) / 0.06), var(--ink-2));
  padding: 14px;
}
.quiz-cta__icon {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand-dim); color: var(--brand);
  display: grid; place-items: center; flex-shrink: 0;
}

/* ───────── lesson view ───────── */
.lesson-progress { height: 2px; background: var(--ink-3); flex-shrink: 0; }
.lesson-progress > span { display: block; height: 100%; background: var(--brand); transition: width .2s; }

.lesson-cover {
  height: 140px; position: relative; margin: 0 16px;
  border-radius: 14px; overflow: hidden;
}
.lesson-cover__chips {
  position: absolute; bottom: 12px; left: 12px; right: 12px;
  display: flex; gap: 6px; flex-wrap: wrap;
}

.prose { padding: 0 16px; line-height: 1.65; color: var(--t2); font-size: 14px; }
.prose h1, .prose h2 { font-family: var(--f-display); font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--t1); margin: 22px 0 10px; line-height: 1.25; }
.prose h3, .prose h4 { font-family: var(--f-display); font-weight: 600; font-size: 18px; letter-spacing: -0.01em; color: var(--t1); margin: 22px 0 10px; line-height: 1.25; }
.prose p { margin: 0 0 14px; }
.prose strong, .prose b { color: var(--t1); }
.prose em, .prose i { color: var(--brand-hi); font-style: italic; }
.prose ul, .prose ol { margin: 0 0 14px; padding-left: 0; }
.prose ul li {
  position: relative; padding: 5px 0 5px 22px; list-style: none;
}
.prose ul li::before {
  content: ''; position: absolute; left: 0; top: 14px;
  width: 8px; height: 2px; background: var(--brand); border-radius: 1px;
}
.prose ol { padding-left: 22px; list-style: decimal; }
.prose ol li { padding: 4px 0; padding-left: 4px; }
.prose ol li::marker { color: var(--brand); font-weight: 700; }
.prose code { background: var(--ink-3); padding: 1px 6px; border-radius: 4px; font-family: var(--f-mono); font-size: 12px; }
.prose blockquote {
  border-left: 3px solid var(--brand); padding: 4px 12px; margin: 14px 0;
  background: var(--brand-dim); border-radius: 0 8px 8px 0; color: var(--t1);
}
.prose .callout, .prose .tip {
  background: oklch(0.78 0.15 80 / 0.08);
  border: 1px solid oklch(0.55 0.15 80 / 0.3);
  border-radius: 12px; padding: 12px; margin: 14px 0;
  color: var(--t2);
}

/* sticky bottom action bar */
.sticky-bottom {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(180deg, transparent, var(--ink-0) 30%);
  display: flex; gap: 8px; z-index: 4;
}

/* ───────── quiz ───────── */
.quiz-bar { height: 3px; background: var(--ink-3); margin: 0 16px; border-radius: 2px; flex-shrink: 0; }
.quiz-bar > span { display: block; height: 100%; background: var(--brand); border-radius: 2px; transition: width .3s; }

.quiz-option {
  padding: 14px 16px; text-align: left; border-radius: 14px;
  background: var(--ink-2); border: 1.5px solid var(--ink-3);
  font-size: 14px; color: var(--t1); cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; gap: 10px;
  width: 100%;
}
.quiz-option:disabled { cursor: default; }
.quiz-option.picked { background: var(--brand-dim); border-color: var(--brand); }
.quiz-option.correct { background: var(--fresh-dim); border-color: var(--fresh); }
.quiz-option.wrong { background: var(--hot-dim); border-color: var(--hot); }
.quiz-option__letter {
  width: 24px; height: 24px; border-radius: 6px;
  background: oklch(1 0 0 / 0.06); color: var(--t3);
  display: grid; place-items: center;
  font-family: var(--f-mono); font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.quiz-option__text { flex: 1; }

.quiz-result-wheel {
  width: 160px; height: 160px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  margin-top: 20px;
}
.quiz-result-wheel__inner {
  position: absolute; inset: 8px; border-radius: 50%; background: var(--ink-1);
  display: grid; place-items: center; text-align: center;
}
.quiz-result-wheel__pct { font-family: var(--f-display); font-size: 40px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; }
.quiz-result-wheel__sub { font-size: 11px; color: var(--t3); margin-top: 2px; }

/* ───────── recipes search & cards ───────── */
.search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: var(--ink-2); border-radius: 12px;
  border: 1px solid var(--ink-3);
}
.search-box input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--t1); font-size: 14px;
}
.search-box input::placeholder { color: var(--t4); }

.recipe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.recipe-card {
  padding: 0; overflow: hidden;
  background: var(--ink-2); border: 1px solid var(--ink-3); border-radius: var(--r-md);
  text-align: left; cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.recipe-card:hover { transform: translateY(-2px); border-color: var(--ink-4); }
.recipe-card__cover { height: 110px; position: relative; }
.recipe-card__heart {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: oklch(0 0 0 / 0.45); backdrop-filter: blur(6px);
  color: white; display: grid; place-items: center;
}
.recipe-card__body { padding: 10px; }
.recipe-card__name { font-family: var(--f-display); font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; line-height: 1.2; }
.recipe-card__meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 10.5px; color: var(--t3); }

/* recipe detail */
.recipe-hero { position: relative; height: 180px; flex-shrink: 0; }
.recipe-hero__shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, oklch(0 0 0 / 0.3) 0%, transparent 40%, var(--ink-0) 100%);
}
.recipe-hero__btns { position: absolute; top: 10px; right: 12px; display: flex; gap: 6px; }
.recipe-hero__back {
  position: absolute; top: 10px; left: 12px;
  background: oklch(0 0 0 / 0.5); backdrop-filter: blur(8px);
}

.meta-row { padding: 0; display: flex; }
.meta-cell {
  flex: 1; padding: 12px 8px; text-align: center;
  border-right: 1px solid var(--ink-3);
}
.meta-cell:last-child { border-right: none; }
.meta-cell__label {
  color: var(--t4); font-size: 11px;
  display: flex; align-items: center; gap: 4px; justify-content: center;
}
.meta-cell__value { margin-top: 4px; font-family: var(--f-display); font-size: 15px; font-weight: 600; }

.ing-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--ink-2); border: 1px solid var(--ink-3);
  border-radius: 10px; text-align: left; cursor: pointer;
  transition: all .15s; width: 100%;
}
.ing-row.on { background: var(--fresh-dim); border-color: oklch(0.55 0.12 var(--hue-fresh) / 0.4); }
.ing-row__check {
  width: 20px; height: 20px; border-radius: 6px; flex-shrink: 0;
  background: transparent; border: 1.5px solid var(--ink-5);
  display: grid; place-items: center;
}
.ing-row.on .ing-row__check { background: var(--fresh); border-color: var(--fresh); color: oklch(0.18 0.02 60); }
.ing-row__q { font-family: var(--f-mono); font-size: 12px; min-width: 56px; color: var(--t2); }
.ing-row__name { font-size: 13px; color: var(--t1); flex: 1; }
.ing-row.on .ing-row__name { color: var(--t3); text-decoration: line-through; }
.ing-row.on .ing-row__q { opacity: 0.6; }

.step-row { display: flex; gap: 12px; align-items: flex-start; }
.step-row__num {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand-dim); color: var(--brand-hi);
  display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 600; font-size: 13px;
}
.step-row__title { font-weight: 600; font-size: 13.5px; }
.step-row__text { font-size: 13px; color: var(--t2); line-height: 1.55; margin-top: 4px; }

/* ───────── cooking mode ───────── */
.cook-num {
  width: 72px; height: 72px; border-radius: 20px;
  background: var(--brand-dim); color: var(--brand-hi);
  display: grid; place-items: center;
  font-family: var(--f-display); font-size: 36px; font-weight: 600;
}
.cook-timer {
  font-family: var(--f-mono); font-size: 48px; font-weight: 700;
  letter-spacing: -0.04em; color: var(--t2);
  text-align: center;
}
.cook-timer.running { color: var(--brand); }
.cook-timer.done { color: var(--fresh); }

/* ───────── stats: hero + chart ───────── */
.stats-hero {
  padding: 20px 16px;
  background: linear-gradient(135deg, oklch(0.72 0.18 var(--hue-brand) / 0.15), var(--ink-2));
  border: 1px solid oklch(0.55 0.15 var(--hue-brand) / 0.35);
  border-radius: var(--r-md);
  text-align: center;
}
.stats-hero__big {
  font-family: var(--f-display); font-size: 54px; font-weight: 600;
  color: var(--brand); letter-spacing: -0.03em; line-height: 1;
}
.stats-chart { padding: 16px; }
.stats-chart__bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; }
.stats-chart__bar {
  flex: 1; min-height: 2px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--brand-lo), var(--brand-hi));
}
.stats-chart__bar.empty { background: var(--ink-3); opacity: 0.4; }
.stats-chart__bar.dim { opacity: 0.55; }

.grid-stat-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-stat__value { font-family: var(--f-display); font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.grid-stat__label { font-size: 11.5px; color: var(--t2); margin-top: 2px; }
.grid-stat__sub { font-size: 10.5px; color: var(--t4); margin-top: 1px; }

/* ───────── achievements ───────── */
.ach-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.ach-badge {
  padding: 14px 8px; text-align: center;
  background: linear-gradient(180deg, oklch(0.72 0.18 var(--hue-brand) / 0.08), var(--ink-2));
  border: 1px solid oklch(0.55 0.15 var(--hue-brand) / 0.25);
  border-radius: var(--r-md);
}
.ach-badge__icon { font-size: 28px; }
.ach-badge__name { font-size: 11.5px; font-weight: 600; margin-top: 4px; line-height: 1.2; }

.ach-row__icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: oklch(1 0 0 / 0.05); border: 1px solid var(--ink-3);
  display: grid; place-items: center; font-size: 22px;
  filter: grayscale(1); opacity: 0.5;
}

/* ───────── cover-art container ───────── */
.cover-art {
  position: relative; width: 100%; height: 100%; overflow: hidden;
}
.cover-art__shade {
  position: absolute; inset: 0;
  background: radial-gradient(100% 60% at 50% 100%, oklch(0 0 0 / 0.45), transparent 70%);
}
.cover-art__noise {
  position: absolute; inset: 0;
  background-image: radial-gradient(oklch(1 0 0 / 0.04) 1px, transparent 1px);
  background-size: 3px 3px; mix-blend-mode: overlay; opacity: 0.5;
}
.cover-art svg { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ───────── progress ring (svg) ───────── */
.ring { position: relative; flex-shrink: 0; }
.ring__label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--f-display); font-weight: 600; font-size: 15px;
}

/* ───────── toast ───────── */
.toast {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 10px 18px; border-radius: 10px;
  background: var(--ink-3); color: var(--t1);
  font-size: 13px; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 100;
  border: 1px solid var(--ink-4);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: var(--fresh-dim); border-color: var(--fresh); color: var(--fresh); }
.toast.error { background: var(--hot-dim); border-color: var(--hot); color: var(--hot); }

/* ───────── loading spinner ───────── */
.loading {
  width: 28px; height: 28px;
  border: 3px solid var(--ink-3); border-top-color: var(--brand);
  border-radius: 50%; animation: spin .8s linear infinite;
  margin: 40px auto;
}

/* ───────── empty state ───────── */
.empty { padding: 40px 16px; text-align: center; color: var(--t3); font-size: 13px; }

/* ───────── utilities ───────── */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.flex-1 { flex: 1; min-width: 0; }
.w-full { width: 100%; }
.text-center { text-align: center; }

.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-10 { gap: 10px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }

.px-16 { padding-left: 16px; padding-right: 16px; }
.py-12 { padding-top: 12px; padding-bottom: 12px; }
.p-16 { padding: 16px; }

.mt-2 { margin-top: 2px; } .mt-4 { margin-top: 4px; } .mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; } .mt-10 { margin-top: 10px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-10 { margin-bottom: 10px; }

.flex-wrap { flex-wrap: wrap; }
.no-shrink { flex-shrink: 0; }
.hidden { display: none !important; }
