/* Frevaro – forest, cream and paprika from the original app, refined. */
@font-face {
  font-family: "Manrope";
  src: url("/fonts/manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --bg: #f4f1e8;
  --bg-glow: #e3eee4;
  --paper: #fffdf8;
  --paper-2: #f8f6ef;
  --ink: #1b2621;
  --muted: #6b7770;
  --line: #e6e3d9;
  --forest: #2a6a50;
  --forest-dark: #174a37;
  --sage: #dceadf;
  --sage-2: #eef4ef;
  --paprika: #e46f4b;
  --paprika-soft: #fbe5dc;
  --amber: #c98f22;
  --amber-soft: #f8ecd2;
  --plum: #8a405c;
  --plum-soft: #f3e3ea;
  --danger: #b3261e;
  --on-forest: #ffffff;
  --shadow: 0 1px 2px rgba(27, 38, 33, 0.05), 0 10px 30px rgba(27, 38, 33, 0.07);
  --shadow-lift: 0 2px 6px rgba(27, 38, 33, 0.08), 0 18px 40px rgba(27, 38, 33, 0.12);
  --radius: 24px;
  --radius-sm: 16px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1411;
    --bg-glow: #15241c;
    --paper: #161f1a;
    --paper-2: #1b2620;
    --ink: #e7eee9;
    --muted: #9aa79f;
    --line: #26332c;
    --forest: #6cc49b;
    --forest-dark: #a3dcc0;
    --sage: #20372b;
    --sage-2: #1a2a22;
    --paprika: #f2896a;
    --paprika-soft: #3a2620;
    --amber: #e5b54e;
    --amber-soft: #352d1a;
    --plum: #d695b0;
    --plum-soft: #352330;
    --danger: #f2b8b5;
    --on-forest: #0b1a12;
    --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 10px 30px rgba(0, 0, 0, 0.25);
    --shadow-lift: 0 18px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 520px at 50% -180px, var(--bg-glow), transparent 70%) no-repeat, var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--forest); }
h1, h2, h3 { margin: 0; letter-spacing: -0.025em; line-height: 1.1; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 19px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 750; }
p { margin: 0; }
img { max-width: 100%; display: block; }
.boot { padding: 40vh 24px; text-align: center; color: var(--muted); }

/* ---------- layout ---------- */
.shell { max-width: 640px; margin: 0 auto; min-height: 100dvh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 32px); }
.shell.no-nav { padding-bottom: 32px; }
.page { padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 14px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 10px 2px 2px; }
.page-head .eyebrow { font-size: 13px; color: var(--muted); font-weight: 700; letter-spacing: 0.02em; margin-bottom: 4px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.strong { font-weight: 750; }
.center { text-align: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- cards ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card.tight { padding: 12px 14px; }
.card-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 4px -2px; }
.section-label { font-size: 13px; font-weight: 800; color: var(--muted); letter-spacing: 0.02em; margin: 8px 4px 0; }
.section-head .section-label { margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 15px;
  border: 1px solid var(--line); background: var(--paper); color: var(--forest);
  font-weight: 750; cursor: pointer; text-decoration: none; user-select: none;
  transition: transform 0.08s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn.primary { background: linear-gradient(160deg, var(--forest), var(--forest-dark)); border-color: transparent; color: var(--on-forest); box-shadow: 0 6px 18px color-mix(in srgb, var(--forest) 30%, transparent); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 12px; }
.btn.block { width: 100%; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 14px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; flex: none; text-decoration: none;
  transition: background 0.15s ease, transform 0.08s ease;
}
.icon-btn:active { background: var(--sage); transform: scale(0.95); }
.icon-btn.filled { background: var(--paper); border-color: var(--line); color: var(--forest); box-shadow: var(--shadow); }

/* ---------- today ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.ring { position: relative; width: 128px; height: 128px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--sage-2); }
.ring .value { stroke: var(--forest); transition: stroke-dashoffset 0.6s cubic-bezier(.2, .8, .2, 1); }
.ring.over .value { stroke: var(--paprika); }
.ring .center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.ring .center .num { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.ring .center .lbl { font-size: 11.5px; color: var(--muted); font-weight: 700; margin-top: 3px; }
.hero-stats { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stat .spread { font-size: 13.5px; margin-bottom: 5px; gap: 6px; }
.stat .spread > .muted { white-space: nowrap; }
.stat .name { font-weight: 750; display: flex; align-items: center; gap: 6px; min-width: 0; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.macro-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.macro-chip { background: var(--paper-2); border-radius: 14px; padding: 8px 11px; font-size: 15px; font-weight: 800; }
.macro-chip span { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 650; font-size: 12px; }

.hunger {
  width: 100%; border: none; border-radius: 22px; cursor: pointer; text-align: left;
  background: linear-gradient(135deg, var(--forest) 0%, var(--forest-dark) 100%); color: var(--on-forest);
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  box-shadow: 0 10px 28px color-mix(in srgb, var(--forest) 34%, transparent);
  transition: transform 0.1s ease;
  position: relative; overflow: hidden;
}
.hunger::after { content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); }
.hunger:active { transform: scale(0.985); }
.hunger .badge-icon { width: 46px; height: 46px; border-radius: 15px; background: rgba(255, 255, 255, 0.16); display: flex; align-items: center; justify-content: center; flex: none; }
.hunger .t { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.hunger .s { font-size: 13.5px; opacity: 0.85; font-weight: 600; }

.actions { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.action {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 12px 2px 10px; border-radius: 18px; border: 1px solid var(--line);
  background: var(--paper); color: var(--ink); font-size: 12.5px; font-weight: 700; cursor: pointer;
  box-shadow: var(--shadow); transition: transform 0.08s ease;
}
.action:active { transform: scale(0.95); }
.action .ic { width: 38px; height: 38px; border-radius: 13px; display: flex; align-items: center; justify-content: center; background: var(--sage); color: var(--forest-dark); }
.action.voice .ic { background: var(--paprika-soft); color: var(--paprika); }

.meal-card { cursor: pointer; display: flex; gap: 12px; align-items: center; transition: transform 0.08s ease; }
.meal-card:active { transform: scale(0.99); }
.tile { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--sage); color: var(--forest-dark); }
.tile.photo { background: var(--paprika-soft); color: var(--paprika); }
.tile.barcode { background: var(--amber-soft); color: var(--amber); }
.tile.template { background: var(--plum-soft); color: var(--plum); }
.meal-card .kcal { text-align: right; font-weight: 800; white-space: nowrap; font-size: 17px; }
.meal-card .kcal small { display: block; font-weight: 650; color: var(--muted); font-size: 12px; }

/* ---------- forms ---------- */
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper); outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--forest); box-shadow: 0 0 0 4px color-mix(in srgb, var(--forest) 15%, transparent); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; color: var(--muted); }
.input.num { width: 92px; text-align: right; }
.error-text { color: var(--danger); font-size: 14px; }

.segmented { display: flex; gap: 4px; background: var(--paper-2); border: 1px solid var(--line); padding: 4px; border-radius: 16px; }
.segmented button {
  flex: 1; min-height: 42px; border: none; border-radius: 12px; background: transparent;
  font-weight: 750; color: var(--muted); cursor: pointer; padding: 0 8px; transition: background 0.15s ease, color 0.15s ease;
}
.segmented button.on { background: var(--sage); color: var(--forest-dark); box-shadow: var(--shadow); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 7px 12px; font-size: 14px; font-weight: 650; color: var(--ink); cursor: pointer; text-align: left;
}
.chip.on { background: var(--sage); border-color: transparent; color: var(--forest-dark); }

.dictation { position: relative; display: flex; flex-direction: column; gap: 8px; }
.dictation-bar { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.mic {
  width: 48px; height: 48px; border-radius: 50%; border: none; flex: none; cursor: pointer;
  background: var(--paprika-soft); color: var(--paprika); display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s ease, background 0.2s ease;
}
.mic.big { width: 76px; height: 76px; }
.mic.on { background: var(--paprika); color: #fff; animation: pulse 1.4s ease-out infinite; }
.mic:active { transform: scale(0.94); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--paprika) 55%, transparent); } 100% { box-shadow: 0 0 0 16px transparent; } }

.voice-hero { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px 0 6px; }
.photo-preview { border-radius: 20px; overflow: hidden; max-height: 42dvh; background: var(--paper-2); display: flex; justify-content: center; }
.photo-preview img { object-fit: cover; width: 100%; max-height: 42dvh; }

/* ---------- progress ---------- */
.bar { height: 9px; border-radius: 999px; background: var(--sage-2); overflow: hidden; }
.bar > div { height: 100%; border-radius: 999px; background: var(--bar-color, var(--forest)); transition: width 0.5s cubic-bezier(.2, .8, .2, 1); }
.bar.over > div { background: var(--paprika); }
.bar.thin { height: 7px; }
.macro-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.macro { background: var(--paper-2); border-radius: 14px; padding: 9px 11px; }
.macro .v { font-weight: 800; }
.macro .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.big-number { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.big-number small { font-size: 15px; font-weight: 650; color: var(--muted); letter-spacing: 0; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); min-height: 54px; }
.list-row:last-child { border-bottom: none; }
.list-row.clickable { cursor: pointer; }

.check {
  width: 30px; height: 30px; border-radius: 10px; border: 2px solid var(--line); flex: none;
  display: inline-flex; align-items: center; justify-content: center; background: var(--paper); cursor: pointer; color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.check:active { transform: scale(0.9); }
.check.on { background: var(--forest); border-color: var(--forest); color: var(--on-forest); }
.done-text { text-decoration: line-through; color: var(--muted); }

.level { display: inline-flex; gap: 4px; background: var(--paper-2); border-radius: 12px; padding: 3px; border: 1px solid var(--line); }
.level button {
  border: none; background: transparent; border-radius: 9px; min-width: 44px; height: 30px;
  font-size: 12px; font-weight: 750; color: var(--muted); cursor: pointer; padding: 0 6px;
}
.level button.on.plenty, .level button.on.some { background: var(--sage); color: var(--forest-dark); }
.level button.on.low { background: var(--amber-soft); color: var(--amber); }
.level button.on.empty { background: var(--plum-soft); color: var(--plum); }
.level-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.level-dot.plenty, .level-dot.some { background: var(--forest); }
.level-dot.low { background: var(--amber); }
.level-dot.empty { background: var(--plum); }

.stars { display: inline-flex; gap: 2px; }
.stars button { border: none; background: none; padding: 2px; cursor: pointer; color: var(--line); }
.stars button.on { color: var(--amber); }
.stars.readonly button { cursor: default; padding: 0; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 750; padding: 3px 9px; border-radius: 999px; background: var(--sage); color: var(--forest-dark); white-space: nowrap; }
.badge.warn { background: var(--paprika-soft); color: var(--paprika); }
.badge.neutral { background: var(--paper-2); color: var(--muted); border: 1px solid var(--line); }

.empty { text-align: center; padding: 26px 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty .ic { width: 58px; height: 58px; border-radius: 20px; background: var(--sage); color: var(--forest-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.empty .strong { color: var(--ink); }

/* ---------- bottom nav (floating) ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: calc(10px + var(--safe-b)); z-index: 20; padding: 0 12px; pointer-events: none; }
.nav-inner {
  pointer-events: auto; max-width: 520px; margin: 0 auto; height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lift);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 700;
}
.nav a .pill { display: flex; align-items: center; justify-content: center; width: 50px; height: 30px; border-radius: 999px; transition: background 0.2s ease; }
.nav a.on { color: var(--forest-dark); font-weight: 800; }
.nav a.on .pill { background: var(--sage); }

/* ---------- sheets ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(12, 18, 15, 0.45); z-index: 40; animation: fade 0.18s ease; backdrop-filter: blur(2px); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; margin: 0 auto; max-width: 640px;
  max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 28px 28px 0 0; box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.22);
  animation: rise 0.24s cubic-bezier(.2, .8, .2, 1); padding-bottom: var(--safe-b);
}
.sheet-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px 20px; }
.sheet-head h2 { flex: 1; font-size: 21px; }
.sheet-body { overflow-y: auto; padding: 6px 16px 18px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px 14px; border-top: 1px solid var(--line); background: var(--paper); display: flex; gap: 10px; }
.grabber { width: 42px; height: 5px; border-radius: 99px; background: var(--line); margin: 9px auto 0; }
@keyframes rise { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- draft review ---------- */
.item-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: none; }
.item-food { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.item-food.unmatched { color: var(--paprika); font-weight: 700; }
.grams { display: flex; align-items: center; gap: 4px; }
.grams button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; font-weight: 800; color: var(--forest); }
.grams input { width: 64px; height: 34px; text-align: center; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-weight: 700; }
.totals { display: flex; justify-content: space-between; font-weight: 800; gap: 8px; flex-wrap: wrap; }

.suggestion { display: flex; flex-direction: column; gap: 9px; }
.suggestion .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.suggestion ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.suggestion .num { width: 28px; height: 28px; border-radius: 9px; background: var(--sage); color: var(--forest-dark); font-weight: 800; display: flex; align-items: center; justify-content: center; flex: none; font-size: 14px; }

.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 36px 12px; color: var(--muted); text-align: center; font-weight: 600; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--sage); border-top-color: var(--forest); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding: 8px 14px calc(var(--nav-h) + var(--safe-b) + 110px); }
/* scrollIntoView must stop above the fixed composer, not behind it on phones. */
.chat-end { scroll-margin-bottom: calc(var(--nav-h) + var(--safe-b) + 110px); }
.msg { display: flex; gap: 8px; align-items: flex-end; }
.msg.user { justify-content: flex-end; }
.avatar { width: 30px; height: 30px; border-radius: 10px; background: var(--sage); color: var(--forest-dark); display: flex; align-items: center; justify-content: center; flex: none; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 20px; line-height: 1.5; overflow-wrap: anywhere; }
.bubble.user { background: linear-gradient(160deg, var(--forest), var(--forest-dark)); color: var(--on-forest); border-bottom-right-radius: 6px; }
.bubble.assistant { background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.bubble img { border-radius: 14px; margin: -2px -6px 6px; max-width: calc(100% + 12px); max-height: 260px; object-fit: cover; }
.bubble p + p, .bubble ul, .bubble ol { margin-top: 6px; }
.bubble ul, .bubble ol { padding-left: 20px; margin-bottom: 0; }
.bubble code { background: var(--paper-2); padding: 1px 5px; border-radius: 6px; font-size: 0.92em; }
.bubble.user code { background: rgba(255, 255, 255, 0.18); }
.tool-status { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-weight: 600; }
.run-status { display: flex; align-items: center; gap: 8px; padding: 0 2px 0 38px; font-size: 13px; font-weight: 600; color: var(--muted); }
.run-status .btn { padding: 4px 10px; min-height: 0; }
.run-wait { padding: 0 2px 0 38px; }
.msg.user + .run-wait { padding: 0 4px; text-align: right; }
.bubble.note { color: var(--muted); font-style: italic; }
.bubble.failed { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; border-color: var(--paprika); }
.bubble.sending { opacity: 0.7; }
.bubble.unsent { opacity: 0.55; }
.send-failed { display: flex; align-items: center; gap: 6px; justify-content: flex-end; padding: 4px 2px 0; color: var(--paprika); }
.typing { display: inline-flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

.composer { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 18px); z-index: 15; padding: 0 12px; }
.composer-inner {
  max-width: 600px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px;
  background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: 26px; padding: 8px; box-shadow: var(--shadow-lift);
}
.composer-row { display: flex; gap: 6px; align-items: flex-end; }
.composer textarea { flex: 1; min-height: 44px; max-height: 150px; resize: none; padding: 11px 6px; border: none; background: transparent; outline: none; line-height: 1.4; }
.composer .round { width: 44px; height: 44px; border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; background: transparent; color: var(--muted); }
.composer .round:active { background: var(--sage); }
.composer .send { background: linear-gradient(160deg, var(--forest), var(--forest-dark)); color: var(--on-forest); }
.composer .send:disabled { opacity: 0.45; }
.composer .mic { width: 44px; height: 44px; }
.attachment { display: flex; align-items: center; gap: 10px; padding: 4px; }
.attachment img { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; }
.interim { font-size: 14px; color: var(--muted); padding: 0 8px; font-style: italic; }

/* ---------- history chart ---------- */
.chart { display: flex; align-items: flex-end; gap: 4px; height: 96px; padding-top: 6px; position: relative; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; cursor: pointer; }
.chart .b { width: 100%; max-width: 22px; border-radius: 7px 7px 4px 4px; background: var(--sage); min-height: 3px; transition: height 0.4s ease; }
.chart .b.hit { background: var(--forest); }
.chart .b.over { background: var(--paprika); }
.chart .d { font-size: 10.5px; color: var(--muted); font-weight: 700; }
.chart .target { position: absolute; left: 0; right: 0; border-top: 1.5px dashed color-mix(in srgb, var(--forest) 45%, transparent); }

/* ---------- misc ---------- */
.toast-host { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 26px); z-index: 60; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 16px; font-weight: 650; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); max-width: 520px; animation: rise 0.22s ease; pointer-events: auto; }
.toast.error { background: var(--danger); color: #fff; }
.video-box { position: relative; border-radius: 22px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.video-box video { width: 100%; height: 100%; object-fit: cover; }
.video-box .aim { position: absolute; left: 12%; right: 12%; top: 36%; bottom: 36%; border: 2px solid rgba(255, 255, 255, 0.9); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.25); }
.auth { max-width: 420px; margin: 0 auto; padding: 14vh 22px 40px; display: flex; flex-direction: column; gap: 14px; }
.logo { display: flex; align-items: center; gap: 12px; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; color: var(--ink); margin-bottom: 6px; }
.logo .mark { width: 48px; height: 48px; border-radius: 16px; background: linear-gradient(160deg, var(--forest), var(--forest-dark)); color: #f7f4ed; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 20px color-mix(in srgb, var(--forest) 30%, transparent); }
.watch-row { display: grid; grid-template-columns: 104px 1fr 48px; gap: 10px; align-items: center; font-size: 14px; }
.md p { margin: 0; }

/* ---------- smart input (type / speak / photo) ---------- */
.smart-add { padding: 8px; }
.smart-add .input { border: none; background: transparent; box-shadow: none; min-height: 46px; }
.smart-add .input:focus { box-shadow: none; }
.smart-add .interim { padding: 4px 10px 2px; }
.round-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line); flex: none; cursor: pointer;
  background: var(--paper-2); color: var(--forest); display: flex; align-items: center; justify-content: center;
}
.round-btn.primary { background: linear-gradient(160deg, var(--forest), var(--forest-dark)); color: var(--on-forest); border-color: transparent; }
.round-btn:active { transform: scale(0.94); }
.mic.small { width: 38px; height: 38px; }
.voice-input .mic { width: 48px; height: 48px; }
.interim { font-size: 13.5px; color: var(--muted); font-style: italic; padding: 4px 4px 0; }

/* ---------- item icons and Bring!-style tiles ---------- */
.item-icon { display: inline-flex; align-items: center; justify-content: center; border-radius: 30%; background: var(--paper-2); flex: none; line-height: 1; }
.item-icon.letter { color: #fff; font-weight: 800; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 520px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile-item {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; text-align: center;
  min-height: 108px; padding: 12px 6px 10px; border-radius: 20px; border: 1px solid var(--line);
  background: var(--paper); box-shadow: var(--shadow); cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform 0.08s ease, opacity 0.2s ease;
}
.tile-item:active { transform: scale(0.95); }
.tile-item .item-icon { background: transparent; }
.tile-name { font-size: 13.5px; font-weight: 750; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.tile-amount { font-size: 12px; color: var(--muted); font-weight: 650; margin-top: -2px; }
.tiles.faded .tile-item { min-height: 84px; padding: 9px 4px 8px; box-shadow: none; background: var(--paper-2); opacity: 0.75; }
.tiles.faded .tile-name { font-size: 12.5px; font-weight: 650; color: var(--muted); }

/* ---------- dishes ---------- */
.dish-card { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.dish-emoji { width: 46px; height: 46px; border-radius: 15px; background: var(--amber-soft); display: flex; align-items: center; justify-content: center; font-size: 26px; flex: none; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
