:root {
  --bg: #fbf7f2;
  --surface: #ffffff;
  --text: #2a211b;
  --muted: #7a6c61;
  --border: #ece3d9;
  --accent: #e2572b;
  --accent-soft: #fde9e1;
  --accent-text: #ffffff;
  --ok: #2f8f5b;
  --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .06);
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17130f;
    --surface: #221c17;
    --text: #f3ebe3;
    --muted: #a89a8d;
    --border: #3a3029;
    --accent: #ff7a4d;
    --accent-soft: #3d241a;
    --accent-text: #1b120d;
    --ok: #5cc48b;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Georgian", system-ui, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 720px; margin: 0 auto; padding: 16px;
}
.brand { font-weight: 700; font-size: 18px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); font-size: 18px;
}
.icon-btn[hidden] { visibility: hidden; display: block; }

.progress { max-width: 688px; margin: 0 auto 8px; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }
.demo-banner {
  max-width: 688px; margin: 8px auto; padding: 8px 12px; border-radius: 10px;
  background: var(--accent-soft); font-size: 13px; text-align: center;
}
.demo-banner code { font-size: 12px; }

main { max-width: 720px; margin: 0 auto; padding: 8px 16px 120px; }

/* Welcome */
.hero { text-align: center; padding: 48px 0 24px; }
.hero .big { font-size: 64px; }
.hero h1 { font-size: 28px; margin: 12px 0 8px; }
.hero p { color: var(--muted); margin: 0 auto 28px; max-width: 420px; }

/* Question */
.step-count { color: var(--muted); font-size: 13px; margin-top: 16px; }
.q-title { font-size: 24px; margin: 4px 0 4px; }
.q-hint { color: var(--muted); margin: 0 0 20px; font-size: 14px; }

.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.option {
  display: flex; align-items: center; gap: 10px;
  padding: 14px; border-radius: 14px; text-align: left;
  border: 2px solid var(--border); background: var(--surface);
  transition: border-color .15s, background .15s, transform .1s;
}
.option:hover { border-color: var(--accent); }
.option:active { transform: scale(.98); }
.option .emoji { font-size: 22px; }
.option.selected { border-color: var(--accent); background: var(--accent-soft); }
.option .check {
  margin-left: auto; width: 20px; height: 20px; border-radius: 6px; flex: none;
  border: 2px solid var(--border); display: grid; place-items: center; font-size: 13px;
}
.option.selected .check { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

textarea {
  width: 100%; min-height: 110px; padding: 14px; border-radius: 14px;
  border: 2px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; resize: vertical;
}
textarea:focus { outline: none; border-color: var(--accent); }

.footer-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, transparent);
}
.footer-bar .inner { max-width: 688px; margin: 0 auto; display: flex; gap: 10px; }

.btn {
  flex: 1; padding: 14px 20px; border-radius: 14px; border: none;
  background: var(--accent); color: var(--accent-text); font-weight: 600; font-size: 16px;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--border); flex: 0 0 auto; }
.btn.inline { flex: none; }

/* Loading */
.loading { text-align: center; padding: 80px 0; }
.loading .pot { font-size: 56px; display: inline-block; animation: bob 1s ease-in-out infinite alternate; }
.loading p { color: var(--muted); }
@keyframes bob { to { transform: translateY(-10px) rotate(-6deg); } }

.error {
  padding: 16px; border-radius: 14px; background: var(--accent-soft); margin: 24px 0;
}

/* Results */
.results-head h2 { font-size: 24px; margin: 16px 0 4px; }
.results-head p { color: var(--muted); margin: 0 0 16px; }
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.dish {
  text-align: left; padding: 18px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px; transition: transform .15s, border-color .15s;
}
.dish:hover { transform: translateY(-2px); border-color: var(--accent); }
.dish .row { display: flex; align-items: center; gap: 10px; }
.dish .emoji { font-size: 32px; }
.dish h3 { margin: 0; font-size: 18px; }
.dish .cuisine { color: var(--muted); font-size: 13px; }
.dish .desc { margin: 4px 0 0; font-size: 14px; }
.dish .why { margin: 0; font-size: 13px; color: var(--muted); font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); }

/* Recipe */
.recipe h1 { font-size: 28px; margin: 16px 0 6px; }
.recipe .intro { color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 12px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-size: 18px; }
.card h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.ing { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--border); cursor: pointer; }
.ing:last-child { border-bottom: none; }
.ing input { accent-color: var(--accent); width: 18px; height: 18px; }
.ing .amt { margin-left: auto; color: var(--muted); white-space: nowrap; }
.ing.done span:not(.amt) { text-decoration: line-through; color: var(--muted); }
.step { display: flex; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.step:last-child { border-bottom: none; }
.step .num {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); font-weight: 700;
}
.step.done .num { background: var(--ok); color: #fff; }
.step.done .body { opacity: .55; }
.step h3 { margin: 4px 0 2px; font-size: 16px; }
.step p { margin: 0; }
.step .mins { font-size: 12px; color: var(--muted); }
ul.tips { margin: 0; padding-left: 20px; }
ul.tips li { margin: 4px 0; }

@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .options { grid-template-columns: 1fr 1fr; }
  .q-title { font-size: 21px; }
}
