/* ==========================================================================
   Rezeptbuch — Stylesheet
   Aufbau: 1 Tokens · 2 Grundlagen · 3 Kopfleiste · 4 Bausteine ·
           5 Übersicht · 6 Karten · 7 Listen & Filter · 8 Rezeptdetail ·
           9 Editor · 10 Tabellen & Konto · 11 Anmeldung · 12 Kleinkram ·
           13 Responsive
   ========================================================================== */

/* ---------------------------------------------------------------- 1 Tokens */
:root {
  --paper: #fdfaf6;
  --paper-2: #f6efe7;
  --surface: #ffffff;
  --surface-2: #fbf7f2;
  --ink: #1b1613;
  --ink-soft: #3a322c;
  --muted: #726459;
  --line: #ebe0d5;
  --line-strong: #d9cabb;
  --accent: #cf5228;
  --accent-2: #e8863f;
  --accent-ink: #a8401c;
  --accent-soft: #fdeee6;
  --sage: #3f6b52;
  --sage-soft: #eaf2ec;
  --gold: #cf9a1f;
  --danger: #b8321f;
  --shadow-sm: 0 1px 2px rgba(40, 25, 15, .06), 0 2px 8px rgba(40, 25, 15, .05);
  --shadow-md: 0 2px 6px rgba(40, 25, 15, .06), 0 12px 28px rgba(40, 25, 15, .09);
  --shadow-lg: 0 18px 48px rgba(40, 25, 15, .16);
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-pill: 999px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1200px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12100e;
    --paper-2: #171412;
    --surface: #1c1917;
    --surface-2: #221e1b;
    --ink: #f4eee8;
    --ink-soft: #ded5cc;
    --muted: #a2958b;
    --line: #322b26;
    --line-strong: #453b34;
    --accent: #ff8a4c;
    --accent-2: #ffab6b;
    --accent-ink: #ffc79b;
    --accent-soft: #34211a;
    --sage: #86c3a1;
    --sage-soft: #1e2a22;
    --gold: #e8bb4f;
    --danger: #ff7a63;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #12100e;
  --paper-2: #171412;
  --surface: #1c1917;
  --surface-2: #221e1b;
  --ink: #f4eee8;
  --ink-soft: #ded5cc;
  --muted: #a2958b;
  --line: #322b26;
  --line-strong: #453b34;
  --accent: #ff8a4c;
  --accent-2: #ffab6b;
  --accent-ink: #ffc79b;
  --accent-soft: #34211a;
  --sage: #86c3a1;
  --sage-soft: #1e2a22;
  --gold: #e8bb4f;
  --danger: #ff7a63;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ----------------------------------------------------------- 2 Grundlagen */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 12% -10%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 70%),
    radial-gradient(700px 420px at 100% 0%, color-mix(in srgb, var(--sage) 8%, transparent), transparent 65%);
  z-index: 0;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -.015em; }
h1 { font-family: var(--serif); font-size: clamp(1.7rem, 1.2rem + 2vw, 2.5rem); font-weight: 600; }
h2 { font-size: 1.08rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6rem; }
code { font-family: var(--mono); font-size: .85em; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 26px 22px 64px; position: relative; z-index: 1; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.link { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--accent); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-form { gap: 12px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mini-head { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); margin-bottom: 8px; font-weight: 600; }

/* --------------------------------------------------------- 3 Kopfleiste */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 22px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.02em; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 11px; font-size: 18px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 32%, transparent);
}
.brand-mark.big { width: 54px; height: 54px; font-size: 28px; border-radius: 16px; margin: 0 auto 10px; }
.brand-text { font-size: 1.06rem; }
.nav { display: flex; gap: 4px; margin-left: auto; flex-wrap: wrap; }
.nav-link {
  padding: 7px 13px; border-radius: var(--r-pill); font-size: .92rem; font-weight: 550;
  color: var(--muted); transition: background .18s, color .18s, transform .18s;
}
.nav-link:hover { background: var(--surface); color: var(--ink); }
.nav-link.on { background: var(--ink); color: var(--paper); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); cursor: pointer; font-size: 15px;
  display: grid; place-items: center; transition: transform .18s, border-color .18s;
}
.icon-btn:hover { transform: rotate(-12deg); border-color: var(--line-strong); }
.nav-user { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill); border: 1px solid transparent; transition: border-color .18s, background .18s; }
.nav-user:hover { border-color: var(--line); background: var(--surface); }
.nav-user-name { font-size: .9rem; font-weight: 550; }
.nav-logout { color: var(--muted); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--sage), color-mix(in srgb, var(--sage) 55%, #fff));
  color: #fff; font-weight: 700; font-size: .84rem; flex: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: .76rem; }
.avatar.big { width: 62px; height: 62px; font-size: 1.5rem; }

/* ---------------------------------------------------------- 4 Bausteine */
.btn {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); padding: 9px 16px; border-radius: var(--r-pill);
  font: inherit; font-size: .92rem; font-weight: 560; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  transition: transform .14s ease, box-shadow .18s, background .18s, border-color .18s;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--ink-soft); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  border-color: transparent; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 26%, transparent);
}
.btn-primary:hover { box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 34%, transparent); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 38%, var(--line)); background: transparent; }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: var(--danger); }
.btn-sm { padding: 6px 11px; font-size: .84rem; }
.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.fav-btn.on { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.fav-btn.on .fav-ico { transform: scale(1.15); }
.fav-ico { transition: transform .2s; }

label { display: flex; flex-direction: column; gap: 6px; font-size: .86rem; font-weight: 550; color: var(--ink-soft); }
input, textarea, select, button { font-family: inherit; }
input, textarea, select {
  font-size: .95rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  padding: 10px 12px; width: 100%; transition: border-color .16s, box-shadow .16s, background .16s;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea { resize: vertical; line-height: 1.5; }
/* Auswahlfelder sehen aus wie die Textfelder — gleiche Fläche, gleicher Rand,
   gleiche Polsterung, kein eigenes Zeichen. appearance: none nimmt dem
   Betriebssystem die eigene Formgebung; im Feld steht Text statt Zahlen. */
select { appearance: none; }
/* Die aufklappende Liste zeichnet sonst das Betriebssystem — hell auf hell
   bzw. helle Schrift auf hellem Grund. Eigene Farben zwingen den Browser,
   die Liste selbst zu zeichnen; das Styling des <select> vererbt sich NICHT. */
select option, select optgroup {
  background-color: var(--surface);
  color: var(--ink);
  padding: 6px 8px;
}
.switch { flex-direction: row; align-items: center; gap: 8px; font-weight: 550; cursor: pointer; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.switch span { font-size: .9rem; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line);
  font-size: .82rem; color: var(--ink-soft); transition: all .16s;
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.chip-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-n { font-size: .72rem; opacity: .65; }
.chip-sm { padding: 3px 9px; font-size: .76rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px;
  border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line);
  font-size: .78rem; font-weight: 550; color: var(--ink-soft); white-space: nowrap;
}
.badge-muted { color: var(--muted); }
.badge-gold { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
.badge-ok { color: var(--sage); border-color: color-mix(in srgb, var(--sage) 42%, var(--line)); background: var(--sage-soft); }
.badge-warn { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.badge-sub { opacity: .6; font-size: .72rem; }
.stars { letter-spacing: 1px; font-size: .95rem; }
.stars.sm { font-size: .82rem; }
.star { color: color-mix(in srgb, var(--muted) 40%, transparent); }
.star.full { color: var(--gold); }
.star.half { background: linear-gradient(90deg, var(--gold) 50%, color-mix(in srgb, var(--muted) 40%, transparent) 50%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
}
.panel > h2 { margin-bottom: 14px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-tools { display: flex; gap: 8px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.fields .wide { grid-column: 1 / -1; }
.sex { display: none; }

/* ------------------------------------------------------------ 5 Übersicht */
.hero {
  position: relative; overflow: hidden; border-radius: 26px; padding: 34px 34px 30px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line); box-shadow: var(--shadow-md); margin-bottom: 30px;
}
.hero-glow {
  position: absolute; inset: -40% -10% auto auto; width: 620px; height: 620px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%);
  filter: blur(6px); pointer-events: none;
}
.hero-inner { position: relative; }
.hero-kicker { text-transform: uppercase; letter-spacing: .16em; font-size: .74rem;
  font-weight: 650; color: var(--accent-ink); margin-bottom: 6px; }
.hero h1 { max-width: 22ch; margin-bottom: 18px; }
.hero-search { display: flex; gap: 10px; max-width: 560px; }
.hero-search input { border-radius: var(--r-pill); padding: 12px 18px; box-shadow: var(--shadow-sm); }
.hero-search .btn { padding: 12px 22px; }
.stats { display: flex; gap: 30px; margin-top: 24px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; }
.stat b { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; line-height: 1.1; }
.stat span { font-size: .8rem; color: var(--muted); }
.stats-dark { margin: 0; }
.stats-dark .stat b { font-size: 1.4rem; }

.sect { margin: 34px 0; }
.sect-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.sect-head h2 { font-family: var(--serif); font-size: 1.32rem; font-weight: 600; }

.cat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.cat-pill {
  display: flex; align-items: center; gap: 10px; padding: 13px 15px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.cat-pill:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.cat-ico { font-size: 1.3rem; }
.cat-name { font-weight: 560; font-size: .92rem; }
.cat-count { margin-left: auto; font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- 6 Karten */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .22s, border-color .2s;
  animation: cardIn .45s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.05); }
.card-ph, .detail-photo.gen {
  width: 100%; height: 100%; display: grid; place-items: center; font-size: 2.6rem;
}
.ph-0 { background: linear-gradient(140deg, #ffe3c9, #ffc79b); }
.ph-1 { background: linear-gradient(140deg, #d9ecdf, #b6ddc4); }
.ph-2 { background: linear-gradient(140deg, #e5e0f7, #cdc4ee); }
.ph-3 { background: linear-gradient(140deg, #ffe0e0, #f6c3c3); }
.ph-4 { background: linear-gradient(140deg, #fdf0c9, #f4dd9a); }
.ph-5 { background: linear-gradient(140deg, #d8ecf4, #b4d9e8); }
.card-cat {
  position: absolute; left: 10px; bottom: 10px; padding: 4px 10px; border-radius: var(--r-pill);
  background: color-mix(in srgb, #1b1613 62%, transparent); color: #fff;
  font-size: .74rem; font-weight: 550; backdrop-filter: blur(6px);
}
.card-fav { position: absolute; right: 10px; top: 10px; color: #fff; font-size: 1rem;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .55); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { font-size: 1.02rem; }
.card-desc { font-size: .86rem; color: var(--muted); margin: 0; min-height: 2.4em; }
.card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .79rem; color: var(--muted); margin-top: auto; }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------------- 7 Listen & Filter */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px;
  margin-bottom: 20px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 16px; }
.filterbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); margin-bottom: 18px;
}
.filterbar select, .filterbar input { width: auto; }
.filter-q { flex: 1 1 220px; min-width: 160px; }
.filterbar .switch { padding: 0 6px; }
.crumbs { display: flex; gap: 8px; font-size: .84rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a:hover { color: var(--accent); }

/* ---------------------------------------------------------- 8 Rezeptdetail */
.detail-head { display: flex; justify-content: space-between; gap: 26px; align-items: flex-start;
  flex-wrap: wrap; margin-bottom: 26px; }
.detail-title { max-width: 62ch; }
.detail-title h1 { margin-bottom: 6px; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; max-width: 330px; justify-content: flex-end; }
.detail-grid { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 22px; align-items: start; }
.detail-photo { margin: 22px 0; border-radius: var(--r-lg); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-md); max-height: 420px; }
.detail-photo img { width: 100%; height: 100%; object-fit: cover; max-height: 420px; }

.scale { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border: 1px dashed var(--line-strong); border-radius: var(--r);
  background: var(--surface-2); margin-bottom: 14px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--surface); cursor: pointer; font-size: .95rem; color: var(--ink);
  display: grid; place-items: center; transition: all .15s;
}
.stepper button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper output { min-width: 34px; text-align: center; font-weight: 650; font-variant-numeric: tabular-nums; }
.stepper .reset { font-size: .8rem; }

.ing-list, .step-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { border-bottom: 1px solid var(--line); }
.ing-list li:last-child { border-bottom: none; }
.ing-list li.ing-group { font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--accent-ink); font-weight: 650; padding: 14px 0 6px; border-bottom: none; }
.ing label, .step label { display: flex; gap: 10px; padding: 9px 0; cursor: pointer; align-items: flex-start; }
.ing input, .step input { width: 17px; height: 17px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.ing-txt { font-size: .95rem; }
.ing .amount, .step .menge { font-weight: 650; }
.ing-note { color: var(--muted); font-size: .85rem; }
.checked .ing-txt, .checked .step-txt { text-decoration: line-through; color: var(--muted); }
.step-n {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: .82rem;
  margin-top: 1px;
}
.step-txt { font-size: .96rem; }
.step-list li + li { border-top: 1px solid var(--line); }
.warn {
  margin-top: 18px; padding: 14px 16px; border-radius: var(--r);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  background: var(--accent-soft);
}
.warn b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--accent-ink); margin-bottom: 6px; }
.warn p { margin: 0; font-size: .92rem; }

.rate-panel { margin-top: 26px; }
.rate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.rate-form { display: flex; flex-direction: column; gap: 12px; }
.star-input { display: flex; gap: 4px; }
.star-btn {
  background: none; border: none; cursor: pointer; font-size: 1.9rem; line-height: 1;
  color: color-mix(in srgb, var(--muted) 42%, transparent); padding: 0; transition: transform .15s, color .15s;
}
.star-btn:hover { transform: scale(1.14); }
.star-btn.on { color: var(--gold); }
.rate-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rating-item { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; background: var(--surface-2); }
.rating-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .88rem; }
.rating-date { margin-left: auto; font-size: .76rem; color: var(--muted); }
.rating-item p { margin: 8px 0 0; font-size: .9rem; color: var(--ink-soft); }

/* --------------------------------------------------------------- 9 Editor */
.editor { display: flex; flex-direction: column; gap: 22px; }
.editor-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.ing-editor, .step-editor { display: flex; flex-direction: column; gap: 8px; }
.ing-row { display: grid; grid-template-columns: 88px 84px 1fr 1fr 34px; gap: 8px; align-items: center; }
.ing-row input { padding: 8px 10px; font-size: .9rem; }
.ing-row.is-group { grid-template-columns: 1fr 34px; }
.ing-row.is-group .i-amount, .ing-row.is-group .i-unit, .ing-row.is-group .i-note { display: none; }
.ing-row.is-group .i-name {
  font-weight: 650; color: var(--accent-ink);
  background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, var(--line));
}
.step-row { display: grid; grid-template-columns: 20px 1fr 34px; gap: 8px; align-items: start; }
.step-handle { color: var(--line-strong); cursor: grab; padding-top: 10px; text-align: center; }
.step-row textarea { min-height: 46px; }
.row-del {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: transparent; color: var(--muted); cursor: pointer; font-size: 1.1rem; line-height: 1;
  transition: all .15s;
}
.row-del:hover { color: var(--danger); border-color: var(--danger); }
.paste-box { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 12px; }
.paste-box summary { cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--accent-ink); }
.paste-box textarea { margin-top: 10px; }
.paste-box .btn { margin-top: 8px; }

.photo-box {
  position: relative; border: 2px dashed var(--line-strong); border-radius: var(--r-lg);
  min-height: 200px; display: flex; flex-direction: column; gap: 10px; align-items: center;
  justify-content: center; padding: 14px; transition: border-color .18s, background .18s;
}
.photo-box.drag { border-color: var(--accent); background: var(--accent-soft); }
.photo-box img { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--r); }
.ph-drop { display: grid; place-items: center; text-align: center; color: var(--muted); gap: 6px; padding: 26px 0; }
.ph-drop span { font-size: 2rem; }
.photo-tools { display: flex; gap: 8px; }
.editor-foot { display: flex; align-items: center; gap: 14px; padding-top: 4px; }

/* ------------------------------------------------------ 10 Tabellen & Konto */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ------------------------------------------------------------ 11 Anmeldung */
.page-auth .wrap { max-width: 520px; }
.page-auth .topbar, .page-auth .foot { display: none; }
.auth-wrap { min-height: 78vh; display: grid; place-items: center; }
.auth-card {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 26px;
  padding: 34px 30px; box-shadow: var(--shadow-lg); animation: cardIn .4s ease both;
}
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-head h1 { font-size: 1.6rem; }
.auth-card .toast { position: static; margin-bottom: 12px; }
.auth-alt { text-align: center; font-size: .88rem; color: var(--muted); margin: 4px 0 0; }
.auth-alt a { color: var(--accent-ink); text-decoration: underline; }

/* ------------------------------------------------------------- 12 Kleinkram */
.empty {
  grid-column: 1 / -1; text-align: center; padding: 54px 20px; border: 1px dashed var(--line-strong);
  border-radius: var(--r-lg); color: var(--muted); display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.empty span { font-size: 2.4rem; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex;
  flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink); color: var(--paper); padding: 11px 16px; border-radius: var(--r);
  font-size: .88rem; box-shadow: var(--shadow-lg); animation: toastIn .28s ease both;
  max-width: 340px;
}
.toast-error { background: var(--danger); color: #fff; }
.toast-ok { background: var(--sage); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.foot {
  max-width: var(--maxw); margin: 0 auto; padding: 22px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: .82rem; display: flex; gap: 10px; flex-wrap: wrap;
}
.foot-dot { opacity: .5; }
.is-scaled .amount, .amount { transition: color .3s; }

/* ----------------------------------------------------------- 13 Responsive */
@media (max-width: 1000px) {
  .detail-grid, .editor-cols, .split, .rate-grid { grid-template-columns: 1fr; }
  .detail-actions { justify-content: flex-start; max-width: none; }
}
@media (max-width: 760px) {
  .wrap { padding: 18px 14px 56px; }
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .nav { order: 3; width: 100%; justify-content: flex-start; overflow-x: auto;
    -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .nav-link { font-size: .88rem; }
  .nav-user-name { display: none; }
  .hero { padding: 24px 20px; border-radius: 20px; }
  .hero-search { flex-direction: column; }
  .hero-search .btn { justify-content: center; }
  .grid-cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
  .ing-row { grid-template-columns: 1fr 1fr; grid-template-areas: "a b" "n n" "x y"; }
  .ing-row .row-del { grid-area: y; justify-self: end; }
  .filterbar { gap: 8px; }
  .filterbar select, .filterbar .btn, .filterbar input { width: 100%; }
  .filter-q { flex: 1 1 100%; }
  .stats { gap: 20px; }
  .toasts { left: 14px; right: 14px; bottom: 14px; }
  .toast { max-width: none; }
  .table th:nth-child(5), .table td:nth-child(5),
  .table th:nth-child(6), .table td:nth-child(6) { display: none; }
}
@media print {
  .topbar, .foot, .toasts { display: none !important; }
}
