/*
 * Tourenplaner – Glas-Design im Stil von iOS, Markenfarben Rot/Grau
 *
 * Über einem weichen Farbverlauf liegen halbtransparente, unscharfe Flächen
 * (Kopfzeile, Karten, Liste, Bestellblatt, Menü). Die Liste bleibt wie auf
 * Papier: Kunde links, Bestellung rechts, Kalb schwarz, Hähnchen rot.
 * Mobile first, Hell/Dunkel automatisch, Systemschrift (keine externen
 * Schriften, DSGVO). Ohne backdrop-filter oder bei „weniger Transparenz"
 * werden die Flächen deckend.
 */

:root {
  /* Grundfarben */
  --bg: #f1f1f2;
  --ink: #252525; --muted: #6b6b6b; --faint: #8f8f8f;
  /* Markenfarben: Rot #E42D24, Dunkelrot #7A0F0A, Grau #252525 */
  --accent: #e42d24; --accent-soft: rgba(228, 45, 36, .12);
  --accent-grad: linear-gradient(165deg, #e42d24 0%, #c8241c 55%, #7a0f0a 130%);
  --link: #7a0f0a;                            /* Text-Links, Ansprechpartner */
  --red: #d42a20; --red-soft: rgba(228, 45, 36, .12);
  --ok: #248a3d; --ok-soft: rgba(52, 199, 89, .16);
  --warn: #b25000; --warn-soft: rgba(255, 149, 0, .16);

  /* Glas */
  --glass: rgba(255, 255, 255, .62);          /* Kopfzeile, Leisten */
  --glass-strong: rgba(255, 255, 255, .82);   /* Bestellblatt, Menü */
  --surface: rgba(255, 255, 255, .70);        /* Karten, Liste */
  --surface-solid: #ffffff;
  --rim: rgba(255, 255, 255, .75);            /* heller Glasrand */
  --line: rgba(37, 37, 37, .12);              /* Trennlinien */
  --line-strong: rgba(37, 37, 37, .20);
  --sunk: rgba(37, 37, 37, .07);              /* leichte Füllung */
  --control: rgba(255, 255, 255, .72);        /* Schaltflächen */
  --field: rgba(255, 255, 255, .80);          /* Eingabefelder */
  --hover: rgba(0, 0, 0, .035);
  --blur: saturate(160%) blur(22px);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 10px 30px rgba(0, 0, 0, .07);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .05);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .22);
  --glow-accent: 0 6px 18px rgba(228, 45, 36, .32);
  --scrim: rgba(20, 10, 10, .30);

  --mesh:
    radial-gradient(75% 60% at 0% 0%, rgba(228, 45, 36, .16), transparent 70%),
    radial-gradient(60% 50% at 100% 4%, rgba(37, 37, 37, .10), transparent 70%),
    radial-gradient(80% 60% at 90% 100%, rgba(122, 15, 10, .15), transparent 70%),
    radial-gradient(60% 50% at 0% 95%, rgba(37, 37, 37, .07), transparent 70%);

  --f-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius: 20px; --radius-md: 14px; --radius-sm: 11px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414;
    --ink: #f4f4f4; --muted: #a6a6a6; --faint: #7d7d7d;
    --accent: #e42d24; --accent-soft: rgba(228, 45, 36, .24);
    --link: #ff7d74;
    --red: #ff5a4f; --red-soft: rgba(228, 45, 36, .22);
    --ok: #30d158; --ok-soft: rgba(48, 209, 88, .18);
    --warn: #ff9f0a; --warn-soft: rgba(255, 159, 10, .18);
    --glass: rgba(37, 37, 37, .62); --glass-strong: rgba(37, 37, 37, .86);
    --surface: rgba(46, 46, 46, .58); --surface-solid: #252525;
    --rim: rgba(255, 255, 255, .07); --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .15);
    --sunk: rgba(255, 255, 255, .07); --control: rgba(255, 255, 255, .07); --field: rgba(0, 0, 0, .26);
    --hover: rgba(255, 255, 255, .05);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .28);
    --shadow-lg: 0 24px 70px rgba(0, 0, 0, .6);
    --glow-accent: 0 6px 20px rgba(228, 45, 36, .42);
    --scrim: rgba(0, 0, 0, .55);
    --mesh:
      radial-gradient(75% 60% at 0% 0%, rgba(228, 45, 36, .22), transparent 70%),
      radial-gradient(60% 50% at 100% 4%, rgba(255, 255, 255, .05), transparent 70%),
      radial-gradient(80% 60% at 90% 100%, rgba(122, 15, 10, .42), transparent 70%),
      radial-gradient(60% 50% at 0% 95%, rgba(255, 255, 255, .03), transparent 70%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141414;
  --ink: #f4f4f4; --muted: #a6a6a6; --faint: #7d7d7d;
  --accent: #e42d24; --accent-soft: rgba(228, 45, 36, .24);
  --link: #ff7d74;
  --red: #ff5a4f; --red-soft: rgba(228, 45, 36, .22);
  --ok: #30d158; --ok-soft: rgba(48, 209, 88, .18);
  --warn: #ff9f0a; --warn-soft: rgba(255, 159, 10, .18);
  --glass: rgba(37, 37, 37, .62); --glass-strong: rgba(37, 37, 37, .86);
  --surface: rgba(46, 46, 46, .58); --surface-solid: #252525;
  --rim: rgba(255, 255, 255, .07); --line: rgba(255, 255, 255, .08); --line-strong: rgba(255, 255, 255, .15);
  --sunk: rgba(255, 255, 255, .07); --control: rgba(255, 255, 255, .07); --field: rgba(0, 0, 0, .26);
  --hover: rgba(255, 255, 255, .05);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .4);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .28);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, .6);
  --glow-accent: 0 6px 20px rgba(228, 45, 36, .42);
  --scrim: rgba(0, 0, 0, .55);
  --mesh:
    radial-gradient(75% 60% at 0% 0%, rgba(228, 45, 36, .22), transparent 70%),
    radial-gradient(60% 50% at 100% 4%, rgba(255, 255, 255, .05), transparent 70%),
    radial-gradient(80% 60% at 90% 100%, rgba(122, 15, 10, .42), transparent 70%),
    radial-gradient(60% 50% at 0% 95%, rgba(255, 255, 255, .03), transparent 70%);
  color-scheme: dark;
}

/* ---------- Grundlagen: App-Gefühl, kein Zoomen, kein Gummiband ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  touch-action: manipulation;           /* kein Doppeltipp-Zoom */
  overscroll-behavior: none;            /* kein Gummiband / Pull-to-Refresh der Seite */
  background: var(--bg);
  scroll-padding-top: calc(var(--safe-top) + 220px);
}
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: transparent; color: var(--ink);    /* Grundfarbe trägt html, sonst deckt body den Verlauf zu */
  font-family: var(--f-body); font-size: 16px; line-height: 1.4; letter-spacing: -.005em;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
/* Farbverlauf hinter allem; fest, damit er beim Scrollen nicht mitwandert (iOS kennt kein background-attachment: fixed). */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--mesh), var(--bg);
}
body.locked { overflow: hidden; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
/* iOS zoomt in Felder unter 16px hinein – deshalb nie kleiner. */
input, textarea, select { font-size: 16px; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 700; line-height: 1.12; letter-spacing: -.022em; margin: 0; }
h1 { font-size: 30px; }
h2 { font-size: 21px; }
h3 { font-size: 17px; margin-top: 6px; }
p { margin: 0; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.mono { font-family: var(--f-mono); }
.warn { color: var(--warn); }
.ok-text { color: var(--ok); }
.ic { width: 22px; height: 22px; flex: 0 0 auto; }
.ic.sm { width: 18px; height: 18px; }

.wrap {
  max-width: 880px; margin: 0 auto;
  padding-left: max(16px, var(--safe-left)); padding-right: max(16px, var(--safe-right));
}

/* Glasfläche als Baustein */
.appbar, .card, .paper, .sheet, .drawer, .toast, .savebar, .auth-card {
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}

/* ---------- Kopfzeile ---------- */
.appbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--glass);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--rim) inset;
  padding-top: var(--safe-top);
}
.appbar .wrap { display: grid; gap: 12px; padding-block: 12px 14px; }
.top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: var(--ink); min-width: 0; }
.brand img { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; box-shadow: var(--shadow-sm); }
.brand span { font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: -.02em; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand small { display: block; font-family: var(--f-body); font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; margin-top: 2px; }
.iconbtn {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 14px; background: var(--control); color: var(--ink); padding: 0;
  box-shadow: var(--shadow-sm); transition: transform .12s, background-color .2s;
}
.iconbtn:active { transform: scale(.95); }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface-solid), 0 2px 6px rgba(228, 45, 36, .4);
}
.badge.inline { position: static; margin-left: auto; box-shadow: none; }

.week {
  display: flex; align-items: center; flex: 0 0 auto;
  background: var(--control); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm);
}
.week a { display: grid; place-items: center; width: 38px; height: 44px; font-size: 24px; color: var(--link); }
.week .lbl { width: auto; min-width: 86px; text-align: center; line-height: 1.15; color: var(--ink); padding-inline: 2px; }
.week .lbl b { font-family: var(--f-display); font-size: 16px; letter-spacing: -.01em; display: block; }
.week .lbl span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.search { position: relative; }
.search input {
  width: 100%; height: 46px; border: 1px solid var(--line); border-radius: 14px; background: var(--field);
  padding: 0 44px 0 42px; -webkit-appearance: none; appearance: none; box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input::placeholder { color: var(--faint); }
.search > .ic { position: absolute; left: 13px; top: 12px; color: var(--faint); }
.search .clr { position: absolute; right: 5px; top: 5px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-size: 22px; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.page-search { margin-bottom: 4px; }

.days { display: grid; grid-template-columns: repeat(5, 1fr) 1.3fr; gap: 7px; }
.days.days5 { grid-template-columns: repeat(5, 1fr); }
.days a {
  border: 1px solid var(--line); background: var(--control); border-radius: 14px; padding: 8px 2px 7px;
  line-height: 1.15; text-align: center; color: var(--ink); min-width: 0; box-shadow: var(--shadow-sm);
  transition: transform .12s, background-color .2s;
}
.days a:active { transform: scale(.97); }
.days b { font-family: var(--f-display); font-size: 16px; font-weight: 700; letter-spacing: -.01em; display: block; }
.days span { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.days .cnt { font-weight: 600; display: inline; }
@media (max-width: 600px) { .days .cnt { display: none; } }
/* Schmale Handys: in der Kopfzeile nur das Logo, damit KW-Wähler, Glocke und Menü passen. */
@media (max-width: 520px) { .top:has(.week) .brand span { display: none; } }
.days a[aria-current="page"] {
  background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: var(--glow-accent);
}
.days a[aria-current="page"] span { color: inherit; opacity: .85; }
.days a.today:not([aria-current="page"]) b { color: var(--link); }

.lists {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px 4px;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-padding-inline: 16px;
}
.lists::-webkit-scrollbar { display: none; }
.lists a {
  flex: 0 0 auto; border: 1px solid var(--line); background: var(--control); border-radius: 999px; padding: 8px 14px;
  display: flex; gap: 7px; align-items: baseline; white-space: nowrap; color: var(--ink); box-shadow: var(--shadow-sm);
}
.lists .no { font-family: var(--f-mono); font-size: 13px; color: var(--muted); }
.lists .fa { font-weight: 600; font-size: 14px; }
.lists .ct { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lists a.complete .ct { color: var(--ok); font-weight: 600; }
.lists a[aria-current="page"] { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); color: var(--link); }
.lists a[aria-current="page"] .no, .lists a[aria-current="page"] .ct { color: inherit; }

/* ---------- Inhalt ---------- */
main .wrap { padding-block: 22px calc(56px + var(--safe-bottom)); display: grid; gap: 16px; }
.board { display: grid; gap: 14px; }
.pagehead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pagehead h1 { margin-right: auto; }
.pagehead .back { flex-basis: 100%; font-size: 15px; font-weight: 600; }
.pagehead h1 small { font-family: var(--f-body); font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.pagehead + .muted, .pagehead + p { margin-top: -6px; }
.sheethead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sheethead h1, .pagehead h1 { font-size: 30px; }
.sheethead h1 small { font-family: var(--f-body); font-weight: 500; font-size: 16px; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
h1 .no, h2 .no { font-family: var(--f-mono); font-size: 14px; font-weight: 500; color: var(--muted); margin-right: 8px; vertical-align: middle; letter-spacing: 0; }
.sheethead .sp { margin-left: auto; display: flex; gap: 8px; }
.sheethead .sp .btn { min-height: 40px; padding: 0 14px; font-size: 14px; }
.tot { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.3; }
.tot > span {
  display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 5px; padding: 7px 12px; border-radius: 12px;
  background: var(--control); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.tot b { color: var(--ink); font-weight: 600; }
.tot b.open { color: var(--red); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--control); color: var(--ink);
  border-radius: 12px; min-height: 44px; padding: 0 18px; font-weight: 600; font-size: 15px; white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: transform .12s, filter .2s, background-color .2s;
}
.btn:active { transform: scale(.97); }
.btn.pri { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: var(--glow-accent); }
.btn.pri:hover { filter: brightness(1.05); }
.btn.danger { color: var(--red); background: var(--red-soft); border-color: transparent; box-shadow: none; }
.btn.big { min-height: 50px; font-size: 16px; width: 100%; border-radius: 14px; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.ib {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 11px; background: var(--control); color: var(--ink); font-size: 13px;
}
.ib.danger { color: var(--red); }
.ib:disabled { opacity: .35; }

.card {
  background: var(--surface); border: 1px solid var(--rim); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; display: grid; gap: 14px; min-width: 0;
}
.card > h2 + p, .card > h2 + .muted { margin-top: -6px; }
.alert { background: var(--ok-soft); color: var(--ok); border-radius: var(--radius-md); padding: 12px 16px; font-weight: 600; font-size: 15px; }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert ul { margin: 8px 0 0; }
.note { color: var(--muted); font-size: 15px; padding: 28px 18px; text-align: center; line-height: 1.5; }
.note b { color: var(--ink); }
.hint { font-size: 13px; color: var(--muted); text-align: center; line-height: 1.5; }

/* ---------- Papier-Liste ---------- */
.paper {
  background: var(--surface); border: 1px solid var(--rim); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.row {
  display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 14px 18px; border-top: 1px solid var(--line); cursor: pointer; transition: background-color .4s;
}
.row:first-child { border-top: 0; }
.row:hover { background: var(--hover); }
.row:active { background: var(--sunk); }
.row.flash { background: var(--accent-soft); }
/* Aus einer Mitteilung hierher geführt: kurz rot markieren (board.js) */
.row.focus { background: var(--accent-soft); box-shadow: inset 4px 0 0 var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .row.focus { animation: row-focus 1.2s ease-in-out 2; }
  @keyframes row-focus { 50% { background: color-mix(in srgb, var(--accent) 22%, transparent); } }
}
.row.inactive { opacity: .55; }
.cust { min-width: 0; line-height: 1.3; }
.knr { font-family: var(--f-mono); font-size: 12px; color: var(--faint); display: block; margin-bottom: 1px; }
.cust b { display: block; font-weight: 600; font-size: 16px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.ort { font-size: 13px; color: var(--muted); }
.ap { display: block; font-size: 12.5px; color: var(--link); margin-top: 3px; }
.ap.warn { color: var(--warn); }
.ord {
  min-width: 0; font-family: var(--f-display); font-weight: 700; font-size: 21px; line-height: 1.25; letter-spacing: -.015em;
  font-variant-numeric: tabular-nums;
  display: flex; flex-wrap: wrap; gap: 4px 16px; align-content: flex-start; padding-top: 2px;
}
.ord .k { color: var(--ink); }
.ord .h { color: var(--red); }
.ord .s { color: var(--ink); font-family: var(--f-body); font-weight: 500; font-size: 15px; letter-spacing: 0; align-self: center; }
.ord .s::before { content: "+ "; color: var(--muted); }
.ord .none { font-family: var(--f-body); font-weight: 600; font-size: 14px; letter-spacing: 0; color: var(--muted); align-self: center; }
.ord .pic { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-body); font-size: 14px; letter-spacing: 0; color: var(--link); align-self: center; }
.ord .empty, .empty { font-family: var(--f-body); font-weight: 500; font-size: 14.5px; letter-spacing: 0; color: var(--muted); }
.ord .meta { flex-basis: 100%; font-family: var(--f-body); font-weight: 400; font-size: 12.5px; letter-spacing: 0; color: var(--faint); margin-top: 2px; }
.row.st-open .empty { color: var(--link); font-weight: 600; }
@media (max-width: 560px) {
  .row { grid-template-columns: minmax(0, 1fr); row-gap: 8px; padding: 14px 16px; }
  .cust b { display: inline; margin-right: 6px; }
}

.hit {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 14px 18px;
  border-top: 1px solid var(--line); color: var(--ink);
}
.hit:first-child { border-top: 0; }
.hit:hover { background: var(--hover); }
.hit .cust b { display: inline; margin-right: 6px; }
.hit .where { font-size: 13px; color: var(--link); font-weight: 600; text-align: right; white-space: nowrap; }
.hit .ord { grid-column: 1 / -1; font-size: 18px; }

/* Liste bearbeiten */
.erow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); }
.erow:first-child { border-top: 0; }
.arrows { display: flex; flex-direction: column; gap: 4px; }
.arrows form { display: contents; }
.arrows .ib { width: 34px; height: 30px; border-radius: 9px; }
.eact { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.eact form { display: inline-flex; gap: 6px; align-items: center; }
.eact select {
  height: 38px; border: 1px solid var(--line); border-radius: 11px; background: var(--field); max-width: 9rem; font-size: 14px; padding: 0 10px;
}
.addrow { margin-top: 4px; }
@media (max-width: 560px) {
  .erow { grid-template-columns: auto minmax(0, 1fr); }
  .eact { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---------- Allgemeine Listen-Einträge ---------- */
.item {
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-top: 1px solid var(--line); color: var(--ink); min-width: 0;
}
.item:first-child { border-top: 0; }
a.item:hover { background: var(--hover); }
a.item:active { background: var(--sunk); }
.item.inactive { opacity: .55; }
.item-main { display: grid; gap: 3px; min-width: 0; line-height: 1.35; }
.item-main b { font-weight: 600; overflow-wrap: anywhere; }
.item-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: 0 0 auto; text-align: right; }
.item-side:has(.tag + .tag) { flex-direction: row; flex-wrap: wrap; justify-content: flex-end; max-width: 50%; }
.item.notif.unread b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; box-shadow: 0 0 0 3px var(--accent-soft); }
.item.audit { align-items: flex-start; }
/* Einstellungen: Kacheln zu Import, Push-Tester, Übersetzungen, Protokoll */
.tools .item { justify-content: flex-start; }
.tools .item-main { flex: 1 1 auto; }
.tool-ic { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.tool-ic .ic { width: 20px; height: 20px; }
.item .btn { flex: 0 0 auto; }
@media (max-width: 480px) {
  .item:has(> .btn), .item:has(> form) { flex-wrap: wrap; }
  .item:has(> .btn) > .btn { margin-left: auto; }
}
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.tag.mono { font-family: var(--f-mono); }
.notify-on { display: inline-flex; align-items: center; gap: 4px; }
.notify-on .ic { width: 14px; height: 14px; color: var(--accent); }
.tag-accent { background: var(--accent-soft); color: var(--link); }
.tag-red { background: var(--red-soft); color: var(--red); }
h2.group { font-size: 20px; display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
h2.group a { color: var(--ink); }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.chip, .toggle-row a {
  display: inline-flex; align-items: center; border: 1px solid var(--line); background: var(--control); border-radius: 999px;
  padding: 8px 15px; min-height: 38px; font-size: 14px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-sm);
}
.toggle-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip.on, .toggle-row a.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--link); box-shadow: none; }
.weekjump { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.weekjump > :first-child { justify-self: start; }
.weekjump > :last-child { justify-self: end; }
.weekjump > span { font-weight: 600; white-space: nowrap; }
@media (max-width: 440px) {
  .weekjump { grid-template-columns: 1fr 1fr; }
  .weekjump > span { grid-column: 1 / -1; grid-row: 1; justify-self: center; }
  .weekjump .btn { width: 100%; padding: 0 12px; }
}
.pager { display: flex; justify-content: space-between; gap: 10px; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 16px; }
.form.inline { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 480px) { .grid2 { grid-template-columns: 1fr; } .form.inline { grid-template-columns: 1fr; } }
.fld { display: grid; gap: 7px; min-width: 0; border: 0; padding: 0; margin: 0; }
.fld > span, .fld > legend { font-size: 13px; font-weight: 600; letter-spacing: .01em; color: var(--muted); padding-left: 2px; }
.fld > legend { margin-bottom: 7px; }
.fld input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .fld select, .fld textarea,
.filters input, .filters select, .search-inline input {
  width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; background: var(--field); padding: 10px 14px;
  -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s;
}
.fld input:focus, .fld select:focus, .fld textarea:focus, .filters input:focus, .filters select:focus, .search-inline input:focus,
.tr-row input:focus, .tr-row textarea:focus, .ofld textarea:focus, .eact select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.fld select, .filters select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px;
}
.fld textarea { resize: vertical; line-height: 1.45; }
.fld input[type="file"] { font-size: 15px; color: var(--muted); max-width: 100%; }
.fld input[type="file"]::file-selector-button {
  margin-right: 12px; min-height: 42px; padding: 0 16px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--control); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow-sm);
}
.fld small, .fld .muted { line-height: 1.45; }
.err { color: var(--red); font-size: 13px; font-style: normal; font-weight: 600; }
.check, .radio { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; line-height: 1.4; }
.check input, .radio input { width: 22px; height: 22px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.radio { padding: 8px 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.sticky-actions { position: sticky; bottom: calc(12px + var(--safe-bottom)); }
.filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) auto; gap: 10px; }
@media (max-width: 640px) { .filters { grid-template-columns: 1fr 1fr; } .filters input, .filters .btn { grid-column: 1 / -1; } }
.search-inline { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 10px 22px; margin: 0; }
.facts dt { color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 480px) { .facts { grid-template-columns: 1fr; gap: 2px; } .facts dd { margin-bottom: 10px; } }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 600; border-top: 0; }
.card:has(> .table) { overflow-x: auto; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--faint); vertical-align: 1px; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.bad { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.push-status { display: grid; gap: 12px; }
.logout-form, .danger-zone { display: flex; justify-content: center; padding-top: 4px; }
.ro { font-size: 14px; color: var(--muted); background: var(--sunk); border-radius: var(--radius-sm); padding: 10px 14px; line-height: 1.45; }

/* ---------- Anmeldung / Fehlerseiten / Assistent ---------- */
body.auth { display: grid; }
.auth-main {
  display: grid; place-items: center; align-content: center; gap: 18px; min-height: 100dvh;
  padding: calc(28px + var(--safe-top)) max(18px, var(--safe-right)) calc(28px + var(--safe-bottom)) max(18px, var(--safe-left));
}
.auth-card { width: 100%; max-width: 420px; gap: 18px; padding: 28px; border-radius: 28px; background: var(--glass-strong); box-shadow: var(--shadow-lg); }
.auth-brand { display: flex; gap: 14px; align-items: center; }
.auth-brand img { border-radius: 14px; box-shadow: var(--shadow-sm); }
.auth-brand h1 { font-size: 28px; }
.auth-brand p { color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; margin-top: 3px; }
.err-code { font-family: var(--f-mono); color: var(--muted); }

.wizard { max-width: 440px; gap: 22px; }
.wiz-dots { display: flex; gap: 6px; justify-content: center; list-style: none; margin: 0; padding: 0; }
.wiz-dots li { width: 28px; height: 5px; border-radius: 3px; background: var(--line-strong); transition: background-color .3s, width .3s; }
.wiz-dots li.on { background: var(--accent); }
.wiz-step { display: grid; gap: 16px; text-align: center; }
.wiz-step h2 { font-size: 28px; }
.wiz-step h2:focus { outline: none; }
.wiz-step > p { color: var(--muted); line-height: 1.5; }
.wiz-step .langswitch { justify-self: center; }
.wiz-ic {
  width: 72px; height: 72px; margin: 4px auto 0; border-radius: 22px; display: grid; place-items: center;
  background: var(--accent-grad); color: #fff; box-shadow: var(--glow-accent);
}
.wiz-ic .ic { width: 34px; height: 34px; }
.wiz-ic.ok { background: linear-gradient(165deg, #3a3a3a, #252525); box-shadow: 0 6px 18px rgba(0, 0, 0, .28); }
.wiz-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; text-align: left; }
.wiz-list li { display: flex; gap: 14px; align-items: flex-start; background: var(--sunk); border-radius: var(--radius-md); padding: 14px 16px; font-size: 15px; line-height: 1.45; }
.wiz-list li .ic { color: var(--accent); margin-top: 1px; }
.wizard .wiz-state { font-weight: 600; color: var(--ink); }
.wizard .wiz-state:empty { display: none; }
.wizard .wiz-state.ok-text { color: var(--ok); }
.wizard .wiz-state.bad { color: var(--red); }
.wizard .wiz-state.warn { color: var(--warn); }
.wiz-help { text-align: left; background: var(--sunk); border-radius: var(--radius-md); padding: 14px 16px; font-size: 15px; line-height: 1.5; }
.wiz-help ol { margin: 8px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.wiz-actions { display: grid; gap: 10px; }
.wiz-foot { display: flex; justify-content: center; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; min-height: 44px; padding: 0 10px; }

/* ---------- Menü-Schublade (schwebendes Glas) ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 20; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.drawer {
  position: fixed; z-index: 21; width: min(330px, calc(100vw - 28px));
  top: calc(8px + var(--safe-top)); right: max(8px, var(--safe-right)); bottom: calc(8px + var(--safe-bottom));
  background: var(--glass-strong); border: 1px solid var(--rim); border-radius: 26px; box-shadow: var(--shadow-lg);
  padding: 16px 12px 14px;
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto; overscroll-behavior: contain;
}
.drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 4px 6px 14px 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.drawer-head b { display: block; font-size: 17px; letter-spacing: -.01em; }
.drawer-head .role { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--link); }
.drawer a, .drawer-logout button {
  display: flex; align-items: center; gap: 14px; padding: 12px 12px; border-radius: 14px; min-height: 46px;
  color: var(--ink); font-weight: 500; border: 0; background: none; width: 100%; text-align: left;
}
.drawer a .ic, .drawer-logout .ic { color: var(--muted); }
.drawer a:hover, .drawer-logout button:hover { background: var(--hover); }
.drawer a[aria-current="page"] { background: var(--accent-soft); color: var(--link); font-weight: 600; }
.drawer a[aria-current="page"] .ic { color: var(--accent); }
.drawer-sec { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); padding: 16px 12px 6px; }
.drawer-logout { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.drawer-logout button { color: var(--red); }
.drawer-logout button .ic { color: var(--red); }
.drawer-foot { font-size: 12px; color: var(--faint); padding: 10px 12px 2px; }
@media (prefers-reduced-motion: no-preference) {
  .drawer:not([hidden]) { animation: slide-in .22s cubic-bezier(.2, .8, .2, 1); }
  @keyframes slide-in { from { transform: translateX(24px) scale(.98); opacity: 0; } }
  .scrim:not([hidden]) { animation: fade-in .2s ease-out; }
  @keyframes fade-in { from { opacity: 0; } }
}

/* ---------- Bestellblatt (Bottom-Sheet) ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 22; margin-inline: auto; max-width: 720px;
  background: var(--glass-strong); border: 1px solid var(--rim); border-bottom: 0;
  border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  max-height: calc(100dvh - var(--safe-top) - 20px); overflow-y: auto; overscroll-behavior: contain;
}
.sheet .wrap { display: grid; gap: 18px; padding-block: 10px 0; max-width: 680px; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 2px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.sheet h2 { font-size: 26px; }
.sheet .sub { font-size: 14px; color: var(--muted); margin-top: 5px; line-height: 1.4; }
.sheet .sub.ap { color: var(--link); margin-top: 3px; }
.sheet .note-line { color: var(--warn); }
.ofld { display: grid; gap: 8px; }
.ofld label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; padding-left: 2px; }
.ofld label i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ofld textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-md); background: var(--field); padding: 12px 14px;
  min-height: 62px; resize: none; overflow: hidden; font-family: var(--f-display); font-weight: 700; font-size: 23px; line-height: 1.3; letter-spacing: -.015em;
  word-spacing: .12em; /* Höhe und Schriftgröße setzt board.js (fit) */
  transition: border-color .15s, box-shadow .15s;
}
.ofld textarea::placeholder { color: var(--faint); font-weight: 500; }
.ofld.k label, .ofld.k textarea { color: var(--ink); }
.ofld.k i { background: var(--ink); }
.ofld.h label, .ofld.h textarea { color: var(--red); }
.ofld.h i { background: var(--red); }
.ofld.h textarea { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.ofld.h textarea:focus { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }
.ofld.s label { color: var(--muted); }
.ofld.s i { background: var(--muted); }
.ofld.s textarea { font-family: var(--f-body); font-weight: 500; font-size: 17px; letter-spacing: 0; min-height: 54px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips button {
  border: 1px solid var(--line); background: var(--control); border-radius: 11px; padding: 6px 13px; min-height: 40px;
  font-family: var(--f-display); font-weight: 700; font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm); transition: transform .1s, background-color .2s;
}
.chips button:active { background: var(--sunk); transform: scale(.95); }
.chips.h button { color: var(--red); }
.check.nothing { padding: 14px 16px; border-radius: var(--radius-md); background: var(--sunk); font-weight: 600; }
.check.nothing small { font-weight: 500; }
.sheet .acts {
  display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap;
  position: sticky; bottom: 0; margin-inline: calc(-1 * max(16px, var(--safe-left))) calc(-1 * max(16px, var(--safe-right)));
  padding: 12px max(16px, var(--safe-right)) calc(14px + var(--safe-bottom)) max(16px, var(--safe-left));
  background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-top: 1px solid var(--line);
}
.sheet .acts .r { display: flex; gap: 10px; margin-left: auto; }
.sheet .btn { min-height: 50px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.sheet .meta { font-size: 13px; color: var(--faint); }
.photos { display: grid; gap: 10px; }
.photos-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.photos-head .lbl {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; min-width: 0;
  font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.photos-head .lbl small { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 13px; }
.photos-head .btn { cursor: pointer; flex: 0 0 auto; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.thumbs:empty { display: none; }
.thumb { position: relative; margin: 0; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--line); background: var(--sunk); box-shadow: var(--shadow-sm); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .ib { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 10px; background: var(--glass-strong); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.thumb.uploading { display: grid; place-items: center; font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: sheet-up .26s cubic-bezier(.2, .8, .2, 1); }
  @keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
}
@media (min-width: 760px) {
  .sheet { bottom: 16px; border-radius: 28px; border-bottom: 1px solid var(--rim); max-height: calc(100dvh - var(--safe-top) - 40px); }
}

.lightbox {
  position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .78); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  display: grid; place-items: center; padding: calc(16px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 14px; }
.lightbox button { position: absolute; top: calc(12px + var(--safe-top)); right: 12px; background: rgba(255, 255, 255, .16); color: #fff; border: 0; border-radius: 999px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(22px + var(--safe-bottom)); z-index: 50;
  background: rgba(28, 28, 32, .82); color: #fff; padding: 13px 18px; border-radius: 16px; font-weight: 600; font-size: 15px;
  max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .08); line-height: 1.4;
}
.toast.error { background: rgba(160, 24, 17, .92); }
@media (prefers-reduced-motion: no-preference) {
  .toast:not([hidden]) { animation: toast-in .22s cubic-bezier(.2, .8, .2, 1); }
  @keyframes toast-in { from { transform: translate(-50%, 12px); opacity: 0; } }
}

.results { display: grid; gap: 16px; }

/* ---------- Nach unten ziehen zum Aktualisieren (app.js) ---------- */
.ptr {
  --pull: 0px; --turn: 0deg;
  position: fixed; left: 50%; top: calc(var(--safe-top) + 8px); z-index: 30;
  width: 44px; height: 44px; margin-left: -22px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted); pointer-events: none;
  background: var(--glass-strong); border: 1px solid var(--rim); box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  opacity: 0; transform: translateY(calc(var(--pull) - 60px));
  transition: transform .28s cubic-bezier(.2, .8, .2, 1), opacity .2s, color .15s;
}
.ptr.drag { transition: opacity .15s, color .15s; }
.ptr.on { opacity: 1; }
.ptr .ic { width: 20px; height: 20px; transform: rotate(var(--turn)); }
.ptr.armed { color: #fff; background: var(--accent-grad); border-color: transparent; box-shadow: var(--glow-accent); }
.ptr.busy .ic { display: none; }
.ptr.busy::after {
  content: ""; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: ptr-spin .7s linear infinite;
}
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* ---------- Sprachumschalter (Segmente wie in iOS) ---------- */
.langswitch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--sunk); justify-self: start; }
.langswitch button { min-height: 36px; padding: 0 18px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; font-size: 14px; transition: background-color .2s, color .2s; }
.langswitch button[aria-pressed="true"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-main > .langswitch { justify-self: center; }

/* ---------- Übersetzungen (Verwaltung) ---------- */
.tr-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; }
.tr-tools [data-tr-count] { grid-column: 1 / -1; }
@media (max-width: 480px) { .tr-tools { grid-template-columns: minmax(0, 1fr); } }
.tr-form { display: grid; gap: 22px; padding-bottom: calc(84px + var(--safe-bottom)); }
.tr-group { display: grid; gap: 10px; }
.tr-group h2 { padding-left: 4px; }
.tr-group h2 small { font-family: var(--f-body); font-size: 14px; font-weight: 500; letter-spacing: 0; }
.tr-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.15fr); gap: 6px 14px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); }
.tr-row:first-child { border-top: 0; }
.tr-de { font-size: 15px; overflow-wrap: anywhere; line-height: 1.4; }
.tr-arrow { color: var(--faint); font-weight: 700; }
.tr-row input, .tr-row textarea {
  width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: var(--field); padding: 10px 12px;
  -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.tr-row textarea { resize: vertical; line-height: 1.4; }
.tr-row.missing input, .tr-row.missing textarea { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); background: var(--warn-soft); }
.tr-row.dirty input, .tr-row.dirty textarea { border-color: var(--accent); background: var(--accent-soft); }
.tr-row.bad input, .tr-row.bad textarea { border-color: var(--red); background: var(--red-soft); }
.tr-own, .tr-bad { grid-column: 3; font-size: 12px; }
.tr-own { color: var(--link); font-weight: 600; }
.savebar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: var(--glass); border-top: 1px solid var(--line); box-shadow: 0 -8px 30px rgba(0, 0, 0, .08);
  padding: 12px 0 calc(12px + var(--safe-bottom));
}
.savebar-in {
  max-width: 880px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding-left: max(16px, var(--safe-left)); padding-right: max(16px, var(--safe-right));
}
.savebar .btn { min-width: 150px; min-height: 48px; border-radius: 14px; }
@media (max-width: 640px) {
  .tr-row { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 16px; }
  .tr-arrow { display: none; }
  .tr-de { color: var(--muted); font-size: 14px; }
  .tr-own, .tr-bad { grid-column: 1; }
}

/* ---------- Ohne Glas: deckende Flächen ---------- */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  :root { --glass: rgba(248, 248, 248, .97); --glass-strong: #fbfbfb; --surface: #ffffff; --control: #ffffff; --field: #ffffff; }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) { --glass: rgba(30, 30, 30, .97); --glass-strong: #252525; --surface: #252525; --control: #2e2e2e; --field: #161616; }
  }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: #f8f8f8; --glass-strong: #fbfbfb; --surface: #ffffff; --control: #ffffff; --field: #ffffff; }
  .appbar, .card, .paper, .sheet, .drawer, .toast, .savebar, .auth-card { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-transparency: reduce) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --glass: #1e1e1e; --glass-strong: #252525; --surface: #252525; --control: #2e2e2e; --field: #161616; }
}
