/* Recipe site — mobile first. Base styles target a 375px phone; min-width queries add columns. */

/* Montserrat (SIL Open Font License), variable weight 400-800, self-hosted. */
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;

  /* colours (--bg, --accent, ...) are defined by the theme sheet of the current mode: theme-food.css or theme-drinks.css */

  --cut: 12px; /* size of the 45-degree corner cuts; override per element */
  --gutter: clamp(14px, 4vw, 28px);
  --gap: clamp(12px, 3vw, 20px);
  --space: clamp(16px, 4vw, 28px);
  --topbar-h: 56px;
  --tap: 44px;

  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-body: clamp(1.0625rem, 1rem + 0.25vw, 1.125rem); /* >= 17px */
  --fs-small: 0.9375rem;
  --fs-h1: clamp(1.6rem, 1.3rem + 1.5vw, 2.4rem);
  --fs-h2: clamp(1.3rem, 1.15rem + 0.8vw, 1.7rem);
}

/* ---------------------------------------------------------------- reset */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + env(safe-area-inset-top) + 72px); }
body {
  margin: 0;
  min-height: 100dvh;
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body) / 1.5 var(--font);
  overflow-wrap: break-word;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1 { font-size: var(--fs-h1); line-height: 1.15; }
h2 { font-size: var(--fs-h2); line-height: 1.2; }
h3 { font-size: 1.1rem; }
h1, h2, h3 { color: var(--gold); }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.visually-hidden, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: fixed; z-index: 100; top: 8px; left: 8px; padding: 10px 14px; background: var(--surface); --cut: 8px; }

.js-only { display: none !important; }
.js .js-only { display: inline-flex !important; }

/* ---------------------------------------------------------------- chamfered corners
   45-degree cuts instead of rounded corners. Change --cut (here or per element) to resize.
   clip-path also clips outlines, so focus rings are drawn inside the element. */

.skip-link, .icon-btn, .mode-switch a, .choice, .parts a, .steps .tip, .field input, .field select, .field textarea, .notice, .account-card, .search-bar input, .search-bar .clear, .search-bar .submit, .btn, .tile, .badge,
.scaler, .step-btn, .step, .step::before, .nutrition, .hero {
  clip-path: polygon(
    var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)),
    calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut)
  );
}
.skip-link:focus-visible, .icon-btn:focus-visible, .mode-switch a:focus-visible, .choice:focus-visible, .parts a:focus-visible, .search-bar input:focus-visible, .btn:focus-visible,
.tile:focus-visible, .badge:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .step-btn:focus-visible, .step:focus-visible { outline-offset: -4px; }
.topbar .icon-btn:focus-visible { outline-offset: -3px; }
.hero { --cut: 0px; }

/* ---------------------------------------------------------------- layout */

.wrap {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding: var(--space) max(var(--gutter), env(safe-area-inset-left)) calc(var(--space) * 2)
    max(var(--gutter), env(safe-area-inset-right));
}
.wrap > h1 { margin-bottom: var(--space); }

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: calc(var(--topbar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(6px, env(safe-area-inset-right)) 0 max(6px, env(safe-area-inset-left));
  display: flex; align-items: center; gap: 4px;
  background: var(--brand); color: var(--brand-text);
  /* chamfered (45 degree) bottom corners; change --chamfer for bigger or smaller cuts */
  --chamfer: 16px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--chamfer)), calc(100% - var(--chamfer)) 100%,
    var(--chamfer) 100%, 0 calc(100% - var(--chamfer)));
}
.brand {
  flex: 1; min-width: 0;
  display: flex; align-items: center; min-height: var(--tap); padding-left: 8px;
}
.brand img, .drawer-logo { height: 42px; width: auto; }
.icon-btn {
  flex: none; width: var(--tap); height: var(--tap);
  display: inline-grid; place-items: center;
  border: 0; --cut: 10px; background: transparent; color: inherit; text-decoration: none;
}
.icon-btn:active { background: rgba(127, 127, 127, 0.25); }
.icon-btn svg, .clear svg, .submit svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.topbar :focus-visible { outline-color: currentColor; }

/* ---------------------------------------------------------------- landing page ("/"): logo + two choices side by side */

html[data-mode="landing"] body { padding-top: 0; }
html[data-mode="landing"] .wrap { max-width: none; padding: 0; }
.landing {
  min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: clamp(14px, 3.5dvh, 32px); text-align: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.landing-logo { margin: 0; height: clamp(190px, 42dvh, 400px); max-width: 100%; }
.landing-logo img { height: 100%; width: auto; max-width: 100%; }
.landing-lead { margin: 0; color: var(--muted); font-size: clamp(0.95rem, 0.85rem + 0.5vw, 1.15rem); }
/* the two choices stay next to each other on every screen */
.landing-choices { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 2.5vw, 20px); width: min(100%, 540px); }
.choice {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: clamp(112px, 17dvh, 168px); padding: 14px 8px; --cut: 18px;
  background: var(--food-brand); color: var(--text); text-decoration: none; min-width: 0;
}
.choice-drinks { background: var(--drinks-brand); }
.choice-icon { width: clamp(34px, 8vw, 46px); height: clamp(34px, 8vw, 46px); fill: none; stroke: var(--gold); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.choice-title { font-size: clamp(1.25rem, 0.95rem + 1.4vw, 1.9rem); font-weight: 800; letter-spacing: 0.02em; color: var(--gold); line-height: 1.15; }
.choice-sub { font-size: clamp(0.8rem, 0.75rem + 0.3vw, 0.95rem); opacity: 0.9; }
.choice:active { transform: scale(0.98); }
@media (hover: hover) {
  .choice { transition: transform 0.15s ease; }
  .choice:hover { transform: translateY(-3px); }
}

/* ---------------------------------------------------------------- Food / Drinks switch */

.mode-switch { display: flex; gap: 8px; padding: 14px var(--gutter) 4px; }
.mode-switch a {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: 0 16px; --cut: 10px;
  background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 600;
}
.mode-switch a.is-current { background: var(--accent); color: var(--accent-text); }
.mode-switch a:not(.is-current):active { background: var(--border); }

/* ---------------------------------------------------------------- drawer (works without JS via :target) */

.drawer {
  position: fixed; inset: 0; z-index: 50;
  visibility: hidden;
  transition: visibility 0s linear 0.25s;
}
.drawer:target, .drawer.open { visibility: visible; transition-delay: 0s; }
.drawer-backdrop {
  position: absolute; inset: 0; background: var(--overlay);
  opacity: 0; transition: opacity 0.25s ease;
}
.drawer:target .drawer-backdrop, .drawer.open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; inset: 0 auto 0 0;
  width: min(80vw, 320px); height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--surface); box-shadow: var(--shadow);
  transform: translateX(-102%); transition: transform 0.25s ease;
}
.drawer:target .drawer-panel, .drawer.open .drawer-panel { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--topbar-h); padding: 0 6px 0 var(--gutter);
  background: var(--brand); color: var(--brand-text);
}
.drawer-panel li a {
  display: flex; align-items: center; min-height: 52px; padding: 0 var(--gutter);
  text-decoration: none; font-size: 1.15rem;
}
.drawer-panel li a:active { background: var(--surface-2); }
.drawer-panel li a[aria-current="page"] {
  background: var(--surface-2); color: var(--accent); font-weight: 700;
  box-shadow: inset 4px 0 0 var(--accent);
}
.drawer-panel:focus { outline: none; }
body.menu-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .drawer, .drawer-backdrop, .drawer-panel { transition: none; }
}

/* ---------------------------------------------------------------- search field */

.search-bar {
  position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top)); z-index: 20;
  display: flex; align-items: center;
  margin: calc(var(--space) * -1) calc(var(--gutter) * -1) var(--space);
  padding: 10px var(--gutter);
  background: var(--bg);
}
.search-bar input {
  flex: 1; min-width: 0; height: 48px;
  padding: 0 calc(var(--tap) * 2 + 4px) 0 16px;
  font-size: 1rem; /* >= 16px, otherwise iOS Safari zooms in */
  background: var(--surface-2); border: 0; --cut: 10px;
  -webkit-appearance: none; appearance: none;
}
.search-bar input:focus { outline: none; background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); box-shadow: inset 0 -3px 0 var(--accent); }
.search-bar input::-webkit-search-cancel-button { display: none; }
.search-bar .clear, .search-bar .submit {
  position: absolute; width: var(--tap); height: var(--tap);
  display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); text-decoration: none; --cut: 10px;
}
.search-bar .submit { right: calc(var(--gutter) + 2px); color: var(--accent); }
.search-bar .clear { right: calc(var(--gutter) + var(--tap)); }
.search-bar input:placeholder-shown ~ .clear { display: none; }

.status { color: var(--muted); font-size: var(--fs-small); margin-bottom: 12px; }

.empty { text-align: center; padding: calc(var(--space) * 1.5) 0; color: var(--muted); }
.empty-title { font-size: 1.15rem; color: var(--text); }
.empty h1 { margin-bottom: 8px; }
.empty-actions { margin-top: 16px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 20px;
  background: var(--accent); color: var(--accent-text);
  border: 2px solid var(--accent); --cut: 12px;
  font-weight: 600; text-decoration: none;
}
.btn-ghost { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: transparent; color: var(--accent); }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

/* ---------------------------------------------------------------- tiles */

.tiles { display: grid; gap: var(--gap); }
.recipe-tiles { grid-template-columns: 1fr; }
.category-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles > li { min-width: 0; filter: var(--drop); }

.tile {
  position: relative; display: block; overflow: hidden;
  --cut: 20px; background: var(--surface-2);
  text-decoration: none; color: #fff; isolation: isolate;
}
.tile-media { position: relative; aspect-ratio: 4 / 3; }
.tile.square .tile-media { aspect-ratio: 1; }
.tile-media img, .placeholder { width: 100%; height: 100%; object-fit: cover; }
.placeholder {
  display: grid; place-items: center;
  background: hsl(var(--hue, 20) 55% 40%); color: #fff;
  font-size: 4rem; font-weight: 700;
}
.tile-name {
  position: absolute; inset: auto 0 0 0; z-index: 1;
  padding: 36px 12px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.45) 55%, transparent);
  font-weight: 700; font-size: 1.1rem; line-height: 1.25;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.tile-name small { display: block; font-weight: 400; font-size: 0.875rem; opacity: 0.9; }
.tile .badge.time {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  background: rgba(0, 0, 0, 0.65); color: #fff; backdrop-filter: blur(4px);
}
@media (hover: hover) {
  .tile { transition: transform 0.15s ease; }
  .tile:hover { transform: translateY(-2px); }
}
.tile:active { transform: scale(0.99); }

/* ---------------------------------------------------------------- home */

.home-section { margin-top: calc(var(--space) * 1.5); }
.home-section .tiles { margin-top: 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head a { color: var(--accent); font-weight: 600; text-decoration: none; padding-block: 10px; }
.home-section:first-of-type { margin-top: var(--space); }

/* ---------------------------------------------------------------- recipe detail */

.recipe > * + * { margin-top: 16px; }
.hero { width: calc(100% + var(--gutter) * 2); max-width: none; margin: calc(var(--space) * -1) calc(var(--gutter) * -1) 0; aspect-ratio: 3 / 2; height: auto; object-fit: cover; }
.hero.placeholder { font-size: 6rem; }
.lead { color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px;
  background: var(--surface-2); border: 0; --cut: 8px;
  font-size: var(--fs-small); text-decoration: none;
}
a.badge { min-height: var(--tap); }
.badge.diet { color: #166534; background: #dcfce7; }
@media (prefers-color-scheme: dark) { .badge.diet { color: #bbf7d0; background: #14391f; } }
.times { color: var(--muted); font-size: var(--fs-small); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.scaler {
  align-items: center; gap: 4px;
  background: var(--surface-2); border: 0; --cut: 14px; padding: 2px;
}
.parts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.parts-label { color: var(--muted); font-size: var(--fs-small); margin-right: 2px; }
.parts a {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 14px; --cut: 8px;
  background: var(--surface-2); color: var(--text); font-size: var(--fs-small); font-weight: 600; text-decoration: none;
}
.parts a:active { background: var(--border); }
.to-top {
  float: right; display: inline-grid; place-items: center; min-width: var(--tap); min-height: var(--tap); margin: -10px -6px -10px 0;
  color: var(--accent); font-size: 1.2rem; font-weight: 700; text-decoration: none;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.scaler-value { min-width: 11ch; padding: 0 4px; white-space: nowrap; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.step-btn {
  width: var(--tap); height: var(--tap); border: 0; --cut: 12px;
  background: var(--accent); color: var(--accent-text); font-size: 1.5rem; line-height: 1;
}
.step-btn:disabled { opacity: 0.4; cursor: default; }

.recipe h2 { margin-top: calc(var(--space) * 1.25); margin-bottom: 8px; }
.ingredient-list { border-top: 1px solid var(--border); }
.group-name { margin: 18px 0 6px; }
.ingredients > .group-name:first-of-type { margin-top: 4px; }
.ingredient-list li { border-bottom: 1px solid var(--border); }
.check { display: flex; align-items: center; gap: 14px; min-height: var(--tap); padding: 10px 2px; cursor: pointer; }
.check input {
  flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--accent);
}
.check input:checked + .ing { text-decoration: line-through; color: var(--muted); }

/* the numbering restarts at 1 in every section ("1. Bouillon": steps 1-6, "2. Risotto": steps 1-8) */
.steps { counter-reset: step; }

/* tips between the steps: no number, a tinted box with a bar on the left */
.steps .tip {
  position: relative; --cut: 12px; padding: 12px 14px 12px 18px; font-size: 0.95em;
  background: color-mix(in srgb, var(--accent) 9%, var(--surface)); box-shadow: inset 4px 0 0 var(--accent);
}
.steps .tip::before {
  content: "Tip"; display: block; margin-bottom: 2px; color: var(--accent);
  font-size: 0.78em; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}

/* parts that only hold tips (tasting notes, mise-en-place, wine tip): a list without numbers */
.notes { display: grid; gap: 8px; margin: 0 0 4px; }
.notes li { position: relative; padding-left: 24px; }
.notes li::before {
  content: ""; position: absolute; left: 5px; top: 0.62em; width: 8px; height: 8px;
  background: var(--gold); transform: rotate(45deg);
}
.notes-block { margin-top: 20px; }
.notes-block summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: var(--tap);
  cursor: pointer; list-style: none;
}
.notes-block summary::-webkit-details-marker { display: none; }
.notes-block summary h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.notes-block summary h3::after {
  content: ""; width: 9px; height: 9px; border: solid currentColor; border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) translateY(-2px); transition: transform 0.2s ease;
}
.notes-block[open] summary h3::after { transform: rotate(-135deg) translateY(-2px); }
.notes-block .notes { margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .notes-block summary h3::after { transition: none; } }
.steps-wrap h3 { margin: 20px 0 8px; }
.steps { display: grid; gap: 10px; filter: var(--drop); }
.step {
  position: relative; counter-increment: step;
  padding: 14px 14px 14px 56px; min-height: var(--tap);
  background: var(--surface); border: 0; --cut: 14px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.step::before {
  content: counter(step); position: absolute; left: 12px; top: 12px;
  width: 32px; height: 32px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text); --cut: 9px; font-weight: 700; font-size: 0.95rem;
}
.step.current { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: inset 4px 0 0 var(--accent); }
.step.current::before { background: var(--accent); color: var(--accent-text); }

.nutrition { margin-top: calc(var(--space) * 1.25); background: var(--surface-2); border: 0; --cut: 14px; }
.nutrition summary { display: flex; align-items: center; min-height: var(--tap); padding: 0 16px; font-weight: 600; cursor: pointer; }
.nutrition dl { padding: 0 16px 8px; }
.nutrition dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.nutrition dt { color: var(--muted); }
.nutrition dd { margin: 0; font-weight: 600; }
.meta { color: var(--muted); font-size: var(--fs-small); }

body.cook-mode .recipe { font-size: 1.4rem; line-height: 1.55; }   /* >= 22px */
body.cook-mode .recipe .badge, body.cook-mode .recipe .times, body.cook-mode .meta { font-size: 1.1rem; }
body.cook-mode .step { padding-left: 64px; }
body.cook-mode .step::before { width: 38px; height: 38px; font-size: 1.1rem; }

/* ---------------------------------------------------------------- larger screens */

@media (min-width: 600px) {
  .recipe-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* show the whole picture: scale with the window, never crop (tall photos are capped at 75% of the window height) */
  .hero { display: block; width: auto; max-width: 100%; height: auto; aspect-ratio: auto; max-height: 75dvh; margin: 0 auto; object-fit: contain; --cut: 14px; }
  .hero.placeholder { display: grid; width: 100%; aspect-ratio: 3 / 2; max-height: 420px; }
  .search-bar { margin-inline: 0; padding-inline: 0; }
  .search-bar .submit { right: 2px; }
  .search-bar .clear { right: var(--tap); }
}

@media (min-width: 900px) {
  .recipe-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .category-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .recipe-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); column-gap: 40px; align-items: start; }
  .recipe-body > section > h2 { margin-top: 0; }
  .recipe-body > section { margin-top: 0; }
  .search-bar { max-width: 640px; }
}

@media (min-width: 1200px) {
  .recipe-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .category-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (min-width: 1500px) {
  .category-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ---------------------------------------------------------------- login, account, accounts (admin) */

.drawer-panel .menu-form { margin: 0; }
.drawer-panel .menu-form button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 52px;
  padding: 0 var(--gutter); border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 1.15rem; text-align: left; cursor: pointer;
}
.drawer-panel .menu-form button:active { background: var(--surface-2); }
.drawer-panel .menu-form small { color: var(--muted); font-size: 0.8rem; }

.auth-card { width: 100%; max-width: 440px; margin-inline: auto; display: grid; gap: 14px; }
.auth-card.wide { max-width: 560px; margin-inline: 0; }
.auth-card h1, .auth-card h2 { margin: 0; }
.wrap > h1 + .notice { margin-top: -8px; }
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
.field input, .field select {
  width: 100%; min-height: 48px; padding: 0 14px; --cut: 10px; border: 0;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 1rem; /* >= 16px: no zoom on iOS */
  -webkit-appearance: none; appearance: none;
}
.field textarea {
  width: 100%; min-height: 96px; padding: 12px 14px; --cut: 10px; border: 0; resize: vertical;
  background: var(--surface-2); color: var(--text); font: inherit; font-size: 1rem; line-height: 1.5;
  -webkit-appearance: none; appearance: none;
}
.field select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; background-color: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); box-shadow: inset 0 -3px 0 var(--accent); }
button.btn { cursor: pointer; font: inherit; font-weight: 600; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.hint { margin: 0; color: var(--muted); font-size: var(--fs-small); }
.text-link { color: var(--accent); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; min-height: var(--tap); }
.notice {
  margin: 0 0 4px; padding: 12px 16px; --cut: 10px; font-size: var(--fs-small); font-weight: 600;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow: inset 4px 0 0 var(--accent);
}
.notice.error { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); box-shadow: inset 4px 0 0 var(--danger); }
.facts { margin: 0; display: grid; gap: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.badge.role-admin { background: var(--accent); color: var(--accent-text); }
.list-title { margin: var(--space) 0 12px; }
.account-list { display: grid; gap: 12px; }
.account-card { --cut: 14px; padding: 14px 16px; background: var(--surface); display: grid; gap: 12px; }
.account-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.account-head .hint { flex-basis: 100%; }
.account-actions { display: grid; gap: 12px; }
.inline-form { display: grid; gap: 8px; align-items: end; }
.check-inline { display: flex; align-items: center; gap: 10px; min-height: var(--tap); font-size: var(--fs-small); }
.check-inline input { width: 22px; height: 22px; accent-color: var(--danger); }
@media (min-width: 600px) {
  .inline-form { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ---------------------------------------------------------------- edit a recipe (administrators) */
.edit-card { max-width: 720px; }
.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.edit-card code { background: var(--surface-2); padding: 1px 6px; }
.backup-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.backup-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 0; border-top: 1px solid var(--border); }
.backup-list .inline-form { display: block; }
.picture-field { display: grid; gap: 10px; }
.picture-field > .label { font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
.picture-field img { max-width: 300px; width: 100%; height: auto; display: block; }
.field input[type="file"] { padding: 10px 14px; min-height: 48px; }

/* category tiles: a collage of up to four pictures of items in the category */
.collage { display: grid; grid-template: 1fr 1fr / 1fr 1fr; gap: 2px; width: 100%; height: 100%; background: var(--surface); }
.collage img { min-height: 0; min-width: 0; }
.collage-2 { grid-template-rows: 1fr; }
.collage-3 img:nth-child(3) { grid-column: 1 / -1; }

/* login log (administrators) */
.badge.outcome-success { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--text); }
.badge.outcome-wrong_password, .badge.outcome-unknown_user, .badge.outcome-locked { background: var(--danger); color: #fff; }
.login-card .facts { font-size: var(--fs-small); }
.login-card .facts > div { padding: 6px 0; flex-wrap: wrap; }
.login-card .facts dd { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.log-details code { display: block; overflow-wrap: anywhere; font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

/* admin buttons on a recipe page */
.admin-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 4px 0 8px; }
.admin-actions form { margin: 0; }
.drawer-panel li > a small { margin-left: 4px; color: var(--muted); }

/* guest access: the QR code (black on white, whatever the theme: scanners need that) */
.qr-box { background: #fff; padding: 12px; width: fit-content; max-width: 100%; }
.qr-box .qr { display: block; width: min(260px, 100%); height: auto; }
.guest-card code { overflow-wrap: anywhere; }
.badge.outcome-guest { background: color-mix(in srgb, var(--accent) 15%, var(--surface)); color: var(--text); }
.badge.outcome-bad_key { background: var(--danger); color: #fff; }

/* the category a search is limited to */
.filter-chip { margin: 0 0 8px; color: var(--muted); font-size: var(--fs-small); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.filter-chip strong { color: var(--text); }
.filter-chip a { color: var(--accent); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; min-height: var(--tap); }

/* the taste profile under the steps */
.taste { margin: var(--space) 0; padding: 14px 16px 12px 18px; --cut: 12px; background: color-mix(in srgb, var(--accent) 9%, var(--surface)); box-shadow: inset 4px 0 0 var(--accent); clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut)); }
.taste h2 { margin: 0 0 6px; font-size: 1em; color: var(--accent); letter-spacing: 0.08em; text-transform: uppercase; }
.taste p { margin: 0 0 6px; }
.badge.rating { font-weight: 700; }

/* sort by A-Z or by rating (the recipes page) */
.sort-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 var(--space); }
.sort-label { color: var(--muted); font-size: var(--fs-small); }
.sort-option {
  display: inline-flex; align-items: center; min-height: var(--tap); padding: 0 16px; --cut: 10px;
  background: var(--surface-2); color: var(--text); text-decoration: none; font-weight: 600;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
.sort-option.is-current { background: var(--accent); color: var(--accent-text); }
