/* ==========================================================================
   Cramer Mühle · Laborportal — Design-Tokens, Basis, Rahmen, Anmeldung, Bausteine
   Hell (warmes Beige) und Dunkel; Gold als Akzent. Seitenspezifisches steht in pages.css.
   ========================================================================== */
@property --e-t { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --e-b { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --e-l { syntax: '<length>'; inherits: true; initial-value: 0px; }
@property --e-r { syntax: '<length>'; inherits: true; initial-value: 0px; }

:root {
  color-scheme: light;
  --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --bg: #efe8d8;
  --bg-2: #e6dcc5;
  --page-bg:
    radial-gradient(1100px 620px at 92% -12%, rgba(226, 189, 98, 0.28), transparent 62%),
    radial-gradient(900px 560px at -8% 112%, rgba(184, 144, 42, 0.17), transparent 60%),
    linear-gradient(180deg, #f3eee1 0%, #efe8d8 55%, #e6dcc5 100%);
  --surface: rgba(251, 248, 240, 0.74);
  --surface-solid: #fbf8f0;
  --surface-2: rgba(244, 237, 221, 0.88);
  --field: rgba(255, 255, 255, 0.66);
  --field-soft: rgba(255, 255, 255, 0.46);
  --field-line: rgba(122, 96, 44, 0.75); /* Feldrand: mind. 3:1 gegen die Karte (WCAG 1.4.11) */
  --ink: #2a251c;
  --ink-2: #5a5244;
  --muted: #706756; /* mind. 4,5:1 auf Seite, Karte und Tabellenkopf */
  --on-gold: #2a251c; /* Schrift auf Gold (Knöpfe, Segmente, Monogramm): 5,1 bis 7,3:1, Weiß käme nur auf 2,1 bis 3,0:1 */
  --line: rgba(122, 96, 44, 0.2);
  --line-soft: rgba(122, 96, 44, 0.11);
  --grid: rgba(122, 96, 44, 0.16);
  --track: rgba(122, 96, 44, 0.13);
  --hover: rgba(226, 189, 98, 0.16);
  --gold: #b8902a;
  --gold-hi: #e2bd62;
  --gold-lo: #8a6a1c;
  --gold-ink: #6b4f12;
  --gold-soft: rgba(226, 189, 98, 0.24);
  --gold-glow: rgba(214, 172, 70, 0.4);
  --ok: #3f7a52;
  --ok-hi: #5aa06f;
  --ok-ink: #2d5e3d;
  --ok-soft: rgba(63, 122, 82, 0.14);
  --ok-line: rgba(63, 122, 82, 0.55);
  --ok-glow: rgba(63, 122, 82, 0.55);
  --bad: #a8322a;
  --bad-hi: #d4574c;
  --bad-ink: #8c2a22;
  --bad-soft: rgba(168, 50, 42, 0.12);
  --bad-line: rgba(168, 50, 42, 0.6);
  --bad-glow: rgba(168, 50, 42, 0.5);
  --warn: #865809; /* mind. 4,5:1 auf der warn-soft-Fläche */
  --warn-soft: rgba(168, 111, 22, 0.15);
  --warn-line: rgba(168, 111, 22, 0.5);
  --c-weizen: #b8902a;
  --c-roggen: #5b4a2a;
  --c-dinkel: #7d8b4f;
  --c-sonstige: #a39a85;
  --hero-a: rgba(252, 249, 241, 0.92);
  --hero-b: rgba(243, 233, 210, 0.9);
  --glass: rgba(251, 248, 240, 0.72);
  --grid-line: rgba(122, 96, 44, 0.1);
  --skel-a: rgba(122, 96, 44, 0.08);
  --skel-b: rgba(255, 255, 255, 0.55);
  --shadow: 0 18px 40px -26px rgba(90, 66, 16, 0.45);
  --shadow-lg: 0 32px 70px -30px rgba(90, 66, 16, 0.55);
  --radius: 16px;
  --radius-sm: 11px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #14110b;
  --bg-2: #1b1710;
  --page-bg:
    radial-gradient(1100px 620px at 92% -12%, rgba(226, 189, 98, 0.14), transparent 62%),
    radial-gradient(900px 560px at -8% 112%, rgba(184, 144, 42, 0.1), transparent 60%),
    linear-gradient(180deg, #18140d 0%, #14110b 55%, #100d08 100%);
  --surface: rgba(38, 32, 22, 0.72);
  --surface-solid: #241f15;
  --surface-2: rgba(49, 42, 29, 0.82);
  --field: rgba(255, 255, 255, 0.05);
  --field-soft: rgba(255, 255, 255, 0.035);
  --field-line: rgba(226, 189, 98, 0.5);
  --ink: #f3ecda;
  --ink-2: #d2c6ab;
  --muted: #9c8f76;
  --line: rgba(226, 189, 98, 0.18);
  --line-soft: rgba(226, 189, 98, 0.1);
  --grid: rgba(226, 189, 98, 0.13);
  --track: rgba(226, 189, 98, 0.13);
  --hover: rgba(226, 189, 98, 0.1);
  --gold: #d9ad4c;
  --gold-hi: #f0cf7e;
  --gold-lo: #b8902a;
  --gold-ink: #f0cf7e;
  --gold-soft: rgba(226, 189, 98, 0.18);
  --gold-glow: rgba(226, 189, 98, 0.3);
  --ok: #62b47e;
  --ok-hi: #86cf9f;
  --ok-ink: #8ad4a5;
  --ok-soft: rgba(98, 180, 126, 0.15);
  --ok-line: rgba(98, 180, 126, 0.55);
  --ok-glow: rgba(98, 180, 126, 0.4);
  --bad: #ef7f73;
  --bad-hi: #f7a096;
  --bad-ink: #ff9d92;
  --bad-soft: rgba(239, 127, 115, 0.15);
  --bad-line: rgba(239, 127, 115, 0.6);
  --bad-glow: rgba(239, 127, 115, 0.4);
  --warn: #e3a94d;
  --warn-soft: rgba(227, 169, 77, 0.16);
  --warn-line: rgba(227, 169, 77, 0.5);
  --c-weizen: #d9ad4c;
  --c-roggen: #a8885a;
  --c-dinkel: #9aab63;
  --c-sonstige: #7c7360;
  --hero-a: rgba(45, 38, 25, 0.9);
  --hero-b: rgba(31, 26, 17, 0.9);
  --glass: rgba(36, 30, 20, 0.68);
  --grid-line: rgba(226, 189, 98, 0.07);
  --skel-a: rgba(226, 189, 98, 0.07);
  --skel-b: rgba(226, 189, 98, 0.16);
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 34px 80px -30px rgba(0, 0, 0, 0.8);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
/* Sprungziele (scrollIntoView, Sprungmarken) landen sonst unter der festen Kopfzeile (66 px, am Telefon 56 px).
   Bewusst als Rand der Ziele und nicht als scroll-padding der Seite: das würde auch die feste Icon-Leiste betreffen. */
.view, .card { scroll-margin-top: 78px; }
body {
  margin: 0;
  color: var(--ink);
  font: 14.5px/1.5 var(--font);
  background: var(--page-bg);
  background-attachment: fixed;
  background-color: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); }
p { margin: 0; }
a { color: var(--gold-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
a.link { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 600; font-size: 0.85rem; }
a.link .ic { width: 15px; height: 15px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-lo); outline-offset: 2px; } /* gold-lo: mind. 3:1 gegen Karte und Seite (gold käme hell nur auf 2,7:1) */
[hidden] { display: none !important; }
::selection { background: var(--gold-soft); }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.78rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 3000; background: var(--gold); color: var(--on-gold); padding: 0.5rem 0.9rem; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; text-decoration: none; }
kbd { font: 600 0.68rem/1 var(--font); padding: 0.18rem 0.4rem; border-radius: 6px; background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.3); margin-left: 0.3rem; letter-spacing: 0.02em; }
.btn.ghost kbd { background: var(--field-soft); border-color: var(--line); }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.gold { background: var(--gold); }
.dot.bad { background: var(--bad); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 1rem; color: var(--muted); }
.boot-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--gold); animation: pulse 1.2s ease-in-out infinite; }

/* ==========================================================================
   Rahmen: Icon-Leiste links, Kopfzeile, Inhalt
   ========================================================================== */
.app { display: grid; grid-template-columns: 84px minmax(0, 1fr); grid-template-rows: 66px minmax(0, 1fr); min-height: 100vh; }
.rail {
  grid-row: 1 / span 2; grid-column: 1;
  position: sticky; top: 0; height: 100vh; z-index: 20;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 0 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.rail-mark {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center; position: relative;
  font-weight: 700; font-size: 0.82rem; letter-spacing: 0.06em; color: var(--on-gold);
  background: linear-gradient(145deg, var(--gold-hi), var(--gold));
  box-shadow: 0 0 0 1px rgba(138, 106, 28, 0.35), 0 8px 20px -8px var(--gold-glow);
  margin-bottom: 22px; transition: transform 0.3s var(--ease);
}
.rail-mark:hover { transform: rotate(-6deg) scale(1.04); text-decoration: none; }
.rail-nav { flex: 1; min-height: 0; }
.rail-track { position: relative; display: flex; flex-direction: column; gap: 10px; }
/* Gleitender Indikator: beide Kanten werden unabhängig über clip-path animiert */
.rail-ind {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60px 40px at 50% 30%, rgba(255, 246, 214, 0.85), transparent 70%),
    linear-gradient(160deg, rgba(226, 189, 98, 0.55), rgba(184, 144, 42, 0.3));
  border: 1px solid rgba(184, 144, 42, 0.55);
  box-shadow: 0 0 22px -4px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  clip-path: inset(var(--e-t) var(--e-r) var(--e-b) var(--e-l) round 16px);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.rail-ind.ready { opacity: 1; }
/* Dunkel: das helle Licht des Indikators würde das helle Symbol des aktiven Links schlucken (1,2:1) */
:root[data-theme="dark"] .rail-ind {
  background:
    radial-gradient(60px 40px at 50% 30%, rgba(255, 246, 214, 0.12), transparent 70%),
    linear-gradient(160deg, rgba(226, 189, 98, 0.55), rgba(184, 144, 42, 0.3));
}
.rail-link {
  position: relative; z-index: 1; width: 54px; height: 54px; display: grid; place-items: center;
  border-radius: 16px; color: var(--ink-2);
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}
.rail-link .ic { width: 22px; height: 22px; }
.rail-link:hover { color: var(--ink); transform: translateY(-1px); text-decoration: none; }
.rail-link.on { color: var(--gold-ink); }
:root[data-theme="dark"] .rail-link.on { color: #fff3d0; }
.rail-link::after, .rail-mark::after {
  content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  padding: 0.35rem 0.7rem; border-radius: 9px; white-space: nowrap;
  background: var(--ink); color: var(--bg); font-size: 0.78rem; font-weight: 600;
  opacity: 0; pointer-events: none; transition: opacity 0.18s var(--ease), transform 0.18s var(--ease); z-index: 60;
}
.rail-link:hover::after, .rail-link:focus-visible::after, .rail-mark:hover::after { opacity: 1; transform: translateY(-50%); }

.topbar {
  grid-column: 2; grid-row: 1; position: sticky; top: 0; z-index: 15;
  display: flex; align-items: center; gap: 16px; padding: 0 26px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.tb-logo { height: 38px; width: auto; display: block; }
.tb-sep { width: 1px; height: 26px; background: var(--line); }
.tb-title { font-size: 0.8rem; font-weight: 650; letter-spacing: 0.09em; text-transform: uppercase; color: var(--gold-ink); }
/* Wechsel Laborportal | Tourenplan (nur für Konten mit Tourenplan, Brama) */
.tb-mods { display: inline-flex; gap: 2px; margin-left: 12px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; }
.tb-mod { padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; color: inherit; text-decoration: none; }
.tb-mod[aria-current='page'] { background: var(--gold-ink); color: #fff; }
.tb-mod:not([aria-current]):hover { background: var(--line); }
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; cursor: pointer;
  background: var(--field-soft); border: 1px solid var(--line); color: var(--ink-2);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.icon-btn:hover { background: var(--hover); color: var(--ink); border-color: var(--gold); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.sm .ic { width: 16px; height: 16px; }
.icon-btn.danger:hover { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
.user { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer;
  background: var(--field-soft); border: 1px solid var(--line); transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.user-chip:hover, .user-chip[aria-expanded="true"] { border-color: var(--gold); background: var(--hover); }
.user-chip .ic { width: 16px; height: 16px; color: var(--muted); }
.av {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; flex: none;
  font-size: 0.74rem; font-weight: 700; color: var(--on-gold); letter-spacing: 0.04em;
  background: linear-gradient(145deg, var(--gold-hi), var(--gold));
}
.av.lg { width: 42px; height: 42px; font-size: 0.9rem; }
.u-txt { display: grid; line-height: 1.2; text-align: left; }
.u-txt b { font-size: 0.84rem; font-weight: 600; }
.u-txt i { font-style: normal; font-size: 0.68rem; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--gold-ink); }
.menu {
  position: absolute; right: 0; top: calc(100% + 10px); width: 280px; z-index: 40; padding: 8px;
  background: var(--surface-solid); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg);
  animation: pop 0.22s var(--ease) both; transform-origin: top right;
}
.menu[hidden] { display: none; }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px; }
.menu-head b { display: block; }
.menu-head span:not(.av) { font-size: 0.78rem; color: var(--muted); }
.menu-sec { padding: 8px 10px 10px; display: grid; gap: 6px; border-top: 1px solid var(--line-soft); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font-weight: 600; color: var(--ink-2); }
.menu-item:hover { background: var(--hover); color: var(--ink); }

.content { grid-column: 2; grid-row: 2; padding: 26px 30px 40px; min-width: 0; }
.view { max-width: 1360px; margin: 0 auto; outline: none; }
.foot { text-align: center; font-size: 0.75rem; letter-spacing: 0.02em; color: var(--muted); padding: 2.4rem 0 0; }

/* Einblendung der Bausteine einer Ansicht */
.view > * { animation: rise 0.6s var(--ease) both; }
.view > *:nth-child(2) { animation-delay: 0.05s; }
.view > *:nth-child(3) { animation-delay: 0.1s; }
.view > *:nth-child(4) { animation-delay: 0.15s; }
.view > *:nth-child(n+5) { animation-delay: 0.2s; }
.kpi-band > .kpi { animation: rise 0.6s var(--ease) both; }
.kpi-band > .kpi:nth-child(2) { animation-delay: 0.06s; }
.kpi-band > .kpi:nth-child(3) { animation-delay: 0.12s; }
.kpi-band > .kpi:nth-child(4) { animation-delay: 0.18s; }
.kpi-band > .kpi:nth-child(5) { animation-delay: 0.24s; }
.kpi-band > .kpi:nth-child(6) { animation-delay: 0.3s; }

/* ==========================================================================
   Anmeldung
   ========================================================================== */
.login-screen { min-height: 100vh; position: relative; display: grid; place-items: center; padding: 24px; overflow: hidden; }
.lg-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(64px); opacity: 0.6; animation: drift 20s ease-in-out infinite alternate; }
.o1 { width: 540px; height: 540px; left: -150px; top: -170px; background: radial-gradient(circle at 30% 30%, #f0cf7e, transparent 70%); }
.o2 { width: 480px; height: 480px; right: -130px; bottom: -150px; background: radial-gradient(circle, #d9ad4c, transparent 70%); animation-duration: 25s; animation-delay: -6s; }
.o3 { width: 320px; height: 320px; left: 58%; top: 10%; background: radial-gradient(circle, rgba(184, 144, 42, 0.7), transparent 70%); animation-duration: 29s; animation-delay: -12s; }
:root[data-theme="dark"] .orb { opacity: 0.32; }
.lg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 45%, #000 18%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 45%, #000 18%, transparent 72%);
}
.lg-theme { position: absolute; top: 18px; right: 18px; z-index: 2; }
.lg-card {
  position: relative; width: min(430px, 100%); padding: 2.3rem 2.2rem 2rem; border-radius: 26px;
  background: var(--glass); backdrop-filter: blur(20px) saturate(1.25); -webkit-backdrop-filter: blur(20px) saturate(1.25);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.35); animation: rise 0.9s var(--ease) both; text-align: center;
}
.lg-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(240, 207, 126, 0.95), rgba(184, 144, 42, 0.12) 42%, rgba(240, 207, 126, 0.55));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.lg-logo { width: 230px; max-width: 80%; display: block; margin: 0 auto 1.1rem; }
.lg-card h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 1.4rem; }
.lg-sec { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0.2rem 0 0; color: var(--muted); font-size: 0.74rem; text-align: center; }
.lg-sec .ic { width: 13px; height: 13px; flex: none; }
.lg-sub { color: var(--muted); font-size: 0.86rem; margin: 0.2rem 0 1.5rem; letter-spacing: 0.03em; }
.lg-card form { display: grid; gap: 0.95rem; text-align: left; }
.fld { display: flex; flex-direction: column; gap: 0.32rem; font-size: 0.72rem; font-weight: 650; letter-spacing: 0.04em; color: var(--muted); text-transform: none; }
.fld > span:first-child { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; }
.fld.ficon .inp {
  display: flex; align-items: center; gap: 0.55rem; padding: 0 0.8rem; border-radius: 12px; color: var(--muted);
  background: var(--field); border: 1px solid var(--field-line); transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
.fld.ficon .inp:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); background: var(--surface-solid); color: var(--gold); outline: 2px solid var(--gold-lo); outline-offset: 1px; }
.fld.ficon input { flex: 1; border: 0; background: transparent; box-shadow: none; padding: 0.75rem 0; font-size: 0.95rem; color: var(--ink); }
.fld.ficon input:focus { box-shadow: none; background: transparent; }
.fld.ficon input:focus-visible { outline: none; } /* den Rahmen zeigt das umgebende Feld */
.eye { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.eye:hover { color: var(--ink); background: var(--hover); }
/* Eigenes Passwort ändern (Dialog aus dem Benutzermenü, js/account.js): Felder wie auf der Anmeldeseite, Meldung unter dem Feld, roter Rand bei aria-invalid */
.pw-form { display: grid; gap: 0.95rem; }
.pw-who { margin: 0; font-size: 0.86rem; overflow-wrap: anywhere; }
.pw-fld > .pw-l { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.68rem; }
.pw-fld .inp:has(input[aria-invalid="true"]) { border-color: var(--bad-line); box-shadow: 0 0 0 3px var(--bad-soft); }
.pw-fld .inp:has(input[aria-invalid="true"]):focus-within { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); outline-color: var(--bad); }
.pw-fe { margin: 0; color: var(--bad-ink); font-size: 0.78rem; font-weight: 600; letter-spacing: 0; }
.pw-fe:empty { display: none; }
.pw-alert { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.6rem 0.8rem; border-radius: 11px; border: 1px solid var(--bad-line); background: var(--bad-soft); color: var(--bad-ink); font-size: 0.85rem; font-weight: 600; }
.pw-alert:empty { display: none; }
.pw-alert .ic { margin-top: 0.1rem; }
.lg-btn { margin-top: 0.3rem; padding: 0.8rem 1rem; font-size: 0.95rem; }
.lg-btn.busy span { opacity: 0.6; }
.lg-btn.busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(42, 37, 28, 0.3); border-top-color: var(--on-gold); animation: spin 0.7s linear infinite; }
.lg-err { min-height: 1.3em; color: var(--bad); font-size: 0.85rem; text-align: center; }
.lg-foot { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: 0.75rem; color: var(--muted); letter-spacing: 0.02em; }
.shake { animation: shake 0.45s var(--ease); }
/* App installieren (PWA): zweitrangiger Knopf unter dem Formular. Der Platz bleibt auch ohne Knopf reserviert (.is-off), damit das Formular nicht
   springt, wenn der Knopf erscheint oder verschwindet (Installation, Wechsel in das App-Fenster); 44 px hoch für den Daumen. */
.lg-install { display: flex; justify-content: center; margin-top: 0.15rem; padding-top: 1.1rem; min-height: calc(1.1rem + 1px + 44px); border-top: 1px solid var(--line-soft); }
.lg-install.is-off { border-top-color: transparent; }
.lg-install-btn { width: 100%; min-height: 44px; }
/* Niedrige Bildschirme (Telefon 375 x 667 und kleiner): der Knopf macht die Karte rund 65 px höher; sonst läge sie über dem Knopf für das Design
   und auf der Fußzeile. Wappen, Abstände und Ränder werden dann enger (nur wenn der Knopf da ist). */
@media (max-height: 700px) {
  .login-screen:has(.lg-install) .lg-card { padding-top: 1.6rem; padding-bottom: 1.4rem; }
  .login-screen:has(.lg-install) .lg-logo { width: 170px; margin-bottom: 0.7rem; }
  .login-screen:has(.lg-install) .lg-sub { margin-bottom: 1rem; }
  .login-screen:has(.lg-install) .lg-install { padding-top: 0.8rem; min-height: calc(0.8rem + 1px + 44px); }
}
/* Anleitung zur Installation (Dialog, wenn der Browser keine Aufforderung anbietet) */
.inst-lead { font-weight: 650; color: var(--ink); margin-bottom: 0.7rem; }
.inst-steps { display: grid; gap: 0.5rem; margin: 0 0 0.9rem; padding-left: 1.35rem; color: var(--ink-2); line-height: 1.55; }
.inst-steps li::marker { color: var(--gold-ink); font-weight: 700; }
.inst-note { margin: 0; line-height: 1.5; }

/* ==========================================================================
   Bausteine
   ========================================================================== */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; margin-bottom: 1rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}
.card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px 160px at 100% 0%, var(--gold-soft), transparent 70%); opacity: 0.55;
}
.card > * { position: relative; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.15rem; }
.ph-title { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.022em; }
.ph-sub { color: var(--muted); font-size: 0.88rem; margin-top: 0.25rem; max-width: 70ch; }
.ph-actions { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.sec-head h2 { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.sec-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.legend-inline { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.78rem; color: var(--muted); }
.legend-inline .dot { margin-left: 0.5rem; }
.legend { font-weight: 650; padding: 0.04rem 0.45rem; border-radius: 6px; }
.legend.ok { background: var(--ok-soft); color: var(--ok-ink); }
.legend.bad { background: var(--bad-soft); color: var(--bad-ink); }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; overflow: hidden;
  font-size: 0.88rem; font-weight: 600; letter-spacing: 0.01em; padding: 0.55rem 1rem; border-radius: 11px; cursor: pointer;
  color: var(--ink-2); background: var(--field-soft); border: 1px solid var(--line);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease), opacity 0.2s;
}
.btn .ic { width: 17px; height: 17px; }
.btn:hover { background: var(--hover); border-color: var(--gold); color: var(--ink); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; pointer-events: none; }
.btn.primary { color: var(--on-gold); border-color: var(--gold-lo); background: linear-gradient(180deg, #d9ad4c 0%, #b8902a 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 18px -10px rgba(138, 106, 28, 0.9); }
.btn.primary:hover { color: var(--on-gold); filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 12px 22px -10px rgba(138, 106, 28, 0.95); }
.btn.ghost { background: var(--field-soft); }
.btn.danger { color: var(--bad); border-color: var(--bad-line); background: transparent; }
.btn.danger:hover { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.btn.danger-solid { color: #fff; border-color: #8c2a22; background: linear-gradient(180deg, #d4574c, #a8322a); }
.btn.danger-solid:hover { color: #fff; filter: brightness(1.06); }
.btn.small { padding: 0.32rem 0.7rem; font-size: 0.8rem; border-radius: 9px; }
.btn.shine::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%); transform: translateX(-120%); transition: transform 0.7s var(--ease); }
.btn.shine:hover::after { transform: translateX(120%); }
/* Ungespeicherte Änderungen: leuchtender Speichern-Knopf */
.btn.is-dirty { animation: glow 1.9s ease-in-out infinite; }

input, select, textarea {
  font: inherit; font-size: 0.9rem; color: var(--ink); min-width: 0;
  background: var(--field); border: 1px solid var(--field-line); border-radius: 10px; padding: 0.5rem 0.65rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
}
select { padding-right: 1.6rem; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:hover, select:hover, textarea:hover { border-color: var(--gold-lo); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); background: var(--surface-solid); }
/* Der Fokus braucht mehr als Goldrand und Schein (2,7:1 und 1,1:1): sichtbarer Rahmen von außen */
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold-lo); outline-offset: 1px; }
input[readonly] { cursor: default; }
input:disabled, select:disabled { opacity: 0.55; cursor: not-allowed; }
input[type="checkbox"] { accent-color: var(--gold); width: 16px; height: 16px; padding: 0; }
textarea { width: 100%; min-height: 84px; resize: vertical; }
.fld input, .fld select { width: 100%; }
.fld.inline { flex-direction: row; align-items: center; gap: 0.6rem; }
.fld.inline input, .fld.inline select { width: auto; min-width: 0; max-width: 100%; }
.fld.inline { max-width: 100%; }
.fld.inline > span { flex: none; }
.chk { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; font-weight: 500; letter-spacing: 0; color: var(--ink-2); cursor: pointer; }

.switch { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; font-size: 0.85rem; font-weight: 600; color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--track); border: 1px solid var(--line); transition: background 0.25s var(--ease), border-color 0.25s var(--ease); flex: none; }
.sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface-solid); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.25s var(--ease); }
.switch input:checked + .sw { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-color: var(--gold-lo); }
.switch input:checked + .sw::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + .sw { outline: 2px solid var(--gold-lo); outline-offset: 2px; }
.switch input:focus-visible { outline: none; } /* das Feld selbst ist unsichtbar; den Fokus zeigt der Schalter */
.switch input:disabled + .sw { opacity: 0.5; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--field-soft); border: 1px solid var(--line); flex-wrap: wrap; }
.seg-b { border: 0; background: transparent; padding: 0.34rem 0.75rem; border-radius: 9px; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease); }
.seg-b:hover { color: var(--ink); background: var(--hover); }
.seg-b[aria-pressed="true"] { color: var(--on-gold); background: linear-gradient(180deg, #d9ad4c, #b8902a); box-shadow: 0 4px 12px -6px rgba(138, 106, 28, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35); }
.seg-lg .seg-b { padding: 0.45rem 1.05rem; font-size: 0.86rem; }

.chips { display: inline-flex; gap: 0.35rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--field-soft); color: var(--ink-2); padding: 0.28rem 0.7rem; border-radius: 999px; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.2s var(--ease); }
.chip:hover { border-color: var(--gold); color: var(--ink); }
.chip.on { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }

.badge { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; font-weight: 650; padding: 0.14rem 0.55rem; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.badge .ic { width: 12px; height: 12px; stroke-width: 2.2; }
.badge.ok { background: var(--ok-soft); color: var(--ok-ink); border-color: var(--ok-line); }
.badge.bad { background: var(--bad-soft); color: var(--bad-ink); border-color: var(--bad-line); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.gold { background: var(--gold-soft); color: var(--gold-ink); border-color: rgba(184, 144, 42, 0.45); }
.badge.neutral { background: var(--field-soft); color: var(--ink-2); border-color: var(--line); }
.badge.muted { background: transparent; color: var(--muted); border-color: var(--line); }

/* Filterleiste */
.fbar { display: flex; flex-wrap: wrap; gap: 0.9rem 1.2rem; align-items: flex-end; padding: 0.85rem 1rem; }
.fb-group { display: flex; flex-direction: column; gap: 0.32rem; }
.fb-group .chips { margin-top: 0.1rem; }
.fb-l { font-size: 0.68rem; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.fb-range { display: flex; align-items: center; gap: 0.4rem; color: var(--muted); }
.fb-sel { display: flex; flex-direction: column; gap: 0.32rem; }
.fb-sel select, .fb-sel input { width: 216px; }
.fb-q input { width: 250px; }
.fb-reset { align-self: flex-end; margin-left: auto; }

/* Tabellen */
/* position: relative ist wichtig: ohne sie ragt unsichtbarer Text für Screenreader (.sr-only, absolut positioniert) am Tabellenende
   aus dem Scrollbereich heraus und macht die ganze Seite breit (auf dem Telefon wird sie dann verkleinert dargestellt). */
.table-wrap { position: relative; overflow-x: auto; border-radius: var(--radius-sm); }
.tbl { width: 100%; border-collapse: collapse; font-size: 0.87rem; }
.tbl th, .tbl td { text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl th { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody tr { transition: background 0.18s var(--ease); }
.tbl tbody tr:hover td { background-image: linear-gradient(var(--hover), var(--hover)); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl tr.click { cursor: pointer; }
.tbl tr.inactive td { opacity: 0.55; }
.tbl .acts { text-align: right; white-space: nowrap; }
.tbl .acts .icon-btn { margin-left: 4px; }
.pager { display: flex; gap: 0.8rem; align-items: center; justify-content: flex-end; margin-top: 0.9rem; font-size: 0.85rem; color: var(--muted); }

/* Hinweise, Dialoge, Auswahllisten */
.toasts { position: fixed; inset: auto 0 20px 0; margin: 0 auto; width: max-content; max-width: calc(100vw - 24px); border: 0; background: transparent; padding: 0; overflow: visible; color: inherit; pointer-events: none; z-index: 5000; }
.toasts:popover-open { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 1.05rem; border-radius: 13px; max-width: 520px;
  background: rgba(43, 38, 29, 0.96); color: #f7f1e1; font-size: 0.88rem; font-weight: 500;
  border: 1px solid rgba(226, 189, 98, 0.4); box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.55);
  animation: toastIn 0.45s var(--ease) both;
}
.toast .ic { color: var(--gold-hi); }
.toast.err { border-color: rgba(239, 127, 115, 0.7); }
.toast.err .ic { color: #ff9d92; }
.toast.warn { border-color: rgba(227, 169, 77, 0.7); }
.toast.warn .ic { color: #f2bf6b; }
.toast.out { animation: toastOut 0.3s ease-in forwards; }

dialog.dlg { padding: 0; border: 0; background: transparent; color: inherit; max-width: none; max-height: none; overflow: visible; }
dialog.dlg::backdrop { background: rgba(28, 22, 10, 0.5); animation: fade 0.25s both; }
.dlg-card { width: min(560px, calc(100vw - 24px)); max-height: min(88vh, 780px); display: flex; flex-direction: column; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.3s var(--ease) both; }
dialog.sm .dlg-card { width: min(420px, calc(100vw - 24px)); }
dialog.lg .dlg-card { width: min(880px, calc(100vw - 24px)); }
dialog.xl .dlg-card { width: min(800px, 100vw); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line-soft); background: linear-gradient(180deg, var(--gold-soft), transparent); }
.dlg-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; }
.dlg-body { padding: 1.1rem 1.2rem; overflow: auto; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 0.6rem; padding: 0.85rem 1.2rem; border-top: 1px solid var(--line-soft); background: var(--surface-2); }
.dlg-text { color: var(--ink-2); line-height: 1.6; }
dialog.drawer { inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: 100dvh; }
dialog.drawer .dlg-card { height: 100dvh; max-height: none; border-radius: 20px 0 0 20px; animation: slideIn 0.36s var(--ease) both; }
dialog.closing .dlg-card { animation: popOut 0.17s ease-in both; }
dialog.drawer.closing .dlg-card { animation: slideOut 0.17s ease-in both; }
dialog.closing::backdrop { animation: fadeOut 0.17s both; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.form-grid .fg-wide { grid-column: 1 / -1; }

.combo-pop { position: fixed; z-index: 4000; overflow-y: auto; padding: 6px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-lg); animation: pop 0.16s var(--ease) both; }
.combo-pop[hidden] { display: none; }
.combo-grp { padding: 8px 10px 4px; font-size: 0.66rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.combo-opt { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; padding: 0.5rem 0.65rem; border-radius: 9px; cursor: pointer; font-size: 0.88rem; }
.combo-opt.on { background: var(--gold-soft); color: var(--ink); }
.co-h { color: var(--muted); font-size: 0.74rem; white-space: nowrap; }
.combo-empty, .combo-more { padding: 0.7rem; color: var(--muted); font-size: 0.82rem; text-align: center; }
.tip { position: fixed; z-index: 4500; pointer-events: none; display: grid; gap: 2px; padding: 0.5rem 0.75rem; border-radius: 11px; background: rgba(43, 38, 29, 0.96); color: #f7f1e1; font-size: 0.78rem; border: 1px solid rgba(226, 189, 98, 0.4); box-shadow: 0 16px 36px -14px rgba(0, 0, 0, 0.6); max-width: 300px; }
.tip[hidden] { display: none; }
.tip b { color: var(--gold-hi); font-weight: 650; }

.skel { border-radius: var(--radius); margin-bottom: 1rem; background: linear-gradient(100deg, var(--skel-a) 20%, var(--skel-b) 40%, var(--skel-a) 60%); background-size: 220% 100%; animation: shimmer 1.5s linear infinite; }
.skel.w40 { width: 40%; }
.empty { display: grid; justify-items: center; text-align: center; gap: 0.5rem; padding: 2.2rem 1rem; }
.empty-ic { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 18px; color: var(--gold); background: var(--gold-soft); border: 1px solid rgba(184, 144, 42, 0.35); box-shadow: 0 10px 26px -14px var(--gold-glow); }
.empty-ic .ic { width: 26px; height: 26px; }
.empty h3 { font-size: 1.02rem; font-weight: 650; margin-top: 0.3rem; }
.empty p { color: var(--muted); max-width: 52ch; font-size: 0.88rem; }
.empty .btn { margin-top: 0.6rem; }
.err-card { display: flex; gap: 1rem; align-items: flex-start; border-color: var(--bad-line); }
.err-ic { color: var(--bad); }
.err-card h3 { font-size: 1rem; margin-bottom: 0.2rem; }
.err-card p { color: var(--ink-2); margin-bottom: 0.7rem; }
.search { position: relative; display: flex; align-items: center; }
.search .ic { position: absolute; left: 0.7rem; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; padding-left: 2.1rem; }

/* ==========================================================================
   Bewegung
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: translateY(6px) scale(0.98); } }
@keyframes slideIn { from { opacity: 0.4; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(40px); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes pulse { 0%, 100% { transform: scale(0.8); opacity: 0.6; } 50% { transform: scale(1.15); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes drift { from { transform: translate(0, 0) scale(1); } to { transform: translate(70px, 50px) scale(1.12); } }
@keyframes glow {
  0%, 100% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 18px -10px rgba(138, 106, 28, 0.9), 0 0 0 0 var(--gold-glow); }
  50% { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 18px -10px rgba(138, 106, 28, 0.9), 0 0 0 7px rgba(226, 189, 98, 0), 0 0 24px 2px var(--gold-glow); }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes fillw { from { width: 0; } }
@keyframes segIn { from { stroke-dasharray: 0 520; } }
@keyframes fadeIn { to { opacity: 1; } }

/* ==========================================================================
   Smartphone: Icon-Leiste unten
   ========================================================================== */
@media (max-height: 760px) and (min-width: 821px) {
  .rail { padding-top: 12px; }
  .rail-mark { width: 38px; height: 38px; margin-bottom: 14px; }
  .rail-link { width: 46px; height: 46px; }
  .rail-track { gap: 6px; }
}
/* Sehr niedrige Fenster (Laptop mit Skalierung, Browser-Zoom, Querformat): ohne Monogramm und enger, 9 Links brauchen 400 px */
@media (max-height: 560px) and (min-width: 821px) {
  .rail { padding: 8px 0; }
  .rail-mark { display: none; }
  .rail-link { width: 40px; height: 40px; }
  .rail-track { gap: 3px; }
}
/* Noch niedriger: die Leiste scrollt (deren Hinweise am Rand würden dabei abgeschnitten und entfallen) */
@media (max-height: 400px) and (min-width: 821px) {
  .rail-nav { overflow-y: auto; scrollbar-width: none; }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-link::after { display: none; }
}
@media (max-width: 820px) {
  .view, .card { scroll-margin-top: 68px; } /* Kopfzeile ist hier 56 px hoch */
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 56px minmax(0, 1fr); }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: calc(66px + env(safe-area-inset-bottom));
    flex-direction: row; padding: 0 8px env(safe-area-inset-bottom); border-right: 0; border-top: 1px solid var(--line);
  }
  .rail-mark { display: none; }
  .rail-nav { overflow-x: auto; overflow-y: hidden; flex: 1; scrollbar-width: none; display: flex; align-items: center; }
  .rail-nav::-webkit-scrollbar { display: none; }
  .rail-track { flex-direction: row; width: max-content; margin: 0 auto; gap: 4px; }
  .rail-link { width: 52px; height: 52px; }
  .rail-link::after { display: none; }
  .topbar { grid-column: 1; padding: 0 14px; gap: 10px; }
  .tb-logo { height: 28px; }
  .tb-sep, .u-txt, .user-chip > .ic { display: none; }
  .user-chip { padding: 3px; }
  .menu { position: fixed; right: 12px; top: 62px; width: min(300px, calc(100vw - 24px)); }
  .content { grid-column: 1; padding: 16px 14px calc(92px + env(safe-area-inset-bottom)); }
  .ph-title { font-size: 1.35rem; }
  .fb-sel select, .fb-sel input, .fb-q input { min-width: 0; width: 100%; }
  .fb-sel { flex: 1 1 100%; }
  .fb-reset { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  dialog.drawer .dlg-card { width: 100vw; border-radius: 0; }
}

/* Reduzierte Bewegung respektieren */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .orb { animation: none !important; }
  .btn.is-dirty { animation: none !important; box-shadow: 0 0 0 3px var(--gold-glow); }
}
