/* ============================================================
   Velena Aktensystem 2.0 — Stylesheet
   Glassmorphism auf flachem Anthrazit. Markenfarbe #920063 nur als
   dezenter Akzent (Kanten, Primär-Aktion, Fokus) — nie als Fläche über
   alles, und nie als Textfarbe auf Dunkel (~2:1). Für Desktop, Tablet
   und Handy (untere Tab-Leiste). Klassennamen sind stabil.
   ============================================================ */

:root {
  color-scheme: dark;

  /* ---- Markenfarbe: nur Akzent ---------------------------------------- */
  --accent:      #920063;   /* Primär-Aktion, Akzentkanten */
  --accent-ink:  #FFFFFF;   /* Text auf der Markenfläche (~8,7:1) */
  --brand-strong:#C81E8C;   /* aufgehellt: Fokus-Ring */
  --accent-soft: rgba(146, 0, 99, .14);
  --accent-glow: rgba(146, 0, 99, .35);

  /* ---- Flächen: neutrales Glas über flachem Anthrazit */
  --bg:      #1C1F24;
  --panel:   rgba(42, 47, 55, .55);
  --panel-2: rgba(52, 58, 67, .55);
  --raised:  rgba(66, 73, 83, .60);

  /* ---- Text (neutralgrau, kein Farbstich) */
  --ink:     #ECEEF1;
  --ink-2:   #AEB4BD;
  --muted:   #949AA4;

  /* ---- Linien: feine helle Glaskanten */
  --line:    rgba(255, 255, 255, .08);
  --line-2:  rgba(255, 255, 255, .14);

  /* ---- Status */
  --alarm:   #FF5A6E;
  --warn:    #F0A73C;
  --ok:      #45C08A;

  /* ---- Glas & Schatten */
  --glass-blur: blur(18px) saturate(135%);
  --sheen:    inset 0 1px 0 rgba(255, 255, 255, .06);
  --shadow:   0 10px 30px rgba(0, 0, 0, .38);
  --shadow-lg:0 22px 60px rgba(0, 0, 0, .50);

  --pad: 22px;
  --radius: 14px;
  --radius-sm: 10px;

  --display: 'Archivo', system-ui, sans-serif;
  --body: 'Source Sans 3', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Heller Modus — helles Glas auf hellem Anthrazit, gleiche Marke. */
[data-theme='day'] {
  color-scheme: light;
  --accent:      #920063;
  --accent-ink:  #FFFFFF;
  --brand-strong:#B4007A;
  --accent-soft: rgba(146, 0, 99, .10);
  --accent-glow: rgba(146, 0, 99, .24);

  --bg:      #EDEFF2;
  --panel:   rgba(255, 255, 255, .66);
  --panel-2: rgba(255, 255, 255, .52);
  --raised:  rgba(255, 255, 255, .82);
  --ink:     #191C21;
  --ink-2:   #49515B;
  --muted:   #6C737D;
  --line:    rgba(20, 24, 30, .10);
  --line-2:  rgba(20, 24, 30, .16);
  --alarm:   #C22036;
  --warn:    #9A5A12;
  --ok:      #1B7A55;

  --sheen:    inset 0 1px 0 rgba(255, 255, 255, .70);
  --shadow:   0 10px 30px rgba(28, 32, 40, .10);
  --shadow-lg:0 22px 60px rgba(28, 32, 40, .16);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

/* Das hidden-Attribut MUSS verstecken (schlägt display:grid der Panels). */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);        /* flach, kein Farb-Wash */
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Schlanke, neutrale Bildlaufleisten. */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -.02em; }
h1 { font-size: 2rem; font-weight: 700; text-transform: uppercase; letter-spacing: -.01em; line-height: 1.05; }
h2 { font-size: 1.05rem; font-weight: 600; }
h3 { font-size: .92rem; font-weight: 600; }
a { color: inherit; }

.mono { font-family: var(--mono); font-variant-ligatures: none; }

/* Abschnittsmarke: // Rechtsgrundlage */
.eyebrow {
  font-family: var(--mono);
  font-size: .7rem; font-weight: 400;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted);
}
.view-head .eyebrow::before,
.nav-group.eyebrow::before { content: '// '; opacity: .55; }

/* ------------------------------------------------------------ Anmeldung */

.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(430px, 100%);
  background: var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 46px 34px 30px;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-lg), var(--sheen);
}
.login-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--accent);
}
.login-card img { width: 72px; height: 72px; object-fit: contain; margin-bottom: 20px; }
.login-card h1 { font-size: 1.7rem; margin-bottom: 8px; }
.login-card p { color: var(--muted); margin: 0 0 28px; font-size: .93rem; }

/* Impressum-Fuß in der Login-Karte */
.login-foot { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--line); }
.login-foot a {
  font-family: var(--mono); font-size: .68rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); text-decoration: none;
}
.login-foot a:hover { color: var(--ink); }

/* ----------------------------------------------------------- Grundgerüst */

.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100dvh; }

.sidebar {
  background: var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--line);
  padding: 0 0 20px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100dvh; overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 22px; border-bottom: 1px solid var(--line); margin-bottom: 14px;
}
.brand img { width: 34px; height: 34px; object-fit: contain; }
.brand strong {
  font-family: var(--display); font-size: .95rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; line-height: 1.15; display: block;
}
.brand span { font-size: .7rem; color: var(--muted); font-family: var(--mono); }

.nav-group { padding: 20px 22px 8px; }

/* Aktiver Punkt: Marken-Kante links + zarte Marken-Füllung. */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 22px; font-size: .93rem; color: var(--ink-2);
  border-left: 2px solid transparent;
  cursor: pointer; text-decoration: none;
  transition: color .16s, background .16s, border-color .16s;
}
.nav-item:hover { color: var(--ink); background: var(--panel-2); }
.nav-item.active {
  color: var(--ink); font-weight: 600;
  border-left-color: var(--accent); background: var(--accent-soft);
}
.nav-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--alarm); margin-left: auto; box-shadow: 0 0 7px var(--alarm); }

/* Impressum-Fuß in der Sidebar (unten). */
.side-foot { margin-top: auto; padding: 16px 22px 0; }
.side-foot a {
  font-family: var(--mono); font-size: .66rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); text-decoration: none;
}
.side-foot a:hover { color: var(--ink); }

.main { min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 26px; border-bottom: 1px solid var(--line);
  background: var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  position: sticky; top: 0; z-index: 20;
}
.search-wrap { flex: 1; max-width: 440px; position: relative; }
.search-wrap input { width: 100%; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--panel-2);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  max-height: 340px; overflow-y: auto; display: none;
  box-shadow: var(--shadow-lg);
}
.search-results.open { display: block; }
.search-results div {
  padding: 9px 13px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.search-results div:last-child { border-bottom: 0; }
.search-results div:hover { background: var(--raised); }

.who { display: flex; align-items: center; gap: 11px; margin-left: auto; font-size: .87rem; }
.who img { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line-2); }
.who small { display: block; color: var(--muted); font-family: var(--mono); font-size: .7rem; }

.view { padding: 30px 26px; flex: 1; }
.view > * { max-width: 1180px; }
.view-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.view-head .grow { flex: 1; }
.view-head h1 { margin-top: 4px; }

/* ---------------------------------------------------------------- Karten */

.card {
  background: var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--sheen);
}
.card + .card { margin-top: 16px; }
.card-head {
  padding: 14px var(--pad); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
}
.card-body { padding: var(--pad); }

.grid { display: grid; gap: 1px; }
.grid.stats {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  background: var(--line); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow), var(--sheen);
}
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }

/* Kennzahlen: große Zahl, kleines Label. */
.stat { background: var(--panel); padding: 22px; }
.stat b {
  font-family: var(--display); font-size: 2.4rem; font-weight: 700;
  display: block; line-height: 1; letter-spacing: -.03em; margin-bottom: 6px;
}
.stat.alarm b { color: var(--alarm); }

/* ------------------------------------------- Signature: Akte mit Stempel */

.dossier { position: relative; margin-bottom: 16px; }
.dossier-tab {
  display: inline-block;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em;
  color: var(--accent-ink); background: var(--accent);
  padding: 4px 12px; text-transform: uppercase;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.dossier-body {
  background: var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  padding: 26px var(--pad); position: relative; overflow: hidden;
  box-shadow: var(--shadow), var(--sheen);
}
.dossier-body h1 { margin-bottom: 6px; }
.dossier-body .sub { color: var(--muted); font-family: var(--mono); font-size: .86rem; }

/* Der Stempel bleibt das eine laute Element (Status-Farben). */
.stamp {
  position: absolute; top: 22px; right: 26px;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(.8rem, 1.5vw, 1.1rem); letter-spacing: .12em; text-transform: uppercase;
  color: var(--alarm); border: 2px solid var(--alarm);
  padding: 8px 15px; transform: rotate(-6deg);
  text-align: center; line-height: 1.15; max-width: 250px;
  border-radius: var(--radius-sm);
  animation: press .28s cubic-bezier(.2,1.4,.5,1) both;
}
.stamp.ok { color: var(--ok); border-color: var(--ok); }
.stamp.warn { color: var(--warn); border-color: var(--warn); }
.stamp small {
  display: block; font-family: var(--mono); font-size: .58em;
  letter-spacing: .04em; font-weight: 400; opacity: .8; text-transform: none; margin-top: 3px;
}

@keyframes press {
  from { transform: rotate(-6deg) scale(1.5); opacity: 0; }
  to   { transform: rotate(-6deg) scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) { .stamp { animation: none; } }

/* -------------------------------------------------------------- Tabellen */

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
thead th {
  text-align: left; font-family: var(--mono); font-size: .68rem; font-weight: 400;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
  padding: 11px var(--pad); border-bottom: 1px solid var(--line-2); white-space: nowrap;
}
tbody td { padding: 12px var(--pad); border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--panel-2); }
td.actions { text-align: right; white-space: nowrap; }
thead th.num, tbody td.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { padding: 52px var(--pad); text-align: center; color: var(--muted); }
.empty b {
  display: block; font-family: var(--display); font-size: 1rem;
  text-transform: uppercase; letter-spacing: .02em; color: var(--ink); margin-bottom: 6px;
}

/* --------------------------------------------------------- Kennzeichnung */

.tag {
  display: inline-block; font-family: var(--mono); font-size: .66rem;
  letter-spacing: .08em; text-transform: uppercase;
  padding: 3px 8px; border: 1px solid currentColor; border-radius: 999px;
}
.tag.none  { color: var(--muted); }
.tag.ok    { color: var(--ok); }
.tag.warn  { color: var(--warn); }
.tag.alarm { color: var(--alarm); }

.plate {
  font-family: var(--mono); font-weight: 600; letter-spacing: .1em;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 3px 8px;
  background: var(--raised);
}

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 9px 24px; font-size: .93rem; }
.dl dt { color: var(--muted); font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; }
.dl dd { margin: 0; }

.entry { border-left: 2px solid var(--line-2); padding: 2px 0 2px 16px; margin-bottom: 18px; }
.entry:last-child { margin-bottom: 0; }
.entry.arrest, .entry.offense { border-left-color: var(--alarm); }
.entry.verdict { border-left-color: var(--warn); }
.entry.note { border-left-color: var(--ok); }
.entry .meta { color: var(--muted); font-family: var(--mono); font-size: .74rem; margin-top: 4px; }

/* Einklappbare Akteneinträge (details/summary) mit eigenem Pfeil. */
details.entry { padding: 10px 0 10px 16px; }
details.entry > summary { cursor: pointer; list-style: none; outline: none; }
details.entry > summary::-webkit-details-marker { display: none; }
details.entry > summary::before {
  content: '▸'; color: var(--muted); margin-right: 8px; font-size: .8em;
  display: inline-block; transition: transform .15s;
}
details.entry[open] > summary::before { transform: rotate(90deg); }
details.entry[open] > summary { margin-bottom: 6px; }

/* -------------------------------------------------------------- Formulare */

label {
  display: block; font-family: var(--mono); font-size: .7rem;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px;
}

input, select, textarea {
  width: 100%; font: inherit; font-size: .93rem; color: var(--ink);
  background: var(--panel-2);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 9px 12px;
  transition: border-color .16s, box-shadow .16s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
input:focus, select:focus, textarea:focus, button:focus-visible, .nav-item:focus-visible, .tab-item:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand-strong); outline-offset: 1px;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
textarea { min-height: 100px; resize: vertical; }
.field { margin-bottom: 16px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 18px; }
.field.wide { grid-column: 1 / -1; }

.btn {
  font-family: var(--mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
  padding: 10px 16px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .16s, border-color .16s, color .16s, box-shadow .16s;
}
.btn:hover { background: var(--raised); border-color: var(--muted); }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn.primary:hover { filter: brightness(1.1); }
.btn.danger { color: var(--alarm); border-color: var(--alarm); background: transparent; }
.btn.danger:hover { background: var(--alarm); color: #fff; }
.btn.ghost { border-color: transparent; color: var(--muted); background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn.ghost:hover { color: var(--ink); background: var(--raised); }
.btn.small { padding: 6px 11px; font-size: .69rem; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar input, .toolbar select { width: auto; min-width: 175px; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line); margin-bottom: 22px; flex-wrap: wrap; }
.tabs button {
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  background: transparent; border: 0; border-bottom: 2px solid transparent;
  padding: 10px 0; cursor: pointer; color: var(--muted);
}
.tabs button:hover { color: var(--ink); }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); }

/* ---------------------------------------------------------------- Dialog */

.overlay {
  position: fixed; inset: 0; background: rgba(10, 12, 15, .58);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 44px 20px; overflow-y: auto; z-index: 100;
}
.modal {
  width: min(690px, 100%); background: var(--panel);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  position: relative;
  box-shadow: var(--shadow-lg), var(--sheen);
}
.modal::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  border-radius: var(--radius) var(--radius) 0 0; background: var(--accent);
}
.modal header { display: flex; align-items: center; padding: 17px var(--pad); border-bottom: 1px solid var(--line); }
.modal header h2 { flex: 1; text-transform: uppercase; letter-spacing: .02em; }
.modal .body { padding: var(--pad); }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px var(--pad); border-top: 1px solid var(--line); }

/* Toast: neutrales Glas mit dezenter Marken-Kante (nicht komplett magenta). */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--raised); color: var(--ink);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line-2); border-left: 3px solid var(--accent);
  padding: 11px 20px; border-radius: var(--radius-sm);
  font-family: var(--mono); font-size: .8rem; letter-spacing: .03em;
  z-index: 200; box-shadow: var(--shadow-lg);
}
.toast.error { border-left-color: var(--alarm); }

/* --------------------------------------------------------------- Rechner */

.calc { display: grid; grid-template-columns: 1fr 340px; gap: 16px; align-items: start; }
.law-row { display: flex; align-items: center; gap: 12px; padding: 10px var(--pad); border-bottom: 1px solid var(--line); }
.law-row:last-child { border-bottom: 0; }
.law-row:hover { background: var(--panel-2); }
.law-row .grow { flex: 1; min-width: 0; }
.law-row .num { font-family: var(--mono); font-size: .78rem; color: var(--muted); }
.sum { position: sticky; top: 80px; }
.sum-row { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.sum-row:last-child { border-bottom: 0; }
.sum-row span { font-family: var(--mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sum-row b { font-family: var(--display); font-size: 1.4rem; letter-spacing: -.02em; }
.sum-row.total b { font-size: 2.1rem; }
.warnbox {
  border: 1px solid var(--alarm); color: var(--alarm);
  background: rgba(255, 90, 110, .08);
  padding: 12px 15px; border-radius: var(--radius-sm); font-size: .84rem; margin-top: 16px;
}
.switch { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: .9rem; cursor: pointer;
  font-family: var(--body); text-transform: none; letter-spacing: 0; color: var(--ink); }
.switch input { width: auto; margin: 0; accent-color: var(--accent); }
.session-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--mono); font-size: .78rem; }
.session-code { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; letter-spacing: .3em; color: var(--ink); }

.output {
  font-family: var(--mono); font-size: .82rem; line-height: 1.7;
  white-space: pre-wrap; background: rgba(0, 0, 0, .22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); padding: 18px; min-height: 130px;
}

/* ------------------------------------------------- Mobile: Tab-Leiste */

/* Untere Tab-Leiste — nur auf schmalen Screens (App-Feeling). */
.tabbar { display: none; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 80;
    transform: translateX(-100%); transition: transform .22s;
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .calc { grid-template-columns: 1fr; }
  .sum { position: static; }
  .view { padding: 18px 16px calc(78px + env(safe-area-inset-bottom)); }
  h1 { font-size: 1.6rem; }

  thead { display: none; }
  tbody td { display: block; padding: 5px 16px; border: 0; }
  tbody td::before {
    content: attr(data-label); display: block;
    font-family: var(--mono); font-size: .64rem; text-transform: uppercase;
    letter-spacing: .08em; color: var(--muted);
  }
  tbody tr { display: block; border-bottom: 1px solid var(--line); padding: 12px 0; }
  td.actions { text-align: left; }

  /* Touch-Ziele ≥ 44px */
  .nav-item { min-height: 46px; }
  .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .tabs button { min-height: 44px; }

  /* Die Tab-Leiste */
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: var(--panel);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--line-2);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .32);
  }
  .tab-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 52px; padding: 5px 2px; position: relative;
    color: var(--muted); text-decoration: none;
    font-family: var(--mono); font-size: .58rem; letter-spacing: .04em; text-transform: uppercase;
    border-radius: var(--radius-sm);
    transition: color .16s, background .16s;
  }
  .tab-item svg { width: 22px; height: 22px; }
  .tab-item:hover { color: var(--ink); }
  .tab-item.active { color: var(--ink); background: var(--accent-soft); }
  .tab-item.active svg { color: var(--accent); }
  .tab-item .dot {
    position: absolute; top: 6px; right: calc(50% - 16px);
    width: 7px; height: 7px; border-radius: 50%; background: var(--alarm);
    box-shadow: 0 0 7px var(--alarm);
  }
}
@media (min-width: 901px) { .menu-toggle { display: none; } }

/* Reduced Motion: alle Übergänge/Animationen ruhigstellen. */
@media (prefers-reduced-motion: reduce) {
  .stamp { animation: none; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* ----------------------------------------------------------------- Druck */

@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; box-shadow: none !important; text-shadow: none !important; }
  .sidebar, .topbar, .tabbar, .tabs, .toolbar, .btn, .search-wrap, .empty { display: none !important; }
  .shell { display: block; }
  .view { padding: 0; }
  .view > * { max-width: none; }
  .card, .dossier-body { border: 1px solid #999; break-inside: avoid; background: #fff; border-radius: 0; }
  .dossier-tab { background: #000; color: #fff; }
  .stamp { animation: none; }
  .dl dt, .entry .meta, thead th { color: #444; }
  a { text-decoration: none; color: #000; }
}
