/* ============================================================
   Sizle — Gen-Z design system (PLAN.md §6)
   Dark-first · bold · vibe-driven · big glanceable cook UI
   ============================================================ */
:root {
  --bg: #0b0b0f;
  --bg-2: #14141b;
  --card: #1b1b24;
  --card-2: #23232e;
  --line: #33334a;
  --text: #f4f4f7;
  --muted: #9a9ab0;
  --flame-1: #ff5500;   /* fire-orange — warmed from #ff6b35 (truer heat, less coral) */
  --flame-2: #c44dff;   /* violet — the music/audio + interactive accent */
  --flame: linear-gradient(135deg, #ff5500 0%, #c44dff 100%);
  --pop: #b6ff3a;       /* electric lime — success / done / finish */
  --pop-dim: rgba(182, 255, 58, 0.14);
  /* semantic accents (tokenized; previously scattered hex literals) */
  --gold: #ffd56b;   --gold-dim: rgba(255,213,107,.14);   /* premium · ratings · waiting */
  --hot: #ffb800;    --hot-dim: rgba(255,184,0,.16);      /* temperature / hot-pan cue */
  --info: #6bd0ff;   --info-dim: rgba(107,208,255,.12);   /* prep / tip cues */
  --action: #ff9d6b; --action-dim: rgba(255,85,0,.14);    /* action / baste cues */
  --cool: #2a8fc7;   --cool-dim: rgba(56,160,224,.12);    /* low-heat (cool) */
  --danger: #ff8a9c; --danger-dim: rgba(255,77,128,.15);  /* hard difficulty */
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}
[data-theme="light"] {
  --bg: #f4f4f8; --bg-2: #ffffff; --card: #ffffff; --card-2: #f0f0f6;
  --line: #e3e3ec; --text: #15151c; --muted: #6b6b80; --shadow: 0 18px 50px rgba(0,0,0,0.12);
  --pop: #2f9e1f;       /* darker lime so success text is readable on white */
  --pop-dim: rgba(47, 158, 31, 0.12);
}
/* Light theme: darken the bright accent text so it reads on white cards. */
[data-theme="light"] .pill.premium,
[data-theme="light"] .pill.diff-medium,
[data-theme="light"] .type.temp { color: #a87b00; background: rgba(168,123,0,.12); }
[data-theme="light"] .type.prep,
[data-theme="light"] .type.tip { color: #1f7fb8; background: rgba(31,127,184,.12); }
[data-theme="light"] .type.action,
[data-theme="light"] .type.baste,
[data-theme="light"] .type.flip { color: #d2641f; background: rgba(210,100,31,.12); }
[data-theme="light"] .pill.diff-hard { color: #d13b5c; }
/* …but keep accents bright on the always-dark featured card */
[data-theme="light"] .exp-card .pill.free { color: #b6ff3a; background: rgba(182,255,58,.16); }
/* the cook screen's dark maroon top would hide dark text — use a light warm top */
[data-theme="light"] .cook { background: radial-gradient(700px 380px at 50% 0%, #ffe1cf 0%, var(--bg) 62%); }

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: radial-gradient(1200px 700px at 50% -10%, #1c1230 0%, var(--bg) 55%);
  color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; gap: 14px; padding: 24px 0;
}

/* ---- phone frame ---- */
.phone {
  position: relative;
  width: 390px; max-width: 94vw; height: 844px; max-height: 90vh;
  background: var(--bg); border-radius: 46px;
  border: 10px solid #000; box-shadow: var(--shadow);
  overflow: hidden;
}
.notch {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 150px; height: 26px; background: #000;
  border-bottom-left-radius: 16px; border-bottom-right-radius: 16px; z-index: 50;
}
.app { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; }
.app::-webkit-scrollbar { display: none; }
.env-note { color: var(--muted); font-size: 12px; letter-spacing: .2px; }

/* ---- screen layout ---- */
.screen { min-height: 100%; display: flex; flex-direction: column; padding: 54px 22px 26px; }
.screen.center { justify-content: center; }
.fade { animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---- typography ---- */
h1 { font-family: "Instrument Sans", sans-serif; font-weight: 700; font-size: 32px; line-height: 1.08; letter-spacing: -0.5px; }
h2 { font-family: "Instrument Sans", sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -0.3px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--flame-2); }
.muted { color: var(--muted); }
.lead { color: var(--muted); font-size: 15px; line-height: 1.5; }
.gradient-text { background: var(--flame); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- buttons ---- */
.btn {
  appearance: none; border: 0; cursor: pointer; width: 100%;
  font-family: "Instrument Sans", sans-serif; font-weight: 700; font-size: 17px;
  color: #fff; padding: 17px 20px; border-radius: var(--radius-sm);
  background: var(--flame); transition: transform .12s ease, filter .12s ease;
  box-shadow: 0 10px 24px rgba(196, 77, 255, 0.28);
}
.btn:active { transform: scale(.97); filter: brightness(1.05); }
.btn.secondary { background: var(--card-2); color: var(--text); box-shadow: none; border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--muted); box-shadow: none; font-weight: 600; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-row { display: flex; gap: 12px; }
.btn-row .btn { width: auto; flex: 1; }

/* ---- inputs ---- */
.field { width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--text);
  padding: 16px 16px; border-radius: var(--radius-sm); font-size: 16px; font-family: inherit; }
.field:focus { outline: none; border-color: var(--flame-2); }

/* ---- generic cards / choices ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.choice {
  width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--line);
  color: var(--text); border-radius: var(--radius-sm); padding: 16px 18px; cursor: pointer;
  font-size: 16px; font-weight: 600; transition: border-color .12s, transform .12s, background .12s;
  display: flex; align-items: center; gap: 12px;
}
.choice:active { transform: scale(.98); }
.choice.selected { border-color: var(--flame-2); background: linear-gradient(135deg, rgba(255,85,0,.12), rgba(196,77,255,.12)); }
.choice .emoji { font-size: 22px; }
.brand-ico { flex: 0 0 auto; width: 24px; height: 24px; display: block; border-radius: 6px; }
.choice small { display: block; font-weight: 500; color: var(--muted); font-size: 13px; margin-top: 2px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.mt-auto { margin-top: auto; }

/* ---- voice picker ---- */
.voicepick { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; }
.vp-row { display: flex; gap: 10px; align-items: center; }
.vp-select { flex: 1; appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%239a9ab0' stroke-width='2'><path d='M2 5l5 5 5-5'/></svg>");
  background-repeat: no-repeat; background-position: right 14px center; }
.vp-row .icon-btn { flex: 0 0 auto; width: 48px; height: 52px; background: var(--flame); border: 0; color: #fff; }

/* ---- progress dots ---- */
.dots { display: flex; gap: 6px; margin-bottom: 18px; }
.dots span { height: 4px; flex: 1; background: var(--line); border-radius: 99px; }
.dots span.on { background: var(--flame); }

/* ---- pills / chips ---- */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 6px 11px; border-radius: 99px; background: var(--card-2); color: var(--muted); border: 1px solid var(--line); }
.pill.free { color: var(--pop); background: var(--pop-dim); border-color: transparent; }
.pill.premium { color: var(--gold); background: rgba(255,213,107,.12); border-color: transparent; }

/* ---- welcome hero ---- */
.hero-emoji { font-size: 72px; filter: drop-shadow(0 8px 20px rgba(196,77,255,.4)); }
.brand { font-family: "Instrument Sans"; font-weight: 700; font-size: 15px; letter-spacing: 3px; text-transform: uppercase; }

/* ---- brand logo (chef-hat mark) ---- */
.hero-logo { width: 116px; height: 116px; object-fit: contain; display: block; margin: 0 auto;
  filter: drop-shadow(0 10px 26px rgba(196,77,255,.38)); }
.login-logo { width: 62px; height: 62px; object-fit: contain; display: block; margin: 0 0 14px;
  filter: drop-shadow(0 8px 20px rgba(196,77,255,.32)); }
.brand-lockup { display: inline-flex; align-items: center; gap: 9px; }
.brand-logo { flex: 0 0 auto; width: 26px; height: 26px; object-fit: contain; display: block; }

/* ---- home / experience card ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--flame); display: grid; place-items: center; font-weight: 800; color: #fff; }
.exp-card {
  position: relative; border-radius: var(--radius); overflow: hidden; cursor: pointer; color: #f4f4f7;
  background: linear-gradient(160deg, #2a1410, #1a0f1a); border: 1px solid var(--line);
  padding: 20px; min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end;
}

/* Premium unlock CTA card */
.prem-cta {
  position: relative; width: 100%; text-align: left; cursor: pointer; overflow: hidden; color: var(--text);
  display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  padding: 22px; border-radius: var(--radius);
  background: linear-gradient(150deg, #2e2008 0%, #231016 55%, #1a0f1a 100%);
  border: 1px solid rgba(255,213,107,.30);
  box-shadow: 0 12px 32px rgba(0,0,0,.35);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.prem-cta::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(360px 200px at 88% -10%, rgba(255,213,107,.20), transparent 60%); }
.prem-cta:hover { transform: translateY(-2px); border-color: rgba(255,213,107,.65); box-shadow: 0 16px 40px rgba(0,0,0,.45); }
.prem-cta .prem-emoji { position: absolute; top: 16px; right: 18px; font-size: 56px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
.prem-cta .pill.premium { position: relative; }
.prem-cta h2 { position: relative; margin: 4px 0 0; font-size: 24px; line-height: 1.15; max-width: 76%; color: var(--text); }
.prem-cta p { position: relative; margin: 0; max-width: 90%; color: var(--muted); font-size: 14px; line-height: 1.45; font-weight: 500; }
.prem-go { position: relative; margin-top: 6px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--flame); color: #fff; font-weight: 800; font-size: 14px;
  padding: 11px 18px; border-radius: 99px; box-shadow: 0 8px 20px rgba(255,85,0,.32); }
.exp-card .glow { position: absolute; inset: 0; background: radial-gradient(420px 220px at 80% 0%, rgba(255,85,0,.35), transparent 60%); }
.exp-card .big-emoji { position: absolute; top: 14px; right: 16px; font-size: 64px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
.exp-card h2 { position: relative; }
.exp-card .song { position: relative; color: #f4f4f7; opacity: .85; font-weight: 600; margin-top: 4px; }
.exp-card .row { position: relative; display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.exp-card.locked { opacity: .85; }
.section-title { font-family: "Instrument Sans"; font-weight: 700; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 24px 2px 12px; }

/* ---- recipe catalog (TheMealDB) ---- */
.searchrow { display: flex; gap: 10px; margin: 4px 0 12px; }
.searchrow .field { flex: 1; }
.searchrow .icon-btn { width: 52px; height: 52px; background: var(--flame); border: 0; color: #fff; font-size: 18px; }
.searchhead { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); margin: 0 2px 8px; }
.searchhead button { background: none; border: 0; color: var(--flame-2); font-weight: 700; cursor: pointer; font-size: 12px; }
.catalog { display: flex; flex-direction: column; gap: 12px; }
.rcard { display: flex; gap: 12px; align-items: stretch; text-align: left; cursor: pointer;
  color: var(--text); /* buttons don't inherit color — set it so titles are white in dark mode */
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; transition: transform .12s, border-color .12s; }
.rcard:active { transform: scale(.99); }
.rcard:hover { border-color: var(--flame-2); }
.rthumb { position: relative; width: 84px; min-width: 84px; height: 84px; border-radius: 12px;
  background-size: cover; background-position: center; background-color: var(--card-2); }
.rsafety { position: absolute; top: 4px; right: 4px; font-size: 13px; background: rgba(0,0,0,.55); border-radius: 8px; padding: 1px 4px; }
.rinfo { display: flex; flex-direction: column; gap: 3px; justify-content: center; min-width: 0; }
.rinfo b { font-family: "Instrument Sans"; font-size: 15px; line-height: 1.15; }
.rinfo small { color: var(--muted); font-size: 12px; }
.rrow { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.rrow .pill { font-size: 11px; padding: 4px 8px; }
.attribution { color: var(--muted); font-size: 11px; margin-top: 12px; text-align: center; }

/* ---- recipe detail ---- */
.detail-hero { width: 100%; height: 180px; border-radius: var(--radius); background-size: cover; background-position: center; background-color: var(--card-2); border: 1px solid var(--line); }
.ing { list-style: none; }
.ing li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ing li:last-child { border-bottom: 0; }
.opt { color: var(--muted); font-style: normal; font-size: 12px; }
/* optional-ingredient toggles (default on; deselect to drop from the recipe) */
.opt-ing-label { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; min-width: 0; }
.opt-ing-label input { width: 17px; height: 17px; accent-color: var(--flame-2); flex: 0 0 auto; }
.opt-ing.off .opt-ing-label span, .opt-ing.off > .muted { text-decoration: line-through; opacity: .45; }

/* difficulty badges */
.pill.diff-easy { color: var(--pop); background: var(--pop-dim); border-color: transparent; }
.pill.diff-medium { color: var(--gold); background: rgba(255,213,107,.14); border-color: transparent; }
.pill.diff-hard { color: var(--danger); background: var(--danger-dim); border-color: transparent; }

/* ---- guided cook ---- */
.gprogress { height: 6px; background: var(--card-2); border-radius: 99px; margin: 8px 20px 0; overflow: hidden; }
.gfill { height: 100%; background: var(--flame); border-radius: 99px; transition: width .3s; }
.safetybox { margin-top: 14px; background: rgba(255,213,107,.12); border: 1px solid rgba(255,213,107,.3);
  color: var(--gold); border-radius: var(--radius-sm); padding: 12px 14px; font-weight: 600; font-size: 14px; }

/* ---- ad slot (free tier) ---- */
.ad {
  border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 14px;
  text-align: center; color: var(--muted); font-size: 12px; background: var(--bg-2); margin-top: 14px;
}
.ad b { color: var(--text); }

/* ============================================================
   COOK SESSION — the hero screen
   ============================================================ */
.cook { padding: 0; height: 100%; display: flex; flex-direction: column; background:
  radial-gradient(700px 380px at 50% 0%, #2a0f18 0%, var(--bg) 60%); }
.cook-top { padding: 48px 20px 6px; display: flex; align-items: center; justify-content: space-between; }
.now-playing { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 16px; }
.eq i { width: 3px; background: var(--flame-2); border-radius: 2px; animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2){ animation-delay:.2s } .eq i:nth-child(3){ animation-delay:.4s } .eq i:nth-child(4){ animation-delay:.1s }
@keyframes eq { 0%,100%{height:5px} 50%{height:16px} }
.cook.paused .eq i { animation-play-state: paused; }

.cook-icons { display: flex; gap: 6px; }
.icon-btn { width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--text); display: grid; place-items: center; cursor: pointer; font-size: 16px; }
.icon-btn.off { opacity: .4; }

/* embedded music video (free tier) */
.cook-video { position: relative; flex: 0 0 auto; margin: 8px 20px 0; border-radius: 16px; overflow: hidden;
  border: 1px solid var(--line); background: #000; aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.cook-video > div, .cook-video iframe { width: 100%; height: 100%; display: block; border: 0; }
.video-tap { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center; cursor: pointer; border: 0; color: #fff;
  background: linear-gradient(160deg, rgba(20,8,16,.86), rgba(10,6,16,.86)); }
.video-tap .play { font-size: 26px; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center;
  background: var(--flame); box-shadow: 0 8px 24px rgba(196,77,255,.45); padding-left: 4px; }
.video-tap small { font-family: "Instrument Sans"; font-weight: 700; font-size: 13px; letter-spacing: .3px; text-align: center; padding: 0 16px; }
.video-tap .yt-link { color: #fff; text-decoration: underline; font-size: 12px; opacity: .85; margin-top: 2px; }
.video-tap .yt-err { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--danger); }
.cook.has-video .ring-wrap { padding: 4px 0 0; }
.cook.has-video .ring-label .cd { font-size: 30px; }

/* countdown ring */
.ring-wrap { display: grid; place-items: center; padding: 6px 0 2px; position: relative; }
.ring { transform: rotate(-90deg); }
.ring .track { stroke: var(--line); }
.ring .prog { stroke: url(#flameGrad); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring-label { position: absolute; text-align: center; }
.ring-label .next { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.ring-label .cd { font-family: "Instrument Sans"; font-weight: 700; font-size: 40px; line-height: 1; margin-top: 2px; }
.ring-label .cd.go { color: var(--pop); }

/* the big step card */
.stepcard { margin: 6px 20px 0; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; flex: 1; display: flex; flex-direction: column; }
.stepcard .type { align-self: flex-start; }
.stepcard h2 { font-size: 30px; margin: 14px 0 10px; line-height: 1.05; }
.stepcard p { font-size: 17px; line-height: 1.5; color: var(--text); }
.stepcard.flash { animation: flash .6s ease; }
@keyframes flash { 0% { border-color: var(--flame-2); box-shadow: 0 0 0 4px rgba(196,77,255,.25);} 100% { border-color: var(--line); box-shadow: none; } }
.beginner-tag { margin-top: 14px; font-size: 12px; color: var(--pop); font-weight: 700; }

/* heat-level guidance badge (high/medium/low, tuned to gas vs electric) */
.heat-badge { display: flex; flex-direction: column; gap: 2px; margin: 10px 0 0; padding: 8px 12px;
  border-radius: 12px; background: rgba(255,85,0,.12); border: 1px solid rgba(255,85,0,.32); }
.heat-badge[hidden] { display: none; }
.heat-badge b { font-size: 13px; color: var(--flame-1); letter-spacing: .3px; }
.heat-badge span { font-size: 11px; color: var(--muted); line-height: 1.35; }
.heat-badge.low, .heat-badge.medium-low { background: var(--cool-dim); border-color: rgba(56,160,224,.34); }
.heat-badge.low b, .heat-badge.medium-low b { color: var(--cool); }

/* per-ingredient nutrition (served by our API: curated staples + Open Food Facts) */
.nutri { font-size: 11px; color: var(--muted); white-space: nowrap; }
.nutri b { color: var(--flame-1); }
.nutri-list li { gap: 10px; }
.nutri-list li.nutri-total { border-top: 1.5px solid var(--line); margin-top: 4px; padding-top: 10px; }
.nutri-list li.nutri-total .nutri b { color: var(--text); }

/* PHASE A: confirm-gate actions + waiting state */
.gate-actions { display: flex; gap: 10px; margin-top: auto; padding-top: 16px; }
.gate-actions[hidden] { display: none; }
.gate-actions .btn { flex: 1; }
.stepcard.waiting { border-color: var(--gold); animation: waitpulse 1.6s ease-in-out infinite; } /* amber = "your turn", not music */
@keyframes waitpulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 213, 107, 0); }
  50% { box-shadow: 0 0 0 5px rgba(255, 213, 107, 0.20); }
}

/* tip / safety badge colors by type */
.type.prep,.type.tip { color: var(--info); background: var(--info-dim); border-color: transparent; }
.type.action,.type.baste { color: var(--action); background: var(--action-dim); border-color: transparent; }
.type.flip { color: var(--flame-1); background: rgba(255,85,0,.16); border-color: transparent; } /* flip = food/heat action, not music */
.type.temp { color: var(--hot); background: var(--hot-dim); border-color: transparent; } /* punchier amber = "pan is hot" */
.type.rest,.type.finish { color: var(--pop); background: var(--pop-dim); border-color: transparent; }

/* timeline bar (passive, pinned bottom) */
.timeline { margin: 14px 20px; }
.tl-track { position: relative; height: 8px; background: var(--card-2); border-radius: 99px; }
.tl-fill { position: absolute; left: 0; top: 0; height: 100%; background: var(--flame); border-radius: 99px; width: 0%; }
.tl-mark { position: absolute; top: -3px; width: 14px; height: 14px; border-radius: 50%; background: var(--bg);
  border: 2px solid var(--line); transform: translateX(-50%); }
.tl-mark.done { background: var(--flame-2); border-color: var(--flame-2); } /* passed checkpoint */
.tl-mark.flip { border-color: var(--flame-1); } /* orange = flip (food/heat) */
.tl-times { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }

.cook-controls { display: flex; gap: 12px; padding: 0 20px 26px; }
.cook-controls .btn { width: auto; flex: 1; }

/* ---- finish screen ---- */
.finish-hero { text-align: center; }
.medal { font-size: 80px; filter: drop-shadow(0 10px 24px rgba(182,255,58,.35)); }
.share-card {
  margin: 18px 0; border-radius: var(--radius); padding: 22px; text-align: center; color: #f4f4f7;
  background: linear-gradient(160deg, #2a1410, #1a0f1a); border: 1px solid var(--line); position: relative; overflow: hidden;
}
.share-card .muted { color: rgba(244,244,247,.72); }
[data-theme="light"] .share-card .streak { color: #b6ff3a; }
.share-card .glow { position: absolute; inset: 0; background: radial-gradient(300px 180px at 50% 0%, rgba(196,77,255,.3), transparent 65%); }
.share-card .big { font-size: 60px; }
.confetti { position: absolute; top: 0; left: 0; right: 0; height: 0; }
.streak { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; color: var(--pop); font-weight: 700; }

/* toast for haptic/voice fallback */
.toast { position: absolute; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: var(--card-2); border: 1px solid var(--line); color: var(--text);
  padding: 10px 16px; border-radius: 99px; font-size: 13px; z-index: 60; opacity: 0;
  transition: opacity .25s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; }

/* ============================================================
   SIDEBAR — off-canvas LEFT drawer
   ============================================================ */
.scrim {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none; transition: opacity .26s ease; z-index: 80;
}
.scrim.show { opacity: 1; pointer-events: auto; }

.sidebar {
  position: absolute; top: 0; left: 0; height: 100%;
  width: 264px; max-width: 84%;
  background: var(--bg-2); border-right: 1px solid var(--line);
  transform: translateX(-100%); transition: transform .26s ease;
  z-index: 90; box-shadow: 18px 0 50px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column;
}
.sidebar.open { transform: translateX(0); }

.sb-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 46px 16px 12px; border-bottom: 1px solid var(--line);
}
.sb-head .brand { font-family: "Instrument Sans"; font-weight: 700; font-size: 15px; letter-spacing: 3px; text-transform: uppercase; }

.sb-nav { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.sb-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--text); cursor: pointer;
  padding: 13px 14px; border-radius: 12px;
  font-family: "Instrument Sans"; font-weight: 600; font-size: 15px;
  transition: background .12s;
}
.sb-ico { font-size: 18px; width: 22px; text-align: center; }
.sb-item:hover { background: var(--card-2); }
.sb-item:focus-visible { outline: 2px solid var(--flame-2); outline-offset: 2px; }
.sb-item.active {
  background: linear-gradient(135deg, rgba(255,85,0,.14), rgba(196,77,255,.16));
  font-weight: 700; box-shadow: inset 3px 0 0 var(--flame-2);
}

.sb-foot { margin-top: auto; padding: 14px; }
.sb-update {
  display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; color: var(--muted);
}
.sb-update b { color: var(--text); font-size: 13px; font-weight: 700; }
.sb-update span { font-size: 11px; }

/* post-cook feedback — display emoji + interactive half-star rating */
.rate-emoji { font-size: 40px; text-align: center; margin: 4px 0 6px; }
.stars { display: flex; gap: 6px; justify-content: center; }
.star { position: relative; width: 34px; height: 34px; font-size: 32px; line-height: 34px; display: inline-block; }
.star-bg { position: absolute; inset: 0; color: var(--line); }
.star-fill { position: absolute; inset: 0; width: 0; overflow: hidden; color: var(--gold); }
.star-fill > span { position: absolute; left: 0; top: 0; }
.star .half { position: absolute; top: 0; width: 50%; height: 100%; background: transparent; border: 0; cursor: pointer; padding: 0; }
.star .half:first-of-type { left: 0; }
.star .half:last-of-type { right: 0; }
.rate-val { text-align: center; font-size: 13px; color: var(--muted); margin-top: 8px; font-weight: 600; }
.cook-photo { width: 100%; max-height: 200px; object-fit: cover; border-radius: 16px; margin-top: 12px; border: 1px solid var(--line); }

/* editable profile rows */
.prow { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.prow:last-child { border-bottom: 0; }
.pval { display: flex; align-items: center; gap: 10px; }
.pval > span { color: var(--text); font-weight: 600; }
.pedit { background: var(--card-2); border: 1px solid var(--line); color: var(--flame-2);
  font-family: "Instrument Sans"; font-weight: 700; font-size: 12px; padding: 5px 13px;
  border-radius: 99px; cursor: pointer; transition: border-color .12s; }
.pedit:hover { border-color: var(--flame-2); }
.pedit:focus-visible { outline: 2px solid var(--flame-2); outline-offset: 2px; }

/* confirm dialog */
.confirm-scrim { position: absolute; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.6); padding: 24px; opacity: 0; transition: opacity .18s; }
.confirm-scrim.show { opacity: 1; }
.confirm-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; width: 100%; max-width: 300px; text-align: center; box-shadow: var(--shadow); }
.confirm-box p { font-size: 16px; font-weight: 600; margin-bottom: 16px; line-height: 1.4; }
.confirm-box .btn-row .btn { flex: 1; }

/* portion selector (e.g. # of eggs) */
.portion { display: flex; gap: 10px; }
.pchip { flex: 1; background: var(--card); border: 1.5px solid var(--line); color: var(--text);
  font-family: "Instrument Sans", sans-serif; font-weight: 700; font-size: 18px; padding: 14px 0;
  border-radius: var(--radius-sm); cursor: pointer; transition: border-color .12s, background .12s; }
.pchip:hover { border-color: var(--flame-2); }
.pchip.on { border-color: var(--flame-2); background: linear-gradient(135deg, rgba(255,85,0,.14), rgba(196,77,255,.16)); }
/* recipe-aware pan picker: unsuitable / unowned pans are grayed + non-clickable */
.pchip.disabled { opacity: .42; cursor: not-allowed; border-style: dashed; }
.pchip.disabled:hover { border-color: var(--line); }
.pchip .pchip-why { display: block; font-size: 10px; font-weight: 600; color: var(--muted); margin-top: 2px; }

/* redirect URI (Spotify setup) */
.redirect { display: block; margin-top: 8px; padding: 10px 12px; background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); color: var(--flame-2); font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }

/* Spotify library panel */
.sp-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sp-tabs { display: flex; gap: 6px; }
.sp-tab { flex: 1; background: var(--card); border: 1.5px solid var(--line); color: var(--muted);
  font-family: "Instrument Sans", sans-serif; font-weight: 700; font-size: 12px; padding: 8px 4px;
  border-radius: var(--radius-sm); cursor: pointer; transition: border-color .12s, color .12s; }
.sp-tab.active { border-color: var(--flame-2); color: var(--text); }

/* Cook-prep Spotify music picker — track rows, queue, shuffle toggle */
.sp-trackrow { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 6px; }
.sp-art { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 6px; object-fit: cover;
  background: var(--card-2); display: inline-grid; place-items: center; font-size: 16px; }
.sp-art.ph { color: var(--muted); }
.sp-trackrow .sp-tname { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-trackrow .sp-tacts { display: flex; gap: 6px; flex: 0 0 auto; }
.mini { background: var(--card-2); border: 1px solid var(--line); color: var(--text); font-weight: 700;
  font-size: 11px; padding: 5px 9px; border-radius: 9px; cursor: pointer; white-space: nowrap; transition: border-color .12s; }
.mini:hover { border-color: var(--flame-2); }
.sp-toggle { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--text); cursor: pointer; }
.sp-toggle input { width: 16px; height: 16px; accent-color: var(--flame-2); }
.qlist { list-style: none; margin: 6px 0 0; padding: 0; }
.qlist li { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 7px 0; border-top: 1px solid var(--line); }
.qlist li.dragging { opacity: 0.45; }
.qlist li.dragover { border-top: 2px solid var(--flame-2); }
.qlist .qhandle { flex: 0 0 auto; color: var(--muted); cursor: grab; font-size: 15px; line-height: 1; user-select: none; }
.qlist li:active .qhandle { cursor: grabbing; }
.qlist .sp-art { width: 26px; height: 26px; border-radius: 5px; font-size: 13px; }
.qlist .qname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qlist .qx { flex: 0 0 auto; background: none; border: 0; color: #ff6b6b; cursor: pointer; font-size: 13px; padding: 2px 6px; }

/* In-cook Spotify now-playing bar */
.sp-bar { display: flex; align-items: center; gap: 8px; padding: 6px 14px;
  background: rgba(29, 185, 84, 0.08); border: 1px solid rgba(29, 185, 84, 0.22);
  border-radius: 10px; margin: 6px 20px 0; font-size: 12px; color: var(--text); }
.sp-bar .sp-track { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-bar .sp-playbtn { font-size: 14px; width: 28px; height: 28px; min-width: 28px; }

/* Connect-your-music = a PREMIUM-gated feature → gold styling so it reads as paid */
.connect-music-btn { width: 100%; padding: 14px; background: rgba(255,213,107,.10); border: 1.5px solid rgba(255,213,107,.45);
  border-radius: var(--radius); color: var(--gold); font-family: "Instrument Sans", sans-serif; font-weight: 700;
  font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 8px; }
.connect-music-btn:hover { border-color: var(--gold); background: rgba(255,213,107,.18); }
.connect-music-btn .cm-prem { font-size: 10px; font-weight: 800; letter-spacing: .5px; color: #1a0f06;
  background: var(--gold); padding: 3px 9px; border-radius: 99px; }
[data-theme="light"] .connect-music-btn { color: #a87b00; background: rgba(168,123,0,.10); border-color: rgba(168,123,0,.4); }
[data-theme="light"] .connect-music-btn:hover { border-color: #a87b00; background: rgba(168,123,0,.16); }
/* premium user, just needs to connect Spotify → green (not a paywall) */
.connect-music-btn.have-premium { color: #1db954; background: rgba(29,185,84,.10); border-color: rgba(29,185,84,.5); }
.connect-music-btn.have-premium:hover { border-color: #1db954; background: rgba(29,185,84,.16); }

/* session log (dev) */
.logcard { margin-bottom: 10px; }
.logcomment { color: var(--text); font-size: 13px; line-height: 1.45; margin: 8px 0 0; background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 11px; }
.loglist { margin-top: 8px; }
.loglist li { font-size: 12px; padding: 5px 0; }

/* settings toggles */
.choice.toggle { justify-content: flex-start; }
.sw { font-size: 12px; font-weight: 800; padding: 4px 11px; border-radius: 99px;
  background: var(--card-2); color: var(--muted); letter-spacing: .5px; }

@media (max-width: 420px) { .phone { border-radius: 0; border-width: 0; height: 100vh; max-height: 100vh; } .notch{ display:none } body{ padding:0 } .env-note{ display:none } }
