/* Neeve Studio — clean, and always light (like neeve.com.au), whatever the device's dark-mode setting.
   Neeve Studio — clean. Off-white, black text, one green, thin lines. No shadows, no boxes inside boxes.
   Type: Jost for everything, Cormorant italic only for a product's name, Apricosa only for the wordmark. */
@font-face { font-family: "Cormorant"; src: url(/fonts/CormorantGaramond-VF.ttf) format("truetype"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url(/fonts/CormorantGaramond-Italic-VF.ttf) format("truetype"); font-style: italic; font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Jost"; src: url(/fonts/Jost-VF.ttf) format("truetype"); font-weight: 100 900; font-display: swap; }
/* the swash n is U+E031, set as that one glyph; never turn on ss01 for a word */
@font-face { font-family: "Apricosa"; src: url(/fonts/Apricosa-Regular.woff) format("woff"); font-display: block; }

:root {
  --bg: #fbfaf7; --surface: #ffffff; --line: #ebe7df; --line-2: #ddd8cd;
  --ink: #1d1c1a; --ink-2: #4b4842; --muted: #8a867d;
  --accent: #2f5a4c; --accent-soft: #eef4f1; --on-accent: #fff;
  --bad: #a3392b; --bad-soft: #fbeeec; --gold: #8a6a2c; --gold-soft: #f8f2e3;
  --side: #f4f1ea; --side-on: #e7e2d8; --dev: #c9a24a;
  --radius: 12px; --bar: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.55 "Jost", -apple-system, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; overflow-wrap: anywhere; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-weight: 500; line-height: 1.2; }
h1 { font-size: 28px; letter-spacing: -.01em; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0; }
a { color: var(--accent); }
.muted { color: var(--muted); } .small { font-size: 14px; } .num { font-variant-numeric: tabular-nums; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wordmark { font: 400 26px/1 "Apricosa", Georgia, serif; color: var(--accent); }
.wordmark.big { font-size: 56px; }
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.script { font-family: "Cormorant", Georgia, serif; font-style: italic; font-weight: 500; }

/* ---------- controls ---------- */
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); font-size: 17px; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--ink-2); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 500; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.ghost, .btn.sage { background: transparent; border-color: transparent; color: var(--accent); padding: 0 10px; }
.btn.danger { color: var(--bad); }
.btn.big { min-height: 54px; font-size: 18px; }
.btn:disabled { opacity: .45; }
.icon-btn { width: 46px; height: 46px; display: inline-grid; place-items: center; border-radius: 999px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; white-space: nowrap; cursor: pointer; font-size: 15px; color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tag { display: inline-block; white-space: nowrap; padding: 1px 9px; border-radius: 999px; font-size: 13px; background: var(--line); color: var(--ink-2); }
.tag.successful, .tag.done { background: var(--accent-soft); color: var(--accent); }
.tag.testing, .tag.in_progress, .tag.idea { background: var(--gold-soft); color: var(--gold); }
.tag.failed, .tag.discarded { background: var(--bad-soft); color: var(--bad); }

/* ---------- shell: one thin bar at the top ---------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px; height: calc(var(--bar) + var(--safe-t)); padding: var(--safe-t) 16px 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .wordmark { text-decoration: none; margin-right: auto; padding-right: 12px; }
.topbar a.tab { padding: 8px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: 16px; min-height: 40px; display: inline-flex; align-items: center; }
.topbar a.tab[aria-current="page"] { background: var(--ink); color: var(--bg); }
.menu { position: relative; }
.menu > button { border: 0; background: none; width: 40px; height: 40px; border-radius: 999px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; }
.menu-list { position: absolute; right: 0; top: 46px; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; }
.menu-list a, .menu-list button { display: block; text-align: left; padding: 12px 14px; border-radius: 8px; color: var(--ink); text-decoration: none; border: 0; background: none; cursor: pointer; font-size: 16px; }
.menu-list a:hover, .menu-list button:hover { background: var(--line); }
@media (max-width: 520px) { .topbar a.tab { padding: 8px 10px; font-size: 15px; } .topbar .wordmark { font-size: 22px; } }

.view { max-width: 820px; margin: 0 auto; padding: 24px 18px calc(48px + var(--safe-b)); }
.view.wide { max-width: 1040px; }

/* ---------- lists: plain rows with thin dividers ---------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.search { margin-bottom: 12px; }
.list { display: grid; }
.row { display: grid; gap: 2px; padding: 14px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; min-height: 60px; align-content: center; }
.row:first-child { border-top: 1px solid var(--line); }
.row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.row-title { font-size: 17px; }
.row-sub { font-size: 14px; color: var(--muted); }
.group-title { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 22px 4px 8px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }
.back-link { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; min-height: 44px; font-size: 16px; margin: -8px 0 8px -6px; }

/* the old list + detail helper, now one thing per screen */
.split { display: grid; }
.pane-list, .pane-detail { min-width: 0; }
.split.has-detail .pane-list { display: none; }
.split:not(.has-detail) .pane-detail { display: none; }
.pane-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pane-head h1 { font-size: 28px; }
.pane-list > .back-link { display: none; }

/* ---------- a page (recipe, ingredient) ---------- */
.page { display: grid; gap: 28px; }
.page-title { font: italic 500 44px/1.05 "Cormorant", Georgia, serif; }
.page-top { display: grid; gap: 6px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.section { display: grid; gap: 8px; }
.section > h2 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .num { white-space: nowrap; text-align: right; }
.phase-label { font-size: 13px; color: var(--muted); padding: 12px 0 0; }
.prose { white-space: pre-wrap; color: var(--ink-2); }
.fact { display: grid; gap: 2px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fact h3 { font-size: 13px; color: var(--muted); font-weight: 400; }
details.fold > summary { cursor: pointer; list-style: none; min-height: 44px; display: flex; align-items: center; color: var(--accent); }
details.fold > summary::-webkit-details-marker { display: none; }
.doc-text { white-space: pre-wrap; overflow-wrap: anywhere; font: 15px/1.55 "Jost", system-ui, sans-serif; color: var(--ink-2); margin: 0; }
.note { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.note-when { font-size: 13px; color: var(--muted); }
.note img { max-width: 100%; border-radius: 10px; }
.note-tools { display: flex; align-items: center; gap: 8px; }
.note-tools .grow, .grow { flex: 1; }
.cam { cursor: pointer; }

/* ---------- Ask: the conversation ---------- */
.ask { display: grid; grid-template-rows: 1fr auto; min-height: calc(100dvh - var(--bar) - var(--safe-t)); max-width: 760px; margin: 0 auto; }
.ask-thread { padding: 24px 18px 12px; display: grid; gap: 22px; align-content: start; }
.ask-hello { padding: 12vh 4px 0; display: grid; gap: 10px; }
.ask-hello h1 { font: italic 500 40px/1.1 "Cormorant", Georgia, serif; }
.ask-hello p { color: var(--muted); }
.ask-starters { display: grid; gap: 8px; margin-top: 18px; }
.ask-starters button { text-align: left; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: transparent; cursor: pointer; color: var(--ink-2); }
.msg { display: grid; gap: 6px; }
.msg.you { justify-items: end; }
.msg.you .bubble { background: var(--line); border-radius: 18px 18px 4px 18px; padding: 10px 16px; max-width: 85%; white-space: pre-wrap; }
.msg.ai .bubble { line-height: 1.6; }
.msg.ai .bubble p { margin: 0 0 10px; }
.msg.ai .bubble ul, .msg.ai .bubble ol { margin: 0 0 10px; padding-left: 22px; }
.msg.ai .bubble table { border-collapse: collapse; width: 100%; margin: 6px 0 12px; font-size: 15px; }
.msg.ai .bubble th, .msg.ai .bubble td { border-bottom: 1px solid var(--line); padding: 6px 8px 6px 0; text-align: left; vertical-align: top; }
.msg.ai .bubble th { font-weight: 500; color: var(--muted); font-size: 13px; }
.msg.ai .bubble h3 { font-size: 17px; margin: 14px 0 6px; }
.msg .did { font-size: 14px; color: var(--muted); }
.msg .saved a { display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); text-decoration: none; font-size: 15px; }
.thinking { color: var(--muted); font-style: italic; }
.ask-box { position: sticky; bottom: 0; padding: 10px 14px calc(14px + var(--safe-b)); background: linear-gradient(transparent, var(--bg) 30%); }
.ask-box form { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--line-2); border-radius: 22px; background: var(--surface); padding: 6px 6px 6px 16px; }
.ask-box textarea { border: 0; min-height: 44px; max-height: 40vh; padding: 10px 0; resize: none; background: transparent; }
.ask-box textarea:focus { outline: none; }
.ask-box .send { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; flex: none; }
.ask-box .send:disabled { opacity: .35; }
.ask-tools { display: flex; justify-content: space-between; padding: 6px 8px 0; font-size: 14px; }
.ask-tools button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 6px 0; }

/* ---------- forms and the older screens (editor, batch sheet) ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stack { display: grid; gap: 16px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.grid3 { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .grid3 { grid-template-columns: 1fr 1fr; } }
.detail-head { display: grid; gap: 6px; }
.detail-head .meta, .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.title-input { font: italic 500 34px/1.1 "Cormorant", Georgia, serif; border: 0; background: transparent; padding: 4px 0; min-height: 52px; }
.title-input:focus { outline: none; border-bottom: 1px solid var(--accent); border-radius: 0; }
textarea[rows="1"] { min-height: 48px; resize: none; overflow: hidden; }
.actionbar { position: sticky; bottom: calc(12px + var(--safe-b)); z-index: 10; display: flex; gap: 8px; align-items: center; padding: 8px; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line-2); border-radius: 999px; margin-top: 20px; }
.actionbar .grow { flex: 1; min-width: 0; padding-left: 8px; font-size: 14px; color: var(--muted); }
.phase { display: grid; gap: 8px; }
.phase-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phase-head h3 { font-size: 15px; color: var(--muted); font-weight: 500; }
.line { display: grid; grid-template-columns: 1fr 96px 46px; grid-template-areas: "name pct del" "info info info"; gap: 6px 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.line .l-name { grid-area: name; } .line .l-pct { grid-area: pct; } .line .l-del { grid-area: del; }
.line .l-info { grid-area: info; display: flex; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.line.over .l-info { color: var(--bad); }
.line .warn { color: var(--bad); }
.pct-wrap { position: relative; }
.pct-wrap input { padding-right: 28px; text-align: right; }
.pct-wrap::after { content: "%"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.g-wrap::after { content: "g"; }
.totals { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
@media (max-width: 560px) { .totals { grid-template-columns: 1fr 1fr; } }
.totals > div { padding: 12px 4px; display: grid; gap: 2px; }
.totals .k { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.totals .v { font-size: 20px; font-variant-numeric: tabular-nums; }
.totals .v.bad { color: var(--bad); } .totals .v.good { color: var(--accent); }
.picker { position: relative; }
.picker-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; }
.picker-list button { display: grid; width: 100%; text-align: left; padding: 10px 14px; min-height: 50px; border: 0; border-bottom: 1px solid var(--line); background: none; cursor: pointer; }
.picker-list button small { color: var(--muted); font-size: 13px; }
.weigh { display: grid; grid-template-columns: 56px 1fr 120px; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.weigh .tick { width: 52px; height: 52px; border-radius: 999px; border: 1.5px solid var(--line-2); background: transparent; display: grid; place-items: center; cursor: pointer; color: transparent; }
.weigh.done .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.weigh.done .w-name { color: var(--muted); }
.weigh .w-target { font-size: 14px; color: var(--muted); }
.weigh .w-off { color: var(--bad); }
.progress { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.photo-add { aspect-ratio: 1; border: 1px dashed var(--line-2); border-radius: 10px; display: grid; place-items: center; color: var(--muted); cursor: pointer; min-height: 96px; }
.saved-dot { font-size: 13px; color: var(--accent); }
.price-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.price-row:first-child { border-top: 0; }
.price-amt { text-align: right; white-space: nowrap; }
.add-price summary { list-style: none; display: inline-flex; }
.add-price summary::-webkit-details-marker { display: none; }
.form-error { color: var(--bad); font-size: 15px; }
.note-fab-wrap { position: fixed; right: 16px; bottom: calc(84px + var(--safe-b)); z-index: 25; display: grid; justify-items: end; gap: 10px; }
.note-fab { min-height: 50px; min-width: 88px; border-radius: 999px; border: 0; background: var(--ink); color: var(--bg); font-size: 16px; cursor: pointer; }
.note-sheet { width: min(420px, calc(100vw - 32px)); display: grid; gap: 10px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--safe-b)); z-index: 50; background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 15px; max-width: calc(100% - 32px); }

/* ---------- sign in ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(380px, 100%); display: grid; gap: 16px; }
.login-brand { display: flex; justify-content: center; }
.login-card .eyebrow { text-align: center; margin-top: -8px; }
.view.ask-view { max-width: none; padding: 0; }

/* ======================================================================
   The workspace: products | what's open | the AI
   ====================================================================== */
.ws { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
.mid { min-width: 0; }
.mid .view { max-width: 760px; }
.side { background: var(--side); border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: calc(16px + var(--safe-t)) 12px calc(12px + var(--safe-b)); gap: 10px; }
.side-mark { padding: 2px 8px 6px; text-decoration: none; font-size: 30px; }
.side-new { justify-content: flex-start; min-height: 42px; font-size: 15px; }
.side-search { min-height: 40px; font-size: 15px; padding: 8px 12px; background: transparent; }
.side-list { flex: 1; overflow-y: auto; min-height: 0; margin: 0 -4px; padding: 0 4px; }
.side-sec { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding: 14px 8px 4px; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; min-height: 40px; }
.side-item.on { background: var(--side-on); }
.side-name { min-width: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--line-2); }
.dot.developing { background: var(--dev); }
.dot.ready { background: var(--accent); }
.side-nav { display: grid; border-top: 1px solid var(--line-2); padding-top: 8px; }
.side-nav a { padding: 10px 8px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 16px; }
.side-nav a.on { background: var(--side-on); color: var(--ink); }
.side-out { border: 0; background: none; color: var(--muted); text-align: left; padding: 8px; cursor: pointer; font-size: 15px; }
.side-foot { display: grid; border-top: 1px solid var(--line-2); padding-top: 8px; }
.side-foot a, .side-foot button { padding: 9px 8px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: 15px; border: 0; background: none; text-align: left; cursor: pointer; }
.side-foot a.on { background: var(--side-on); color: var(--ink); }
.side-foot button { color: var(--muted); }

.mbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: calc(56px + var(--safe-t)); padding: var(--safe-t) 10px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.mbar .wordmark { font-size: 24px; text-decoration: none; }
.mbar-btn { min-width: 44px; height: 44px; border: 0; background: none; border-radius: 999px; display: grid; place-items: center; color: var(--ink-2); cursor: pointer; font: 500 15px "Jost", sans-serif; }
.ai-btn { background: var(--accent); color: var(--on-accent); padding: 0 16px; }

.ai { background: var(--surface); border-left: 1px solid var(--line); display: grid; grid-template-rows: auto 1fr auto; min-height: 0; }
.ai-head { display: flex; align-items: center; gap: 10px; padding: calc(14px + var(--safe-t)) 16px 12px; border-bottom: 1px solid var(--line); }
.ai-title { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbtn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 6px 0; font-size: 15px; }
.ai-thread { overflow-y: auto; padding: 16px; display: grid; gap: 16px; align-content: start; min-height: 0; }
.ai-hello { color: var(--ink-2); display: grid; gap: 12px; padding-top: 8px; }
.ai-starters { display: grid; gap: 8px; }
.ai-starters button { text-align: left; padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: transparent; cursor: pointer; color: var(--ink-2); font-size: 15px; }
.ai .msg.you .bubble { max-width: 90%; font-size: 15px; }
.ai .msg.ai .bubble { font-size: 15px; }
.ai-box { display: flex; gap: 8px; align-items: flex-end; margin: 10px 12px calc(12px + var(--safe-b)); border: 1px solid var(--line-2); border-radius: 20px; padding: 5px 5px 5px 14px; background: var(--bg); }
.ai-box textarea { border: 0; min-height: 40px; max-height: 220px; padding: 8px 0; resize: none; background: transparent; font-size: 16px; }
.ai-box textarea:focus { outline: none; }
.ai-box .send { width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; cursor: pointer; flex: none; }
.ai-box .send:disabled { opacity: .35; }
.scrim { position: fixed; inset: 0; background: rgba(20, 18, 14, .32); z-index: 39; }

.state { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; background: var(--line); color: var(--ink-2); }
.state.developing { background: var(--gold-soft); color: var(--gold); }
.state.ready { background: var(--accent-soft); color: var(--accent); }
.banner { padding: 10px 14px; border-radius: 10px; background: var(--gold-soft); color: var(--ink-2); font-size: 15px; }
.kv.link { color: inherit; text-decoration: none; }
.note-form { display: grid; gap: 8px; }
.note-form textarea { min-height: 64px; }
.note.change { color: var(--muted); }
details.fold { border-top: 1px solid var(--line); }

/* wide (13" iPad landscape, Mac): all three side by side, each scrolls on its own */
@media (min-width: 1000px) {
  .ws { grid-template-columns: 240px minmax(0, 1fr) minmax(320px, 380px); height: 100dvh; overflow: hidden; }
  .side, .mid, .ai { height: 100dvh; }
  .mid { overflow-y: auto; }
  .mbar, .ai-close { display: none; }
  .scrim { display: none; }
}
/* narrower (iPad portrait, phone): the products and the AI slide in */
@media (max-width: 999px) {
  .side { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; }
  .ai { position: fixed; z-index: 40; top: 0; bottom: 0; right: 0; width: min(460px, 100vw); transform: translateX(102%); transition: transform .22s ease; height: 100dvh; }
  .side-open .side, .ai-open .ai { transform: none; }
}

/* Ingredients table: the basics on one line each, tap a row for the full page */
.view.wide { container-type: inline-size; }
.itable { width: 100%; border-collapse: collapse; font-size: 16px; margin-top: 8px; }
.itable th { text-align: left; font-weight: 500; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 0 10px 8px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.itable th button { all: unset; cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; }
.itable th button[aria-pressed="true"] { color: var(--ink); }
.itable th button[aria-pressed="true"]::after { content: " ↓"; }
.itable td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.itable tbody tr { cursor: pointer; }
.itable tbody tr:hover, .itable tbody tr:focus-visible { background: var(--side); outline: none; }
.itable .c-name a { color: var(--ink); text-decoration: none; font-weight: 500; }
.itable .c-sub { display: none; font-size: 14px; color: var(--muted); }
.itable .c-type { color: var(--ink-2); white-space: nowrap; }
.itable td.c-does { color: var(--ink-2); font-size: 15px; }
.itable .c-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.itable .c-unit { color: var(--muted); font-size: 13px; }
.itable th:first-child, .itable td:first-child { padding-left: 0; }
.itable th:last-child, .itable td:last-child { padding-right: 0; }
/* narrow: drop the description, then fold the type under the name */
@container (max-width: 640px) { .itable .c-does { display: none; } }
@container (max-width: 460px) { .itable .c-type, .itable .c-max { display: none; } .itable .c-sub { display: block; } }

/* ingredients: add / fill / copy (15 Nov 2026) */
.ing-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.ing-tools .btn { flex: 1 1 auto; }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn .count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: 13px; font-weight: 600; }
label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; }
label.check input { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.fill-bar { position: fixed; z-index: 60; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); max-width: 560px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 10px 10px 18px; background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px; box-shadow: 0 8px 30px rgba(0,0,0,.12); }
.fill-text { flex: 1 1 200px; min-width: 0; font-size: 15px; color: var(--ink-2); }
.fill-track { order: 3; flex: 1 0 100%; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.fill-track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.copy-sheet { position: fixed; inset: 0; z-index: 70; display: grid; place-items: end center; padding: 12px; padding-bottom: calc(12px + var(--safe-b)); background: rgba(0,0,0,.25); }
.copy-box { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 8px; padding: 16px; background: var(--surface); border-radius: 18px; }
.copy-box textarea { height: 50vh; font: 14px/1.5 ui-monospace, Menlo, monospace; }
/* while the fill bar is up, the sticky Save bar sits above it rather than under it */
body.filling .actionbar { bottom: calc(96px + var(--safe-b)); }

/* Ingredients table view (like her Google Sheet), 15 Nov 2026 */
@media (min-width: 1000px) {
  body.table-mode .ws { grid-template-columns: 240px minmax(0, 1fr) 0; }
  body.table-mode .ai { display: none; }
}
body.table-mode .view.wide { max-width: none; }
.tview .pane-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.t-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.t-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; min-height: 46px; }
.t-bar .t-count { margin-right: auto; }
.t-colpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; margin-bottom: 10px; }
.t-wrap { overflow: auto; max-height: calc(100dvh - 250px); border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--surface); -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.ttable { border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.4; }
.ttable th, .ttable td { padding: 8px 10px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); vertical-align: top; text-align: left; background: var(--surface); }
.ttable thead th { position: sticky; top: 0; z-index: 2; background: var(--side); font-weight: 500; }
.ttable thead tr.t-filters th { top: 44px; padding: 4px 6px 6px; }
.ttable thead th button { all: unset; cursor: pointer; display: flex; align-items: center; min-height: 28px; font-size: 13px; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.ttable thead input { width: 100%; min-width: 0; min-height: 36px; padding: 4px 8px; font-size: 14px; border-radius: 8px; }
.ttable .t-name { position: sticky; left: 44px; z-index: 1; min-width: 170px; max-width: 220px; font-weight: 500; box-shadow: 1px 0 0 var(--line-2); }
.ttable .t-tick { position: sticky; left: 0; z-index: 1; width: 44px; min-width: 44px; text-align: center; padding: 0; }
.ttable thead .t-name, .ttable thead .t-tick { z-index: 3; }
.ttable .t-tick input { width: 22px; height: 22px; margin: 10px 0; accent-color: var(--accent); }
.ttable .t-name a { color: var(--ink); text-decoration: none; display: block; min-height: 28px; }
.ttable .t-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ttable .t-empty { color: var(--line-2); }
.ttable tbody tr:hover td { background: var(--bg); }
.t-added { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; background: var(--gold-soft); color: var(--gold); font-size: 11px; font-style: normal; vertical-align: 1px; }
@media (max-width: 600px) { .ttable .t-name { min-width: 130px; max-width: 150px; } .t-wrap { max-height: calc(100dvh - 300px); } }
