/*
 * RRhub – fælles stil. Farver og skrift er taget fra design/ugeplan-retninger/tokens.css.
 * Login, forsiden, varekataloget (varer.html), opskrifterne (opskrifter.html, opskrift.html), opskriftsformularen
 * (opskrift-formular.html) og ugeplanen (ugeplan.html). Flere tokens tilføjes, når skærmene bygges.
 * Komponenterne følger design/v1b/ (ark, felter, chips, afdelingsoverskrifter).
 *
 * Instrument Sans og Newsreader er selvhostet (SIL OFL, se /fonts/OFL-InstrumentSans.txt og /fonts/OFL-Newsreader.txt),
 * så brugernes IP ikke sendes videre. Newsreader er fra @fontsource-variable/newsreader 5.2.8: den opretstående med
 * aksen for optisk størrelse (opsz 6-72, som i designet), så overskrifterne bliver finere end brødteksten, og den
 * kursive kun med vægt-aksen (bruges kun småt, fx "Ude" på ugeplanen). latin-ext hentes kun, hvis teksten har tegn
 * uden for latin (fx č eller ő); æ, ø og å ligger i latin.
 */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/instrument-sans-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;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/newsreader-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;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/newsreader-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/newsreader-italic-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;
}
@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url("../fonts/newsreader-italic-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light dark;
  --bg: #f6f0e8;
  --surface: #fffbf6;
  --surface-2: #efe7dc;
  --line: #e4d9cc;
  --line-strong: #9c8b7e;
  --ink: #2b201a;
  --ink-soft: #766860;
  --ink-on-tone: #5e5249;
  --peach: #f2a27c;
  --peach-press: #e88f66;
  --peach-soft: #fbe3d4;
  --peach-ink: #a4502a;
  --on-peach: #2b201a;
  --scrim: rgb(43 32 26 / .42);
  /* Farveflader pr. ret (id % 6), når der ikke er billede */
  --tone-1: #f5d5c0; --tone-2: #f1c9a5; --tone-3: #e9dcc7;
  --tone-4: #ecccc2; --tone-5: #e6dfd3; --tone-6: #ddd3c6;
  --error: #a4502a;
  --focus: #a4502a;

  --sans: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --fs-xs: .75rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.1875rem;
  --fs-xl: 1.4375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.125rem;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  --r-sm: 6px; --r-md: 12px; --r-lg: 20px; --r-pill: 999px;
  --target: 44px;
  --dur: 180ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1e1915; --surface: #28211c; --surface-2: #332a24; --line: #3d332c; --line-strong: #8a7a6d;
    --ink: #f3eae0; --ink-soft: #b5a79b; --ink-on-tone: #d6c8bb; --peach-soft: #4a3326; --peach-ink: #f2a27c;
    --scrim: rgb(0 0 0 / .55); --error: #f2a27c; --focus: #f2a27c;
    --tone-1: #4a3326; --tone-2: #4d3a28; --tone-3: #3f3529; --tone-4: #4a322e; --tone-5: #39332c; --tone-6: #3a3029;
  }
}
:root[data-theme="dark"] {
  --bg: #1e1915; --surface: #28211c; --surface-2: #332a24; --line: #3d332c; --line-strong: #8a7a6d;
  --ink: #f3eae0; --ink-soft: #b5a79b; --ink-on-tone: #d6c8bb; --peach-soft: #4a3326; --peach-ink: #f2a27c;
  --scrim: rgb(0 0 0 / .55); --error: #f2a27c; --focus: #f2a27c;
  --tone-1: #4a3326; --tone-2: #4d3a28; --tone-3: #3f3529; --tone-4: #4a322e; --tone-5: #39332c; --tone-6: #3a3029;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--sans); font-size: var(--fs-md); line-height: 1.45;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.page {
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  padding: var(--s-6) var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-4);
}
.page h1 {
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-2xl); line-height: 1.15; margin: 0;
}
.page p { margin: 0; }
.muted { color: var(--ink-soft); }
.error { color: var(--error); font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--target); padding: 0 var(--s-5);
  border-radius: var(--r-pill); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
  align-self: flex-start;
}
.btn:hover { background: var(--surface-2); }

/* Clerks login-komponent må ikke gøre siden bredere end skærmen */
.clerk-sign-in { max-width: 100%; overflow-x: auto; }

/* Link i brødtekst og på forsiden */
.link {
  display: inline-flex; align-items: center; min-height: var(--target);
  font-weight: 600; color: var(--peach-ink);
  text-decoration: underline; text-underline-offset: 3px;
}

/* ================= Varekatalog (varer.html) ================= */

/* Plads til den faste knap i bunden */
.page.catalog { gap: 0; padding-top: 0; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; min-height: 56px; margin: 0 calc(var(--s-2) * -1); }
.text-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: var(--target); padding: 0 var(--s-2); border: 0; border-radius: var(--r-pill);
  background: none; font-weight: 600; font-size: var(--fs-sm); color: var(--ink); text-decoration: none; cursor: pointer;
}
.text-btn:hover { background: var(--surface-2); }
.text-btn.danger { color: var(--error); }
.ico { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.page.catalog h1 { font-size: var(--fs-3xl); line-height: 1; letter-spacing: -.01em; }

/* Vælger mellem "Varer" og "Afdelinger" */
.seg { display: flex; margin-top: var(--s-4); padding: 3px; border-radius: var(--r-pill); background: var(--surface-2); }
.seg button {
  flex: 1; min-height: var(--target); border: 0; border-radius: var(--r-pill); background: none;
  font-size: var(--fs-sm); font-weight: 500; color: var(--ink-soft); cursor: pointer;
}
.seg [aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }

.search {
  display: flex; align-items: center; gap: var(--s-2);
  min-height: var(--target); margin-top: var(--s-4); padding: 0 var(--s-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface);
}
.search .ico { width: 18px; height: 18px; stroke: var(--ink-soft); }
.search input { flex: 1; min-width: 0; min-height: 42px; border: 0; background: transparent; outline: none; }
.search input::placeholder { color: var(--ink-soft); }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }

.state { margin-top: var(--s-5); color: var(--ink-soft); }
.state.error { color: var(--error); }
.empty-box { margin-top: var(--s-5); padding: var(--s-5) var(--s-4); border-radius: var(--r-lg); background: var(--surface-2); }
.empty-box h2 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-xl); margin: 0; }
.empty-box p { margin-top: var(--s-2); color: var(--ink-soft); }

/* Afdelingsoverskrift og varelinjer, som på indkøbslisten */
.dept { margin-top: var(--s-5); }
.dept h2 {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin: 0;
  padding-bottom: var(--s-2); border-bottom: 1px solid var(--ink);
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-xl); line-height: 1.1;
}
.dept .cnt { font-family: var(--sans); font-size: var(--fs-sm); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.rows { list-style: none; margin: 0; padding: 0; }
.item-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  width: 100%; min-height: 60px; padding: var(--s-2) 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; cursor: pointer;
}
.item-row:hover .nm { text-decoration: underline; text-underline-offset: 3px; }
.item-row .nm { display: block; font-size: 1.0625rem; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.item-row .sub { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--ink-soft); }
.item-row .ico { width: 18px; height: 18px; color: var(--ink-soft); }
.badge {
  display: inline-block; margin-left: var(--s-2); padding: 1px 8px; border-radius: var(--r-pill);
  background: var(--peach-soft); color: var(--ink); font-size: var(--fs-xs); font-weight: 600; vertical-align: 2px;
}

/* Afdelingernes rækkefølge */
.help { margin-top: var(--s-4); color: var(--ink-soft); font-size: var(--fs-sm); }
.order { list-style: none; margin: var(--s-4) 0 0; padding: 0; counter-reset: dept; }
.order li {
  display: flex; align-items: center; gap: var(--s-2);
  min-height: 60px; border-bottom: 1px solid var(--line); counter-increment: dept;
}
.order li::before {
  content: counter(dept); width: 28px; flex: none;
  font-family: var(--serif); font-size: var(--fs-lg); color: var(--ink-soft); font-variant-numeric: lining-nums;
}
.order .nm { flex: 1; min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.icon-btn {
  display: grid; place-items: center; width: var(--target); height: var(--target); flex: none;
  border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--surface-2); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.save-state { min-height: 1.45em; margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--ink-soft); }
.save-state.error { color: var(--error); font-weight: 600; }

/* Fast knap i bunden, inden for tommelfingerens rækkevidde */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  padding: var(--s-3) 0 calc(var(--s-3) + env(safe-area-inset-bottom)); background: var(--bg);
}
.dock-inner { max-width: 480px; margin: 0 auto; padding: 0 var(--s-4); }
.btn-primary {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  width: 100%; min-height: 52px; border: 0; border-radius: var(--r-pill);
  background: var(--peach); color: var(--on-peach); font-weight: 600; cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.btn-primary:hover { background: var(--peach-press); }
.btn-primary:disabled { background: var(--surface-2); color: var(--ink-soft); cursor: not-allowed; }

/* Ark (native <dialog>): nedefra på mobilen, i midten på computeren */
.sheet {
  width: 100%; max-width: 480px; max-height: calc(100dvh - 48px);
  margin: auto auto 0; padding: 0; border: 0; border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--surface); color: var(--ink);
}
.sheet::backdrop { background: var(--scrim); }
.sheet form { display: flex; flex-direction: column; }
.sheet-head {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-3) var(--s-2) var(--s-2) var(--s-4); background: var(--surface);
}
.sheet-head h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--fs-xl); line-height: 1.15; }
.sheet-body { padding: 0 var(--s-4) var(--s-5); }
.sheet-foot {
  position: sticky; bottom: 0; display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom)); background: var(--surface);
  border-top: 1px solid var(--line);
}
.sheet-foot .text-btn { align-self: center; }
@media (min-width: 600px) {
  .sheet { margin: auto; border-radius: var(--r-lg); }
}

/* Felter som i formularen i design/v1b */
.field { margin-top: var(--s-4); }
.field > label, .field > .flabel { display: block; font-weight: 600; }
.field .hint { margin-top: 2px; font-size: var(--fs-sm); color: var(--ink-soft); }
.input {
  display: block; width: 100%; min-height: 48px; margin-top: var(--s-2); padding: 0 var(--s-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
  font-size: var(--fs-md);
}
select.input { padding-right: var(--s-2); }
.input:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.input::placeholder { color: var(--ink-soft); }
.input[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.err-msg { margin-top: var(--s-2); font-size: var(--fs-sm); font-weight: 600; color: var(--error); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.cols .field { min-width: 0; }

/* Basisvare: kontakt (checkbox med role="switch") */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-5); }
.switch-row label { font-weight: 600; cursor: pointer; }
.switch-row .hint { display: block; font-weight: 400; font-size: var(--fs-sm); color: var(--ink-soft); }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; position: relative; margin: 0;
  width: 52px; height: 32px; border-radius: var(--r-pill); background: var(--surface-2);
  box-shadow: inset 0 0 0 1.5px var(--line-strong); cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.switch::after {
  content: ""; position: absolute; top: 4px; left: 4px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink-soft); transition: transform var(--dur) var(--ease);
}
.switch:checked { background: var(--peach); box-shadow: none; }
.switch:checked::after { transform: translateX(20px); background: var(--on-peach); }
/* Større trykflade end selve kontakten */
.switch-wrap { display: grid; place-items: center; min-width: var(--target); min-height: var(--target); }

/* Aliasser som chips med × */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-2) 0 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; min-height: var(--target); padding-left: var(--s-3);
  border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); overflow-wrap: anywhere;
}
.chip button {
  display: grid; place-items: center; width: 40px; height: var(--target); flex: none;
  border: 0; background: none; color: var(--ink-on-tone); cursor: pointer; border-radius: var(--r-sm);
}
.chip button .ico { width: 14px; height: 14px; stroke-width: 2; }
.add-alias { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
.add-alias .input { margin: 0; flex: 1; min-width: 0; }
.btn-sec {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 var(--s-4); border-radius: var(--r-pill);
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 600; font-size: var(--fs-sm); cursor: pointer;
}
.btn-sec:hover { background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) { .switch, .switch::after, .btn-primary { transition: none; } }

/* ================= Opskrifter (opskrifter.html og opskrift.html) =================
 * Fra design/v1b/v1b.css og Tavlen (design/ugeplan-retninger/b.css). Rettens farveflade (--tone, t1-t6 ud fra
 * id % 6) går igen på kortet i listen, forsiden, trinnumrene og tips.
 */
.t1 { --tone: var(--tone-1); } .t2 { --tone: var(--tone-2); } .t3 { --tone: var(--tone-3); }
.t4 { --tone: var(--tone-4); } .t5 { --tone: var(--tone-5); } .t6 { --tone: var(--tone-6); }

/* Lys grå tilføjelse efter retnavnet: "Lasagne, 4 pers." */
.add { color: var(--ink-soft); font-weight: 400; white-space: nowrap; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* Skal: indhold + fast bundnavigation */
.app {
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  padding: 0 var(--s-4) calc(96px + env(safe-area-inset-bottom));
}
.app .state { margin-top: var(--s-5); }
.topbar.spread { justify-content: space-between; }
.page-title {
  margin: var(--s-2) 0 0; font-family: var(--serif); font-weight: 400;
  font-size: var(--fs-3xl); line-height: 1; letter-spacing: -.01em;
}

/* Bundnavigation (tabbar) i docken */
.dock:has(.tabbar) { padding-top: var(--s-1); border-top: 1px solid var(--line); }
.dock .btn-primary { margin-top: var(--s-2); }
.tabbar { display: grid; grid-template-columns: repeat(3, 1fr); }
.tabbar .tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; font-size: var(--fs-xs); font-weight: 500; line-height: 1.2; color: var(--ink-soft);
  text-decoration: none; text-align: center;
}
.tabbar .tab[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabbar .tab[aria-disabled="true"] { cursor: default; }
.tabbar svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Listen ---------- */
.filters { display: flex; align-items: center; gap: var(--s-2); margin-top: var(--s-4); }
.filters .search { flex: 1; min-width: 0; margin-top: 0; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: var(--target); padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.filter-btn .heart { width: 18px; height: 18px; fill: none; stroke: var(--peach-ink); stroke-width: 1.8; }
.filter-btn[aria-pressed="true"] { background: var(--peach-soft); border-color: var(--peach-ink); }
.filter-btn[aria-pressed="true"] .heart { fill: var(--peach-ink); }
.count { min-height: 1.45em; margin: var(--s-3) 0 0; font-size: var(--fs-sm); color: var(--ink-soft); }
.app .count + .state:empty { display: none; }

.cards {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2);
  margin: var(--s-2) 0 0; padding: 0; list-style: none;
}
.card {
  position: relative; min-height: 148px; border-radius: var(--r-md); overflow: hidden;
  background: var(--tone, var(--surface-2));
}
.card-link {
  display: flex; flex-direction: column; justify-content: flex-end; height: 100%; min-height: 148px;
  padding: 52px 12px 12px; color: var(--ink); text-decoration: none; border-radius: var(--r-md);
  transition: transform var(--dur) var(--ease);
}
.card-link:active { transform: scale(.985); }
.card-link:focus-visible { outline-offset: -3px; }
.card .nm {
  font-family: var(--serif); font-size: var(--fs-lg); line-height: 1.15; overflow-wrap: anywhere; hyphens: auto;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.card-link:hover .nm { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.card .sub { margin-top: 2px; font-size: var(--fs-sm); color: var(--ink-on-tone); }
/* Hjertet: 44 px trykflade, rund flade på 32 px */
.card-fav {
  position: absolute; top: 2px; right: 2px; display: grid; place-items: center;
  width: var(--target); height: var(--target); border: 0; border-radius: 50%; background: none; cursor: pointer;
}
.card-fav svg {
  width: 32px; height: 32px; padding: 7px; border-radius: 50%; background: var(--surface);
  fill: none; stroke: var(--peach-ink); stroke-width: 2;
}
.card-fav[aria-pressed="true"] svg { fill: var(--peach-ink); }

/* Med billede: billedet øverst og navnet under på rettens flade (som Tavlens ret-vælger). Pladsen holdes i
   rettens farve, til billedet er hentet; fejler det, bliver kortet en almindelig flade igen. */
.card.has-photo .card-link { justify-content: flex-start; padding: 0; }
.card .ph {
  display: block; flex: none; width: 100%; height: 96px; object-fit: cover;
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.card.photo-ready .ph { opacity: 1; }
.card.has-photo .card-text { display: flex; flex-direction: column; flex: 1; justify-content: flex-end; padding: 10px 12px 12px; }
.card.has-photo .nm { -webkit-line-clamp: 3; }

@media (min-width: 600px) { .cards { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 760px) {
  .app.recipes { max-width: 880px; }
  .cards { grid-template-columns: repeat(4, 1fr); gap: var(--s-3); }
  .card, .card-link { min-height: 180px; }
}
@media (min-width: 760px) { .card .ph { height: 116px; } }
@media (prefers-reduced-motion: reduce) { .card-link, .card .ph { transition: none; } }

/* ---------- Opskriften: forside ---------- */
.float-btn {
  display: grid; place-items: center; width: var(--target); height: var(--target);
  border-radius: 50%; background: var(--surface); color: var(--ink);
}
.hero { position: relative; margin: 0 calc(var(--s-4) * -1); background: var(--tone, var(--surface-2)); }
.hero-bar {
  position: absolute; inset: 0 0 auto; display: flex; justify-content: space-between; align-items: center;
  gap: var(--s-2); padding: calc(var(--s-3) + env(safe-area-inset-top)) var(--s-4) 0;
}
.hero-bar .right { display: flex; gap: var(--s-2); }
button.float-btn { border: 0; cursor: pointer; }
button.float-btn:hover { background: var(--surface-2); }
button.float-btn:disabled { opacity: .6; cursor: progress; }
/* Med billede: billedet er forsiden (300 px, 380 px på computer). Pladsen står i rettens farve, mens det hentes */
.hero:not(.flat) { min-height: 300px; }
.hero-photo { display: block; width: 100%; height: 300px; object-fit: cover; }
.dish-head.titled { padding-top: var(--s-5); }
.dish-head > h1 {
  margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--fs-3xl); line-height: 1.06;
  letter-spacing: -.012em; text-wrap: balance; overflow-wrap: anywhere; hyphens: auto;
}
.photo-status, .pic-status { margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--ink-soft); }

/* Uden billede: fladen er forsiden, navnet står stort nederst til venstre */
.hero.flat { min-height: 300px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero.flat h1 {
  margin: 0; padding: 88px var(--s-4) var(--s-5);
  font-family: var(--serif); font-weight: 400; font-size: 2.5rem; line-height: 1.04; letter-spacing: -.015em;
  text-wrap: balance; overflow-wrap: anywhere; hyphens: auto;
}
.hero.flat h1 .add { color: var(--ink-on-tone); }

.dish-head { padding-top: var(--s-3); }
.meta-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: var(--target); }
.meta-row .src {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--target); min-width: 0;
  font-size: var(--fs-sm); color: var(--ink-soft); text-decoration: none;
}
.meta-row .src span { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.meta-row .src:hover { color: var(--ink); }
.fav-btn {
  display: grid; place-items: center; width: var(--target); height: var(--target); flex: none; margin-left: auto; margin-right: -10px;
  border: 0; border-radius: 50%; background: none; cursor: pointer;
}
.fav-btn svg { width: 24px; height: 24px; stroke: var(--peach-ink); stroke-width: 1.7; fill: none; }
.fav-btn[aria-pressed="true"] svg { fill: var(--peach-ink); }
.check-note { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--peach-ink); }
.dish-head .state { margin-top: var(--s-2); }

/* Portioner */
.portions {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  margin-top: var(--s-3); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border-radius: var(--r-pill); background: var(--surface-2);
}
.portions .lbl { font-size: var(--fs-sm); font-weight: 600; }
.portions .lbl small { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--ink-soft); }
.stepper { display: inline-flex; align-items: center; }
.stepper button {
  display: grid; place-items: center; width: var(--target); height: var(--target);
  border: 0; border-radius: 50%; background: var(--surface); font-size: 22px; line-height: 1; cursor: pointer;
}
.stepper button:hover:not(:disabled) { background: var(--bg); }
.stepper button:disabled { opacity: .4; cursor: default; }
.stepper output { min-width: 4.6em; text-align: center; font-weight: 600; }
.stepper .add { font-weight: 400; }

/* Sektioner */
.sec { margin-top: var(--s-6); }
.sec > h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--fs-2xl); line-height: 1.1; }
.sec-note { margin: var(--s-1) 0 0; font-size: var(--fs-sm); color: var(--ink-soft); max-width: 46ch; }

/* Ingredienser: mængden i sin egen kolonne, så navnene flugter */
.grp + .grp { margin-top: var(--s-5); }
.grp > .ings:first-child { margin-top: var(--s-2); } /* gruppe uden overskrift */
.grp-name {
  margin: var(--s-4) 0 var(--s-1);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.ings { margin: 0; padding: 0; list-style: none; }
.ing {
  display: grid; grid-template-columns: 5.5rem 1fr; column-gap: var(--s-3); align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  font-size: 1.0625rem; line-height: 1.35;
}
/* Kolonnen bliver bredere for hele gruppen, hvis en mængde er lang ("12–16 spsk") */
@supports (grid-template-columns: subgrid) {
  .ings { display: grid; grid-template-columns: minmax(5.5rem, max-content) 1fr; column-gap: var(--s-3); }
  .ing { grid-column: 1 / -1; grid-template-columns: subgrid; }
}
.ing .amt { font-weight: 600; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.ing .nm { overflow-wrap: anywhere; }
.ing.free .nm { grid-column: 1 / -1; }
.note { color: var(--ink-soft); }
.unk { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--peach-ink); }

/* Trin: nummer i margenen med rettens farve bag tallet */
.steps { margin: var(--s-4) 0 0; padding: 0; list-style: none; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: var(--s-3); padding: var(--s-4) 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 0; }
.step .n {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--tone, var(--surface-2));
  font-family: var(--serif); font-size: var(--fs-lg); line-height: 1; font-variant-numeric: lining-nums;
}
.step p { margin: 0; font-size: 1.125rem; line-height: 1.55; max-width: 60ch; overflow-wrap: anywhere; }
.step strong { font-weight: 650; }
.step .also { margin: var(--s-2) 0 0; padding: 0; list-style: none; font-size: var(--fs-md); line-height: 1.4; }
.step .also li { display: grid; grid-template-columns: 4.5rem 1fr; gap: var(--s-2); padding: 3px 0; }
.step .also li.free .nm { grid-column: 1 / -1; }
.step .also .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Tips: på rettens flade. Linjeskift fra opskriften bevares */
.tips { margin-top: var(--s-6); padding: var(--s-5) var(--s-4); border-radius: var(--r-lg); background: var(--tone, var(--surface-2)); }
.tips h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--fs-xl); }
.tips-text {
  margin: var(--s-3) 0 0; font-family: var(--serif); font-size: var(--fs-lg); line-height: 1.45;
  white-space: pre-line; overflow-wrap: anywhere;
}

.loading-top, .error-top { padding-top: var(--s-6); }
.error-top .state { margin-top: 0; }

/* Computer: ingredienser til venstre (følger med), trin til højre */
@media (min-width: 960px) {
  .app.recipe { max-width: 1040px; }
  .recipe .hero { margin: var(--s-4) 0 0; border-radius: var(--r-lg); overflow: hidden; }
  .recipe .hero.flat { min-height: 340px; }
  .recipe .hero:not(.flat) { min-height: 380px; }
  .recipe .hero-photo { height: 380px; }
  .recipe .hero.flat h1 { font-size: 3.5rem; max-width: 18ch; padding-left: var(--s-6); padding-bottom: var(--s-6); }
  .recipe-cols { display: grid; grid-template-columns: 360px 1fr; gap: var(--s-7); align-items: start; }
  .recipe-cols .left {
    position: sticky; top: var(--s-4); max-height: calc(100dvh - 106px); overflow-y: auto;
    padding: 0 var(--s-2) var(--s-4); margin: 0 calc(var(--s-2) * -1);
    scrollbar-width: thin;
  }
  .recipe-cols .sec.steps-sec { margin-top: var(--s-5); }
}

/* "Rediger" oven på farvefladen */
.float-pill {
  display: inline-flex; align-items: center; min-height: var(--target); padding: 0 var(--s-4);
  border-radius: var(--r-pill); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: var(--fs-sm); text-decoration: none;
}
.float-pill:hover { background: var(--surface-2); }

/* Docken med både en hovedknap og bundmenuen er højere end bundmenuen alene */
.app.with-action { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
a.btn-primary { text-decoration: none; }
.btn-sec.wide { width: 100%; margin-top: var(--s-5); }

/* ================= Opskriftsformularen (opskrift-formular.html) =================
 * Fra design/v1b/v1b.css ("Formular", billedfeltet og "Forhåndsvisning af tolkningen").
 */
.pic-field { margin-top: var(--s-2); border-radius: var(--r-md); overflow: hidden; background: var(--tone, var(--surface-2)); }
.pic-field img { display: block; width: 100%; height: 180px; object-fit: cover; }
.pic-field[aria-busy="true"] img { opacity: .7; }
.pic-field.loading { min-height: 150px; } /* det gemte billede hentes: rettens flade uden knapper */
.pic-empty { display: flex; flex-direction: column; justify-content: flex-end; min-height: 150px; padding: var(--s-4); }
.pic-empty .nm { font-family: var(--serif); font-size: var(--fs-xl); line-height: 1.1; overflow-wrap: anywhere; }
.pic-empty .hint { margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--ink-on-tone); }
.pic-actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
.pic-actions .btn-sec { flex: 1; gap: var(--s-2); min-width: 0; }
.pic-actions .btn-sec:disabled { opacity: .5; cursor: progress; }
.btn-sec.quiet { color: var(--ink-soft); }
.form .pic-status + .err-msg { margin-top: var(--s-1); }
.form .field { margin-top: var(--s-5); }
.form .field > label, .form .field > .flabel { font-size: var(--fs-md); }
.form .field .help { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--ink-soft); }
.form .err-msg, .form .ok-msg { margin-bottom: 0; }
.area {
  display: block; width: 100%; min-height: 220px; margin-top: var(--s-2); padding: var(--s-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface);
  font: inherit; font-size: var(--fs-md); line-height: 1.5; color: inherit; resize: vertical;
}
.area.short { min-height: 112px; }
.area:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.area::placeholder { color: var(--ink-soft); }
.area[aria-invalid="true"] { border-color: var(--error); border-width: 2px; }
.ok-msg { margin-top: var(--s-2); font-size: var(--fs-sm); color: var(--ink-soft); }
.ok-msg b { color: var(--ink); font-weight: 600; }
.row2 { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-2); }
.row2 .help { margin: 0; }
.form .check-note {
  display: inline-flex; align-items: center; min-height: var(--target);
  text-decoration: underline; text-underline-offset: 3px;
}

/* "Indsæt hele teksten" (trin 6g): et roligt felt øverst på en ny opskrift */
.paste-open { gap: var(--s-2); }
.paste-open .ico { width: 20px; height: 20px; }
.paste-panel { margin-top: var(--s-4); padding: var(--s-4); border-radius: var(--r-md); background: var(--surface-2); }
.paste-panel > label { display: block; font-weight: 600; }
.paste-panel .help { margin: 2px 0 0; }
.paste-panel .area { min-height: 180px; }
.paste-panel .pic-actions { margin-top: var(--s-3); }
.paste-result { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-2); }
.paste-result .ok-msg { margin: 0; color: var(--ink); }
.paste-result .ok-msg:focus { outline: none; }
.paste-result .ok-msg.warn { color: var(--peach-ink); font-weight: 600; }
.paste-skipped { margin-top: var(--s-2); font-size: var(--fs-sm); }
.paste-skipped summary {
  display: flex; align-items: center; min-height: var(--target); cursor: pointer;
  color: var(--ink-soft); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
}
.paste-skipped ul { margin: 0 0 var(--s-2); padding-left: var(--s-5); color: var(--ink-soft); }
.paste-skipped li { margin-top: var(--s-1); overflow-wrap: anywhere; }
.paste-result .text-btn { margin-left: calc(var(--s-2) * -1); }
.form .field .name-hint { margin-top: var(--s-2); color: var(--peach-ink); font-weight: 600; }

/* Forhåndsvisningen står under felterne på mobilen og ved siden af på computeren */
.preview { margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--ink); }
.preview:focus { outline: none; }
.preview > h2 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--fs-2xl); line-height: 1.1; }
.preview .lead { margin: var(--s-1) 0 0; font-size: var(--fs-sm); color: var(--ink-soft); }
.preview .lead b { color: var(--peach-ink); }
.preview .state:empty { display: none; }
.pv-empty { margin-top: var(--s-4); padding: var(--s-5) var(--s-4); border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-soft); font-size: var(--fs-sm); }
.pv-sub { margin: var(--s-6) 0 0; font-family: var(--serif); font-weight: 400; font-size: var(--fs-xl); line-height: 1.15; }
.preview .sec-note { margin-top: var(--s-1); }

.pv-grp { margin-top: var(--s-4); }
.pv-grp .grp-name { margin-top: 0; }
.pv-list { margin: 0; padding: 0; list-style: none; }
.pv { padding: 10px 0; border-bottom: 1px solid var(--line); }
.pv .main { display: grid; grid-template-columns: 5.25rem 1fr; gap: var(--s-3); align-items: baseline; }
.pv .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pv .nm { overflow-wrap: anywhere; }
.pv .nm.missing { color: var(--ink-soft); }
.pv .why { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--ink-soft); }
.pv .why.warn { color: var(--peach-ink); font-weight: 600; }
.pv .acts { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-2); padding-left: calc(5.25rem + var(--s-3)); }
.pv .acts .btn-sec { min-height: var(--target); }
/* "Skift" på en koblet linje: en lille tekstknap i rækkens højre side (stadig 44 px høj) */
.pv .main.has-act { grid-template-columns: 5.25rem 1fr auto; }
.pv .relink { align-self: center; margin-right: calc(var(--s-2) * -1); color: var(--peach-ink); }
.pick-alias-row { margin-top: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); }
/* "Slet opskrift" nederst på en gemt opskrift, adskilt fra resten */
.delete-zone { margin-top: var(--s-7); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.delete-zone .text-btn { margin-left: calc(var(--s-2) * -1); }
.pv .err-msg, .pv-step .err-msg { margin-top: var(--s-2); }
.has-error { box-shadow: inset 3px 0 0 var(--error); padding-left: var(--s-3); }
.has-error:focus { outline: none; }

/* "+"-linje: de dele, der kom fra samme linje, holdes samlet af en streg */
.split { border-bottom: 1px solid var(--line); padding: 10px 0 4px; }
.split .raw { margin: 0; font-size: var(--fs-sm); color: var(--ink-soft); overflow-wrap: anywhere; }
.split .raw q { quotes: "»" "«"; font-style: normal; }
.split .pv-list { margin: var(--s-2) 0 0 6px; padding-left: var(--s-3); border-left: 2px solid var(--line-strong); }
.split .pv { border-bottom: 0; padding: 4px 0; }
.split .pv .main { grid-template-columns: calc(5.25rem - 20px) 1fr; }
.split .pv .main.has-act { grid-template-columns: calc(5.25rem - 20px) 1fr auto; }
.split .pv .acts { padding-left: calc(5.25rem - 20px + var(--s-3)); }

/* Trin med koblede ingredienser: chips med × og "+ Tilføj", der åbner en vælger under trinnet */
.pv-steps { margin: var(--s-2) 0 0; padding: 0; list-style: none; }
.pv-step { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); }
.pv-step .txt { display: grid; grid-template-columns: 28px 1fr; gap: var(--s-2); font-size: var(--fs-sm); line-height: 1.5; }
.pv-step .txt p { margin: 0; overflow-wrap: anywhere; }
.pv-step .txt .n { font-family: var(--serif); font-size: var(--fs-lg); line-height: 1.1; }
.pv-chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0 0; padding: 0 0 0 36px; list-style: none; }
.pv-chips .chip { background: var(--tone, var(--surface-2)); }
.pv-chips .chip button { width: auto; min-width: var(--target); }
.pv-chips .chip b { font-weight: 600; margin-right: 4px; font-variant-numeric: tabular-nums; }
.pv-chips .chip .note { color: var(--ink-on-tone); }
.chip-add {
  display: inline-flex; align-items: center; min-height: var(--target); padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-sm); background: none; box-shadow: inset 0 0 0 1.5px var(--line-strong);
  font-size: var(--fs-sm); font-weight: 600; color: var(--peach-ink); cursor: pointer;
}
.chip-add[aria-expanded="true"] { background: var(--peach-soft); box-shadow: none; }
.picker { margin: var(--s-2) 0 0 36px; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); }
.picker p { margin: 0; font-size: var(--fs-sm); color: var(--ink-soft); }
.picker .pick-sub { margin-top: var(--s-3); font-weight: 600; color: var(--ink); }
.picker .pv-chips { padding-left: 0; margin-top: var(--s-2); }
.opt {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--target); padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm);
  text-align: left; overflow-wrap: anywhere; cursor: pointer;
}
.opt::before { content: "+"; font-weight: 700; color: var(--peach-ink); }
.opt b { font-weight: 600; font-variant-numeric: tabular-nums; }
.opt .note, .opt .from { color: var(--ink-soft); }
.loose { margin-top: var(--s-4); font-size: var(--fs-sm); color: var(--ink-soft); }
.loose b { color: var(--ink); font-weight: 600; }

/* Arkene "Vælg vare" og "Opret vare" */
.sheet .hint { margin: 0; font-size: var(--fs-sm); color: var(--ink-soft); }
.sheet .search { margin-top: var(--s-3); }
.sheet .rows { margin-top: var(--s-2); }

@media (min-width: 900px) {
  .app.form { max-width: 1040px; }
  .form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-7); align-items: start; }
  .form-cols .preview {
    margin-top: var(--s-5); border-top: 0; padding: var(--s-5); border-radius: var(--r-lg); background: var(--surface);
  }
}

/* ================= Kogetilstand (opskrift.html#koge, cook-mode.js) =================
 * Fra design/v1b/kogetilstand.css. Rettens farveflade er bogstøtterne: start og »Velbekomme« står på fladen,
 * trinene på den rolige creme med størst kontrast, og fladen går kun igen i det, der hører til retten:
 * »Til dette trin«, de trin, der mangler i fremskridtsstregen, og tips.
 */
:where(.cook, .mini-sheet) :is(h1, h2, h3, p, ul) { margin: 0; }
:where(.cook, .mini-sheet) ul { padding: 0; list-style: none; }

/* ---------- Skal ---------- */
.cook {
  max-width: 480px; margin: 0 auto; min-height: 100dvh;
  /* Plads til den faste dock: dens målte højde (--cook-dock-h, sat i cook-mode.js) + luft. Højden skifter med
     Wake Lock-noten og på Velbekomme */
  padding: 0 var(--s-4) calc(var(--cook-dock-h, calc(80px + env(safe-area-inset-bottom))) + var(--s-5));
  overflow-x: clip; /* glidet ved trinskift må ikke give vandret scroll */
}
.cook-bar {
  display: grid; grid-template-columns: var(--target) 1fr auto; align-items: center; gap: var(--s-2);
  min-height: 56px; padding-top: env(safe-area-inset-top); margin: 0 calc(var(--s-2) * -1);
}
.cook-bar .x {
  display: grid; place-items: center; width: var(--target); height: var(--target); padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--ink); cursor: pointer;
}
.cook-bar .x:hover { background: var(--surface-2); }
.cook-bar .x svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }

/* Skærmen holdes tændt: lille, stille og ærlig (tom, når browseren ikke kan) */
.awake {
  justify-self: center; display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); color: var(--ink-soft); white-space: nowrap;
}
.awake svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Portioner i bjælken: åbner et lille ark med samme vælger som på opskriften */
.pers-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: var(--target); padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-pill); background: var(--surface-2); cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums;
}
.pers-btn:hover { background: var(--line); }
.pers-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Fremskridt: én streg pr. trin. Det klarede og det aktuelle i blæk, resten i rettens farve */
.progress { display: flex; gap: 4px; margin-top: var(--s-1); }
.progress span { flex: 1; height: 4px; border-radius: 2px; background: var(--tone, var(--surface-2)); }
.progress span.on { background: var(--ink); }

/* ---------- Et trin ---------- */
.step-head { margin-top: var(--s-5); font-family: var(--serif); font-weight: 400; font-size: var(--fs-3xl); line-height: 1; letter-spacing: -.01em; font-variant-numeric: lining-nums; }
.cook h1:focus { outline: none; }
.step-text {
  margin-top: var(--s-4); max-width: 34ch;
  font-size: 1.5rem; line-height: 1.42; letter-spacing: -.003em;
  overflow-wrap: anywhere; text-wrap: pretty;
}
.step-text.short { font-size: 1.75rem; line-height: 1.32; }
.step-text.long { font-size: 1.375rem; line-height: 1.45; }
.step-text strong { font-weight: 650; } /* tal, enhed og første ord bindes med hårde mellemrum (recipe-steps.js) */

/* Til dette trin: på rettens flade */
.for-step { margin-top: var(--s-6); padding: var(--s-3) var(--s-4) var(--s-2); border-radius: var(--r-lg); background: var(--tone, var(--surface-2)); }
.for-step h2 { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-on-tone); }
.for-step li {
  display: grid; grid-template-columns: 5.25rem 1fr; gap: var(--s-3); align-items: baseline;
  padding: 10px 0; font-size: 1.1875rem; line-height: 1.3;
}
.for-step li + li { border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }
.for-step .amt { font-weight: 600; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.for-step .nm { overflow-wrap: anywhere; }
.for-step li.free .nm { grid-column: 1 / -1; }
.for-step .note { color: var(--ink-on-tone); }
.no-ing { margin-top: var(--s-6); font-size: var(--fs-md); color: var(--ink-soft); }

/* Skift mellem trin: kort glid i den retning, man går. Ingen bevægelse ved reduceret bevægelse */
.cook .from-right { animation: cook-in-r 200ms var(--ease); }
.cook .from-left { animation: cook-in-l 200ms var(--ease); }
@keyframes cook-in-r { from { opacity: 0; transform: translateX(24px); } }
@keyframes cook-in-l { from { opacity: 0; transform: translateX(-24px); } }
@media (prefers-reduced-motion: reduce) { .cook .from-right, .cook .from-left { animation: none; } }

/* ---------- Bunden: Tilbage og Næste i tommelfingerens rækkevidde ---------- */
.cook-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--bg); padding: var(--s-3) 0 calc(var(--s-3) + env(safe-area-inset-bottom)); }
.cook-dock.on-tone { background: var(--tone); }
.cook-dock-inner { max-width: 480px; margin: 0 auto; padding: 0 var(--s-4); }
.nav-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: var(--s-2); }
.nav-row .btn-primary, .btn-back, .cook-dock .dock-stack .btn-primary { min-height: 56px; font-size: 1.0625rem; }
.btn-back {
  display: flex; align-items: center; justify-content: center; gap: var(--s-2);
  border: 0; border-radius: var(--r-pill); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--ink); font-weight: 600; cursor: pointer;
}
.btn-back:hover { background: var(--surface-2); }
.nav-row svg, .cook-dock .btn-primary svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.kbd-hint { display: none; }

/* ---------- Timere (trin 10b, cook-timer-ui.js) ----------
 * En tid i trinteksten er en rolig fersken-markering (.pill) i tekstens egen størrelse. Selve knappen er gennemsigtig
 * og fylder hele linjens højde, så trykfeltet er så højt som linjen, og to tider på hver sin linje aldrig overlapper.
 * Har trinnet en tid, er linjerne mindst 44 px høje (trykfeltet), ellers samme linjeafstand som før.
 * Kører timeren, er markeringen fyldt fersken; er tiden gået, i blæk.
 */
.cook .step-text:has(.step-timer) { line-height: max(44px, 1.32em); } /* vinder over .short/.long, også på computer */
.step-timer {
  display: inline-block; padding: 0 2px; margin: 0; border: 0; background: none; color: inherit;
  font: inherit; font-weight: 650; letter-spacing: inherit; line-height: inherit; vertical-align: baseline;
  white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.step-timer .pill {
  padding: .04em .22em; border-radius: var(--r-sm); background: var(--peach-soft); box-shadow: inset 0 -2px 0 var(--peach);
}
.step-timer svg { width: .72em; height: .72em; margin-right: .18em; vertical-align: -.06em; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.step-timer:hover .pill { background: color-mix(in srgb, var(--peach) 40%, var(--peach-soft)); }
.step-timer:focus-visible { outline: none; }
.step-timer:focus-visible .pill { outline: 2px solid var(--focus); outline-offset: 2px; }
.step-timer.running .pill { background: var(--peach); color: var(--on-peach); box-shadow: none; }
.step-timer.done .pill { background: var(--ink); color: var(--bg); box-shadow: none; }

/* Kort besked over timerne (fx "Der kører allerede 4 timere …"): samme rolige tekst som Wake Lock-noten */
.tm-note { margin: 0 0 var(--s-2); font-size: var(--fs-sm); line-height: 1.4; color: var(--ink); }
.tm-note[hidden] { display: none; }

/* Timerne øverst i docken: én række pr. timer med navn, tid tilbage, +1 min og stop (OK, når tiden er gået) */
.cook-timers { display: grid; gap: 6px; margin: 0 0 var(--s-2); padding: 0; list-style: none; }
.cook-timers[hidden] { display: none; }
.cook-timer {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: var(--s-1);
  min-height: 56px; padding: 4px 4px 4px var(--s-4); border-radius: var(--r-md);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong);
}
.tm-text { display: flex; flex-direction: column; min-width: 0; }
.tm-label { font-size: var(--fs-xs); line-height: 1.3; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-left { font-size: 1.375rem; line-height: 1.15; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; }
.tm-add, .tm-stop {
  display: grid; place-items: center; min-width: var(--target); min-height: var(--target); padding: 0 var(--s-3);
  border: 0; border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink);
  font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; cursor: pointer;
}
.tm-stop { padding: 0; }
.tm-add:hover, .tm-stop:hover { background: var(--line); }
.tm-stop svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
.cook-timer.done { background: var(--peach); color: var(--on-peach); box-shadow: none; animation: tm-done 1.6s var(--ease) 3; }
.cook-timer.done .tm-label { color: var(--on-peach); }
.cook-timer.done .tm-add, .cook-timer.done .tm-stop { background: var(--surface); color: var(--ink); }
.cook-timer.done .tm-stop { padding: 0 var(--s-4); }
@keyframes tm-done { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--peach) 45%, transparent); } }
@media (prefers-reduced-motion: reduce) { .cook-timer.done { animation: none; } }

/* På opskriften: en timer er gået, mens kogetilstanden er lukket. Står over ▶ Start i docken */
.timer-banner {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  margin-bottom: var(--s-2); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-4);
  border-radius: var(--r-md); background: var(--peach-soft);
}
.timer-banner[hidden] { display: none; }
.timer-banner-text { margin: 0; flex: 1 1 12rem; font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.timer-banner .btn-sec { flex: none; }
.app.with-action.with-timer-banner { padding-bottom: calc(220px + env(safe-area-inset-bottom)); }

/* ---------- Start ---------- */
.start-flat {
  margin: 0 calc(var(--s-4) * -1); padding: 0 var(--s-4) var(--s-5);
  background: var(--tone, var(--surface-2));
}
.start-flat .cook-bar { grid-template-columns: var(--target) 1fr; }
.start-flat .x, .done-screen .x { background: var(--surface); }
.start-flat .x:hover, .done-screen .x:hover { background: var(--surface-2); }
.start-flat h1 {
  margin-top: 72px; font-family: var(--serif); font-weight: 400; font-size: 2.5rem; line-height: 1.04;
  letter-spacing: -.015em; text-wrap: balance; overflow-wrap: anywhere; hyphens: auto;
}
.start-flat .meta { margin-top: var(--s-2); font-size: var(--fs-md); color: var(--ink-on-tone); }
.cook .portions { margin-top: var(--s-5); }
.gather { margin-top: var(--s-6); }
.gather > h2 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-2xl); line-height: 1.1; }
.gather .grp-name { margin: var(--s-4) 0 var(--s-1); }
.gather .grp > .ings:first-child { margin-top: var(--s-3); }
.wake-note { margin: 0 0 var(--s-3); font-size: var(--fs-sm); line-height: 1.4; color: var(--ink-soft); }
.wake-note b { color: var(--ink); font-weight: 600; }

/* ---------- Tips og Velbekomme ---------- */
.tips-screen .tips { margin-top: var(--s-5); padding: var(--s-5) var(--s-4) var(--s-6); }
.tips-screen .tips h1 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-3xl); line-height: 1; }
.tips-screen .tips-text { margin-top: var(--s-4); font-size: 1.375rem; line-height: 1.45; max-width: 34ch; white-space: normal; }
.tips-screen .tips-text p + p { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); }

body.cooking-done { background: var(--tone); }
.done-screen { display: flex; flex-direction: column; }
.done-screen .cook-bar { grid-template-columns: var(--target) 1fr; }
.done-screen h1 {
  margin-top: 30vh; font-family: var(--serif); font-weight: 400; font-size: 3.25rem; line-height: 1;
  letter-spacing: -.02em;
}
.done-screen .meta { margin-top: var(--s-3); font-size: var(--fs-lg); color: var(--ink-on-tone); overflow-wrap: anywhere; }
.dock-stack { display: grid; gap: var(--s-2); }
/* På rettens flade er fersken for tæt på fladen; knappen bliver et lyst ark som knapperne på forsiden */
.btn-primary.on-tone { background: var(--surface); color: var(--ink); }
.btn-primary.on-tone:hover { background: var(--bg); }
.dock-stack .text-btn { justify-content: center; min-height: 48px; font-size: var(--fs-md); }
.dock-stack .text-btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }

/* ---------- Ark: portioner under madlavningen (native <dialog>) ---------- */
.mini-sheet {
  width: 100%; max-width: 480px; margin: auto auto 0; padding: 0; border: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--surface); color: var(--ink);
}
.mini-sheet::backdrop { background: var(--scrim); }
.mini-sheet-inner { padding: var(--s-2) var(--s-4) calc(var(--s-4) + env(safe-area-inset-bottom)); }
.mini-sheet .grabber { width: 36px; height: 4px; margin: 0 auto var(--s-2); border-radius: 2px; background: var(--line-strong); opacity: .5; }
.mini-sheet h2 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-xl); line-height: 1.15; }
.mini-sheet .sheet-title { display: flex; align-items: center; min-height: 48px; }
.mini-sheet .portions { margin-top: var(--s-2); background: var(--surface-2); }
.mini-sheet .stepper button { background: var(--surface); }
.mini-sheet .hint { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--ink-soft); }
.mini-sheet .btn-primary { margin-top: var(--s-4); }

/* ---------- Computer og tablet: tekst til venstre, ingredienser til højre ---------- */
@media (min-width: 900px) {
  .cook { max-width: 1040px; padding-bottom: calc(var(--cook-dock-h, 80px) + var(--s-7)); }
  .cook-dock-inner { max-width: 1040px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); }
  .cook-timers { flex: 1 0 100%; margin: 0; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .nav-row { width: 420px; }
  .kbd-hint:not([hidden]) { display: block; margin: 0; font-size: var(--fs-sm); color: var(--ink-soft); }
  .kbd-hint kbd {
    display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px;
    border-radius: var(--r-sm); box-shadow: inset 0 0 0 1px var(--line-strong);
    font-family: var(--sans); font-size: var(--fs-xs); font-weight: 600; color: var(--ink);
  }
  .progress { margin-top: var(--s-2); }
  .cook-step { display: grid; grid-template-columns: 1fr 340px; gap: var(--s-7); align-items: start; margin-top: var(--s-6); }
  .step-head { margin-top: 0; font-size: 2.75rem; }
  .step-text { font-size: 2.125rem; line-height: 1.32; max-width: 26ch; }
  .step-text.short { font-size: 2.5rem; line-height: 1.24; }
  .step-text.long { font-size: 1.875rem; line-height: 1.36; max-width: 30ch; }
  .for-step, .no-ing { margin-top: 0; }
  .for-step { padding: var(--s-4) var(--s-5) var(--s-3); }
  .start-flat { margin: var(--s-4) 0 0; padding: 0 var(--s-6) var(--s-6); border-radius: var(--r-lg); }
  .start-flat h1 { margin-top: var(--s-6); font-size: 3.5rem; max-width: 16ch; }
  .start-cols { display: grid; grid-template-columns: 360px 1fr; gap: var(--s-7); align-items: start; }
  .start-cols .gather { margin-top: var(--s-5); max-width: 560px; }
  .start-dock .cook-dock-inner { justify-content: flex-end; }
  .start-dock .dock-stack, .done-dock .dock-stack { width: 420px; }
  .done-screen h1 { margin-top: 26vh; font-size: 4.5rem; }
  .done-dock .cook-dock-inner { justify-content: flex-start; }
}

/* ================= Ugeplan, Tavlen (ugeplan.html, ugeplan.js) =================
 * Fra design/ugeplan-retninger/b.css (retning B) med Newsreader fra retning A. Ugen er syv felter, to og to, med
 * søndag i fuld bredde. Hvert felt har rettens farveflade; med billede fylder fotoet feltets top. Rester får
 * kildedagens farve, så parret ses med det samme. Ude er et roligt hul i ugen, og en tom dag inviterer til at vælge.
 */
.wk { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); padding: var(--s-5) 0 var(--s-3); }
.wk-head { min-width: 0; }
.wk h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: var(--fs-3xl); line-height: 1; letter-spacing: -.01em; font-variant-numeric: lining-nums; }
.wk-dates { margin: 0 0 var(--s-1); font-size: var(--fs-sm); color: var(--ink-soft); }
.wk-nav { display: flex; align-items: center; flex: none; margin-right: -10px; }
.wk-nav .icon-btn { text-decoration: none; }
.wk-today { margin-right: var(--s-1); white-space: nowrap; }
.week .state { margin-top: var(--s-3); }
.week-error { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); }
.week-error .state { margin-top: var(--s-5); }

.board { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.board.is-loading { opacity: .45; transition: opacity var(--dur) var(--ease); }
.board > li { min-width: 0; }
.board > li.wide { grid-column: 1 / -1; }

.tile {
  position: relative; display: flex; flex-direction: column; width: 100%; height: 132px; padding: 0;
  border: 0; border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  background: var(--tone, var(--surface-2)); color: var(--ink); text-align: left;
  transition: transform var(--dur) var(--ease);
}
.tile:active { transform: scale(.985); }
.tile .ph {
  display: block; flex: 0 0 60px; width: 100%; height: 60px; min-height: 0; object-fit: cover;
  opacity: 0; transition: opacity var(--dur) var(--ease);
}
.tile.photo-ready .ph { opacity: 1; }
.tile-text { display: flex; flex-direction: column; justify-content: space-between; flex: 1; min-height: 0; gap: 2px; padding: 10px 12px 12px; }
.tile-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .tag { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.tile .tag .num { letter-spacing: 0; }
.tile .nm {
  font-family: var(--serif); font-size: var(--fs-lg); line-height: 1.15; font-weight: 400; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tile .add { color: var(--ink-on-tone); }
.tile .sub {
  font-size: var(--fs-xs); line-height: 1.3; color: var(--ink-on-tone);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tile:has(.sub) .nm { -webkit-line-clamp: 2; }
.tile:hover .nm { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.tile:focus-visible { outline-offset: 2px; }

/* Med billede: fotoet øverst og navnet mindre under det */
.tile.has-photo .tile-text { justify-content: flex-start; padding: var(--s-2) 10px 10px; }
.tile.has-photo .nm { font-size: .9375rem; line-height: 1.2; -webkit-line-clamp: 2; }
.tile.has-photo:has(.sub) .nm { -webkit-line-clamp: 1; }

/* Ude: et roligt hul i ugen */
.tile.is-out { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.tile.is-out .tag { color: var(--ink-soft); }
.tile.is-out .nm { font-style: italic; font-weight: 300; color: var(--ink-soft); }

/* Tom dag: plus og "Vælg ret" i fersken */
.tile.is-empty { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.tile.is-empty .nm {
  display: flex; align-items: center; gap: var(--s-2);
  font-family: var(--sans); font-size: var(--fs-md); font-weight: 600; color: var(--peach-ink);
}
.tile.is-empty .nm .add { font-weight: 400; color: var(--ink-soft); }
.plus { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--peach-soft); }
.plus svg { width: 16px; height: 16px; stroke: var(--peach-ink); stroke-width: 2; fill: none; stroke-linecap: round; }

/* Søndag i fuld bredde: fotoet til venstre */
.wide .tile { height: 104px; flex-direction: row; }
.wide .tile .ph { flex: 0 0 46%; height: 100%; }
.wide .tile.has-photo .tile-text { justify-content: space-between; padding: 10px 12px 12px; }
.wide .tile.has-photo .nm { font-size: var(--fs-lg); line-height: 1.15; }

@media (min-width: 760px) {
  .app.week { max-width: 880px; }
  .board { grid-template-columns: repeat(4, 1fr); gap: var(--s-3); }
  .board .tile { height: 200px; }
  .board .tile .ph { flex-basis: 116px; height: 116px; }
  .board > li.wide { grid-column: span 2; }
  .board .wide .tile { height: 200px; }
  .board .wide .tile .ph { height: 100%; }
  .tile.has-photo .nm { font-size: var(--fs-lg); line-height: 1.15; }
}
@media (prefers-reduced-motion: reduce) { .tile, .tile .ph, .board.is-loading { transition: none; } }

/* ---------- Arket for en dag ---------- */
.day-sheet { height: calc(100dvh - 48px); }
.day-sheet[open] { display: flex; flex-direction: column; overflow: hidden; }
.day-sheet .sheet-head, .day-sheet .sheet-foot { flex: none; }
.day-sheet .sheet-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.day-sheet[aria-busy="true"] .sheet-body { opacity: .7; }
@media (min-width: 600px) { .day-sheet { height: min(820px, calc(100dvh - 48px)); } }

.day-set { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; padding: var(--s-1) 0 var(--s-3); }
.day-set .seg { display: inline-flex; margin-top: 0; }
.day-set .seg button { flex: none; min-width: 76px; padding: 0 var(--s-3); }
.day-set .stepper { margin-right: -4px; }
.day-set .stepper button { background: var(--surface-2); }
.day-set .stepper button:hover:not(:disabled) { background: var(--line); }
.day-set .stepper output { min-width: 4.2em; font-size: var(--fs-sm); }
.sheet-warning { margin: 0 0 var(--s-3); font-size: var(--fs-sm); font-weight: 600; color: var(--peach-ink); }
.day-sheet .err-msg { margin: 0 0 var(--s-3); }
.out-note { margin: var(--s-3) 0 0; color: var(--ink-soft); }

/* Den valgte ret eller rester, på rettens flade */
.chosen {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  margin-bottom: var(--s-3); padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3);
  border-radius: var(--r-md); background: var(--tone, var(--surface-2));
}
.chosen-text { display: flex; flex-direction: column; min-width: 0; }
.chosen-lbl { font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-on-tone); }
.chosen-nm { font-family: var(--serif); font-size: var(--fs-lg); line-height: 1.2; overflow-wrap: anywhere; }
.chosen-sub { font-size: var(--fs-sm); color: var(--ink-on-tone); }
.chosen-link {
  align-self: flex-start; display: inline-flex; align-items: center; min-height: var(--target);
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}
.chosen .text-btn { flex: none; }
.chosen .text-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); }

/* "Rester fra onsdag": kun gyldige kilder (tidligere dage med en ret) */
.leftover-opts { display: flex; flex-direction: column; gap: var(--s-2); }
.leftover-opt {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  width: 100%; min-height: 56px; padding: var(--s-2) var(--s-3); border: 0; border-radius: var(--r-md);
  background: var(--surface-2); color: var(--ink); text-align: left; cursor: pointer;
}
.leftover-opt:hover { background: var(--line); }
.leftover-opt .lo-text { display: flex; flex-direction: column; min-width: 0; }
.leftover-opt strong { font-weight: 600; font-size: var(--fs-sm); }
.leftover-opt .lo-text span { font-size: var(--fs-sm); color: var(--ink-soft); overflow-wrap: anywhere; }
.leftover-opt[aria-pressed="true"] { background: var(--tone, var(--peach-soft)); box-shadow: inset 0 0 0 2px var(--ink); }
.leftover-opt[aria-pressed="true"] .lo-text span { color: var(--ink-on-tone); }

.day-sheet .sheet-label {
  margin: var(--s-5) 0 var(--s-2); font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft);
}
.day-sheet .search { margin-top: 0; background: var(--bg); }
#dishes-state { margin-top: var(--s-2); font-size: var(--fs-sm); }
#dishes-state:empty { display: none; }
#dishes > .sheet-label:first-child { margin-top: var(--s-3); }
#dishes .empty-box { margin-top: var(--s-3); }

/* Retterne som felter: billede øverst eller navnet på fladen */
.dish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-2); margin: var(--s-3) 0 0; padding: 0; list-style: none; }
.dish-grid > li { min-width: 0; }
.tile.pick { height: 172px; }
.tile.pick .tile-text { justify-content: flex-end; }
.tile.pick .ph { flex-basis: 92px; height: 92px; }
.tile.pick.has-photo .tile-text { justify-content: flex-start; }
.tile.pick.has-photo:has(.sub) .nm { -webkit-line-clamp: 2; }
.tile.pick .hb {
  position: absolute; top: 6px; right: 6px; z-index: 1; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface);
}
.tile.pick .hb svg { width: 16px; height: 16px; fill: var(--peach-ink); stroke: none; }
.tile.pick[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--ink); }
.tile.pick[aria-pressed="true"] .tile-text::after {
  content: "Valgt"; position: absolute; top: 6px; left: 6px; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg); font-size: var(--fs-xs); font-weight: 600;
}
@media (min-width: 600px) { .dish-grid { grid-template-columns: repeat(3, 1fr); } }

/* ================= Indkøbslisten (indkoebsliste.html, indkoebsliste.js) =================
 * Efter design/v1b/indkoebsliste.html. Afdelingsoverskrifterne (.dept) og .rows deles med varekataloget.
 */
.list .wk { padding-bottom: var(--s-4); }
.nowrap { white-space: nowrap; }
.list .seg.mode { margin-top: 0; }
.list-meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-1) var(--s-3); margin-top: var(--s-2); }
.mode-hint { margin: 0; font-size: var(--fs-sm); color: var(--ink-soft); }
.sync { display: flex; align-items: center; gap: var(--s-2); margin: 0; font-size: var(--fs-xs); color: var(--ink-soft); white-space: nowrap; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: #3f7d4e; flex: none; }
.offline .sync .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-soft); }

.banner {
  display: flex; gap: var(--s-2); align-items: flex-start;
  margin: var(--s-3) 0 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: var(--ink); color: var(--bg); font-size: var(--fs-sm); font-weight: 500;
}
.banner svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; flex: none; margin-top: 1px; }
.list #action-error { margin-top: var(--s-3); }
.list .state { margin-top: var(--s-5); }

/* En vare: tekst til venstre, knapperne til højre */
.line {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s-3);
  min-height: 68px; padding: var(--s-2) 0; border-bottom: 1px solid var(--line);
}
.line-text { min-width: 0; }
.line .nm { display: block; font-size: 1.0625rem; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere; }
.line .sub { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.35; overflow-wrap: anywhere; }
.line .sub .q { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.line .flag { display: block; margin-top: 2px; font-size: var(--fs-sm); font-weight: 600; color: var(--peach-ink); }
.line-acts { display: flex; align-items: center; gap: var(--s-1); }
.line .del { color: var(--ink-soft); }
.line .del .ico { width: 18px; height: 18px; }

/* Den runde knap: flueben i butikken, "Har vi" derhjemme */
.tick {
  display: grid; place-items: center; width: 52px; height: 52px; flex: none; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer;
  box-shadow: inset 0 0 0 2px var(--line-strong); background: var(--surface);
  transition: background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tick svg { width: 22px; height: 22px; stroke: var(--ink); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tick:hover:not(:disabled) { box-shadow: inset 0 0 0 2px var(--ink); }
.tick:hover:not(:disabled) svg { opacity: .25; }
.tick:active:not(:disabled) { background: var(--peach-soft); }
.tick .h { display: none; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-soft); }
.home-mode .tick svg { display: none; }
.home-mode .tick .h { display: block; }
.tick:disabled, .back:disabled, .line .del:disabled { opacity: .45; cursor: not-allowed; }
/* Lige trykket: cirklen fyldes, og linjen bliver stående et øjeblik (SETTLE_MS i shopping-list.js), før den flytter */
.tick.on, .tick.on:hover:not(:disabled) { background: var(--peach); box-shadow: none; }
.tick.on svg, .tick.on:hover:not(:disabled) svg { opacity: 1; stroke: var(--on-peach); }
.home-mode .tick.on svg { display: block; }
.home-mode .tick.on .h { display: none; }
.tick[aria-disabled="true"], .back[aria-disabled="true"] { cursor: default; }
.line.settling { animation: line-settle 450ms var(--ease) forwards; }
@keyframes line-settle { 0%, 55% { opacity: 1; } 100% { opacity: .4; } }

/* Klaret: i bunden, gennemstreget, med "Flyt tilbage" */
.done-sec { margin-top: var(--s-6); }
.done-sec h2 {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin: 0;
  padding-bottom: var(--s-2); border-bottom: 1px solid var(--line-strong);
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-xl); line-height: 1.1; color: var(--ink-soft);
}
.done-sec .cnt { font-family: var(--sans); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.line.done { min-height: 60px; }
.line.done .nm { text-decoration: line-through; text-decoration-thickness: 1px; color: var(--ink-soft); font-weight: 400; }
.back {
  min-height: var(--target); padding: 0 var(--s-2); margin-right: calc(var(--s-2) * -1);
  border: 0; border-radius: var(--r-pill); background: none; cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; color: var(--peach-ink); text-decoration: underline; text-underline-offset: 3px;
  white-space: nowrap;
}
.back:hover:not(:disabled) { background: var(--surface-2); }

.list .empty-box { margin-top: var(--s-5); }
.list .empty-box p { margin-bottom: 0; max-width: 40ch; }
.empty-link {
  display: inline-flex; align-items: center; min-height: var(--target); margin-top: var(--s-2);
  font-weight: 600; color: var(--peach-ink); text-decoration: underline; text-underline-offset: 3px;
}

.list-tools { margin-top: var(--s-6); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.list-tools .text-btn { margin-left: calc(var(--s-2) * -1); }
.list-tools .text-btn:disabled { opacity: .5; cursor: not-allowed; }
.list-tools .help { margin: var(--s-1) 0 0; }

/* Tilføj vare i docken, inden for tommelfingerens rækkevidde */
.add-line { margin-bottom: var(--s-2); }
.add-row { display: flex; gap: var(--s-2); }
.add-line .input { margin: 0; }
.add-row .input { flex: 1; min-width: 0; border-radius: var(--r-pill); padding: 0 var(--s-4); }
.add-row button {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; padding: 0;
  border: 0; border-radius: 50%; background: var(--peach); color: var(--on-peach); cursor: pointer;
}
.add-row button:hover:not(:disabled) { background: var(--peach-press); }
.add-row button svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }
.add-row button:disabled { background: var(--surface-2); color: var(--ink-soft); cursor: not-allowed; }
.add-row .input:disabled { opacity: .6; }
.add-dept { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
.add-dept label { flex: none; font-size: var(--fs-sm); font-weight: 600; }
.add-dept .input { flex: 1; min-width: 0; min-height: var(--target); }
.add-line .err-msg { margin: var(--s-2) 0 0; }

@media (min-width: 900px) {
  .app.list { max-width: 720px; }
  .list ~ .dock .dock-inner { max-width: 720px; }
}
@media (prefers-reduced-motion: reduce) { .tick { transition: none; } .line.settling { animation: none; } }

/* ---------- Del-opskrifter (trin 6i, design/v1b/del-opskrift.css) ----------
 * En del-opskrift bærer sin egen farve (t1-t6 ud fra dens id) som en lille prøve ved navnet og bag trinnummeret.
 * Navnet står der altid, så farven er kun genkendelse. */
.sw {
  display: inline-block; flex: none; width: 12px; height: 12px; border-radius: 3px;
  background: var(--tone, var(--surface-2));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent);
  vertical-align: -1px;
}

/* Opskriften og "Find frem": del-opskriften som ingrediensgruppe efter rettens egne */
/* Prøven står ved første linje, også når et langt navn brydes (align-items: flex-start). Navnet står i en 44 px
 * høj række: 14 px luft over en linje på 16 px, og prøven (12 px) 2 px nede i den linje */
.cgrp .grp-name {
  display: flex; align-items: flex-start; gap: var(--s-2); margin-bottom: 0; min-height: var(--target); line-height: 16px;
}
.cgrp .grp-name > .sw { margin-top: 16px; }
.cgrp .grp-name > .cgrp-title { padding: 14px 0; }
.cgrp .grp-name a {
  display: inline-flex; align-items: flex-start; gap: 6px; min-height: var(--target); padding: 14px 0; box-sizing: border-box;
  color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.cgrp .grp-name a:hover { text-decoration-thickness: 2px; }
.cgrp .grp-name a svg { margin-top: 1px; width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cgrp-meta { margin: -6px 0 var(--s-1); font-size: var(--fs-sm); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.cgrp-empty { margin: var(--s-2) 0 0; font-size: var(--fs-sm); color: var(--ink-soft); }

/* Trin fra en del-opskrift: navnet over teksten (opskriften og kogetilstanden) */
.step .from, .cook .from {
  display: flex; align-items: flex-start; gap: 6px; margin-bottom: var(--s-1);
  font-size: var(--fs-xs); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; overflow-wrap: anywhere;
  line-height: 16px;
}
.step p.from { font-size: var(--fs-xs); line-height: 16px; max-width: none; }
.from > .sw { margin-top: 2px; }

/* Formularen */
.pv .why.comp { display: flex; align-items: center; gap: 6px; color: var(--ink); font-weight: 600; }
.pv-note { margin: var(--s-2) 0 0 36px; font-size: var(--fs-sm); color: var(--ink-soft); }
.pv .err-msg { padding-left: calc(5.25rem + var(--s-3)); }
.split .pv .err-msg { padding-left: calc(5.25rem - 20px + var(--s-3)); }

/* Kogetilstanden: etiketten over "Trin 4 af 7" */
.cook .from { margin: var(--s-5) 0 0; }
.cook .from + .step-head { margin-top: var(--s-2); }
@media (min-width: 900px) {
  .cook .from { margin: 0 0 var(--s-2); }
  .cook .from + .step-head { margin-top: 0; }
}
