/* ==========================================================================
   Teigplaner – Styles
   Modern CSS: oklch-Farben, light-dark(), Nesting, :has(), Container Queries,
   @property, View Transitions, text-wrap: balance, reduced motion.
   ========================================================================== */

@property --fill {
  syntax: "<percentage>";
  inherits: true;
  initial-value: 0%;
}

:root {
  color-scheme: light dark;

  /* Pizza-Palette */
  --sauce:  oklch(60% 0.2 30);
  --sauce-2: oklch(52% 0.19 28);
  --crust:  oklch(76% 0.13 70);
  --cheese: oklch(95% 0.06 95);
  --basil:  oklch(58% 0.14 145);
  --ember:  oklch(72% 0.17 55);

  --bg:      light-dark(oklch(97.5% 0.018 80), oklch(18% 0.012 40));
  --bg-2:    light-dark(oklch(94% 0.03 75), oklch(22% 0.015 40));
  --surface: light-dark(oklch(99.5% 0.006 85 / .78), oklch(25% 0.014 40 / .72));
  --surface-solid: light-dark(oklch(99.5% 0.006 85), oklch(25% 0.014 40));
  --ink:     light-dark(oklch(24% 0.03 40), oklch(95% 0.015 80));
  --ink-2:   light-dark(oklch(45% 0.03 45), oklch(76% 0.02 70));
  --line:    light-dark(oklch(24% 0.03 40 / .12), oklch(95% 0.015 80 / .12));
  --accent:  light-dark(var(--sauce), oklch(70% 0.18 35));
  --accent-ink: oklch(99% 0.01 80);
  --accent-soft: light-dark(oklch(93% 0.05 40), oklch(32% 0.07 35));
  --ok:      light-dark(oklch(50% 0.13 145), oklch(75% 0.14 145));
  --warn:    light-dark(oklch(55% 0.16 55), oklch(80% 0.14 70));
  --bad:     light-dark(oklch(52% 0.2 25), oklch(72% 0.17 25));

  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 1px 0 oklch(100% 0 0 / .6) inset,
            0 18px 40px -18px light-dark(oklch(40% 0.08 40 / .35), oklch(0% 0 0 / .6)),
            0 2px 6px -2px light-dark(oklch(40% 0.08 40 / .18), oklch(0% 0 0 / .4));
  --ease-spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121, 1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991, 0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1);
  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Instrument Sans", ui-sans-serif, system-ui, sans-serif;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"]  { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
/* hidden muss auch gegen display-Regeln gewinnen (Zurück-Button behält seinen Platz) */
[hidden]:not(#backBtn) { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: clamp(1rem, .96rem + .2vw, 1.0625rem);
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(60rem 40rem at 110% -10%, light-dark(oklch(90% 0.08 50 / .7), oklch(35% 0.09 40 / .45)), transparent 60%),
    radial-gradient(50rem 36rem at -15% 30%, light-dark(oklch(92% 0.07 95 / .6), oklch(28% 0.05 70 / .35)), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* feines Mehlstaub-Korn */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .32; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .35 0 0 0 0 .2 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grain { mix-blend-mode: screen; opacity: .12; } }
:root[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .12; }

.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.22em; }
.ic-lg { width: 2.25rem; height: 2.25rem; }

h1, h2, h3, legend { font-family: var(--font-display); text-wrap: balance; letter-spacing: -0.02em; }
p { text-wrap: pretty; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem max(1rem, env(safe-area-inset-left)) .75rem max(1rem, env(safe-area-inset-right));
  max-width: 1180px; margin-inline: auto;
}
.topbar::before {
  content: ""; position: absolute; inset: 0 -100vw; z-index: -1;
  background: color-mix(in oklch, var(--bg) 70%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink);
  font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; letter-spacing: -0.03em;
  & b { color: var(--accent); font-weight: 800; }
}
.brand-mark { width: 2.2rem; height: 2.2rem; transition: rotate .8s var(--ease-spring); }
.brand:hover .brand-mark { rotate: 120deg; }

.top-tools { display: flex; align-items: center; gap: .5rem; }
.mini-seg {
  display: inline-flex; padding: 3px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface);
  & button {
    font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .02em; min-width: 2.4rem; min-height: 2.25rem;
    padding: 0 .65rem; border: 0; border-radius: 99px; background: transparent; color: var(--ink-2); cursor: pointer;
    transition: background .25s, color .25s;
  }
  & button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
  & button:not([aria-pressed="true"]):hover { color: var(--ink); }
  /* Rechtsseiten: Sprachwechsel als Link */
  & a {
    display: inline-grid; place-items: center; font-size: .8rem; font-weight: 700; min-width: 2.4rem; min-height: 2.25rem;
    padding: 0 .65rem; border-radius: 99px; color: var(--ink-2); text-decoration: none;
  }
  & a[aria-current="page"] { background: var(--ink); color: var(--bg); }
  & a:not([aria-current]):hover { color: var(--ink); }
}
@media (max-width: 440px) { .brand-name { display: none; } }

.icon-btn {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  & .ic-moon { display: none; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-btn .ic-sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .ic-moon { display: block; }
}
:root[data-theme="dark"] .icon-btn .ic-sun { display: none; }
:root[data-theme="dark"] .icon-btn .ic-moon { display: block; }

/* ---------- Layout ---------- */
main {
  position: relative; z-index: 1;
  max-width: 1180px; margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 3.5rem) 1rem 3rem;
}

.hero { max-width: 52rem; margin-bottom: clamp(1.5rem, 3vw, 2.5rem); }
/* Im Ergebnis braucht es den großen Claim nicht mehr */
main:has(#result:not([hidden])) .hero { display: none; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 .9rem;
  font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
  & .dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--basil); box-shadow: 0 0 0 4px color-mix(in oklch, var(--basil) 25%, transparent); }
}
h1 {
  font-size: clamp(2.3rem, 1.4rem + 4.6vw, 5rem);
  line-height: .98; margin: 0; font-weight: 800; letter-spacing: -0.045em;
  font-variation-settings: "opsz" 96;
}
.hl {
  color: var(--accent);
  background: linear-gradient(90deg, var(--sauce), var(--ember));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Fortschritt ---------- */
.progress {
  display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem;
}
.progress-pizza { width: 3.4rem; height: 3.4rem; flex: none; filter: drop-shadow(0 6px 10px oklch(40% 0.1 40 / .25)); }
.pp-crust { fill: var(--crust); }
.pp-slice { fill: light-dark(oklch(88% 0.05 75), oklch(35% 0.03 50)); stroke: var(--crust); stroke-width: 1.5;
  transition: fill .5s ease, transform .6s var(--ease-spring); transform-origin: 0 0; }
.pp-slice.done { fill: var(--sauce); }
.pp-slice.current { fill: var(--cheese); transform: scale(1.06); }
.pp-top { fill: var(--cheese); opacity: 0; transition: opacity .4s .15s; }
.pp-top.on { opacity: 1; }

.progress-steps {
  display: flex; flex-wrap: wrap; gap: .4rem; list-style: none; margin: 0; padding: 0;
  & li {
    font-size: .85rem; font-weight: 600; padding: .35rem .75rem; border-radius: 99px;
    color: var(--ink-2); background: var(--surface); border: 1px solid var(--line);
    transition: background .3s, color .3s;
  }
  & li[aria-current="step"] { background: var(--ink); color: var(--bg); border-color: transparent; }
  & li.done { color: var(--ok); }
  & li.done::before { content: "✓ "; }
  & button { all: unset; cursor: pointer; }
}

/* ---------- Wizard ---------- */
.wizard {
  position: relative;
  background: var(--surface);
  backdrop-filter: blur(18px) saturate(1.3);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 8px);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 3.5vw, 2.75rem);
  container-type: inline-size;
  view-transition-name: wizard;
}
.step { border: 0; margin: 0; padding: 0; min-width: 0; view-transition-name: step; }
legend {
  display: flex; align-items: baseline; gap: .75rem; padding: 0; margin-bottom: .4rem;
  font-size: clamp(1.6rem, 1.1rem + 2vw, 2.6rem); font-weight: 750; line-height: 1.05;
}
.step-no {
  font-size: .5em; font-weight: 700; color: var(--accent); padding: .2em .55em; border-radius: 99px;
  background: var(--accent-soft); letter-spacing: 0;
}
.lead { color: var(--ink-2); margin: 0 0 1.5rem; max-width: 46rem; }
.sub { font-size: 1.1rem; margin: 2rem 0 .8rem; font-weight: 700; }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.chip {
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  padding: .6rem 1rem; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface-solid); color: var(--ink);
  transition: transform .25s var(--ease-spring), background .2s, border-color .2s;
  &:hover { transform: translateY(-2px); border-color: var(--accent); }
  &[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
}

.datetime { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 1rem; max-width: 34rem; }
.field {
  display: grid; gap: .35rem;
  & span { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
  & input {
    font: inherit; font-size: 1.25rem; font-weight: 600; font-family: var(--font-display);
    padding: .85rem 1rem; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
    background: var(--surface-solid); color: var(--ink); min-height: 3.4rem; width: 100%;
    transition: border-color .2s, box-shadow .2s;
    &:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 22%, transparent); }
  }
}
.countdown {
  display: inline-flex; align-items: center; gap: .5rem; margin: 1.25rem 0 0; font-weight: 600; color: var(--ink-2);
  &.bad { color: var(--bad); }
}

/* Zähler */
.counter { display: flex; align-items: center; gap: 1.25rem; }
.round-btn {
  width: 3.5rem; height: 3.5rem; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--surface-solid); color: var(--ink); font-size: 1.6rem; font-weight: 600; cursor: pointer;
  display: grid; place-items: center; line-height: 1;
  transition: transform .3s var(--ease-spring), background .2s;
  &:hover { background: var(--accent-soft); }
  &:active { transform: scale(.88); }
  &:disabled { opacity: .35; cursor: not-allowed; }
}
#countOut {
  font-family: var(--font-display); font-weight: 800; font-size: clamp(3.5rem, 2.5rem + 4vw, 5.5rem);
  min-width: 2ch; text-align: center; line-height: 1; letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
}
#countOut.bump { animation: bump .4s var(--ease-spring); }
@keyframes bump { 0% { scale: .7; } 100% { scale: 1; } }

.pizza-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1rem; min-height: 2.2rem; }
.mini-pizza { width: 2.1rem; height: 2.1rem; animation: pop .45s var(--ease-spring) both; }
@keyframes pop { from { scale: 0; rotate: -90deg; } to { scale: 1; rotate: 0deg; } }

/* Karten (Radio) */
.cards { display: grid; gap: .85rem; }
.cards-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); }
.cards-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.card {
  position: relative; display: grid; gap: .25rem; align-content: start; cursor: pointer;
  padding: 1.15rem 1.2rem; border-radius: var(--radius); border: 1.5px solid var(--line);
  background: var(--surface-solid);
  transition: transform .35s var(--ease-spring), border-color .2s, box-shadow .25s, background .25s;
  & input { position: absolute; opacity: 0; pointer-events: none; }
  & b { font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
  & small { color: var(--ink-2); font-size: .9rem; }
  & .ic-lg { color: var(--accent); margin-bottom: .35rem; }
  &:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  &:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 3px; }
  &:has(input:checked) {
    border-color: var(--accent);
    background: color-mix(in oklch, var(--accent-soft) 70%, var(--surface-solid));
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--accent) 20%, transparent), var(--shadow);
  }
  &:has(input:checked)::after {
    content: "✓"; position: absolute; top: .8rem; right: .9rem; display: grid; place-items: center;
    width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
    font-size: .85rem; font-weight: 800; animation: pop .4s var(--ease-spring);
  }
  &:has(input:disabled) { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
}
.size-dot {
  width: 4rem; height: 4rem; margin-bottom: .5rem; border-radius: 50%; scale: var(--s);
  transform-origin: left center;
  background:
    radial-gradient(circle at 30% 35%, var(--cheese) 0 10%, transparent 11%),
    radial-gradient(circle at 65% 60%, var(--cheese) 0 12%, transparent 13%),
    radial-gradient(circle at 40% 70%, var(--basil) 0 6%, transparent 7%),
    radial-gradient(circle, var(--sauce) 0 66%, var(--crust) 67%);
  transition: scale .5s var(--ease-spring), rotate .6s var(--ease-spring);
}
.card:has(input:checked) .size-dot { rotate: 25deg; }

.style-card {
  gap: .5rem; padding: 1.3rem 1.3rem 1.2rem;
  & .style-top { display: flex; align-items: center; gap: .6rem; padding-right: 2rem; }
  & .badge-time {
    display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 700;
    padding: .25rem .6rem; border-radius: 99px; background: var(--bg-2); color: var(--ink);
  }
  & p { margin: 0; color: var(--ink-2); font-size: .93rem; }
  & .meter { display: flex; gap: .25rem; align-items: center; font-size: .8rem; color: var(--ink-2); }
  & .meter i { width: 1.1rem; height: .4rem; border-radius: 99px; background: var(--line); }
  & .meter i.on { background: var(--ember); }
  & .fit { font-size: .85rem; font-weight: 700; display: flex; align-items: center; gap: .35rem; }
  & .fit.ok { color: var(--ok); }
  & .fit.bad { color: var(--bad); }
}

/* ---------- Profi-Modus ---------- */
.pro { margin-top: 1.75rem; }
.switch-row {
  display: flex; align-items: center; gap: 1rem; cursor: pointer; padding: 1rem 1.2rem;
  border-radius: var(--radius); border: 1.5px dashed var(--line); background: var(--bg-2);
  transition: border-color .2s, background .2s;
  & input { position: absolute; opacity: 0; pointer-events: none; }
  & .switch {
    position: relative; flex: none; width: 3.2rem; height: 1.9rem; border-radius: 99px;
    background: light-dark(oklch(80% 0.02 60), oklch(40% 0.02 50)); transition: background .25s;
  }
  & .switch::after {
    content: ""; position: absolute; top: .2rem; left: .2rem; width: 1.5rem; height: 1.5rem; border-radius: 50%;
    background: white; box-shadow: 0 2px 6px oklch(0% 0 0 / .25); transition: translate .35s var(--ease-spring);
  }
  & input:checked + .switch { background: var(--accent); }
  & input:checked + .switch::after { translate: 1.3rem 0; }
  & input:focus-visible + .switch { outline: 3px solid var(--accent); outline-offset: 3px; }
  & .switch-text { display: grid; gap: .1rem; }
  & b { font-family: var(--font-display); font-size: 1.1rem; }
  & small { color: var(--ink-2); font-size: .9rem; }
  &:has(input:checked) { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
}
.pro-panel {
  margin-top: 1rem; padding: clamp(1rem, 2.5vw, 1.5rem); border-radius: var(--radius);
  background: var(--surface-solid); border: 1px solid var(--line);
  animation: rise .5s var(--ease-spring) both;
}
.pro-for { margin: 0 0 1rem; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.pro-groups {
  display: grid; gap: 1.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  & h4 { margin: 0 0 .5rem; font-family: var(--font-display); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
}
.pro-field {
  padding: .55rem 0;
  & .pro-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
  & label { font-weight: 600; font-size: .95rem; }
  & output { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
  & .pro-hint { margin: .2rem 0 0; font-size: .8rem; color: var(--warn); min-height: 0; }
  & .pro-hint:empty { display: none; }
}
/* Regler: Füllstand über --p */
input[type="range"] {
  --p: 50%;
  appearance: none; width: 100%; height: 2rem; background: transparent; cursor: pointer; margin: .2rem 0 0;
  &::-webkit-slider-runnable-track { height: .45rem; border-radius: 99px;
    background: linear-gradient(90deg, var(--sauce), var(--ember)) 0 / var(--p) 100% no-repeat, var(--line); }
  &::-moz-range-track { height: .45rem; border-radius: 99px; background: var(--line); }
  &::-moz-range-progress { height: .45rem; border-radius: 99px; background: linear-gradient(90deg, var(--sauce), var(--ember)); }
  &::-webkit-slider-thumb { appearance: none; width: 1.5rem; height: 1.5rem; margin-top: -.53rem; border-radius: 50%;
    background: var(--cheese); border: 3px solid var(--sauce); box-shadow: 0 2px 8px oklch(30% 0.08 40 / .3); transition: scale .25s var(--ease-spring); }
  &::-moz-range-thumb { width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--cheese); border: 3px solid var(--sauce); }
  &:active::-webkit-slider-thumb { scale: 1.2; }
  &:focus-visible { outline: none; }
  &:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--accent); outline-offset: 2px; }
}
.pro-sum {
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; margin-top: 1.25rem; padding-top: 1rem;
  border-top: 1px dashed var(--line);
  & div { display: grid; }
  & span { font-size: .78rem; font-weight: 600; color: var(--ink-2); }
  & strong { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
  & strong.bad { color: var(--bad); }
  & .btn { margin-left: auto; }
}
.btn-sm { min-height: 2.5rem; padding: .5rem 1rem; font-size: .9rem; }
.pro-warn { margin: .75rem 0 0; font-weight: 600; font-size: .9rem; color: var(--bad); }
.pro-note { margin: .75rem 0 0; font-size: .88rem; color: var(--ink-2); }
.window-note {
  display: flex; gap: .6rem; align-items: flex-start; max-width: 46rem; margin: -.75rem 0 1.25rem;
  padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--bg-2); color: var(--ink-2); font-size: .92rem;
  & .ic { color: var(--accent); margin-top: .1rem; }
}
.pro-badge {
  display: inline-block; vertical-align: middle; font-family: var(--font-body); font-size: .9rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; padding: .3rem .7rem; border-radius: 99px; background: var(--ink); color: var(--bg);
}

.segmented {
  display: inline-grid; grid-auto-flow: column; padding: .3rem; border-radius: 99px;
  background: var(--bg-2); border: 1px solid var(--line);
  & label { position: relative; cursor: pointer; }
  & input { position: absolute; opacity: 0; }
  & span { display: block; padding: .6rem 1.2rem; border-radius: 99px; font-weight: 600; transition: background .25s, color .25s; }
  & input:checked + span { background: var(--surface-solid); color: var(--accent); box-shadow: 0 2px 8px oklch(30% 0.05 40 / .15); }
  & input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
}

.summary-pill {
  display: flex; flex-wrap: wrap; gap: .4rem; margin-top: 2rem; min-height: 1.8rem;
  & span { font-size: .85rem; font-weight: 600; padding: .3rem .7rem; border-radius: 99px; background: var(--bg-2); color: var(--ink-2); }
}

.wizard-nav {
  display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; padding-top: 1.5rem;
  border-top: 1px dashed var(--line);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font: inherit; font-weight: 700; font-size: 1rem; min-height: 3.1rem; padding: .8rem 1.4rem;
  border-radius: 99px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform .3s var(--ease-spring), box-shadow .25s, background .2s;
  &:active { transform: scale(.96); }
  &:disabled { opacity: .45; cursor: not-allowed; }
}
.btn-primary {
  background: linear-gradient(180deg, color-mix(in oklch, var(--accent) 88%, white), var(--accent));
  color: var(--accent-ink);
  box-shadow: 0 10px 24px -10px color-mix(in oklch, var(--accent) 80%, transparent), inset 0 1px 0 oklch(100% 0 0 / .3);
  &:hover:not(:disabled) { transform: translateY(-2px); }
  &:hover .ic { translate: 3px 0; }
  & .ic { transition: translate .3s var(--ease-spring); }
}
.btn-soft { background: var(--accent-soft); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg-2); }
#backBtn[hidden] { display: inline-flex; visibility: hidden; }

/* ---------- Ergebnis ---------- */
.result { view-transition-name: result; outline: none; }
.result-head {
  margin-bottom: 1.5rem;
  & h2 { font-size: clamp(2rem, 1.3rem + 3vw, 3.6rem); line-height: 1; margin: 0 0 .75rem; font-weight: 800; letter-spacing: -0.04em; }
}
.actions { display: flex; flex-wrap: wrap; gap: .6rem; }

.bento {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
  grid-template-areas:
    "start start start start start stats stats stats stats stats stats stats"
    "ingr ingr ingr ingr ingr time time time time time time time"
    "shop shop shop shop shop time time time time time time time"
    "tips tips tips tips tips time time time time time time time"
    "gear gear gear gear gear gear gear gear ad ad ad ad";
}
.tile {
  background: var(--surface); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
  animation: rise .7s var(--ease-spring) both;
  container-type: inline-size;
  & h3 { display: flex; align-items: center; gap: .5rem; margin: 0 0 1rem; font-size: 1.2rem; font-weight: 700; }
  & h3 .ic { color: var(--accent); }
}
.tile:nth-child(2) { animation-delay: .06s; } .tile:nth-child(3) { animation-delay: .12s; }
.tile:nth-child(4) { animation-delay: .18s; } .tile:nth-child(5) { animation-delay: .24s; } .tile:nth-child(6) { animation-delay: .3s; }
@keyframes rise { from { opacity: 0; translate: 0 24px; scale: .98; } to { opacity: 1; translate: 0 0; scale: 1; } }

.tile-start {
  grid-area: start; position: relative; overflow: hidden; color: oklch(99% 0.01 80); border: 0;
  background:
    radial-gradient(circle at 92% 110%, oklch(80% 0.15 70 / .8), transparent 45%),
    linear-gradient(140deg, var(--sauce), var(--sauce-2));
  & .tile-label { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
  & .big { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.2rem); line-height: 1; margin: .5rem 0 .4rem; letter-spacing: -0.04em; }
  & p { margin: 0; }
  &::after {
    content: ""; position: absolute; right: -2.5rem; top: -2.5rem; width: 9rem; height: 9rem; border-radius: 50%;
    background:
      radial-gradient(circle at 35% 40%, oklch(99% 0.02 90 / .9) 0 9%, transparent 10%),
      radial-gradient(circle at 60% 65%, oklch(99% 0.02 90 / .9) 0 11%, transparent 12%),
      radial-gradient(circle, oklch(100% 0 0 / .14) 0 60%, transparent 61%);
    animation: spin 40s linear infinite;
  }
}
@keyframes spin { to { rotate: 360deg; } }

.tile-stats { grid-area: stats; display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: .75rem; padding: .75rem; }
.stat {
  border-radius: var(--radius-sm); background: var(--bg-2); padding: .9rem 1rem; display: grid; gap: .1rem; align-content: center;
  & .ic { color: var(--accent); margin-bottom: .2rem; }
  & strong { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
  & span { font-size: .8rem; color: var(--ink-2); font-weight: 600; }
}

.tile-ingredients { grid-area: ingr; }
.ingredients {
  list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem;
  & li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
  & li:last-child { border-bottom: 0; }
  & .qty { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; }
  & .qty small { font-size: .7em; font-weight: 600; color: var(--ink-2); margin-left: .15em; }
  & .name { font-weight: 600; }
  & .name small { display: block; color: var(--ink-2); font-weight: 400; font-size: .85rem; }
}
.fine { font-size: .82rem; color: var(--ink-2); margin: .8rem 0 0; }

.tile-timeline { grid-area: time; }
.timeline {
  list-style: none; margin: 0; padding: 0; position: relative;
  &::before { content: ""; position: absolute; left: 1.2rem; top: .8rem; bottom: .8rem; width: 2px;
    background: repeating-linear-gradient(to bottom, var(--line) 0 6px, transparent 6px 11px); }
  & li { position: relative; display: grid; grid-template-columns: 2.4rem 1fr; gap: 1rem; padding: .7rem 0; }
  & .t-ic {
    position: relative; z-index: 1; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--surface-solid); border: 1.5px solid var(--line); color: var(--accent);
  }
  & li.cold .t-ic { color: oklch(60% 0.12 240); }
  & li.fire .t-ic { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
  & li.parallel .t-ic { border-style: dashed; }
  & .t-when { font-size: .82rem; font-weight: 700; color: var(--accent); letter-spacing: .02em; }
  & .t-title { font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; margin: .1rem 0; display: flex; flex-wrap: wrap; gap: .5rem; align-items: baseline; }
  & .t-dur { font-family: var(--font-body); font-size: .78rem; font-weight: 600; color: var(--ink-2); padding: .1rem .5rem; border-radius: 99px; background: var(--bg-2); }
  & .t-desc { margin: 0; color: var(--ink-2); font-size: .93rem; }
}

.tile-shop { grid-area: shop; }
.checklist {
  list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem;
  & label { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; }
  & input { appearance: none; flex: none; width: 1.35rem; height: 1.35rem; margin-top: .1rem; border-radius: 7px; border: 1.5px solid var(--line); background: var(--surface-solid); display: grid; place-items: center; cursor: pointer; transition: background .2s; }
  & input:checked { background: var(--basil); border-color: transparent; }
  & input:checked::after { content: "✓"; color: white; font-size: .8rem; font-weight: 800; }
  & label:has(input:checked) span { text-decoration: line-through; color: var(--ink-2); }
  & small { display: block; color: var(--ink-2); font-size: .85rem; }
}

.tile-tips { grid-area: tips; }
.tips { margin: 0; padding-left: 1.1rem; display: grid; gap: .5rem; color: var(--ink-2); font-size: .95rem;
  & li::marker { color: var(--accent); } }

/* ---------- Affiliate-Links im Fließtext ---------- */
a.aff {
  color: inherit; font-weight: 600; text-decoration: underline; text-decoration-style: dotted;
  text-decoration-color: color-mix(in oklch, var(--accent) 70%, transparent);
  text-decoration-thickness: 2px; text-underline-offset: 3px;
  transition: color .2s, text-decoration-color .2s;
  &::after { content: "*"; font-size: .75em; vertical-align: super; margin-left: 1px; color: var(--accent); }
  &:hover { color: var(--accent); text-decoration-style: solid; text-decoration-color: var(--accent); }
}
.aff-note { font-size: .78rem !important; color: var(--ink-2); opacity: .85; }

/* ---------- Helfer-Kachel ---------- */
.tile-gear { grid-area: gear; }
.gear-lead { margin: -.5rem 0 1rem !important; }
.gear {
  list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}
.gear-card {
  display: flex; gap: .8rem; align-items: flex-start; height: 100%; padding: .9rem 1rem;
  border-radius: var(--radius-sm); background: var(--bg-2); color: var(--ink); text-decoration: none;
  border: 1px solid transparent;
  transition: transform .3s var(--ease-spring), border-color .2s, background .2s;
  &:hover { transform: translateY(-2px); border-color: color-mix(in oklch, var(--accent) 45%, transparent); background: var(--surface-solid); }
  &:hover .gear-cta .ic { translate: 3px 0; }
  & .gear-ic { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--surface-solid); color: var(--accent); }
  & .gear-body { display: grid; gap: .15rem; }
  & b { font-family: var(--font-display); font-size: 1rem; }
  & em { font-style: normal; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2);
    padding: .1rem .4rem; border-radius: 99px; border: 1px solid var(--line); vertical-align: middle; }
  & small { color: var(--ink-2); font-size: .85rem; line-height: 1.4; }
  & .gear-cta { margin-top: .25rem; font-size: .8rem; font-weight: 700; color: var(--accent); display: inline-flex; align-items: center; gap: .2rem; }
  & .gear-cta .ic { width: 1em; height: 1em; transition: translate .3s var(--ease-spring); }
}

/* ---------- Werbeflächen: klar gekennzeichnet, im Kachel-Look ---------- */
.ad-slot { position: relative; }
.ad-label {
  display: block; margin-bottom: .5rem; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); opacity: .8;
}
.tile-ad { grid-area: ad; display: flex; flex-direction: column; }
.tile-ad .ad-body { flex: 1; min-height: 250px; }
.ad-strip {
  margin-top: 2rem; padding: 1rem clamp(1rem, 2.4vw, 1.6rem); border-radius: var(--radius);
  border: 1px solid var(--line); background: color-mix(in oklch, var(--surface) 60%, transparent);
  & .ad-body { min-height: 90px; }
}
.ad-preview .ad-body {
  display: grid; place-items: center; border-radius: var(--radius-sm); border: 1.5px dashed var(--line);
  background: repeating-linear-gradient(-45deg, transparent 0 10px, color-mix(in oklch, var(--line) 50%, transparent) 10px 11px);
}
.ad-ph { font-size: .8rem; font-weight: 600; color: var(--ink-2); }
/* Liefert AdSense nichts aus (z. B. ohne Einwilligung), verschwindet die ganze Fläche samt Label */
.ad-slot:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
.bento:has(.tile-ad[hidden], .tile-ad:has(ins[data-ad-status="unfilled"])) .tile-gear { grid-column: 1 / -1; }

/* ---------- Einwilligung ---------- */
.consent {
  position: fixed; z-index: 40; left: max(1rem, env(safe-area-inset-left)); bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(24rem, calc(100vw - 2rem)); padding: 1.1rem 1.2rem;
  border-radius: var(--radius); background: var(--surface-solid); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: rise .5s var(--ease-spring) both;
  & b { font-family: var(--font-display); font-size: 1.05rem; }
  & p { margin: .35rem 0 .9rem; font-size: .88rem; color: var(--ink-2); }
}
.consent-actions { display: flex; gap: .5rem; & .btn { flex: 1; } }

.foot-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; margin-top: .5rem;
  & a, & .linklike { color: var(--ink-2); font: inherit; font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; }
  & .linklike { background: none; border: 0; padding: 0; cursor: pointer; }
}

.foot { position: relative; z-index: 1; text-align: center; color: var(--ink-2); font-size: .85rem; padding: 1rem 1rem 3rem;
  & p { margin: .3rem auto; max-width: 46rem; } }

/* Rechtsseiten (Impressum, Datenschutz, 404) */
.prose {
  max-width: 44rem; padding: clamp(1.4rem, 4vw, 2.8rem); border-radius: calc(var(--radius) + 8px);
  background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(12px);
  & h1 { font-family: var(--font-display, inherit); font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; margin: 0 0 1rem; text-wrap: balance; }
  & h2 { font-size: 1.1rem; margin: 2rem 0 .4rem; text-wrap: balance; }
  & p { margin: 0 0 .9rem; line-height: 1.6; text-wrap: pretty; }
  & .lead { font-size: 1.05rem; }
  & a { color: var(--accent); text-underline-offset: 3px; }
  & .updated { margin-top: 2rem; color: var(--ink-2); font-size: .85rem; }
  & .todo { background: oklch(90% 0.15 95); color: oklch(25% 0.05 60); padding: 0 .3em; border-radius: 4px; }
}
.prose-back { display: inline-flex; margin-top: 1.4rem; }

/* Mehl-Burst */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.burst i {
  position: absolute; width: var(--sz); height: var(--sz); border-radius: 50%; background: var(--c);
  left: var(--x); top: var(--y);
  animation: fly 1.3s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes fly { to { translate: var(--dx) var(--dy); opacity: 0; scale: .4; } }

/* ---------- View Transitions ---------- */
::view-transition-old(step) { animation: vt-out .28s ease both; }
::view-transition-new(step) { animation: vt-in .45s var(--ease-spring) both; }
@keyframes vt-out { to { opacity: 0; translate: calc(var(--dir, 1) * -40px) 0; filter: blur(4px); } }
@keyframes vt-in  { from { opacity: 0; translate: calc(var(--dir, 1) * 40px) 0; filter: blur(4px); } }
::view-transition-group(wizard) { animation-duration: .45s; }

/* ---------- Responsiv ---------- */
@media (max-width: 860px) {
  .bento {
    grid-template-columns: 1fr;
    grid-template-areas: "start" "stats" "ingr" "time" "shop" "tips" "gear" "ad";
  }
}
@media (max-width: 560px) {
  .progress-steps li { font-size: .75rem; padding: .3rem .6rem; }
  .wizard-nav { position: sticky; bottom: 0; margin-inline: -1.25rem; margin-bottom: -1.25rem; padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
    background: color-mix(in oklch, var(--surface-solid) 85%, transparent); backdrop-filter: blur(10px); border-radius: 0 0 calc(var(--radius) + 8px) calc(var(--radius) + 8px); }
  .wizard-nav .btn { flex: 1; }
  .actions .btn { flex: 1 1 100%; }
}
@container (max-width: 420px) {
  .counter { justify-content: center; }
  .pizza-row { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ==========================================================================
   Druck / PDF – feste A4-Ausgabe
   ========================================================================== */
.print-sheet { display: none; }

@page { size: A4; margin: 14mm 14mm 16mm; }

@media print {
  :root { color-scheme: light; }
  body { background: #fff !important; color: #1d1714; font-size: 10pt; }
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block !important; font-family: var(--font-body); }

  .ps-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8mm;
    border-bottom: 2.5pt solid #d2412e; padding-bottom: 4mm; margin-bottom: 5mm; }
  .ps-brand { display: flex; align-items: center; gap: 3mm; font-family: var(--font-display); font-weight: 800; font-size: 13pt; }
  .ps-brand svg { width: 10mm; height: 10mm; }
  .ps-head h1 { font-size: 22pt; line-height: 1.05; margin: 2mm 0 0; letter-spacing: -0.03em; }
  .ps-meta { text-align: right; font-size: 9pt; color: #5b4b42; line-height: 1.5; }
  .ps-meta strong { color: #1d1714; }

  .ps-start { display: flex; gap: 6mm; align-items: center; background: #fbeae4 !important; border-radius: 4mm; padding: 4mm 5mm; margin-bottom: 5mm;
    -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ps-start b { font-family: var(--font-display); font-size: 16pt; color: #b8321f; }

  .ps-note { margin: -2mm 0 5mm; font-size: 8.5pt; color: #5b4b42; }
  .ps-grid { display: grid; grid-template-columns: 64mm 1fr; gap: 7mm; }
  .ps-sec h2 { font-family: var(--font-display); font-size: 12pt; margin: 0 0 2.5mm; padding-bottom: 1.5mm; border-bottom: 0.75pt solid #e3d6cc; }
  .ps-sec + .ps-sec { margin-top: 6mm; }

  .ps-ingr { width: 100%; border-collapse: collapse; }
  .ps-ingr td { padding: 1.6mm 0; border-bottom: 0.5pt dotted #cdbcb0; vertical-align: top; }
  .ps-ingr td:last-child { text-align: right; font-weight: 700; font-family: var(--font-display); font-size: 11pt; white-space: nowrap; }
  .ps-ingr small { display: block; color: #7a6a60; font-size: 8pt; }

  .ps-list { list-style: none; padding: 0; margin: 0; }
  .ps-list li { display: flex; gap: 2.5mm; padding: 1.1mm 0; }
  .box { flex: none; width: 3.6mm; height: 3.6mm; border: 0.9pt solid #6b5a50; border-radius: 0.8mm; margin-top: 0.4mm; }

  .ps-steps { list-style: none; margin: 0; padding: 0; }
  .ps-steps li { display: grid; grid-template-columns: 5mm 26mm 1fr; gap: 3mm; padding: 2.3mm 0; border-bottom: 0.5pt solid #eee3da; break-inside: avoid; }
  .ps-when { font-weight: 700; color: #b8321f; font-size: 9pt; line-height: 1.35; }
  .ps-steps b { font-family: var(--font-display); font-size: 10.5pt; }
  .ps-steps p { margin: .6mm 0 0; color: #5b4b42; font-size: 9pt; }
  .ps-steps .dur { font-weight: 600; color: #7a6a60; font-size: 8.5pt; }

  .ps-notes { margin-top: 6mm; border: 0.75pt dashed #cdbcb0; border-radius: 3mm; padding: 3mm 4mm; min-height: 24mm; color: #9a8a80; font-size: 8.5pt; break-inside: avoid; }
  .ps-foot { margin-top: 5mm; font-size: 7.5pt; color: #9a8a80; text-align: center; }
}
