/* André's Excellent Food World — PWA. Tokens come from tokens.css (four themes); the component styles follow
   the reference rendering of the design system (design/project/components/bundle.css), copied here. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; color-scheme: light; }
html[data-theme="dark"], html[data-theme="menthe-dark"] { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(70% 380px at 100% 0%, var(--aura-1), transparent 100%),
    radial-gradient(60% 420px at 0% 100%, var(--aura-2), transparent 100%), var(--paper);
  background-attachment: fixed;
  color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 22px;
  -webkit-font-smoothing: antialiased; overflow-wrap: anywhere;
}
h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: var(--bordeaux); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--bordeaux); outline-offset: 2px; border-radius: 6px; }

/* ── Small helpers ── */
.a-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.a-row.nowrap { flex-wrap: nowrap; }
.a-row.between { justify-content: space-between; }
.a-row.top { align-items: flex-start; }
.a-row.top > .a-ic { margin-top: 1px; }
.a-stack { display: flex; flex-direction: column; gap: 12px; }
.a-stack.tight { gap: 6px; }
.a-stack.loose { gap: 20px; }
.a-soft { color: var(--ink-soft); }
.a-num { font-variant-numeric: tabular-nums; }
.a-serif { font-family: var(--font-serif); }
.a-it { font-style: italic; }
.a-acc { color: var(--bordeaux); }
.a-grow { flex: 1; min-width: 0; }
.a-ic { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.a-ic.lg { width: 22px; height: 22px; }
.a-ic.fill { fill: currentColor; stroke: none; }
.pre { white-space: pre-wrap; }
.clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 16px; word-break: break-all; }

/* ── Glass ── */
.a-card, .a-chip, .a-ardoise, .a-mono, .a-glass { -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); }
.a-glass { background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-edge), 0 6px 20px var(--glass-shade); }

/* ── Wordmark ── */
.a-wordmark { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.a-wordmark .w-name { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: -0.4px; color: var(--ink); }
.a-wordmark .w-sub { font-family: var(--font-sans); font-weight: 500; font-size: 10px; letter-spacing: 3.2px; color: var(--ink-soft); padding-left: 3.2px; white-space: nowrap; }
.a-wordmark.compact { gap: 2px; align-items: flex-start; }
.a-wordmark.compact .w-name { font-size: 22px; letter-spacing: -0.2px; }
.a-wordmark.compact .w-sub { font-size: 7.5px; letter-spacing: 2.4px; padding-left: 0; }

/* ── Type ── */
.large-title { font-family: var(--font-serif); font-size: 30px; line-height: 36px; font-weight: 400; }
.title { font-family: var(--font-serif); font-size: 22px; line-height: 28px; font-weight: 400; }
.headline-serif { font-family: var(--font-serif); font-size: 17px; line-height: 22px; font-weight: 600; }
.body-serif { font-family: var(--font-serif); font-size: 17px; line-height: 24px; font-weight: 400; }
.subheadline { font-size: 15px; line-height: 20px; }
.footnote { font-size: 13px; line-height: 18px; }
.caption { font-size: 12px; line-height: 16px; }

/* ── Section header ── */
.a-label { font-family: var(--font-sans); font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-soft); }
.a-section { display: flex; align-items: center; gap: 10px; padding-top: 8px; }
.a-section .a-label { white-space: nowrap; }
.a-section .rule { flex: 1; height: var(--hairline); min-height: 0.5px; background: var(--rule); }
.a-section .trail { color: var(--bordeaux); font-size: 15px; background: none; border: 0; padding: 0; white-space: nowrap; }

/* ── Chip ── */
.a-chip { display: inline-flex; align-items: center; gap: 5px; padding: var(--chip-pad-y) var(--chip-pad-x); border: 0; border-radius: var(--radius-capsule); background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 var(--hairline) var(--glass-edge), inset 0 0 0 1px var(--rule); font-size: 15px; line-height: 20px; white-space: nowrap; }
.a-chip .n { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-soft); }
.a-chip.sel { background: var(--bordeaux-wash); color: var(--bordeaux); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bordeaux) 45%, transparent); }
.a-chip.sel .n { color: var(--bordeaux); }
.a-chip.sm { font-size: 13px; line-height: 16px; padding: 4px 10px; }
.a-chip svg { width: 12px; height: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 2px var(--gutter); scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }

/* ── Rating ── */
.a-stars { display: inline-flex; gap: 1.5px; color: var(--brass); vertical-align: middle; }
.a-stars svg { width: 12px; height: 12px; }
.a-stars .off { color: var(--ink-faint); opacity: .55; }
.a-stars.big { gap: 6px; }
.a-stars.big svg { width: 24px; height: 24px; }
.a-stars button { border: 0; background: none; padding: 2px; color: inherit; display: grid; }

/* ── Tinted glass: five tints per palette ── */
.t-vin    { --m-bg: rgba(176, 16, 44, 0.10);  --m-ink: #8a0f24; }
.t-fauve  { --m-bg: rgba(160, 120, 70, 0.14); --m-ink: #6e5230; }
.t-laiton { --m-bg: rgba(200, 150, 40, 0.16); --m-ink: #6b5014; }
.t-sauge  { --m-bg: rgba(91, 122, 153, 0.14); --m-ink: #3d5670; }
.t-zinc   { --m-bg: rgba(20, 20, 22, 0.07);   --m-ink: #3a3a40; }
[data-theme="dark"] .t-vin    { --m-bg: rgba(255, 92, 112, 0.16);  --m-ink: #ffb3bd; }
[data-theme="dark"] .t-fauve  { --m-bg: rgba(200, 160, 112, 0.16); --m-ink: #e6cba6; }
[data-theme="dark"] .t-laiton { --m-bg: rgba(224, 176, 64, 0.16);  --m-ink: #f0cf85; }
[data-theme="dark"] .t-sauge  { --m-bg: rgba(157, 180, 204, 0.16); --m-ink: #bcd0e3; }
[data-theme="dark"] .t-zinc   { --m-bg: rgba(255, 255, 255, 0.08); --m-ink: #d4d4d8; }
[data-theme="menthe"] .t-vin    { --m-bg: rgba(156, 113, 120, 0.16); --m-ink: #6a4650; }
[data-theme="menthe"] .t-fauve  { --m-bg: rgba(181, 146, 160, 0.24); --m-ink: #5e3f4f; }
[data-theme="menthe"] .t-laiton { --m-bg: rgba(170, 250, 200, 0.55); --m-ink: #1f5a3e; }
[data-theme="menthe"] .t-sauge  { --m-bg: rgba(187, 200, 202, 0.45); --m-ink: #3a4d50; }
[data-theme="menthe"] .t-zinc   { --m-bg: rgba(22, 32, 29, 0.07);    --m-ink: #2f3a37; }
[data-theme="menthe-dark"] .t-vin    { --m-bg: rgba(216, 180, 191, 0.16); --m-ink: #ecd2da; }
[data-theme="menthe-dark"] .t-fauve  { --m-bg: rgba(181, 146, 160, 0.20); --m-ink: #e2cbd5; }
[data-theme="menthe-dark"] .t-laiton { --m-bg: rgba(170, 250, 200, 0.14); --m-ink: #c4fbd8; }
[data-theme="menthe-dark"] .t-sauge  { --m-bg: rgba(187, 200, 202, 0.14); --m-ink: #d3dddf; }
[data-theme="menthe-dark"] .t-zinc   { --m-bg: rgba(255, 255, 255, 0.08); --m-ink: #d8e0de; }

/* ── Avatar, monogram ── */
.a-avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; font-family: var(--font-serif); font-weight: 500; font-size: 15px; background: var(--m-bg); color: var(--m-ink); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--m-ink) 25%, transparent); flex: none; }
.a-avatar.sm { width: 22px; height: 22px; font-size: 11px; }
.a-avatar.lg { width: 56px; height: 56px; font-size: 26px; }
.a-avatars { display: inline-flex; }
.a-avatars .a-avatar { background: linear-gradient(var(--m-bg), var(--m-bg)), var(--paper); box-shadow: 0 0 0 2px var(--paper); }
.a-avatars .a-avatar + .a-avatar { margin-left: -4px; }
.a-mono { position: relative; display: grid; place-items: center; border-radius: var(--radius); overflow: hidden; background: var(--m-bg); color: var(--m-ink); flex: none; }
.a-mono::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 85% 0%, rgba(255, 255, 255, 0.45), transparent 60%); }
[data-theme="dark"] .a-mono::before, [data-theme="menthe-dark"] .a-mono::before { background: radial-gradient(120% 90% at 85% 0%, rgba(255, 255, 255, 0.10), transparent 60%); }
.a-mono::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--m-ink) 25%, transparent); }
.a-mono .g { position: relative; font-family: var(--font-serif); font-style: italic; font-weight: 400; line-height: 1; font-size: 30px; }

/* ── Ardoise ── */
.a-ardoise { position: relative; padding: var(--ardoise-pad); border-radius: var(--radius); background: var(--slate); color: var(--chalk); }
.a-ardoise::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 0.5px rgba(255, 255, 255, 0.14); pointer-events: none; }
.a-ardoise .a-label { color: color-mix(in srgb, var(--chalk) 72%, transparent); }
.a-ardoise .big { font-family: var(--font-serif); font-size: 44px; line-height: 1; font-variant-numeric: tabular-nums; }
.a-ardoise .a-soft { color: color-mix(in srgb, var(--chalk) 72%, transparent); }

/* ── Buttons ── */
.a-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--radius-capsule); font-family: var(--font-sans); cursor: pointer; text-align: center; }
.a-btn.primary { background: var(--bordeaux); color: var(--on-bordeaux); font-size: 17px; font-weight: 600; padding: var(--button-pad-y) var(--button-pad-x); }
.a-btn.secondary { background: var(--glass); color: var(--bordeaux); font-size: 15px; font-weight: 600; padding: 9px 14px; box-shadow: inset 0 0 0 0.5px var(--glass-edge), inset 0 0 0 1px var(--rule); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }
.a-btn.plain { background: none; color: var(--bordeaux); font-size: 15px; padding: 9px 6px; }
.a-btn.danger { color: var(--brass-text); }
.a-btn.wide { width: 100%; }
.a-btn:disabled { opacity: .45; cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 20px; background: none; color: var(--ink); position: relative; flex: none; }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 5px; background: var(--bordeaux); box-shadow: 0 0 0 2px var(--paper); }

/* ── Card, list, badges ── */
.a-card { display: block; background: var(--surface); border-radius: var(--radius); box-shadow: inset 0 0 0 0.5px var(--glass-edge), inset 0 0 0 1px var(--rule); padding: var(--card-pad); color: inherit; }
a.a-card, button.a-card { text-align: left; border: 0; width: 100%; }
.a-card.a-row, .a-card.a-stack, .a-card.a-wine { display: flex; }
.a-card.a-wine { display: grid; }
.a-list > * + * { border-top: var(--hairline) solid var(--rule); }
.a-line { display: flex; align-items: center; gap: 10px; padding: 9px 0; min-width: 0; }
.a-line.top { align-items: flex-start; }
.a-line.dim .subheadline { color: var(--ink-soft); }
.a-stat { display: flex; flex-direction: column; gap: 2px; }
.a-stat b { font-family: var(--font-serif); font-weight: 400; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.a-badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.3px; white-space: nowrap; }
.a-badge.ok { background: color-mix(in srgb, var(--sage) 16%, transparent); color: var(--sage); }
.a-badge.wait { background: color-mix(in srgb, var(--brass-text) 14%, transparent); color: var(--brass-text); }
.a-badge.acc { background: var(--bordeaux-wash); color: var(--bordeaux); }
.a-badge.neutral { background: var(--surface-sunk); color: var(--ink-soft); }
.a-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 16px; text-align: center; }
.a-empty svg { width: 24px; height: 24px; color: var(--ink-soft); }
.a-empty .t { font-family: var(--font-serif); font-weight: 400; font-size: 19px; }
.a-empty .h { font-size: 13px; line-height: 18px; color: var(--ink-soft); max-width: 300px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); background: color-mix(in srgb, var(--brass-text) 10%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brass-text) 30%, transparent); font-size: 14px; line-height: 19px; }
.notice svg { color: var(--brass-text); margin-top: 2px; }
.notice.calm { background: var(--surface-sunk); box-shadow: inset 0 0 0 1px var(--rule); }
.notice.calm svg { color: var(--ink-soft); }

/* ── Photos ── */
.a-photo { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--surface-sunk); flex: none; display: block; border: 0; padding: 0; }
.a-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb { width: 64px; height: 64px; }
.thumb.sm { width: 44px; height: 44px; border-radius: var(--radius-inner); }
.thumb.sm .g { font-size: 20px; }
.cover { width: 100%; aspect-ratio: 16 / 10; }
.cover .g { font-size: 72px; }
.a-media { display: grid; gap: 4px; grid-template-columns: repeat(3, 1fr); }
.a-media .a-photo { border-radius: 8px; aspect-ratio: 1; width: 100%; }
.a-media.one { grid-template-columns: 1fr; }
.a-media.one .a-photo { aspect-ratio: 16 / 10; max-height: 380px; border-radius: var(--radius); }
.a-by { position: absolute; left: 5px; bottom: 5px; }
.a-by .a-avatar { background: linear-gradient(var(--m-bg), var(--m-bg)), var(--paper); box-shadow: 0 0 0 1.5px var(--paper); }
.viewer { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8, 8, 10, 0.86); padding: 16px; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 10px; object-fit: contain; }
.viewer .close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 10px; color: #fff; }
.viewer .state { color: #fff; font-size: 14px; }

/* ── Wine ── */
.a-robe { display: inline-block; width: 10px; height: 10px; border-radius: 5px; flex: none; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.25); }
.robe-red { background: #6e1423; } .robe-white { background: #e9dc9a; } .robe-rose { background: #f0b2b0; } .robe-orange { background: #d9963f; }
.robe-sweet { background: #d8a93a; } .robe-fortified { background: #5a2a1c; }
.robe-sparkling { background: radial-gradient(circle at 30% 35%, #fff 0 1px, transparent 1.5px), radial-gradient(circle at 65% 60%, #fff 0 1px, transparent 1.5px), #efe3a8; }
.a-wine { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: start; }
.a-wine .cuvee { font-family: var(--font-serif); font-size: 19px; line-height: 1.15; }
.a-wine .meta { font-size: 13px; line-height: 18px; color: var(--ink-soft); }
.a-wine .stock { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.a-wine .stock b { font-family: var(--font-serif); font-weight: 400; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.a-window { position: relative; height: 6px; border-radius: 3px; background: var(--surface-sunk); box-shadow: inset 0 0 0 0.5px var(--rule); }
.a-window .w { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: var(--sage); }
.a-window .now { position: absolute; top: -4px; width: 2px; height: 14px; border-radius: 1px; background: var(--bordeaux); }
.a-window-scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; margin-top: 4px; }
.ledger .qty { font-family: var(--font-serif); font-size: 19px; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.ledger .qty.out { color: var(--ink-soft); }

/* ── Event ── */
.a-event { position: relative; overflow: hidden; border-radius: 22px; display: block; aspect-ratio: 16 / 10; background: var(--m-bg, var(--surface-sunk)); color: inherit; }
.a-event > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.a-event > .g { position: absolute; right: 18px; top: 6px; font-family: var(--font-serif); font-style: italic; font-size: 96px; line-height: 1; color: var(--m-ink); opacity: .35; }
.a-event .over { position: absolute; left: 10px; right: 10px; bottom: 10px; border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-edge); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); }
.a-event .when { font-size: 11px; font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; color: var(--bordeaux); }
.a-event .ttl { font-family: var(--font-serif); font-size: 22px; line-height: 1.1; }

/* ── Shell ── */
.app { min-height: 100vh; min-height: 100dvh; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; min-height: 52px; padding: calc(6px + env(safe-area-inset-top)) 8px 6px 16px; background: color-mix(in srgb, var(--paper) 72%, transparent); -webkit-backdrop-filter: blur(22px) saturate(1.5); backdrop-filter: blur(22px) saturate(1.5); }
.topbar.has-back { padding-left: 4px; }
.topbar h1 { flex: 1; min-width: 0; font-family: var(--font-serif); font-weight: 400; font-size: 26px; line-height: 32px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar.has-back h1 { font-size: 19px; line-height: 24px; }
.view { width: 100%; max-width: 720px; margin: 0 auto; padding: 8px var(--gutter) calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.tabbar { position: fixed; z-index: 30; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 6px 4px; border-radius: 26px; background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-edge), 0 6px 20px var(--glass-shade); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 0 3px; border-radius: 20px; color: var(--ink-soft); font-size: 10px; line-height: 12px; font-weight: 500; white-space: nowrap; min-width: 0; }
.tab svg { width: 22px; height: 22px; }
.tab.on { color: var(--bordeaux); background: var(--bordeaux-wash); }
.syncline { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 16px; color: var(--ink-soft); }
.syncline .led { width: 7px; height: 7px; border-radius: 4px; background: var(--ink-faint); flex: none; }
.syncline .led.ok { background: var(--sage); }
.syncline .led.err { background: var(--brass-text); }
.fab { position: fixed; z-index: 25; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); box-shadow: 0 6px 20px var(--glass-shade); }
.only-wide { display: none; }

@media (min-width: 900px) {
  .sidebar { display: flex; flex-direction: column; gap: 4px; position: fixed; z-index: 30; top: 12px; bottom: 12px; left: 12px; width: 236px; padding: 20px 12px 14px; border-radius: 22px; background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-edge), 0 6px 20px var(--glass-shade); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); overflow-y: auto; }
  .sidebar .a-wordmark { margin: 0 8px 16px; }
  .side-link { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; color: var(--ink); font-size: 15px; line-height: 20px; position: relative; }
  .side-link svg { width: 20px; height: 20px; color: var(--ink-soft); }
  .side-link.on { background: var(--bordeaux-wash); color: var(--bordeaux); }
  .side-link.on svg { color: var(--bordeaux); }
  .side-link .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--bordeaux); margin-left: auto; }
  .sidebar .spacer { flex: 1; min-height: 12px; }
  .sidebar .sep { height: var(--hairline); min-height: 0.5px; background: var(--rule); margin: 8px 10px; }
  .sidebar .syncline { padding: 8px 10px 0; }
  .main { margin-left: 260px; }
  .tabbar, .only-narrow { display: none !important; }
  .only-wide { display: revert; }
  .topbar { padding-left: 24px; padding-right: 24px; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; position: static; max-width: 768px; margin: 0 auto; padding-top: 22px; }
  .topbar.has-back { padding-left: 12px; }
  .topbar h1 { font-size: 34px; line-height: 41px; }
  .topbar.has-back h1 { font-size: 22px; line-height: 28px; }
  .view { padding: 8px 24px 48px; max-width: 768px; }
  .fab { position: static; box-shadow: none; align-self: flex-start; }
  .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
}

/* ── Forms ── */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field > .lbl { font-size: 13px; line-height: 18px; color: var(--ink-soft); }
.input, .field input[type="text"], .field input[type="number"], .field input[type="date"], .field input[type="datetime-local"], .field input[type="password"], .field input[type="search"], .field input[type="url"], .field input[type="tel"], .field select, .field textarea {
  width: 100%; min-width: 0; padding: 10px 12px; border: 0; border-radius: var(--radius-inner); background: var(--surface-sunk); box-shadow: inset 0 0 0 1px var(--rule); font-size: 16px; line-height: 22px; color: var(--ink); -webkit-appearance: none; appearance: none; }
.field textarea { min-height: 88px; resize: vertical; }
.field select, select.input { background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 17px) 19px, calc(100% - 12px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
.input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }
.fields { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.rowedit { display: grid; gap: 6px; padding: 10px; border-radius: var(--radius-inner); background: var(--surface-sunk); }
.rowedit .line { display: grid; gap: 6px; align-items: center; }
.rowedit .line.ing { grid-template-columns: 76px minmax(0, 1fr) 36px; grid-template-areas: "food food x" "qty unit ."; }
.rowedit .line.ing > :nth-child(1) { grid-area: qty; }
.rowedit .line.ing > :nth-child(2) { grid-area: unit; }
.rowedit .line.ing > :nth-child(3) { grid-area: food; }
.rowedit .line.ing > :nth-child(4) { grid-area: x; }
.rowedit .line.ing + .line.ing { margin-top: 6px; padding-top: 10px; border-top: var(--hairline) solid var(--rule); }
@media (min-width: 560px) { .rowedit .line.ing { grid-template-columns: 76px 130px minmax(0, 1fr) 36px; grid-template-areas: "qty unit food x"; } .rowedit .line.ing + .line.ing { margin-top: 0; padding-top: 0; border-top: 0; } }
.rowedit .line.step { grid-template-columns: minmax(0, 1fr) 36px; }
.rowedit .line.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 36px; }
.rowedit .input { background: var(--paper); padding: 8px 10px; }
.rowedit .icon-btn { width: 36px; height: 36px; color: var(--ink-soft); }
.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 12px; top: 13px; color: var(--ink-soft); pointer-events: none; }
.searchbox input { width: 100%; padding: 10px 12px 10px 36px; border: 0; border-radius: var(--radius-capsule); background: var(--surface); box-shadow: inset 0 0 0 var(--hairline) var(--glass-edge), inset 0 0 0 1px var(--rule); font-size: 16px; line-height: 22px; -webkit-appearance: none; appearance: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; border-radius: var(--radius-capsule); background: var(--surface-sunk); box-shadow: inset 0 0 0 1px var(--rule); }
.seg button { border: 0; background: none; padding: 7px 10px; border-radius: var(--radius-capsule); font-size: 14px; line-height: 18px; color: var(--ink-soft); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg button.on { background: var(--glass-edge); color: var(--ink); box-shadow: 0 1px 3px var(--glass-shade), inset 0 0 0 0.5px var(--rule); font-weight: 600; }
select.sel-inline { width: auto; max-width: 58%; flex: none; padding: 7px 30px 7px 10px; font-size: 15px; line-height: 20px; background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; }
.switch { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.switch .a-grow { display: flex; flex-direction: column; gap: 2px; }
.switch input { -webkit-appearance: none; appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--zinc); position: relative; flex: none; margin: 0; cursor: pointer; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 11px; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch input:checked { background: var(--bordeaux); }
.switch input:checked::after { transform: translateX(18px); }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--bordeaux); flex: none; margin: 0; }
.sharebox { display: flex; flex-direction: column; gap: 8px; }
.sharebox .says { font-size: 13px; line-height: 18px; color: var(--ink-soft); }
.error { color: var(--brass-text); font-size: 14px; line-height: 19px; }
.qr { display: block; width: 100%; max-width: 220px; height: auto; margin: 0 auto; background: #fff; border-radius: 12px; }

/* ── Onboarding ── */
.onboard { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 20px; }
.onboard .box { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 18px; }
.onboard .a-wordmark { align-self: center; margin-bottom: 8px; }

/* ── Steps, ingredients ── */
.ingredients li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 8px 0; }
.ingredients .q { text-align: right; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding: 10px 0; }
.steps .no { font-family: var(--font-serif); font-size: 19px; color: var(--bordeaux); font-variant-numeric: tabular-nums; }
.steps .t { display: flex; flex-direction: column; gap: 4px; }

/* ── Toasts ── */
.toasts { position: fixed; z-index: 70; left: 0; right: 0; bottom: calc(92px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 420px; padding: 10px 16px; border-radius: 18px; background: var(--slate); color: var(--chalk); font-size: 14px; line-height: 19px; box-shadow: 0 6px 20px var(--glass-shade); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
[data-theme="dark"] .toast, [data-theme="menthe-dark"] .toast { background: #2a2a2e; }
@media (min-width: 900px) { .toasts { bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── Dialog, photo remove button ── */
.dialog { max-width: 380px; width: 100%; background: var(--paper); }
.a-photo .icon-btn { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 12px; background: rgba(20, 20, 22, 0.55); color: #fff; }

/* « Événements » is the longest tab label: on the narrowest phones it needs a slightly smaller size. */
@media (max-width: 350px) {
  .tabbar { left: 4px; right: 4px; padding: 6px 2px; }
  .tab { font-size: 9px; letter-spacing: -0.1px; }
  .view { padding-left: 12px; padding-right: 12px; }
}
