/* Kochkompass App: Kopfleiste mit Tabs (Kochen, Favoriten), Suchfeld, dann Kompass, drei Rezeptkarten und das aufgeklappte Rezept. */
:root {
  --bg: #fbf7f8;
  --surface: #ffffff;
  --fg: #2a1a24;
  --muted: #76636e;
  --line: #eaddE3;
  --accent: #9e2257;
  --accent-soft: #f6e3eb;
  --herb: #3c6a48;
  --herb-soft: #e4efe6;
  --warn: #9a5b12;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #191116; --surface: #23181f; --fg: #f3e9ee; --muted: #b29ea9; --line: #3a2a33;
    --accent: #e8689a; --accent-soft: #3d1d2b; --herb: #86b893; --herb-soft: #1f3125; --warn: #e0a557;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #191116; --surface: #23181f; --fg: #f3e9ee; --muted: #b29ea9; --line: #3a2a33;
  --accent: #e8689a; --accent-soft: #3d1d2b; --herb: #86b893; --herb-soft: #1f3125; --warn: #e0a557;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--body); font-size: 16px; line-height: 1.5;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 24px 56px;
}
.wrap { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 28px; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.15; }
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pic { display: inline-flex; flex: none; }
.pic svg { width: 100%; height: 100%; }

/* Kopf */
.head { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.head-art { width: 92px; height: 92px; }
.head-art svg { width: 100%; height: 100%; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.head h1 { font-size: clamp(32px, 6vw, 50px); font-weight: 700; letter-spacing: -.01em; }
.head .char { color: var(--muted); margin: 6px 0 0; max-width: 60ch; }

.sec-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.sec-h h2 { font-size: 24px; }
.sec-sub { font-family: var(--mono); font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

/* Kompass */
.roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.role { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.role h3 { font-size: 16px; font-weight: 600; color: var(--accent); }
.role-note { margin: 0; font-size: 13.5px; color: var(--muted); }
.pairs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pairs li { display: flex; gap: 10px; align-items: center; min-width: 0; }
.pairs .pic { width: 34px; height: 34px; }
.pairs b { display: block; font-weight: 600; font-size: 15px; line-height: 1.2; }
.pairs small { display: block; font-size: 13px; color: var(--muted); line-height: 1.3; }
.twist { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--herb-soft); font-size: 15px; }
.twist b { color: var(--herb); }

/* Rezeptkarten */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.card {
  display: flex; flex-direction: column; gap: 6px; text-align: left; cursor: pointer; position: relative;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0;
  transition: border-color .15s, background .15s, transform .15s;
}
.card:hover { border-color: var(--accent); }
.card[aria-selected="true"] { border: 2px solid var(--accent); background: var(--accent-soft); }
@media (prefers-reduced-motion: no-preference) { .card:active { transform: scale(.985); } }
.trio { display: flex; margin-bottom: 4px; }
.trio .pic { width: 46px; height: 46px; border-radius: 50%; background: var(--bg); border: 2px solid var(--surface); }
.trio .pic + .pic { margin-left: -12px; }
.card[aria-selected="true"] .trio .pic { border-color: var(--accent-soft); }
.card-kitchen { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--herb); }
.card-name { font-family: var(--display); font-weight: 600; font-size: 17px; line-height: 1.2; }
.card-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-flag { position: absolute; top: 12px; right: 12px; font-family: var(--mono); font-size: 10.5px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--herb); color: var(--herb); }

/* Rezept */
#recipe { scroll-margin-top: 16px; }
.recipe { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.r-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.r-top h2 { font-size: clamp(22px, 4.2vw, 30px); margin-top: 4px; }
.r-top > div:first-child { min-width: 0; flex: 1 1 260px; }
.badge { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--herb); }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.stepper button { background: transparent; border: 0; width: 38px; height: 36px; font-size: 20px; cursor: pointer; color: var(--accent); }
.stepper button:disabled { opacity: .35; cursor: default; }
.stepper span { font-family: var(--mono); font-size: 13px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.meta li { font-family: var(--mono); font-size: 12.5px; font-variant-numeric: tabular-nums; padding: 3px 9px; border-radius: 6px; background: var(--herb-soft); }
.why { margin: 0; font-size: 15px; }
.why b { color: var(--accent); }

.ing { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .ing { grid-template-columns: 1fr; } }
.ing h4, .steps-h { font-size: 13px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
.ing-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ing-row { width: 100%; display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; text-align: left; background: none; border: 0; border-bottom: 1px dotted var(--line); padding: 7px 0; cursor: pointer; }
.box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--muted); display: grid; place-items: center; }
.ing-row[aria-pressed="true"] .box { background: var(--herb); border-color: var(--herb); }
.ing-row[aria-pressed="true"] .box::after { content: "✓"; color: var(--bg); font-size: 12px; font-weight: 700; }
.ing-row[aria-pressed="true"] .ing-name { text-decoration: line-through; color: var(--muted); }
.ing-name { font-size: 15px; min-width: 0; }
.ing-amt { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.step-row { width: 100%; display: grid; grid-template-columns: 36px 1fr; gap: 12px; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; }
.num { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: var(--bg); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 17px; }
.step-row b { display: block; font-size: 16px; }
.step-text { display: block; font-size: 15px; margin-top: 2px; }
.steps li.done .step-row { opacity: .6; }
.steps li.done .num { background: var(--herb); }
.tipline { font-size: 15px; background: var(--herb-soft); border-radius: 10px; padding: 10px 12px; margin: 0; }

.adapt { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.adapt label { font-weight: 600; }
.adapt-row { display: flex; gap: 8px; flex-wrap: wrap; }
.text { flex: 1 1 220px; min-width: 0; font: inherit; font-size: 15px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); color: var(--fg); }
.text:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.btn { border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 1.5px solid var(--accent); font-weight: 600; }
.btn.primary { background: var(--accent); color: var(--bg); }
.btn:disabled { opacity: .55; cursor: progress; }
.link { align-self: flex-start; background: none; border: 0; padding: 2px 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.status { font-size: 14px; color: var(--muted); margin: 0; }
.status.err { color: var(--warn); }

#sources h4 { font-size: 13px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; margin-bottom: 6px; }
#sources ul { margin: 0; padding-left: 18px; font-size: 14.5px; }
#sources a { color: var(--accent); }
.foot { font-size: 12.5px; color: var(--muted); text-align: center; margin: 0; }

/* ---------- App-Rahmen ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--bg); }
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 20px; }
.brand svg { width: 28px; height: 28px; }
.tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.tabs button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: 14.5px; }
.tabs button[aria-selected="true"] { background: var(--accent); color: var(--bg); }
.count { font-family: var(--mono); font-size: 12px; margin-left: 4px; opacity: .8; }

/* Login */
.login { max-width: 360px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 14px; text-align: center; align-items: stretch; }
.login .head-art { width: 84px; height: 84px; margin: 0 auto; }
.login h1 { font-size: 36px; }
.login form { display: flex; flex-direction: column; gap: 10px; }

/* Suche */
.search { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.search h1 { font-size: clamp(26px, 5vw, 34px); }
.search-row { display: flex; gap: 8px; flex-wrap: wrap; }
.search .text.big { font-size: 18px; padding: 12px 14px; }
.search details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14.5px; }
.search details[open] summary { margin-bottom: 8px; }
.loader { display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center; padding: 32px 12px; }
.loader .head-art { width: 72px; height: 72px; }
@media (prefers-reduced-motion: no-preference) { .loader .head-art { animation: bob 1.6s ease-in-out infinite; } }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.loader .shimmer.bar { width: min(260px, 80%); }
.notice { font-size: 13.5px; color: var(--muted); margin: 0; }

/* Herz / Merken */
.r-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.heart { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--accent); color: var(--accent); background: transparent; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-weight: 600; font-size: 14px; }
.heart[aria-pressed="true"] { background: var(--accent); color: var(--bg); }
.heart svg { width: 16px; height: 16px; }

/* Favoriten */
.favs { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.empty { text-align: center; color: var(--muted); padding: 40px 12px; background: var(--surface); border: 1px dashed var(--line); border-radius: 16px; }
.back { align-self: flex-start; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.small { padding: 7px 12px; }
.logout { font-size: 13px; }
