:root {
  --bg: #ffffff;
  --soft: #f7f5f2;
  --card: #ffffff;
  --ink: #1b2130;
  --muted: #646b78;
  --line: #ebe8e4;
  --brand: #e0561b;
  --brand-dark: #c94814;
  --brand-ink: #ffffff;
  --brand-soft: #fdefe7;
  --peach: #fdf1ea;
  --herb: #3d7a38;
  --warn: #8a5a00;
  --warn-soft: #fcf0d6;
  --bad: #b3261e;
  --bad-soft: #fbe5e3;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(27, 33, 48, .05), 0 4px 14px rgba(27, 33, 48, .06);
  --wrap: 1280px;
  --wide: 1536px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16181d;
    --soft: #1e2128;
    --card: #1f2229;
    --ink: #eef0f3;
    --muted: #a3a9b4;
    --line: #2e323b;
    --brand: #f2733a;
    --brand-dark: #e0561b;
    --brand-ink: #1a0b04;
    --brand-soft: #3a2217;
    --peach: #2a211c;
    --herb: #8cc77f;
    --warn: #f0c060;
    --warn-soft: #3a2f16;
    --bad: #f2867d;
    --bad-soft: #3d1d1a;
    --shadow: none;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15.5px/1.55 "Plus Jakarta Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--brand); }
h1, h2, h3 { letter-spacing: -.02em; }
h1 { font-size: 2rem; line-height: 1.15; font-weight: 800; margin: 0 0 .25rem; }
h2 { font-size: 1.2rem; font-weight: 700; margin: 0 0 .75rem; }
h3 { font-size: 1rem; font-weight: 700; margin: 1rem 0 .4rem; }
p { margin: 0 0 .75rem; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .9rem; }
code { font-family: ui-monospace, Consolas, monospace; background: var(--soft); border: 1px solid var(--line); padding: 2px 6px; border-radius: 6px; word-break: break-all; }
kbd { font: .85em ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-in { max-width: var(--wide); margin: 0 auto; padding: 0 84px 0 86px; height: 86px; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; flex: none; }
.brand .hat { color: var(--brand); }
.brand-text { font-size: 2.35rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.brand-text span { color: var(--brand); }
.topnav { display: flex; align-items: center; gap: 18px; margin-left: auto; margin-right: 60px; }
.topnav-link { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 1.22rem; font-weight: 500; color: var(--ink); text-decoration: none; background: none; border: 0; padding: 10px 12px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.topnav-link:hover { color: var(--brand); }
.topnav-link.on { color: var(--brand); font-weight: 600; }
.topnav-quiet { color: var(--muted); font-size: .95rem; }
.badge-count:not(:empty) { background: var(--brand); color: var(--brand-ink); border-radius: 999px; font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; }
.dropdown { position: relative; }
.dropdown-panel { display: none; position: absolute; top: calc(100% + 6px); left: -12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(27, 33, 48, .14); padding: 16px; gap: 24px; z-index: 30; }
.dropdown.open .dropdown-panel { display: flex; }
.dropdown-col { display: flex; flex-direction: column; min-width: 180px; max-width: 260px; }
.dropdown-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: 0 10px 6px; }
.dropdown-col a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .93rem; }
.dropdown-col a:hover { background: var(--soft); color: var(--brand); }
.dropdown-col a.on { color: var(--brand); font-weight: 600; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.topsearch { display: flex; align-items: center; flex: none; }
.topbar .topsearch input { width: 0; padding: 8px 0; border: 0; opacity: 0; transition: width .2s, opacity .2s, padding .2s; }
.topbar .topsearch:focus-within input, .topbar .topsearch.open input { width: 200px; padding: 8px 12px; border: 1px solid var(--line); opacity: 1; }
.search-btn { background: none; border: 0; color: var(--ink); cursor: pointer; padding: 6px; display: grid; place-items: center; }
.search-btn:hover { color: var(--brand); }
.burger { display: none; margin-left: auto; background: none; border: 0; padding: 8px; cursor: pointer; flex-direction: column; gap: 5px; }
.burger span { display: block; width: 24px; height: 2.5px; border-radius: 2px; background: var(--ink); }

.main { padding: 32px 32px 56px; max-width: var(--wrap); margin: 0 auto; min-width: 0; }
.main-home { padding-top: 0; max-width: none; padding-left: 0; padding-right: 0; }
body.public .main { max-width: 460px; margin: 10vh auto 0; }

/* Home */
.hero { position: relative; background: linear-gradient(100deg, #f4f1ed 0%, #f6f3f0 55%, #ece8e3 100%); overflow: hidden; }
.hero-photo { position: absolute; inset: 0 0 0 auto; width: 52%; background-size: cover; background-position: left center; }
.hero-photo::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #f5f2ee 0%, rgba(245, 242, 238, 0) 28%); }
.hero-in { position: relative; max-width: var(--wide); margin: 0 auto; padding: 56px 32px 54px 105px; }
.hero h1 { font-size: clamp(2.4rem, 4.6vw, 4.1rem); line-height: 1.05; letter-spacing: -.035em; color: #161b27; max-width: 12ch; margin-bottom: 22px; }
.hero-lede { font-size: 1.32rem; line-height: 1.45; color: #2a303c; max-width: 31ch; margin-bottom: 28px; }
.btn-big { font-size: 1.2rem; padding: 14px 34px; border-radius: 10px; }
.hero-points { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 14px 56px; color: #2a303c; font-size: 1.05rem; }
.hero-points li { display: flex; align-items: center; gap: 12px; }
.hero-points svg { color: var(--brand); }
.hero-points li:nth-child(2) svg { color: var(--herb); }
.hero-points li:nth-child(3) svg { color: #2a303c; }
.home-section { max-width: var(--wide); margin: 0 auto; padding: 30px 80px 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 18px; }
.section-head h2, .latest h2 { font-size: 2rem; font-weight: 800; margin: 0; }
.more-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px; }
.tile { display: flex; flex-direction: column; background: var(--soft); border-radius: 10px; overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(27, 33, 48, .12); }
.tile img { width: 100%; aspect-ratio: 210 / 99; object-fit: cover; display: block; }
.tile-label { padding: 12px 8px 14px; text-align: center; font-weight: 600; font-size: 1.1rem; line-height: 1.25; }
.tile-label small { display: block; font-size: .78rem; font-weight: 500; color: var(--muted); }
.home-split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .82fr); gap: 56px; padding-top: 46px; align-items: start; }
.plan-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; background: var(--peach); border-radius: 14px; overflow: hidden; margin-left: -30px; }
.plan-text { display: flex; gap: 22px; padding: 32px 10px 32px 50px; }
.plan-icon { color: var(--brand); flex: none; margin-top: 6px; }
.plan-text h2 { font-size: 2rem; line-height: 1.12; font-weight: 800; margin-bottom: 12px; }
.plan-text p { color: #2a303c; max-width: 30ch; }
.plan-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
.latest ul { list-style: none; padding: 0; margin: 18px 0 0; }
.latest li + li { border-top: 1px solid var(--line); }
.latest a { display: flex; gap: 22px; align-items: center; padding: 10px 0 12px; color: var(--ink); text-decoration: none; }
.latest img { width: 156px; height: 74px; object-fit: cover; border-radius: 8px; flex: none; }
.latest strong { display: block; font-size: 1.13rem; font-weight: 600; line-height: 1.3; }
.latest a:hover strong { color: var(--brand); }
.latest-meta { display: flex; gap: 0; color: var(--muted); font-size: .95rem; margin-top: 6px; }
.latest-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.latest-meta > span + span::before { content: ""; width: 1px; height: 16px; background: var(--line); margin: 0 12px; }
.latest-meta svg { color: var(--brand); }

.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 2.3rem; }
.page-head p { max-width: 70ch; margin: .35rem 0 0; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px; min-width: 0; }
.card > :last-child { margin-bottom: 0; }
.empty { text-align: center; padding: 40px 20px; }

/* Forms */
.form { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; }
.form .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .9rem; }
input[type=text], input[type=url], input[type=email], input[type=password], input[type=search], select, textarea {
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; font-weight: 400; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: -1px; border-color: transparent; }
.form-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.form .form-actions { margin-top: 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600; font-size: .93rem; padding: 9px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn-primary { background: linear-gradient(180deg, var(--brand), var(--brand-dark)); border-color: var(--brand-dark); color: var(--brand-ink); box-shadow: 0 2px 6px rgba(224, 86, 27, .25); }
.btn-primary:hover { filter: brightness(1.05); border-color: var(--brand-dark); }
.btn-small { padding: 4px 10px; font-size: .8rem; }
.btn.on { color: var(--brand); border-color: var(--brand); }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--bad); cursor: pointer; text-decoration: underline; }
.inline-form { display: inline; }
.icon-btn { background: none; border: 0; font-size: 1.1rem; line-height: 1; color: var(--line); cursor: pointer; padding: 4px; margin-left: auto; }
.icon-btn.on { color: #e0a100; }

.flash, .note { padding: 11px 15px; border-radius: 10px; margin-bottom: 16px; background: var(--brand-soft); }
.main-home .flash { max-width: calc(var(--wide) - 160px); margin: 16px auto; }
.flash-bad, .note-bad { background: var(--bad-soft); color: var(--bad); }
.note-warn { background: var(--warn-soft); color: var(--warn); }

/* Recipe list */
.toolbar { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar input[type=search] { flex: 1 1 240px; }
.toolbar select { width: auto; }
.rgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.rcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; transition: box-shadow .15s, transform .15s; }
.rcard:hover { box-shadow: 0 8px 22px rgba(27, 33, 48, .1); transform: translateY(-1px); }
.rcard-top { display: flex; gap: 6px; align-items: center; min-height: 26px; }
.rcard h3 { font-size: 1.12rem; font-weight: 700; line-height: 1.3; margin: 8px 0 6px; }
.rcard h3 a { color: var(--ink); text-decoration: none; }
.rcard h3 a:hover { color: var(--brand); }
.rdesc { margin-bottom: 8px; }
.rmeta { margin: auto 0 0; color: var(--herb); font-weight: 600; }
.rbook { margin: 2px 0 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.chip-tag { background: var(--soft); color: var(--muted); border: 1px solid var(--line); font-weight: 600; }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }

/* One recipe */
.recipe-title { font-size: 2.5rem; }
.crumbs { margin-bottom: 6px; }
.lede { font-size: 1.1rem; max-width: 75ch; }
.facts { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 0 0 22px; padding: 14px 18px; background: var(--soft); border-radius: var(--radius); }
.facts div { min-width: 70px; }
.facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; font-weight: 700; }
.recipe-body { display: grid; grid-template-columns: minmax(240px, 1fr) 2fr; gap: 18px; align-items: start; }
.ingredients ul { list-style: none; padding: 0; margin: 0 0 8px; }
.ingredients li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.ingredients li:last-child { border-bottom: 0; }
.ingredients label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.ingredients input { accent-color: var(--brand); }
.ingredients input:checked + span { color: var(--muted); text-decoration: line-through; }
.ingredients h3, .method h3 { color: var(--brand); }
.ingredients li { display: flex; align-items: baseline; gap: 8px; }
.ingredients li label { flex: 1; }
.shop-item { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--card, #fff);
  color: var(--brand); font-size: 16px; line-height: 1; cursor: pointer; align-self: center; }
.shop-item:hover { border-color: var(--brand); }
.shop-item.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.shop-item:disabled { opacity: .6; }
.ingredients .shop-whole, .ingredients.whole-on .shop-hint, .ingredients.whole-on .shop-item { display: none; }
.ingredients.whole-on .shop-whole { display: block; }
.ingredients .shop-hint, .ingredients .shop-whole { margin: -4px 0 8px; }
.method ol { padding-left: 0; margin: 0; list-style: none; counter-reset: step; }
.method li { counter-increment: step; position: relative; padding: 0 0 16px 42px; }
.method li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: .82rem; font-weight: 700; }
.danger-zone { margin-top: 20px; }

/* Settings and books */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; align-items: center; margin: 0 0 12px; }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; min-width: 0; }
.steps-list li { margin-bottom: 8px; }
.book-form { display: grid; grid-template-columns: 2fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 8px; }

/* Shopping list and pantry */
.rcard-top .shop-btn { margin-left: auto; }
.rcard-top .fav-btn { margin-left: 0; }
.shop-btn { filter: grayscale(1); opacity: .4; font-size: 1rem; }
.shop-btn.on { filter: none; opacity: 1; }
.btn.js-shop.on { background: var(--brand-soft); }
.shop-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
.shop-list { list-style: none; padding: 0; margin: 0 0 12px; }
.shop-line { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.shop-line:last-child { border-bottom: 0; }
.shop-main { display: flex; gap: 10px; align-items: baseline; cursor: pointer; min-width: 0; }
.shop-main input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); position: relative; top: 3px; }
.shop-text { min-width: 0; }
.shop-for { display: block; }
.shop-line.done .shop-text { color: var(--muted); text-decoration: line-through; }
.shop-actions { display: flex; gap: 6px; align-items: baseline; flex: none; }
.shop-actions form { display: inline; }
.link-plain { color: var(--muted); text-decoration: none; font-size: .85rem; }
.link-plain:hover { color: var(--brand); text-decoration: underline; }
.have-card .shop-text { color: var(--muted); }
.add-extra { display: flex; gap: 8px; margin: 8px 0 12px; }
.plan-list { list-style: none; padding: 0; margin: 0 0 10px; }
.plan-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.plan-list li > a { font-weight: 700; text-decoration: none; display: block; }
.plan-controls { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.plan-controls form { display: inline; }
.plan-controls select { width: auto; padding: 3px 6px; font-size: .85rem; }
.pantry-list { list-style: none; padding: 0; margin: 0 0 12px; columns: 2 200px; column-gap: 24px; }
.pantry-list li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px dashed var(--line); break-inside: avoid; }
.pantry-list form { display: inline; }
.chip-btn { border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; font: inherit; font-size: .8rem; font-weight: 600; padding: 4px 10px; }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }

@media (max-width: 1180px) {
  .hero-in { padding-left: 40px; }
  .home-section { padding-left: 32px; padding-right: 32px; }
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-split { grid-template-columns: 1fr; gap: 36px; }
  .plan-card { margin-left: 0; }
  .topbar-in { gap: 12px; padding: 0 28px; }
  .topnav { gap: 4px; margin-right: 8px; }
  .topnav-link { padding: 10px 10px; font-size: 1.02rem; }
  .brand-text { font-size: 1.7rem; }
  .brand .hat { width: 40px; height: 40px; }
}

@media (max-width: 960px) {
  .topbar-in { height: 66px; padding: 0 16px; }
  .brand .hat { width: 32px; height: 32px; }
  .brand-text { font-size: 1.35rem; }
  .burger { display: flex; }
  .topnav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; box-shadow: 0 12px 24px rgba(27, 33, 48, .1); margin: 0; max-height: calc(100vh - 66px); overflow-y: auto; }
  .topbar.nav-open .topnav { display: flex; }
  .topnav-link { padding: 12px 6px; justify-content: space-between; }
  .dropdown-panel { position: static; box-shadow: none; border: 0; padding: 0 0 8px; flex-direction: column; gap: 10px; }
  .dropdown-col { max-width: none; }
  .topsearch input { display: none; }
  .topbar .topsearch.open input { display: block; width: 150px; }
  .main { padding: 22px 16px 40px; }
  .main-home { padding: 0 0 40px; }
  .hero-photo { position: relative; width: 100%; height: 220px; inset: auto; background-position: center; }
  .hero-photo::before { display: none; }
  .hero { display: flex; flex-direction: column-reverse; }
  .hero-in { padding: 28px 16px 26px; }
  .hero-lede { font-size: 1.1rem; }
  .hero-points { margin-top: 26px; gap: 12px 26px; font-size: .95rem; }
  .home-section { padding: 26px 16px 0; }
  .section-head h2, .latest h2, .plan-text h2 { font-size: 1.5rem; white-space: nowrap; }
  .more-link { font-size: .9rem; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tile-label { font-size: 1rem; }
  .plan-card { grid-template-columns: 1fr; }
  .plan-text { padding: 24px 20px; gap: 14px; }
  .plan-icon { width: 40px; height: 40px; }
  .plan-photo { max-height: 200px; }
  .latest img { width: 110px; height: 64px; }
  .latest a { gap: 14px; }
  .recipe-body, .shop-layout { grid-template-columns: 1fr; }
  .book-form { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 1.8rem; }
  .recipe-title { font-size: 1.9rem; }
}

@media print {
  .topbar, .no-print, .danger-zone, .flash { display: none !important; }
  body { background: #fff; color: #000; }
  .main { padding: 0; }
  .card, .facts { box-shadow: none; border-color: #ccc; }
  .recipe-body { grid-template-columns: 1fr 2fr; }
}
.brand-login { justify-content: center; margin: 0 0 22px; }

/* Categories */
.filters { margin-bottom: 14px; }
.filters .toolbar { margin-bottom: 10px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filter { display: flex; flex-direction: column; gap: 3px; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.filter select { width: auto; min-width: 140px; font-size: .9rem; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); padding: 7px 10px; }
.filter-sep { margin-left: auto; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.chip-filter { background: var(--brand); color: var(--brand-ink); }
.chip-filter:hover { filter: brightness(1.08); }
.group-head { font-size: 1.4rem; font-weight: 800; margin: 26px 0 12px; padding-bottom: 6px; border-bottom: 2px solid var(--brand-soft); }
.group-head:first-of-type { margin-top: 6px; }
.rcats { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 8px; }
.rcats .chip { font-size: .7rem; padding: 2px 7px; }
.cat-line { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: baseline; margin: 10px 0 0; }
.cat-line div { display: flex; gap: 8px; align-items: baseline; }
.cat-line dt { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.cat-line dd { margin: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.chip-cat { background: #eef5ec; color: var(--herb); }
.chip-cat:hover { filter: brightness(.96); }
.cat-pick { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 16px 14px; margin: 0; }
.cat-pick legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.cat-pick-group { margin-top: 10px; }
.cat-pick-group .dropdown-title { padding: 0 0 6px; display: block; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pick { cursor: pointer; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick span { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .85rem; font-weight: 500; background: var(--card); }
.pick:hover span { border-color: var(--brand); }
.pick input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); font-weight: 600; }
.pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.pick-new { width: 150px !important; padding: 4px 12px !important; border-radius: 999px !important; font-size: .85rem; }
.suggest-table { width: 100%; border-collapse: collapse; font-size: .92rem; margin-bottom: 4px; }
.suggest-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.suggest-table td { padding: 7px 8px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.suggest-table td:nth-child(2) a { color: var(--ink); text-decoration: none; font-weight: 600; }
.suggest-table .chip { margin: 0 3px 3px 0; }
.cat-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.cat-groups .card { margin: 0; }
.cat-group-name { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.h2-input { font-size: 1.15rem !important; font-weight: 800; border-color: transparent !important; padding: 4px 6px !important; }
.h2-input:hover, .h2-input:focus { border-color: var(--line) !important; }
.cat-list { list-style: none; padding: 0; margin: 0 0 8px; }
.cat-list li { display: flex; align-items: center; gap: 10px; padding: 3px 0; border-bottom: 1px dashed var(--line); }
.cat-list li .small { white-space: nowrap; color: var(--muted); }
.cat-rename { flex: 1; min-width: 0; }
.cat-rename input { border-color: transparent; padding: 5px 6px; }
.cat-rename input:hover, .cat-rename input:focus { border-color: var(--line); }
.cat-list form:last-child { display: inline; }
@media (max-width: 960px) {
  .filter-sep { margin-left: 0; }
  .filter select { min-width: 0; }
  .suggest-table { font-size: .85rem; }
  .suggest-table th:nth-child(n+4), .suggest-table td:nth-child(n+4) { display: none; }
}

/* The full-size menu needs about 1400px; tighten it a step before the 1180px layout. */
@media (max-width: 1440px) and (min-width: 1181px) {
  .topbar-in { padding: 0 32px; gap: 16px; }
  .topnav { gap: 4px; margin-right: 12px; }
  .topnav-link { font-size: 1.1rem; padding: 10px 10px; }
  .brand-text { font-size: 2rem; }
  .brand .hat { width: 50px; height: 50px; }
}

/* Below 1180px the full menu doesn't fit beside the logo, so it folds into the ☰ button (as on phones). */
@media (max-width: 1180px) {
  .topbar-in { height: 70px; padding: 0 24px; }
  .brand .hat { width: 38px; height: 38px; }
  .brand-text { font-size: 1.6rem; }
  .burger { display: flex; }
  .topnav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 8px 24px 16px; box-shadow: 0 12px 24px rgba(27, 33, 48, .1); margin: 0; max-height: calc(100vh - 70px); overflow-y: auto; gap: 0; }
  .topbar.nav-open .topnav { display: flex; }
  .topnav-link { padding: 12px 6px; justify-content: space-between; font-size: 1.05rem; }
  .dropdown-panel { position: static; box-shadow: none; border: 0; padding: 0 0 8px; flex-wrap: wrap; gap: 10px 24px; }
  .dropdown-col { max-width: none; }
}

/* Email or save */
.send-menu { position: relative; }
.send-menu > summary { list-style: none; }
.send-menu > summary::-webkit-details-marker { display: none; }
.send-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 15; width: 340px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(27, 33, 48, .16); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.send-panel p { margin: 0; }
.send-panel .note { margin: 0; }
.send-downloads { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; }
@media (max-width: 960px) {
  .send-menu { position: static; }
  .page-head { position: relative; }
  .send-panel { left: 16px; right: 16px; width: auto; }
}

/* Cookbook essentials */
.ess-book { text-decoration: none; color: var(--ink); }
.ess-section .section-head { margin-bottom: 8px; flex-wrap: wrap; }
.ess-section .section-head h2 { font-size: 1.5rem; text-transform: capitalize; }
.ess-list { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 0 28px; }
.ess-item { padding: 12px 0; border-bottom: 1px dashed var(--line); break-inside: avoid; }
.ess-item dt { font-weight: 700; font-size: 1.02rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ess-item dd { margin: 4px 0 0; }
.ess-item dd p { margin: 0 0 4px; font-size: .93rem; }
.ess-swap { color: var(--herb); }
.ess-actions { display: flex; gap: 14px; margin-top: 2px; }
.ess-actions form { display: inline; }
.shop-swap { color: var(--herb); }

/* Very narrow phones: a smaller logo so the menu and search buttons still fit. */
@media (max-width: 400px) {
  .topbar-in { gap: 6px; padding: 0 10px; }
  .brand { gap: 8px; }
  .brand .hat { width: 28px; height: 28px; }
  .brand-text { font-size: 1.15rem; }
}

/* Shopping List button in the top bar: always visible, beside the search. */
.shop-pill { display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--brand); color: var(--brand); background: var(--card); font-weight: 600; font-size: 1rem; text-decoration: none; white-space: nowrap; }
.shop-pill:hover { background: var(--brand-soft); }
.shop-pill.on { background: var(--brand); color: var(--brand-ink); }
.shop-pill.on .badge-count:not(:empty) { background: var(--brand-ink); color: var(--brand); }
@media (max-width: 1440px) and (min-width: 1181px) {
  .shop-pill { padding: 8px 13px; font-size: .95rem; }
}
@media (max-width: 1180px) {
  .brand { order: 0; }
  .shop-pill { order: 1; margin-left: auto; }
  .topsearch { order: 2; }
  .burger { order: 3; margin-left: 0; }
}
@media (max-width: 600px) {
  .shop-pill { padding: 7px 10px; gap: 4px; }
  .shop-pill-label { display: none; }
}

/* Recipe photos */
.rcard.has-photo { padding-top: 0; overflow: hidden; }
.rcard-photo { display: block; margin: 0 -18px 12px; }
.rcard-photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.photo-area { margin: 0 0 20px; }
.recipe-photo { display: block; width: 100%; max-height: 520px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow); }
.photo-area.has-photo .photo-tools { margin-top: 8px; }
.photo-tools > summary { list-style: none; display: inline-flex; }
.photo-tools > summary::-webkit-details-marker { display: none; }
.photo-area:not(.has-photo) .photo-tools > summary { display: none; }
.photo-drop { margin-top: 10px; border: 2px dashed var(--line); border-radius: var(--radius); padding: 16px 20px; background: var(--soft); transition: border-color .15s, background .15s; }
.photo-drop.over { border-color: var(--brand); background: var(--brand-soft); }
.photo-drop.busy { opacity: .6; pointer-events: none; }
.photo-steps { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.photo-steps li::marker { font-weight: 700; color: var(--brand); }
.photo-status { margin: 8px 0 0; }
.photo-status:empty { display: none; }
.link-label { color: var(--brand); text-decoration: underline; cursor: pointer; }
.link-label input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.prompt-text { margin-top: 10px; }
.prompt-text summary { cursor: pointer; color: var(--muted); }
.prompt-text textarea { margin-top: 6px; font-size: .85rem; }
.photo-tools form + form { margin-top: 6px; }
@media print { .recipe-photo { max-height: 260px; box-shadow: none; } }

/* Shown when reading a saved copy without a connection. */
.offline-bar { background: var(--warn-soft); color: var(--warn); text-align: center; font-size: .9rem; font-weight: 600; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.offline-bar[hidden] { display: none; }
@media print { .offline-bar { display: none; } }

/* Amazon matching (amazon.php) and "Order on Amazon" on the shopping list */
.shop-amazon a { color: var(--muted); }
.amz-tabs { margin: 0 0 12px; }
.amz-search { margin-bottom: 16px; }
.amz-head { display: flex; gap: 10px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.amz-head h2 { margin: 0 0 6px; }
.amz-choose { display: grid; gap: 8px; }
.amz-option { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; min-width: 0; }
.amz-option:has(input[type=radio]:checked) { border-color: var(--brand); background: var(--brand-soft); }
.amz-option input[type=radio] { flex: none; accent-color: var(--brand); }
.amz-option img, .amz-thumb { width: 48px; height: 48px; object-fit: contain; flex: none; background: #fff; border-radius: 6px; }
.amz-option > span { min-width: 0; overflow-wrap: anywhere; }
.amz-option .small { display: block; }
.amz-link { width: min(100%, 340px); margin: 4px 6px 0 0; font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.amz-choose .btn { justify-self: start; }
.amz-qty { width: 56px; flex: none; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.amz-basket .shop-main { align-items: center; }
.amz-basket .shop-main input[type=checkbox] { top: 0; }
.amz-steps { padding-left: 18px; }
.amz-steps li { margin-bottom: 6px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; }

/* Nutrition card on the recipe page */
.nutrition .nut-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.nutrition .nut-head h2 { margin: 0; }
.nut-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; margin: 0 0 12px; }
.nut-tiles div { background: var(--soft); border-radius: var(--radius); padding: 10px 12px; }
.nut-tiles dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; }
.nut-tiles dd { margin: 2px 0 0; font-weight: 700; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.nut-tiles .nut-kcal { background: var(--brand-soft); }
.nut-tiles .nut-kcal dd { color: var(--brand); }
.nut-fitness { display: flex; align-items: flex-end; gap: 10px 14px; flex-wrap: wrap; margin: 4px 0 12px; }
.nut-fitness .field { flex-direction: row; align-items: center; gap: 8px; }
.nut-fitness input[type=number] { width: 5em; }
.nut-lines table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.nut-lines th, .nut-lines td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.nut-lines .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.nut-lines tr:not(.nut-counted) td:first-child { color: var(--muted); }
.nut-lines .table-wrap { overflow-x: auto; }
.nut-form .nut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 10px 0; }

/* Grocery budget (budget.php, plan.php) */
.budget-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 14px; }
.budget-stats > div { display: flex; flex-direction: column; gap: 2px; }
.budget-stats strong { font-size: 1.5rem; font-weight: 800; }
.budget-stats strong.over, .budget-table .over { color: var(--bad); }
.budget-bar { position: relative; height: 12px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); margin: 4px 0 10px; }
.budget-spent { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--herb); }
.budget-spent.over { background: var(--bad); }
.budget-plan { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--brand); border-radius: 2px; }
.budget-set { margin: 12px 0 0; align-items: center; }
.budget-set input { max-width: 120px; }
.budget-table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.budget-table th, .budget-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.budget-table th { font-size: .78rem; color: var(--muted); font-weight: 700; }
.budget-table tfoot td { font-weight: 700; border-bottom: 0; }
.num { text-align: right !important; white-space: nowrap; }
.price-edit { display: inline-block; }
.price-edit summary { list-style: none; cursor: pointer; }
.price-edit summary::-webkit-details-marker { display: none; }
.price-form { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.price-form input { width: 70px; margin-left: 4px; font: inherit; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.price-form select { font: inherit; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); }
.spend-form, .plan-form { display: grid; gap: 10px; }
.spend-form input, .plan-form input, .plan-form select { font: inherit; font-weight: 400; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.plan-form .check { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.spend-list { margin-top: 14px; }
.spend-list li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.spend-list form { margin-left: auto; }
.history { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.history li { display: grid; grid-template-columns: 48px 1fr auto; gap: 8px; align-items: center; }
.history-bar { position: relative; height: 10px; background: var(--soft); border-radius: 999px; }
.history-bar span { position: absolute; inset: 0 auto 0 0; background: var(--herb); border-radius: 999px; }
.history-bar span.over { background: var(--bad); }
.history-bar i { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .6; }
.shop-price { margin-left: 6px; white-space: nowrap; }
.rcost { display: block; color: var(--herb); font-weight: 600; }

/* Essential recipes (basics.php) */
.basics-head .chips { margin-top: 4px; }
.basics-toc { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; }
.basics-toc a { color: var(--muted); }
.basics-list { list-style: none; padding: 0; margin: 0; }
.basics-dish { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px dashed var(--line); scroll-margin-top: 90px; }
.basics-dish:last-child { border-bottom: 0; }
.basics-tick input { width: 20px; height: 20px; accent-color: var(--herb); margin-top: 2px; cursor: pointer; }
.basics-body { flex: 1; min-width: 0; }
.basics-name { font-size: 1rem; }
.basics-dish.done .basics-name { color: var(--herb); }
.basics-dish.done .basics-name::after { content: ' ✓'; }
.basics-recipe { margin-top: 3px; overflow-wrap: anywhere; }
.basics-more { margin-top: 4px; }
.basics-more summary { cursor: pointer; color: var(--muted); }
.basics-more ul { margin: 6px 0 0; padding-left: 18px; }
.basics-more li { margin-bottom: 4px; }
.basics-shop { flex: none; }
.basics-shop .shop-btn:disabled { cursor: default; }

/* Public / Not public (2026-12-02) */
.chip-public { background: #e3f4e8; color: #1d6b37; border-color: #bfe3c9; }
.chip-private { background: var(--soft, #f4f2ef); color: var(--muted); }
@media (prefers-color-scheme: dark) {
  .chip-public { background: #193524; color: #8fd9a8; border-color: #24513a; }
}
.ingredients .ing-amz { flex: none; width: auto; margin-left: auto; font-size: .8rem; font-weight: 600; text-decoration: none; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.ingredients .ing-amz:hover { background: var(--brand-soft); }
.ingredients li:has(.ing-amz) { display: flex; align-items: baseline; gap: 8px; }
.amz-buy { margin-top: 16px; display: grid; gap: 8px; justify-items: start; }
.site-foot { max-width: 1200px; margin: 40px auto 0; padding: 24px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.site-foot p { margin: 4px 0; }
.legal { max-width: 760px; }
.legal h2 { margin-top: 28px; }

/* Members on easiercooking.com: sign up, Saved, My list, Account (src/members.php) */
.center { text-align: center; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check-line { display: flex; gap: 8px; align-items: flex-start; margin: 14px 0 4px; font-size: .95rem; }
.check-line input { margin-top: 3px; }
.btn-quiet { background: none; border-color: transparent; color: var(--muted, #666); box-shadow: none; }
.btn-quiet:hover { color: var(--brand); }
.btn-danger { background: #b3261e; border-color: #8c1d17; color: #fff; }
.btn.on { border-color: var(--brand); color: var(--brand); }
.topnav-cta { margin-left: 6px; padding: 8px 18px; font-size: 1.05rem; white-space: nowrap; }
.hero-second { margin-left: 10px; background: var(--card); }
.hero-login { margin: 12px 0 0; color: var(--muted, #555); }
.saved-item { display: flex; flex-direction: column; gap: 6px; }
.saved-item .rcard { flex: 1; }
.saved-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.list-head p { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.list-recipe { margin-bottom: 16px; }
.list-recipe-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.list-recipe-head h2 a { color: inherit; text-decoration: none; }
.list-recipe-head h2 a:hover { color: var(--brand); }
@media (max-width: 760px) { .hero-second { margin: 10px 0 0; } .topnav-cta { margin: 8px 0 0; text-align: center; justify-content: center; } }
