:root {
  /* ── DS Canonical Color Tokens (production-aligned values) ─────────────── */
  --color-bg-primary: #071014;
  --color-bg-secondary: rgba(22, 31, 36, 0.78);
  --color-surface: rgba(22, 31, 36, 0.78);
  --color-surface-2: rgba(28, 39, 45, 0.94);
  --color-border: rgba(207, 255, 232, 0.11);
  --color-text-primary: #f5fbf7;
  --color-text-secondary: #9aa7a3;
  --color-text-tertiary: #6f7d79;
  --color-accent: #7cf2a6;
  --color-success: #43d4a3;
  --color-warning: #e9bc4f;
  --color-error: #ff716d;
  --color-info: #7fb8ff;

  /* Status tints */
  --tint-accent: rgba(124, 242, 166, 0.14);
  --tint-success: rgba(67, 212, 163, 0.14);
  --tint-warning: rgba(233, 188, 79, 0.14);
  --tint-error: rgba(255, 113, 109, 0.14);
  --tint-info: rgba(127, 184, 255, 0.14);

  /* Brand */
  --on-accent: #071014;
  --grad-accent: linear-gradient(135deg, #7cf2a6 0%, #43d4a3 100%);
  --grad-accent-hover: linear-gradient(135deg, #98f8b8 0%, #4fe0b1 100%);

  /* ── Legacy aliases (keeps existing rules working) ─────────────────────── */
  --ink: var(--color-text-primary);
  --muted: var(--color-text-secondary);
  --subtle: var(--color-text-tertiary);
  --paper: var(--color-bg-primary);
  --panel: var(--color-surface);
  --panel-strong: var(--color-surface-2);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line: var(--color-border);
  --leaf: var(--color-accent);
  --leaf-dark: var(--color-success);
  --leaf-glow: rgba(124, 242, 166, 0.34);
  --mint: #72f0cf;   /* kept separate from --leaf to preserve tab gradient */
  --tomato: var(--color-error);
  --gold: var(--color-warning);
  --sky: var(--color-info);

  /* ── Typography ──────────────────────────────────────────────────────────── */
  --font-primary: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-demibold: 600;
  --weight-bold: 700;
  --weight-extrabold: 800;
  --weight-black: 900;
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 28px;
  --leading-tight: 1.05;
  --leading-snug: 1.25;
  --leading-body: 1.45;
  --tracking-display: -0.045em;
  --tracking-eyebrow: 0.02em;

  /* ── Spacing (8 px base scale) ───────────────────────────────────────────── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ── Radii (production values — intentionally differ from DS spec values) ── */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 16px;      /* inputs, small surfaces */
  --radius-lg: 22px;      /* cards, panels */
  --radius-xl: 28px;      /* large decorative surfaces */
  --radius-button: 18px;  /* buttons, tabs */
  --radius-pill: 999px;
  --radius-full: 999px;

  /* ── Shadows ─────────────────────────────────────────────────────────────── */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-card: 0 24px 70px rgba(0, 0, 0, 0.42);
  --shadow-brand: 0 18px 34px rgba(67, 212, 163, 0.24);
  --shadow: var(--shadow-card);

  /* ── Glass ───────────────────────────────────────────────────────────────── */
  --blur-glass: blur(18px);

  /* ── Motion ──────────────────────────────────────────────────────────────── */
  --dur-fast: 160ms;
  --dur-base: 260ms;
  --dur-view: 280ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --lift-hover: translateY(-1px);

  /* ── Layout ──────────────────────────────────────────────────────────────── */
  --layout-max-width: 1180px;
  --layout-gutter: 16px;
  --grid-texture-size: 42px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-primary);
  background:
    radial-gradient(circle at 20% 6%, rgba(124, 242, 166, 0.18), transparent 32%),
    radial-gradient(circle at 92% 18%, rgba(114, 240, 207, 0.12), transparent 30%),
    radial-gradient(circle at 50% 100%, rgba(67, 212, 163, 0.16), transparent 36%),
    linear-gradient(160deg, #0d171c 0%, #071014 46%, #05090d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: var(--grid-texture-size) var(--grid-texture-size);
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 72%);
}

button,
input,
textarea {
  font: inherit;
}

button,
.file-button {
  min-height: 48px;
  border: 1px solid rgba(220, 255, 239, 0.12);
  border-radius: var(--radius-button);
  padding: 0 18px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition:
    transform var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
}

button:hover,
.file-button:hover {
  transform: var(--lift-hover);
  border-color: rgba(124, 242, 166, 0.34);
  background: linear-gradient(180deg, rgba(124, 242, 166, 0.14), rgba(255, 255, 255, 0.04));
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  transform: none;
}

.primary {
  border-color: transparent;
  color: var(--on-accent);
  font-weight: var(--weight-extrabold);
  background: var(--grad-accent);
  box-shadow: var(--shadow-brand), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.primary:hover {
  background: var(--grad-accent-hover);
}

.wide {
  width: 100%;
}

.app-shell {
  position: relative;
  width: min(var(--layout-max-width), calc(100% - calc(var(--layout-gutter) * 2)));
  margin: 0 auto;
  padding: 30px 0 96px;
}

.topbar {
  margin-bottom: 28px;
}

.topbar > div {
  position: relative;
}

.topbar > div::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: 6px;
  width: 78px;
  height: 78px;
  border: 1px solid rgba(124, 242, 166, 0.24);
  border-radius: var(--radius-full);
  background: radial-gradient(circle, rgba(124, 242, 166, 0.14), transparent 62%);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--leaf);
  font-size: 0.78rem;
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-display);
}

h1 {
  max-width: 680px;
  font-size: clamp(2.35rem, 7vw, 5.6rem);
  font-weight: var(--weight-black);
}

h1::first-letter {
  color: var(--leaf);
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  font-weight: 850;
}

h3 {
  font-size: 1.08rem;
  font-weight: var(--weight-extrabold);
}

.tabs {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(7, 16, 20, 0.86);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: var(--blur-glass);
}

@media (min-width: 821px) {
  .tabs {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(600px, calc(100% - 24px));
    gap: 8px;
    padding: 7px;
    border-radius: 24px;
  }
}

.tab {
  min-height: 52px;
  min-width: 0;
  padding: 0 4px;
  border-color: transparent;
  border-radius: 19px;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-size: 0.76rem;
}

.tab.active {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--leaf), var(--mint));
  box-shadow: 0 12px 26px rgba(124, 242, 166, 0.22);
}

.view {
  display: none;
}

.view.active {
  display: block;
  animation: rise-in var(--dur-view) ease both;
}

.capture-grid,
.recipe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.85fr);
  gap: 18px;
}

.panel,
.item-card,
.recipe-card,
.shopping-item,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: var(--blur-glass);
}

.panel {
  overflow: hidden;
}

.camera-panel {
  padding: 14px;
}

.camera-frame {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  border: 1px solid rgba(124, 242, 166, 0.12);
  border-radius: 24px;
  background:
    radial-gradient(circle at 50% 44%, rgba(124, 242, 166, 0.19), transparent 30%),
    linear-gradient(160deg, rgba(18, 30, 34, 0.92), rgba(4, 12, 16, 0.98));
}

.camera-frame::before {
  content: "";
  position: absolute;
  inset: 44px;
  border: 2px dashed rgba(124, 242, 166, 0.28);
  border-radius: 32px;
  pointer-events: none;
}

video,
.camera-empty {
  width: 100%;
  height: 100%;
  min-height: 420px;
}

video {
  display: block;
  object-fit: cover;
}

.camera-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--leaf);
  font-size: 1.24rem;
  font-weight: var(--weight-extrabold);
  text-shadow: 0 0 28px rgba(124, 242, 166, 0.46);
}

.camera-empty.hidden {
  display: none;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.upload-preview {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  border: 1px solid rgba(124, 242, 166, 0.16);
  border-radius: 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.upload-preview img {
  width: 88px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: rgba(4, 12, 16, 0.78);
}

.upload-preview div {
  display: grid;
  gap: 4px;
}

.upload-preview span,
.upload-preview small {
  color: var(--muted);
}

.upload-preview strong {
  overflow-wrap: anywhere;
  color: var(--ink);
}

.file-button {
  display: inline-grid;
  place-items: center;
  position: relative;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.form-panel,
.recipe-layout .panel {
  padding: 22px;
}

form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(220, 255, 239, 0.12);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  color: var(--ink);
  background: rgba(4, 12, 16, 0.58);
  outline: none;
  transition:
    border-color var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease,
    background var(--dur-fast) ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124, 242, 166, 0.55);
  background: rgba(4, 12, 16, 0.78);
  box-shadow: 0 0 0 4px rgba(124, 242, 166, 0.12);
}

input::placeholder,
textarea::placeholder {
  color: rgba(154, 167, 163, 0.62);
}

select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 55% / 7px 7px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 55% / 7px 7px no-repeat,
    rgba(4, 12, 16, 0.58);
}

.quantity-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  gap: 10px;
}

textarea {
  resize: vertical;
}

.prediction-box {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(124, 242, 166, 0.2);
  border-radius: var(--radius-button);
  padding: 15px;
  background: linear-gradient(135deg, rgba(124, 242, 166, 0.14), rgba(114, 240, 207, 0.045));
}

.prediction-box span {
  color: var(--muted);
  font-size: 0.82rem;
}

.prediction-box strong {
  color: var(--leaf);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 12px;
}

.inventory-list,
.recipe-list,
.shopping-list,
.reminder-list {
  display: grid;
  gap: 12px;
}

.item-card,
.recipe-card,
.shopping-item,
.reminder-panel,
.empty-state {
  padding: 16px;
}

.item-card,
.recipe-card,
.shopping-item,
.reminder-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.item-card h3,
.recipe-card h3 {
  color: #ffffff;
}

.recipe-card p {
  color: var(--muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  padding: 0 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.84rem;
  font-weight: var(--weight-bold);
}

.chip.ok {
  color: var(--on-accent);
  background: var(--grad-accent);
}

.chip.warn {
  color: #171109;
  background: linear-gradient(135deg, #f4d777, var(--gold));
}

.chip.bad {
  color: #fff;
  background: linear-gradient(135deg, #ff8b82, var(--tomato));
}

.reminder-panel {
  display: grid;
  gap: 14px;
  margin: 14px 0 16px;
  border: 1px solid rgba(233, 188, 79, 0.24);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 14% 18%, rgba(233, 188, 79, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.032)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: var(--blur-glass);
}

.reminder-item {
  border: 1px solid rgba(233, 188, 79, 0.18);
  border-radius: var(--radius-button);
  padding: 12px;
  background: rgba(233, 188, 79, 0.07);
}

.reminder-item.expired {
  border-color: rgba(255, 113, 109, 0.24);
  background: rgba(255, 113, 109, 0.08);
}

.reminder-item div {
  display: grid;
  gap: 3px;
}

.reminder-item small {
  color: var(--muted);
}

.danger {
  border-color: rgba(255, 113, 109, 0.28);
  color: #ff9a94;
  background: rgba(255, 113, 109, 0.08);
}

.shopping-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.shopping-check input {
  width: 21px;
  height: 21px;
  accent-color: var(--leaf);
}

.shopping-check span {
  display: grid;
  gap: 3px;
}

.shopping-check small {
  color: var(--muted);
}

.shopping-item.done strong {
  color: var(--muted);
  text-decoration: line-through;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

.helper-text {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.head-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: end;
}

.file-button.slim {
  min-height: 48px;
}

.auth-panel {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(124, 242, 166, 0.2);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(124, 242, 166, 0.1), rgba(114, 240, 207, 0.04));
  display: grid;
  gap: 10px;
}

.settings-section {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: grid;
  gap: 10px;
}

.settings-section h3 {
  margin: 0 0 2px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#login-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

#login-form input {
  flex: 1 1 160px;
  min-height: 48px;
}

#login-form #login-submit,
#logout-button {
  min-height: 48px;
  flex: 0 0 auto;
}

#login-form[hidden],
#logout-button[hidden] {
  display: none;
}

/* ── Home Dashboard ─────────────────────────────────────────────────────── */

.home-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.stat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035)),
    var(--panel);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: var(--blur-glass);
  text-align: center;
}

.stat-tile .stat-value {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: var(--weight-black);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--leaf);
}

.stat-tile.warn .stat-value {
  color: var(--gold);
}

.stat-tile.bad .stat-value {
  color: var(--tomato);
}

.stat-tile .stat-label {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: var(--weight-demibold);
}

.home-locations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.loc-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-3);
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.loc-tile .loc-count {
  font-size: clamp(1.4rem, 4vw, 1.9rem);
  font-weight: var(--weight-black);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--leaf);
}

.loc-tile .loc-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: var(--weight-demibold);
}

.home-alerts {
  display: grid;
  gap: var(--space-4);
}

/* ─────────────────────────────────────────────────────────────────────────── */

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Toast notifications ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(max(14px, env(safe-area-inset-bottom)) + 74px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: var(--space-2) var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  backdrop-filter: var(--blur-glass);
  box-shadow: var(--shadow-md);
  color: var(--color-text-primary);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  max-width: min(90vw, 360px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity var(--dur-base) var(--ease-standard),
              transform var(--dur-base) var(--ease-standard);
}

.toast.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.toast-success { border-color: var(--color-success); color: var(--color-success); }
.toast.toast-error   { border-color: var(--color-error);   color: var(--color-error); }
.toast.toast-warning { border-color: var(--color-warning); color: var(--color-warning); }

/* ── Bottom sheet ─────────────────────────────────────────────────────────── */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  transition: background var(--dur-base) var(--ease-standard);
}

.sheet-overlay.sheet-visible {
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}

.bottom-sheet {
  width: 100%;
  max-width: 600px;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--space-5);
  padding-bottom: calc(var(--space-5) + max(env(safe-area-inset-bottom, 0px), 74px));
  max-height: 90dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--dur-base) var(--ease-standard);
  box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.4);
}

.sheet-overlay.sheet-visible .bottom-sheet {
  transform: translateY(0);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
}

.sheet-header h2 {
  margin: 0;
  font-size: var(--text-lg);
}

.sheet-close {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
  font-size: 0.875rem;
  padding: 0;
  line-height: 1;
  transition: background var(--dur-fast) ease;
}

.sheet-close:hover { background: rgba(255, 255, 255, 0.08); }

@media (max-width: 820px) {
  body {
    background:
      radial-gradient(circle at 50% -5%, rgba(124, 242, 166, 0.22), transparent 34%),
      linear-gradient(170deg, #0d171c 0%, #071014 58%, #05090d 100%);
  }

  .app-shell {
    width: min(100% - 22px, 560px);
    padding: 18px 0 108px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    margin-bottom: 18px;
  }

  .topbar > div::after {
    right: 8px;
    bottom: -4px;
    width: 62px;
    height: 62px;
  }

  h1 {
    font-size: clamp(2.1rem, 12vw, 3.8rem);
  }

  .capture-grid,
  .recipe-layout {
    grid-template-columns: 1fr;
  }

  .camera-frame,
  video,
  .camera-empty {
    min-height: 330px;
  }

  .camera-frame::before {
    inset: 32px;
  }

  .item-card,
  .recipe-card,
  .shopping-item,
  .reminder-item {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .card-actions,
  .head-actions,
  .form-actions {
    display: grid;
    justify-content: stretch;
  }

  button,
  .file-button {
    width: 100%;
  }

  .quantity-row {
    grid-template-columns: 1fr;
  }

  .home-stats,
  .home-locations {
    gap: var(--space-2);
  }
}
