/* Cook With Kenyon — brand-matched (light, warm, Kenyon orange) */
:root {
  --bg: #ffffff;
  --bg-2: #f7f3ee;
  --surface: #ffffff;
  --surface-2: #f3ede4;
  --line: #ece4d8;
  --espresso: #2c2721;      /* Kenyon dark */
  --text: #2c2721;
  --muted: #6f665c;
  --faint: #a89d8f;
  --orange: #f7941d;        /* Kenyon accent */
  --orange-2: #ffb04d;
  --orange-ink: #b3660a;
  --gold: #dd9933;
  --radius: 16px;
  --topbar-h: 56px;
  --tabbar-h: 62px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --shadow: 0 6px 20px rgba(44, 39, 33, .08);
  font-family: "Outfit", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; background: var(--bg); color: var(--text); }
body { overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

#app { min-height: 100%; }

/* ---------- Top bar (espresso, white logo) ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: calc(var(--topbar-h) + var(--sat));
  padding-top: var(--sat);
  display: flex; align-items: center; gap: 8px; padding-left: 16px; padding-right: 16px;
  background: var(--espresso);
  box-shadow: 0 2px 14px rgba(44, 39, 33, .18);
}
.brand { display: flex; align-items: center; height: 100%; }
.brand-logo { height: 26px; width: auto; }
.brand-fallback { display: flex; flex-direction: column; line-height: 1; color: #fff; }
.brand-fallback .e { font-size: 9px; letter-spacing: 3px; color: var(--orange-2); font-weight: 700; margin-bottom: 3px; }
.brand-fallback .w { font-size: 20px; letter-spacing: 5px; font-weight: 800; }
.topbar-spacer { flex: 1; }
.back-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; }
.back-btn svg { width: 20px; height: 20px; }

/* ---------- Tab bar (white, orange active) ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  height: calc(var(--tabbar-h) + var(--sab));
  padding-bottom: var(--sab);
  display: flex; align-items: stretch;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: .2px; transition: color .15s; }
.tab svg { width: 23px; height: 23px; }
.tab.is-active { color: var(--orange); }

/* ---------- View / scroll area ---------- */
.view {
  padding-top: calc(var(--topbar-h) + var(--sat));
  padding-bottom: calc(var(--tabbar-h) + var(--sab));
  min-height: 100vh;
}
.pad { padding: 16px; }
.section-title { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin: 4px 2px 14px; }
.eyebrow { color: var(--orange); font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }

/* ---------- Search + chips ---------- */
.searchbar { position: relative; margin: 8px 0 12px; }
.searchbar input {
  width: 100%; height: 46px; border-radius: 12px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); padding: 0 14px 0 42px; font-size: 15px; outline: none;
}
.searchbar input::placeholder { color: var(--faint); }
.searchbar input:focus { border-color: var(--orange); background: #fff; }
.searchbar svg { position: absolute; left: 13px; top: 13px; width: 20px; height: 20px; color: var(--faint); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 8px 15px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; }
.chip.is-active { background: var(--orange); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(247,148,29,.32); }

/* ---------- Recipe grid ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.card { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card .thumb { aspect-ratio: 1/1; width: 100%; object-fit: cover; background: var(--surface-2); }
.card .cbody { padding: 11px 12px 13px; }
.card .ctitle { font-size: 14px; font-weight: 700; line-height: 1.25; letter-spacing: -.2px; }
.card .cmeta { margin-top: 6px; font-size: 11px; color: var(--faint); }
.card .badge { position: absolute; top: 9px; left: 9px; padding: 4px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .3px; background: rgba(44,39,33,.72); color: #fff; backdrop-filter: blur(6px); text-transform: uppercase; }
.card:active { transform: scale(.985); }

/* ---------- Recipe detail ---------- */
.hero { position: relative; margin-top: calc(-1 * (var(--topbar-h) + var(--sat))); }
.hero img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.hero .scrim { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(44,39,33,.35) 0%, rgba(44,39,33,0) 40%, rgba(255,255,255,.0) 78%, var(--bg) 100%); }
.detail { padding: 0 16px 24px; margin-top: -30px; position: relative; }
.detail h1 { font-size: 27px; font-weight: 800; letter-spacing: -.6px; line-height: 1.12; margin: 0 0 8px; }
.detail .desc { color: var(--muted); font-size: 15px; line-height: 1.55; margin-bottom: 16px; }
.metarow { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 18px; }
.pill { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; font-size: 12px; color: var(--muted); font-weight: 600; }
.pill b { color: var(--text); }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; padding: 10px; border-radius: 9px; font-size: 14px; font-weight: 700; color: var(--muted); }
.seg button.is-active { background: var(--orange); color: #fff; box-shadow: 0 3px 10px rgba(247,148,29,.3); }
.ing-row { display: flex; align-items: baseline; gap: 12px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.ing-row:last-child { border-bottom: 0; }
.ing-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--orange); flex: 0 0 auto; transform: translateY(-2px); }
.ing-row span { font-size: 15px; line-height: 1.4; }
.step { display: flex; gap: 14px; padding: 13px 0; }
.step .num { flex: 0 0 auto; width: 29px; height: 29px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(247,148,29,.3); }
.step p { margin: 3px 0 0; font-size: 15px; line-height: 1.55; color: var(--text); }
.ask-cta { position: sticky; bottom: calc(var(--tabbar-h) + var(--sab) + 12px); margin-top: 22px; }
.ask-cta button { width: 100%; height: 52px; border-radius: 14px; background: var(--orange); color: #fff; font-weight: 700; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 10px 26px rgba(247,148,29,.38); }

/* ---------- Product detail ---------- */
.pgallery { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 14px; scrollbar-width: none; }
.pgallery::-webkit-scrollbar { display: none; }
.pgallery img { flex: 0 0 auto; width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); }
.seg-title { font-size: 13px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--orange); margin: 6px 0 10px; }
.spectable { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 20px; }
.specrow { display: flex; justify-content: space-between; gap: 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.specrow:last-child { border-bottom: 0; }
.specrow:nth-child(odd) { background: var(--surface-2); }
.speck { color: var(--muted); font-weight: 600; }
.specv { color: var(--text); font-weight: 700; text-align: right; }
.prod-actions { display: flex; gap: 10px; }
.btn-ghost, .btn-solid { flex: 1; height: 50px; border-radius: 13px; display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 700; font-size: 14.5px; text-decoration: none; }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.btn-solid { background: var(--orange); color: #fff; box-shadow: 0 8px 22px rgba(247,148,29,.32); }

/* ---------- Manuals ---------- */
.mrow { display: flex; align-items: center; gap: 14px; padding: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.mrow .micon { width: 44px; height: 44px; border-radius: 11px; background: #fff5e8; display: grid; place-items: center; color: var(--orange); flex: 0 0 auto; }
.mrow .mtitle { font-size: 15px; font-weight: 700; }
.mrow .msub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.mrow .chev { margin-left: auto; color: var(--faint); }

/* ---------- Ask the Grill (chat) ---------- */
.chat-wrap { display: flex; flex-direction: column; background: var(--bg-2);
  height: calc(100vh - var(--topbar-h) - var(--sat) - var(--tabbar-h) - var(--sab));
  height: calc(100dvh - var(--topbar-h) - var(--sat) - var(--tabbar-h) - var(--sab)); }
.chat-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 16px 8px;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.msg { max-width: 86%; padding: 12px 15px; border-radius: 18px; font-size: 15px; line-height: 1.5; margin-bottom: 12px; white-space: pre-wrap; }
.msg.user { margin-left: auto; background: var(--orange); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 4px 12px rgba(247,148,29,.28); }
.msg.bot { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.msg .src { margin-top: 8px; font-size: 12px; color: var(--orange-ink); font-weight: 700; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 2px 10px; }
.suggest button { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font-size: 13px; color: var(--muted); font-weight: 600; box-shadow: var(--shadow); }
.chat-hero { text-align: center; padding: 30px 20px 12px; }
.chat-hero .flame { font-size: 42px; }
.chat-hero h2 { font-size: 23px; margin: 10px 0 4px; font-weight: 800; }
.chat-hero p { color: var(--muted); font-size: 14px; margin: 0 auto; max-width: 280px; }
.composer { display: flex; gap: 8px; padding: 10px 12px calc(10px + var(--sab)); border-top: 1px solid var(--line); background: #fff; }
.composer input { flex: 1; height: 47px; border-radius: 24px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); padding: 0 18px; font-size: 15px; outline: none; }
.composer input:focus { border-color: var(--orange); background: #fff; }
.composer button { width: 47px; height: 47px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; flex: 0 0 auto; box-shadow: 0 4px 12px rgba(247,148,29,.34); }
.composer button:disabled { opacity: .4; }
.composer .voice-toggle { width: 47px; height: 47px; border-radius: 50%; background: var(--surface-2); color: var(--faint); box-shadow: none; }
.composer .voice-toggle.on { background: #fff5e8; color: var(--orange); }
.composer .voice-toggle svg { width: 22px; height: 22px; }
.msg.bot { position: relative; }
.speak { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.speak svg { width: 15px; height: 15px; }
.speak.on { background: var(--orange); color: #fff; }
.typing span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--faint); margin-right: 4px; animation: blink 1.2s infinite; }
.typing span:nth-child(2){ animation-delay:.2s } .typing span:nth-child(3){ animation-delay:.4s }
@keyframes blink { 0%,60%,100%{opacity:.25} 30%{opacity:1} }

/* ---------- Misc ---------- */
.empty { text-align: center; color: var(--faint); padding: 60px 20px; font-size: 15px; }
.fade-in { animation: fade .3s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
