/* ============================================================
   Cookedo — design tokens
   Palette: cast-iron charcoal + brass, freshness states borrowed
   from real ingredient decay (sage → amber → paprika).
   Type: Fraunces (display) / Inter (UI) / JetBrains Mono (data)
   ============================================================ */

:root {
  --bg: #14120F;
  --surface: #1D1A16;
  --surface-2: #262220;
  --surface-3: #2F2A26;
  --border: #34302A;
  --border-soft: #26221E;

  --text: #F2ECE3;
  --text-muted: #A69C8C;
  --text-faint: #736A5D;

  --brass: #C9A24B;
  --brass-bright: #E0BC66;
  --brass-dim: #8A6F33;

  --fresh: #7C9A6E;
  --fresh-bg: rgba(124, 154, 110, 0.14);
  --aging: #D68A3C;
  --aging-bg: rgba(214, 138, 60, 0.14);
  --expiring: #C1553B;
  --expiring-bg: rgba(193, 85, 59, 0.16);

  --sage-2: #93B08A;
  --clay: #A85C3F;
  --wheat: #C4A567;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --shadow-card: 0 1px 0 rgba(0,0,0,0.4), 0 8px 24px -12px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

::selection { background: var(--brass-dim); color: var(--text); }

button, input {
  font-family: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 500; }
p { margin: 0; }

/* ============================== layout shell ============================== */

.app-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  height: 100vh;
  width: 100vw;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 22px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 26px;
}
.brand-mark {
  width: 28px; height: 28px;
  color: var(--brass);
  flex-shrink: 0;
}
.brand-mark svg { width: 100%; height: 100%; }
.brand-name {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--surface-2);
  color: var(--brass-bright);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.household-switch {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.household-switch:hover { background: var(--surface-2); }
.household-switch svg { width: 16px; height: 16px; color: var(--text-faint); margin-left: auto; }
.household-info { display: flex; flex-direction: column; text-align: left; }
.household-name { font-size: 13px; font-weight: 600; }
.household-sub { font-size: 11.5px; color: var(--text-faint); }

.avatar {
  --av: var(--brass);
  width: 30px; height: 30px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--av) 30%, var(--surface-3));
  color: var(--av);
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--av) 45%, transparent);
}
.avatar-sm { width: 26px; height: 26px; font-size: 10.5px; }

/* main */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px 18px;
  flex-shrink: 0;
}
.topbar-title h1 { font-size: 26px; font-weight: 500; }
.topbar-title p { font-size: 13px; color: var(--text-faint); margin-top: 2px; font-family: var(--font-mono); }

.topbar-actions { display: flex; align-items: center; gap: 10px; }
.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 14px;
  width: 260px;
}
.search svg { width: 15px; height: 15px; color: var(--text-faint); flex-shrink: 0; }
.search input {
  border: none; background: transparent; outline: none;
  font-size: 13.5px; color: var(--text); width: 100%;
}
.search input::placeholder { color: var(--text-faint); }

.icon-btn {
  position: relative;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--brass-bright); border-color: var(--brass-dim); }
.dot-badge {
  position: absolute; top: 8px; right: 9px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--expiring);
  box-shadow: 0 0 0 2px var(--surface);
}

.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 4px 36px 48px;
}
.view { display: none; animation: fade-in 0.25s ease; }
.view.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ============================== buttons / chips ============================== */

.btn {
  font-size: 13.5px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.1s ease, filter 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brass); color: #1A1509; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--brass-dim); color: var(--brass-bright); }
.btn-sm { padding: 8px 14px; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }

.text-link {
  background: none; border: none; cursor: pointer;
  color: var(--text-faint); font-size: 12.5px; font-weight: 600;
  padding: 0;
  border-bottom: 1px solid transparent;
}
.text-link:hover { color: var(--brass-bright); border-color: var(--brass-dim); }

.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--surface-3); color: var(--brass-bright); border-color: var(--brass-dim); }

.filter-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 20px;
  gap: 16px;
}

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h3 { font-size: 15px; font-weight: 600; color: var(--text); }

/* ============================== freshness ring (signature) ============================== */

.fresh-ring { flex-shrink: 0; }
.fresh-ring circle.track { stroke: var(--border); fill: none; }
.fresh-ring circle.progress { fill: none; stroke-linecap: round; transform-origin: center; transform: rotate(-90deg); transition: stroke-dashoffset 0.4s ease; }
.fresh-ring.fresh circle.progress { stroke: var(--fresh); }
.fresh-ring.aging circle.progress { stroke: var(--aging); }
.fresh-ring.expiring circle.progress { stroke: var(--expiring); }
.fresh-ring text { font-family: var(--font-mono); font-size: 9px; fill: var(--text-muted); text-anchor: middle; }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; font-family: var(--font-mono);
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.status-pill.fresh { background: var(--fresh-bg); color: var(--sage-2); }
.status-pill.fresh::before { background: var(--fresh); }
.status-pill.aging { background: var(--aging-bg); color: var(--aging); }
.status-pill.aging::before { background: var(--aging); }
.status-pill.expiring { background: var(--expiring-bg); color: var(--expiring); }
.status-pill.expiring::before { background: var(--expiring); }

/* ============================== dashboard ============================== */

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  padding: 30px 32px;
  background: linear-gradient(155deg, var(--surface) 0%, var(--surface) 55%, #201B15 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  margin-bottom: 36px;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--expiring);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}
.hero-headline {
  font-size: 40px;
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -0.01em;
  max-width: 480px;
}
.hero-sub {
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 440px;
}
.hero-actions { display: flex; gap: 10px; margin-top: 26px; }

.hero-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
}
.hero-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-faint); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.fading-list { display: flex; flex-direction: column; gap: 4px; }
.fading-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px;
  border-bottom: 1px solid var(--border-soft);
}
.fading-row:last-child { border-bottom: none; }
.fading-row-name { font-size: 13.5px; font-weight: 600; flex: 1; }
.fading-row-meta { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }

.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; }
.recipe-strip { display: flex; flex-direction: column; gap: 12px; }

.week-mini { display: flex; flex-direction: column; gap: 6px; }
.week-mini-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.week-mini-day { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); width: 30px; }
.week-mini-meal { font-size: 13px; font-weight: 500; flex: 1; }
.week-mini-empty { color: var(--text-faint); font-style: normal; font-size: 12.5px; }

.activity-feed { display: flex; flex-direction: column; gap: 14px; }
.activity-row { display: flex; gap: 10px; align-items: flex-start; }
.activity-text { font-size: 13px; color: var(--text-muted); line-height: 1.45; }
.activity-text b { color: var(--text); font-weight: 600; }
.activity-time { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 2px; }

/* ============================== fridge ============================== */

.fridge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.fridge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.fridge-card:hover { border-color: var(--border); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.fridge-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.fridge-card-name { font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.fridge-card-cat { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.fridge-card-bottom { display: flex; align-items: center; justify-content: space-between; }
.fridge-card-qty { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }

/* ============================== recipes ============================== */

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}
.recipe-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: default;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.recipe-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.recipe-art {
  height: 108px;
  position: relative;
}
.recipe-match {
  position: absolute; top: 10px; right: 10px;
  background: rgba(20,18,15,0.72);
  backdrop-filter: blur(4px);
  color: var(--brass-bright);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(201,162,75,0.35);
}
.recipe-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.recipe-title { font-size: 15.5px; font-weight: 600; font-family: var(--font-display); }
.recipe-meta { display: flex; gap: 12px; font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); }
.recipe-missing { font-size: 12px; color: var(--text-muted); }
.recipe-missing b { color: var(--aging); font-weight: 600; }

/* small recipe row used in dashboard strip */
.recipe-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.recipe-row-art { width: 52px; height: 52px; border-radius: var(--radius-sm); flex-shrink: 0; }
.recipe-row-title { font-size: 14px; font-weight: 600; }
.recipe-row-meta { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 3px; }
.recipe-row-match { margin-left: auto; font-family: var(--font-mono); font-size: 12px; color: var(--brass-bright); font-weight: 700; }

/* ============================== AI Chef ============================== */

.ai-layout { display: grid; grid-template-columns: 1fr 300px; gap: 24px; height: calc(100vh - 190px); }
.ai-chat {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.ai-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 10px; max-width: 80%; }
.msg-bot { align-self: flex-start; }
.msg-user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.msg-bot .msg-avatar { background: var(--surface-3); color: var(--brass); border: 1px solid var(--border); }
.msg-bot .msg-avatar svg { width: 15px; height: 15px; }
.msg-bubble { padding: 12px 15px; border-radius: var(--radius-md); font-size: 13.5px; line-height: 1.55; }
.msg-bot .msg-bubble { background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg-user .msg-bubble { background: var(--brass); color: #1A1509; font-weight: 500; border-bottom-right-radius: 4px; }
.msg-bubble ul { margin: 8px 0 0; padding-left: 18px; }
.msg-bubble li { margin-bottom: 3px; }

.ai-prompts { display: flex; gap: 8px; padding: 0 24px 14px; flex-wrap: wrap; }
.prompt-chip {
  font-size: 12px; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  cursor: pointer;
}
.prompt-chip:hover { border-color: var(--brass-dim); color: var(--brass-bright); }

.ai-input-bar {
  display: flex; gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-soft);
}
.ai-input-bar input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 999px; padding: 11px 16px; font-size: 13.5px; outline: none;
}
.ai-input-bar input:focus { border-color: var(--brass-dim); }

.ai-context {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow-y: auto;
}
.ai-context h4 { font-size: 14px; font-weight: 600; }
.ai-context-sub { font-size: 12px; color: var(--text-faint); margin-top: 6px; line-height: 1.5; }
.ai-context-list { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.ai-context-row { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }
.ai-context-row-name { flex: 1; }

/* ============================== meal plan ============================== */

.mealplan-grid {
  display: grid;
  grid-template-columns: 90px repeat(7, 1fr);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
}
.mp-cell {
  padding: 12px;
  border-bottom: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  min-height: 74px;
}
.mp-head {
  padding: 14px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.mp-head.mp-today { color: var(--brass-bright); }
.mp-label {
  padding: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  background: var(--surface-2);
  display: flex; align-items: center;
}
.mp-cell:nth-child(8n) { border-right: none; }
.mp-meal {
  font-size: 12px;
  font-weight: 600;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  border-left: 2px solid var(--brass-dim);
  line-height: 1.4;
}
.mp-meal.uses-fading { border-left-color: var(--expiring); }
.mp-empty-cell {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint);
  font-size: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: default;
  opacity: 0.5;
}

/* ============================== scan ============================== */

.scan-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; }
.scanner-panel { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.scanner-frame {
  width: 100%;
  aspect-ratio: 16/10;
  background: radial-gradient(ellipse at center, #201C17 0%, #14120F 80%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.corner { position: absolute; width: 34px; height: 34px; border: 2px solid var(--brass-dim); opacity: 0.7; }
.corner.tl { top: 22px; left: 22px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.corner.tr { top: 22px; right: 22px; border-left: none; border-bottom: none; border-radius: 0 6px 0 0; }
.corner.bl { bottom: 22px; left: 22px; border-right: none; border-top: none; border-radius: 0 0 0 6px; }
.corner.br { bottom: 22px; right: 22px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }
.scan-line {
  position: absolute; left: 60px; right: 60px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--brass-bright), transparent);
  top: 30px;
  opacity: 0;
}
.scanner-frame.scanning .scan-line {
  opacity: 1;
  animation: scan-sweep 1.4s ease-in-out infinite;
}
@keyframes scan-sweep {
  0% { top: 26px; }
  50% { top: calc(100% - 26px); }
  100% { top: 26px; }
}
.scanner-hint { color: var(--text-faint); font-size: 13px; font-family: var(--font-mono); }
.scanner-frame.scanning .scanner-hint { color: var(--brass-bright); }

.manual-entry { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.divider-label { font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.manual-form { display: flex; gap: 8px; width: 100%; max-width: 380px; }
.manual-form input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 10px 15px; font-size: 13px; font-family: var(--font-mono); outline: none;
}
.manual-form input:focus { border-color: var(--brass-dim); }

.scan-result-panel { display: flex; flex-direction: column; gap: 24px; }
.scan-result {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 20px;
}
.scan-result.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 12px; color: var(--text-faint); padding: 36px 20px;
}
.scan-result.empty svg { color: var(--text-faint); }
.scan-result.empty p { font-size: 13px; line-height: 1.5; max-width: 220px; }
.scan-result-found { display: flex; flex-direction: column; gap: 14px; }
.scan-result-head { display: flex; gap: 12px; align-items: center; }
.scan-result-swatch { width: 46px; height: 46px; border-radius: var(--radius-sm); flex-shrink: 0; }
.scan-result-name { font-size: 15px; font-weight: 600; }
.scan-result-code { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.qty-stepper { display: flex; align-items: center; gap: 10px; }
.qty-stepper button {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); cursor: pointer; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.qty-stepper span { font-family: var(--font-mono); font-size: 14px; min-width: 20px; text-align: center; }

.scan-recent h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--text-muted); }
.recent-list { display: flex; flex-direction: column; gap: 8px; }
.recent-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border-soft);
}
.recent-row-name { flex: 1; }
.recent-row-time { color: var(--text-faint); font-family: var(--font-mono); font-size: 11px; }

/* ============================== shared fridges ============================== */

.shared-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.shared-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.shared-card-head { display: flex; align-items: center; gap: 12px; }
.shared-card-icon {
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: var(--surface-3); display: flex; align-items: center; justify-content: center;
  color: var(--brass); flex-shrink: 0;
}
.shared-card-icon svg { width: 20px; height: 20px; }
.shared-card-name { font-size: 15.5px; font-weight: 600; }
.shared-card-sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -8px; border-width: 2px; border-color: var(--surface); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.shared-card-stats {
  display: flex; gap: 18px;
  padding: 12px 0;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}
.stat-block .stat-num { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--brass-bright); }
.stat-block .stat-label { font-size: 11px; color: var(--text-faint); }
.shared-activity { display: flex; flex-direction: column; gap: 10px; }
.shared-activity .activity-text { font-size: 12.5px; }

/* ============================== toast ============================== */

.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-3);
  border: 1px solid var(--brass-dim);
  color: var(--text);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 100;
  box-shadow: var(--shadow-card);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================== auth ============================== */

.hidden { display: none !important; }

.auth-screen {
  height: 100vh; width: 100vw;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(201,162,75,0.10), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(124,154,110,0.08), transparent 50%),
    var(--bg);
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 34px 32px 28px;
  box-shadow: var(--shadow-card);
}
.auth-brand { padding: 0 0 22px; justify-content: center; }
.auth-tabs {
  display: flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: transparent;
  border-radius: 999px;
  color: var(--text-faint);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.auth-tab.active { background: var(--surface-3); color: var(--brass-bright); }
.auth-lede {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 22px;
  line-height: 1.5;
}
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.auth-field input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  font-size: 13.5px;
  outline: none;
}
.auth-field input:focus { border-color: var(--brass-dim); }
.auth-submit { margin-top: 4px; width: 100%; }
.auth-forgot {
  display: block;
  margin: 16px auto 0;
  font-size: 12px;
}
.auth-status {
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.5;
  text-align: center;
  min-height: 1px;
}
.auth-status.error { color: var(--expiring); }
.auth-status.info { color: var(--sage-2); }

.account-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  margin-bottom: 4px;
}
.account-email {
  flex: 1; min-width: 0;
  font-size: 12.5px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn-tiny { width: 28px; height: 28px; flex-shrink: 0; border-color: var(--border-soft); }
.icon-btn-tiny svg { width: 14px; height: 14px; }

/* ============================== scrollbars ============================== */

.view-container::-webkit-scrollbar, .ai-messages::-webkit-scrollbar, .ai-context::-webkit-scrollbar { width: 8px; }
.view-container::-webkit-scrollbar-thumb, .ai-messages::-webkit-scrollbar-thumb, .ai-context::-webkit-scrollbar-thumb {
  background: var(--surface-3); border-radius: 8px;
}
.view-container::-webkit-scrollbar-track, .ai-messages::-webkit-scrollbar-track, .ai-context::-webkit-scrollbar-track { background: transparent; }

/* ============================== responsive ============================== */

@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
  .ai-layout { grid-template-columns: 1fr; height: auto; }
  .scan-layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body { overflow: auto; }
  .app-shell { grid-template-columns: 1fr; height: auto; }
  .sidebar { flex-direction: row; align-items: center; padding: 12px 16px; overflow-x: auto; }
  .brand { padding: 0 16px 0 0; }
  .nav { flex-direction: row; }
  .nav-item span { display: none; }
  .sidebar-footer { display: none; }
  .main { height: auto; }
  .view-container { overflow: visible; }
  .hero { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; align-items: flex-start; gap: 14px; }
  .search { width: 100%; }
  .topbar-actions { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
