:root {
  --bg: #f8f0e5;
  --card: #fffdf9;
  --ink: #3a281a;
  --muted: #86705b;
  --line: #eadcc8;
  --accent: #8f5f33;
  --accent-soft: #f1e3cf;
  --gold: #b98b53;
  --brown: #50351f;
  --shadow: 0 2px 10px rgba(80, 53, 31, .06);
  --ok: #3f7d4e;
  --radius: 14px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; }
a { color: var(--accent); }
main { max-width: 960px; margin: 0 auto; padding: 16px 16px 64px; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: rgba(248, 240, 229, .9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 960px; margin: 0 auto; padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.logo {
  flex: none; width: 44px; height: 44px; display: block;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 1.4rem; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.brand-name em { color: var(--gold); font-weight: 400; }
.brand-tagline { font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.add-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: .92rem;
  color: var(--accent); background: var(--accent-soft); border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.add-btn:hover { border-color: var(--accent); }
.add-btn span[aria-hidden] { font-size: 1.15rem; line-height: 1; }

/* Brand lockup: monogram, name, heart ornament, slogan (home and login pages) */
.lockup { text-align: center; margin-bottom: 22px; color: var(--ink); }
.lockup img { display: block; margin: 0 auto 10px; width: 120px; height: auto; }
.lockup-name { font-family: "Bodoni MT", Didot, "Times New Roman", serif; font-size: 2.1rem; line-height: 1; text-transform: uppercase; letter-spacing: -.01em; color: var(--brown); }
.lockup-gourmand { font-size: 1.15rem; letter-spacing: .42em; margin-right: -.42em; text-transform: uppercase; color: #a87940; margin-top: 6px; }
.lockup-ornament { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--gold); margin: 10px auto 8px; max-width: 280px; }
.lockup-ornament span { flex: 1; height: 1px; background: #d9bf9a; }
.lockup-ornament svg { width: 18px; height: 16px; }
.lockup-slogan { color: #503b29; }
.home-lockup { margin: 10px 0 24px; }
body:has(.lockup) .topbar .brand-text { visibility: hidden; }
.page-head { margin: 8px 0 20px; }
.page-head h1 { font-family: Georgia, serif; font-size: 2rem; line-height: 1.15; margin: 0; color: var(--brown); }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.ico { width: 24px; height: 24px; flex: none; display: block; }

button, .btn, .btn-ghost {
  font: inherit; border-radius: 10px; cursor: pointer; text-decoration: none;
  padding: 10px 16px; border: 1px solid transparent; display: inline-block;
}
.btn, button.primary { background: var(--accent); color: #fff; }
.btn:disabled, button:disabled { opacity: .6; cursor: default; }
.btn-ghost, button.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
button.danger { background: transparent; color: #a33; border-color: #e7c4c4; }

/* Add page */
.import { display: grid; gap: 14px; margin-bottom: 20px; }
.import[hidden] { display: none; }
.add-option {
  display: grid; grid-template-columns: 52px 1fr; gap: 16px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow);
}
.add-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.add-ico .ico { width: 26px; height: 26px; }
.import h2 { margin: 2px 0 4px; font-family: Georgia, serif; font-size: 1.2rem; color: var(--brown); }
.import p.hint { margin: 0 0 12px; color: var(--muted); font-size: .9rem; }
.import form { display: flex; gap: 8px; }
.import input { flex: 1; min-width: 0; }
.photo-pick { cursor: pointer; }
.photo-pick:hover { border-color: var(--accent); }
.busy { pointer-events: none; opacity: .55; }
.originals { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.originals img { height: 220px; border-radius: 10px; border: 1px solid var(--line); display: block; }
.status { margin-top: 12px; font-size: .95rem; display: flex; align-items: center; gap: 10px; }
.status.error { color: #a33; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 3px solid var(--accent-soft); border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Import in progress: a simmering pot and the steps ticked off. */
.cooking { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 20px 18px; text-align: center; margin-bottom: 20px; }
.cooking h2 { font-family: Georgia, serif; color: var(--brown); margin: 4px 0; font-size: 1.35rem; }
.cooking-msg { margin: 0 0 14px; min-height: 1.4em; }
.cooking-pot { position: relative; width: 84px; height: 84px; margin: 14px auto 4px; color: var(--accent); }
.cooking-pot .ico { width: 84px; height: 84px; stroke-width: 1.2; animation: simmer 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.steam { position: absolute; bottom: 64%; width: 5px; height: 20px; border-radius: 5px; background: var(--gold); opacity: 0; animation: steam 2.4s ease-in infinite; }
.steam:nth-child(1) { left: 33%; }
.steam:nth-child(2) { left: 47%; animation-delay: .8s; }
.steam:nth-child(3) { left: 61%; animation-delay: 1.6s; }
@keyframes steam { 0% { transform: translateY(8px) scaleY(.5); opacity: 0; } 30% { opacity: .6; } 100% { transform: translateY(-28px) scaleY(1.2); opacity: 0; } }
@keyframes simmer { 50% { transform: translateY(-2px) rotate(-2deg); } }
.cooking-steps { list-style: none; padding: 0; margin: 0 auto 16px; display: inline-grid; gap: 7px; text-align: left; }
.cooking-steps li { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.cooking-steps li::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); flex: none; display: grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; }
.cooking-steps li.current { color: var(--ink); font-weight: 600; }
.cooking-steps li.current::before { border-color: var(--accent); border-top-color: transparent; animation: spin 1s linear infinite; }
.cooking-steps li.done::before { content: "✓"; background: var(--ok); border-color: var(--ok); }
.cooking-bar { height: 6px; max-width: 320px; margin: 0 auto 12px; border-radius: 6px; background: var(--accent-soft); overflow: hidden; }
.cooking-bar span { display: block; width: 40%; height: 100%; border-radius: 6px; background: var(--accent); animation: slide 1.5s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.cooking.finished .cooking-bar span { width: 100%; animation: none; transform: none; background: var(--ok); }
.cooking.finished .steam { display: none; }
.cooking.finished .cooking-pot .ico { animation: none; color: var(--ok); }
@media (prefers-reduced-motion: reduce) {
  .cooking *, .cooking *::before { animation: none !important; }
  .steam { display: none; }
}

input, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
textarea { min-height: 120px; resize: vertical; }

/* Home: search, categories, recipes */
.searchbar {
  display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 999px;
  padding: 6px 6px 6px 18px; box-shadow: var(--shadow); border: 1px solid var(--line); margin-bottom: 18px; color: var(--muted);
}
.searchbar input { border: 0; background: transparent; padding: 8px 0; outline: none; }
.icon-btn { padding: 8px; border-radius: 999px; background: transparent; color: var(--ink); display: grid; place-items: center; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--accent-soft); }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }
.cat-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 26px; }
.cat-tile {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 4px 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; color: var(--ink);
  font-size: .85rem; box-shadow: var(--shadow); transition: background .15s, color .15s;
}
.cat-tile .ico { width: 28px; height: 28px; color: var(--accent); }
.cat-tile:hover { border-color: var(--gold); }
.cat-tile.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat-tile.active .ico { color: #fff; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 12px; }
.section-head h2 { margin: 0; font-size: 1.3rem; color: var(--brown); font-weight: 600; }
.section-head span { color: var(--muted); font-size: .88rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(80, 53, 31, .12); }
.card .thumb { aspect-ratio: 4 / 3; background: var(--accent-soft) center / cover no-repeat; }
.card .thumb.empty { display: grid; place-items: center; font-size: 2.5rem; }
.card .fav { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(255, 253, 249, .92); color: var(--accent); display: grid; place-items: center; }
.card .fav .ico { width: 17px; height: 17px; fill: currentColor; }
.card .body { padding: 10px 12px 12px; }
.card h3 { margin: 0; font-size: .98rem; font-weight: 600; line-height: 1.3; color: var(--brown); }
.card .meta { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }

/* Detail — same look as the printed recipe card */
.hero { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 32px; align-items: start; }
.hero.no-img { grid-template-columns: 1fr; }
.hero img { width: 100%; border-radius: 16px; aspect-ratio: 4 / 5; object-fit: cover; display: block; }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; color: var(--accent);
  margin-top: 6px; padding-bottom: 6px; display: inline-block; border-bottom: 2px solid var(--accent);
}
.hero h1 { font-family: Georgia, serif; font-size: 2.1rem; margin: 18px 0 12px; line-height: 1.18; letter-spacing: -.01em; }
.hero .desc { font-family: Georgia, serif; font-style: italic; color: var(--muted); margin: 0 0 18px; font-size: 1.02rem; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.fact { background: var(--accent-soft); border-radius: 12px; padding: 8px 18px 9px; display: flex; flex-direction: column; }
.fact small { font-size: .68rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.fact strong { font-size: 1.05rem; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .8rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.recipe-body { display: grid; grid-template-columns: minmax(0, 370px) 1fr; gap: 36px; align-items: start; margin-top: 32px; }
.recipe-body h2 { font-family: Georgia, serif; font-size: 1.45rem; margin: 0 0 12px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px 22px; }
.panel h3 { font-family: Georgia, serif; color: var(--accent); font-size: 1.15rem; margin: 24px 0 8px; }
ul.ingredients { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
ul.ingredients li { padding: 7px 0; border-bottom: 1px dashed var(--line); }
ul.ingredients li:last-child { border-bottom: 0; }
ul.ingredients label { display: grid; grid-template-columns: auto 88px 1fr; gap: 8px; align-items: baseline; cursor: pointer; }
ul.ingredients input { width: auto; margin: 0; accent-color: var(--accent); }
.qty { font-weight: 700; color: var(--accent); }
ul.ingredients input:checked ~ span { text-decoration: line-through; color: var(--muted); }
ul.tips { margin: 0; padding-left: 18px; font-size: .88rem; }
ul.tips li { margin-bottom: 6px; }
ol.steps { padding-left: 0; margin: 0; list-style: none; counter-reset: step; }
ol.steps li { counter-increment: step; display: flex; gap: 14px; padding: 9px 0; }
ol.steps li::before {
  content: counter(step); flex: none; width: 28px; text-align: left;
  font-family: Georgia, serif; font-weight: 700; font-size: 1.35rem; line-height: 1.2; color: var(--accent);
}
details { margin-top: 18px; color: var(--muted); }
details pre { white-space: pre-wrap; font: inherit; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.notice { background: #fff7e0; border: 1px solid #f0dfa8; border-radius: 10px; padding: 12px; margin-top: 16px; }

/* Seasons: filter on the home page, picker on the edit page */
.chip {
  font: inherit; font-size: .88rem; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); user-select: none;
}
.chip:hover { border-color: var(--accent); }
.chip.active, .chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.chip input { display: none; }
.season-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 18px; }
.season-filter[hidden] { display: none; }
.form .season-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.form .season-picker .chip { display: inline-block; margin: 0; font-weight: 400; }
.form .season-picker .chip:has(input:checked) { font-weight: 600; }

/* Edit — picture of the dish */
.dish-photo {
  display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-top: 16px;
}
.dish-photo label:first-child { margin-top: 0; }
.dish-photo .hint { margin: 0 0 4px; color: var(--muted); font-size: .88rem; }
.dish-photo .actions { margin-top: 8px; }
.dish-preview img, .dish-empty { width: 160px; height: 160px; border-radius: 12px; object-fit: cover; display: block; }
.dish-empty {
  background: var(--accent-soft); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; font-size: 2rem; text-align: center;
}
.dish-empty span { font-size: .75rem; color: var(--muted); padding: 0 10px; }
.status.ok { color: var(--ok); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.img-choice {
  padding: 0; border: 2px solid transparent; background: var(--card); border-radius: 12px; overflow: hidden;
  text-align: left; cursor: pointer;
}
.img-choice:hover { border-color: var(--accent); }
.img-choice img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.img-choice span { display: block; padding: 4px 8px 6px; font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.generated { margin-top: 12px; display: flex; gap: 16px; align-items: end; flex-wrap: wrap; }
.generated img { width: 260px; max-width: 100%; border-radius: 12px; display: block; }

/* Edit */
.form label { display: block; font-weight: 600; margin: 14px 0 6px; }
.form small { font-weight: 400; color: var(--muted); }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
select { font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
button.small, .btn-ghost.small { padding: 5px 10px; font-size: .82rem; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); vertical-align: middle; }
.badge.off { background: #eee; color: var(--muted); }

/* Top bar navigation */
.nav { display: flex; align-items: center; gap: 10px; flex: none; }
.nav-icon { position: relative; text-decoration: none; padding: 7px; border-radius: 10px; color: var(--brown); }
.nav-icon:hover { background: var(--accent-soft); }
.count {
  position: absolute; top: -2px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center;
}
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: var(--bg); text-decoration: none;
  display: grid; place-items: center; font-weight: 700; font-family: Georgia, serif;
}
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); flex: none; }
.sync-dot.pending { background: #d9a400; }
.sync-dot.syncing { background: #d9a400; animation: pulse 1s ease-in-out infinite; }
.sync-dot.offline { background: #aaa; }
.sync-dot.error { background: #c0392b; }
@keyframes pulse { 50% { opacity: .3; } }

/* Login, registration */
.auth { display: grid; place-items: start center; padding-top: 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.auth-card h1 { font-family: Georgia, serif; margin: 0 0 6px; }
.auth-card .hint { color: var(--muted); margin: 0 0 8px; }
.auth-alt { text-align: center; margin: 18px 0 0; font-size: .92rem; }

/* Account, inbox */
.form h1, .admin h1 { font-family: Georgia, serif; }
.block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-top: 16px; }
.block h2 { margin: 0 0 4px; font-size: 1.1rem; }
.block .hint, .inbox-item .hint { color: var(--muted); margin: 4px 0; font-size: .9rem; }
.inbox-item {
  display: grid; grid-template-columns: 110px 1fr; gap: 16px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px;
}
.inbox-item img, .inbox-item .thumb { width: 110px; height: 110px; border-radius: 10px; object-fit: cover; }
.inbox-item .thumb.empty { display: grid; place-items: center; font-size: 2rem; background: var(--accent-soft); }
.inbox-item h3 { margin: 0; font-family: Georgia, serif; }
.inbox-item .message { font-style: italic; margin: 6px 0; }
.shared-by { margin: -4px 0 10px; color: var(--accent); font-size: .9rem; }
.share-box { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); display: grid; gap: 8px; }
.share-box label { font-weight: 600; }

/* Admin */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; text-decoration: none; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.admin h2 { font-size: 1.1rem; margin: 26px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
a.tile[href]:hover { border-color: var(--accent); }
.tile strong { font-family: Georgia, serif; font-size: 1.9rem; color: var(--accent); line-height: 1.1; }
.tile span { color: var(--muted); font-size: .85rem; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table small { color: var(--muted); }
.table tr.inactive td { opacity: .55; }
.table tr.warn td { background: #fdf3f0; }
.row-actions { min-width: 140px; }
.row-actions button { display: block; width: 100%; margin: 0 0 4px; }
.journal td:first-child { white-space: nowrap; }
.invite-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.link-row { display: flex; gap: 8px; margin-top: 8px; }
.link-row input { flex: 1; min-width: 0; }
.friend-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.block h2 + .friend-row, .block .hint + .friend-row { border-top: 0; }
.friend-row small { color: var(--muted); }
.notif-list { padding: 4px 8px; }
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 12px 10px; border-radius: 10px; color: inherit; text-decoration: none; }
.notif + .notif { border-top: 1px solid var(--line); }
.notif:hover { background: var(--accent-soft); }
.notif.unread { background: #fff7e0; }
.notif-emoji { font-size: 1.4rem; line-height: 1.2; }
.notif small { color: var(--muted); }
.notif .notif-when { font-size: .78rem; }
.row-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.journal-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.journal-filter select { width: auto; }
.notice code { background: #fff; padding: 2px 8px; border-radius: 6px; font-size: 1rem; }

@media (max-width: 760px) {
  .hero, .recipe-body { grid-template-columns: 1fr; gap: 20px; }
  .hero img { aspect-ratio: 4 / 3; }
  .hero h1 { font-size: 1.7rem; margin-top: 12px; }
  .recipe-body { margin-top: 24px; }
}

@media (max-width: 600px) {
  .dish-photo { grid-template-columns: 1fr; }
  .add-label { display: none; }
  .add-btn { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .brand-name { font-size: 1.2rem; }
  .row { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .brand-tagline { display: none; }
  .nav { gap: 6px; }
  .nav-icon { padding: 4px; }
  .avatar { width: 34px; height: 34px; }
  .invite-form { grid-template-columns: 1fr; }
  .inbox-item { grid-template-columns: 70px 1fr; }
  .inbox-item img, .inbox-item .thumb { width: 70px; height: 70px; }
}

/* Bottom tab bar (phones) */
.tabbar { display: none; }
@media (max-width: 600px) {
  .tabbar:not([hidden]) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
    align-items: end; padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 253, 249, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(80, 53, 31, .06);
  }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .7rem; color: var(--muted); text-decoration: none; padding: 4px 0; }
  .tabbar a.active { color: var(--accent); font-weight: 600; }
  .tabbar a.active .ico { stroke-width: 2; }
  .tabbar .tab-add { justify-self: center; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; justify-content: center; margin-top: -22px; box-shadow: 0 4px 14px rgba(143, 95, 51, .35); }
  .tabbar .tab-add.active { color: #fff; }
  .tabbar .tab-add .ico { width: 28px; height: 28px; }
  body:has(.tabbar:not([hidden])) main { padding-bottom: 110px; }
  .nav .add-btn, .nav .avatar { display: none; }
  .cat-tiles { gap: 6px; }
  .cat-tile { padding: 12px 2px 10px; font-size: .74rem; border-radius: 14px; }
  .cat-tile .ico { width: 24px; height: 24px; }
  .home-lockup img { width: 96px; }
  .home-lockup .lockup-name { font-size: 1.8rem; }
  .add-option { grid-template-columns: 1fr; gap: 10px; }
}

/* Small phones, logged in: the logo alone leaves room for the menu icons. */
@media (max-width: 440px) {
  .topbar-inner:has(.nav .avatar) .brand-text { display: none; }
}
