/* ==========================================================================
   Tutela — Design-System „Aktendeckel & Siegel“
   Tag = Aktenpapier + Kanzleitinte · Seitenleiste = Aktenschrank (immer dunkel)
   Amtsgrün trägt Interaktion, Siegelrot nur die Marke. Statusfarben nur mit Bedeutung.
   Schriften lokal (DSGVO): Newsreader (Titel), Albert Sans (Text), Sometype Mono (Zahlen, Codes).
   ========================================================================== */

@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-var-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Newsreader"; src: url("fonts/newsreader-var-latin-ext.woff2") format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Albert Sans"; src: url("fonts/albertsans-var.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Sometype Mono"; src: url("fonts/sometype-mono.woff2") format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Sometype Mono"; src: url("fonts/sometype-mono-ext.woff2") format("woff2"); font-weight: 400 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* metrik-angepasste Fallbacks: kein Springen beim Laden der Schriften */
@font-face { font-family: "Tutela Serif Fallback"; src: local("Georgia"), local("DejaVu Serif"); size-adjust: 94%; ascent-override: 92%; }
@font-face { font-family: "Tutela Sans Fallback"; src: local("Arial"), local("Liberation Sans"); size-adjust: 100%; }

:root {
  color-scheme: light;
  --papier: #ecebe5;         /* Seitengrund */
  --flaeche: #faf9f6;        /* Karten */
  --flaeche-2: #f2f1ec;      /* eingelassene Flächen, Tabellenkopf */
  --tinte: #17212b;          /* Text */
  --tinte-2: #34404c;
  --dunst: #5a6570;          /* gedämpfter Text (AA auf Papier) */
  --linie: rgba(23, 33, 43, .13);
  --linie-stark: rgba(23, 33, 43, .28);
  --amt: #1d5a49;            /* Interaktion, Links, Fokus */
  --amt-tief: #14443a;
  --amt-hauch: rgba(29, 90, 73, .09);
  --siegel: #b3372a;         /* Markenpunkt */
  --knopf: #17212b; --knopf-text: #faf9f6;

  --gruen: #1d6b36; --gruen-bg: rgba(29, 107, 54, .1);
  --gelb: #8a5300;  --gelb-bg: rgba(200, 120, 0, .13);
  --rot: #b3212a;   --rot-bg: rgba(179, 33, 42, .09);
  --blau: #2c4f86;  --blau-bg: rgba(44, 79, 134, .1);

  /* Aktenschrank (Seitenleiste) – in beiden Modi dunkel */
  --schrank: #111a20; --schrank-2: #18242c; --schrank-3: #20303a;
  --schrank-tinte: #e6ecea; --schrank-dunst: #98a9ae; --schrank-linie: rgba(230, 236, 234, .1);

  --ff-titel: "Newsreader", "Tutela Serif Fallback", Georgia, serif;
  --ff-text: "Albert Sans", "Tutela Sans Fallback", Arial, sans-serif;
  --ff-mono: "Sometype Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --r-s: 6px; --r: 10px; --r-l: 14px;
  --schatten: 0 1px 0 var(--linie), 0 16px 32px -26px rgba(23, 33, 43, .55);
  --kante: 3px 3px 0 var(--tinte);   /* harter Versatzschatten der Knöpfe */
  --ease: cubic-bezier(.2, .75, .15, 1);
  --seitenleiste: 272px;

  /* Kompatibilität: ältere Inline-Styles der Fachseiten */
  --tt-primary: var(--amt); --tt-primary-dark: var(--amt-tief); --tt-accent: var(--gruen);
  --tt-bg: var(--papier); --tt-surface: var(--flaeche); --tt-border: var(--linie-stark); --tt-text: var(--tinte); --tt-muted: var(--dunst);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --papier: #0d1418; --flaeche: #141e24; --flaeche-2: #101920;
    --tinte: #e4eae8; --tinte-2: #c5d0cf; --dunst: #9aaaae;
    --linie: rgba(228, 234, 232, .12); --linie-stark: rgba(228, 234, 232, .26);
    --amt: #7cc2a9; --amt-tief: #a3d8c4; --amt-hauch: rgba(124, 194, 169, .12);
    --siegel: #ff8a75;
    --knopf: #e4eae8; --knopf-text: #0d1418;
    --gruen: #6fcf8e; --gruen-bg: rgba(111, 207, 142, .12);
    --gelb: #e7b45c;  --gelb-bg: rgba(231, 180, 92, .13);
    --rot: #ff8b93;   --rot-bg: rgba(255, 139, 147, .11);
    --blau: #a3b8e6;  --blau-bg: rgba(163, 184, 230, .12);
    --schatten: 0 1px 0 var(--linie), 0 16px 32px -24px rgba(0, 0, 0, .8);
    --kante: 3px 3px 0 rgba(0, 0, 0, .55);
  }
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--ff-text); font-size: 15px; line-height: 1.55; color: var(--tinte);
  background-color: var(--papier);
  background-image: radial-gradient(var(--linie) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
h1, h2, h3, h4 { font-family: var(--ff-titel); color: var(--tinte); font-weight: 600; letter-spacing: -.01em; line-height: 1.18; margin: 0 0 .6rem; text-wrap: balance; }
h1 { font-size: clamp(1.65rem, 1.2rem + 1.4vw, 2.2rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
p { margin: 0 0 .8rem; }
a { color: var(--amt); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--amt-tief); }
code, kbd, .mono { font-family: var(--ff-mono); font-size: .92em; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--amt); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--amt-hauch); }
hr { border: 0; border-top: 1px dashed var(--linie-stark); margin: 1.2rem 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Gerüst ---------- */
.tt-menue-schalter { position: absolute; opacity: 0; pointer-events: none; }
.tt-page { display: flex; min-height: 100vh; }
.tt-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tt-content { width: 100%; max-width: 1240px; padding: 1.6rem 2.2rem 4rem; }

.tt-sidebar {
  width: var(--seitenleiste); flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--schrank); color: var(--schrank-tinte); display: flex; flex-direction: column;
  scrollbar-width: thin; scrollbar-color: var(--schrank-3) transparent;
}
.tt-brand { display: flex; align-items: center; justify-content: space-between; padding: 1.3rem 1.3rem 0; }
.tt-wortmarke { font-family: var(--ff-titel); font-weight: 650; font-size: 1.75rem; letter-spacing: -.02em; color: inherit; text-decoration: none; line-height: 1; }
.tt-wortmarke:hover { color: inherit; }
.tt-punkt { color: var(--siegel); }
.tt-sidebar .tt-punkt { color: #ff7a63; }
.tt-brand-sub { font-family: var(--ff-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--schrank-dunst); padding: .45rem 1.3rem 1rem; border-bottom: 1px solid var(--schrank-linie); }
.tt-menue-zu { display: none; }

.tt-nav { display: flex; flex-direction: column; padding: .7rem .6rem 1rem; gap: 1px; flex: 1; }
.tt-nav-item {
  display: flex; align-items: center; gap: .65rem; padding: .44rem .7rem; border-radius: var(--r-s);
  color: #c9d4d4; text-decoration: none; font-size: .9rem; line-height: 1.3; transition: background .15s var(--ease), color .15s;
}
.tt-nav-item:hover { background: var(--schrank-2); color: #fff; }
.tt-nav-item.active { background: var(--schrank-3); color: #fff; box-shadow: inset 3px 0 0 #7cc2a9; font-weight: 600; }
.tt-nav-start { margin-bottom: .3rem; }
.tt-ic { width: 1.3rem; text-align: center; font-size: .95rem; opacity: .85; flex-shrink: 0; }
.tt-nav-gruppe { border-top: 1px solid var(--schrank-linie); padding: .25rem 0; }
.tt-nav-gruppe > summary {
  list-style: none; cursor: pointer; padding: .55rem .7rem .4rem; font-family: var(--ff-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--schrank-dunst); display: flex; justify-content: space-between; align-items: center; border-radius: var(--r-s);
}
.tt-nav-gruppe > summary::-webkit-details-marker { display: none; }
.tt-nav-gruppe > summary::after { content: "+"; font-size: .9rem; transition: transform .2s var(--ease); }
.tt-nav-gruppe[open] > summary::after { transform: rotate(45deg); }
.tt-nav-gruppe > summary:hover { color: var(--schrank-tinte); }

.tt-sidebar-fuss { border-top: 1px solid var(--schrank-linie); padding: 1rem 1.3rem 1.3rem; background: var(--schrank-2); }
.tt-user-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-user-rolle { font-family: var(--ff-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--schrank-dunst); margin-bottom: .6rem; }
.tt-sidebar-aktionen { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.tt-sidebar-link { color: #c9d4d4; font: inherit; font-size: .88rem; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.tt-sidebar-link:hover { color: #fff; }
.tt-logout { margin: 0; }

.tt-topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 1rem; padding: .7rem 2.2rem;
  border-bottom: 1px dashed var(--linie-stark); min-height: 52px;
}
.tt-menue-auf, .tt-wortmarke-mobil, .tt-schleier { display: none; }
.tt-tresor { font-family: var(--ff-mono); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gruen);
  border: 1px solid var(--linie-stark); border-radius: 999px; padding: .22rem .7rem; background: var(--flaeche); white-space: nowrap; }

/* ---------- Seitenkopf ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin: .4rem 0 1.4rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .3rem 0 0; }
.muted { color: var(--dunst); }
.text-danger { color: var(--rot); }

/* ---------- Karten ---------- */
.tt-card {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-l);
  padding: 1.25rem 1.4rem; box-shadow: var(--schatten); margin-bottom: 1.1rem; min-width: 0;
}
.tt-card h2 { margin-top: 0; }
.tt-card > h2:first-child, .tt-card > h3:first-child { margin-top: 0; }
/* Tabellen nie abschneiden: die Karte (bzw. jeder Tabellen-Container) scrollt waagerecht. */
.tt-card:has(.tt-table), .tt-card:has(table), .tt-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }

/* ---------- Kennzahlen ---------- */
.tt-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .9rem; margin-bottom: 1.3rem; }
.tt-tile {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--r-l); padding: 1rem 1.1rem;
  color: inherit; text-decoration: none; box-shadow: var(--schatten); transition: transform .18s var(--ease), border-color .18s;
}
a.tt-tile:hover { transform: translateY(-2px); border-color: var(--amt); color: inherit; }
.tt-tile .num { font-family: var(--ff-titel); font-size: 2rem; font-weight: 600; color: var(--tinte); line-height: 1; font-variant-numeric: tabular-nums; }
.tt-tile .lbl { color: var(--dunst); font-size: .84rem; margin-top: .4rem; hyphens: auto; -webkit-hyphens: auto; overflow-wrap: normal; }

/* ---------- Tabellen ---------- */
.tt-table { width: 100%; border-collapse: collapse; background: var(--flaeche); font-size: .92rem; }
.tt-table th, .tt-table td { text-align: left; padding: .62rem .85rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tt-table th {
  background: var(--flaeche-2); color: var(--dunst); font-family: var(--ff-mono); font-weight: 500; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; position: sticky; top: 0;
}
.tt-table tbody tr { transition: background .12s; }
.tt-table tbody tr:hover { background: var(--amt-hauch); }
.tt-table td.num, .tt-table th.num, .num-r { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--ff-mono); font-size: .88rem; }
.tt-table tbody tr:last-child td { border-bottom: 0; }
.tt-warnzeile td { background: var(--rot-bg); }

/* ---------- Formulare ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .85rem 1rem; margin-bottom: .8rem; }
.fld { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.fld label { font-size: .78rem; color: var(--tinte-2); font-weight: 600; }
.fld label:has(input[type=checkbox]), .fld label:has(input[type=radio]) { display: flex; gap: .45rem; align-items: center; font-weight: 500; font-size: .88rem; min-height: 40px; }
input, select, textarea, button { font: inherit; color: inherit; }
.fld input:not([type=checkbox]):not([type=radio]), .fld select, .fld textarea,
.tt-content input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=hidden]), .tt-content select, .tt-content textarea {
  padding: .55rem .7rem; border: 1px solid var(--linie-stark); border-radius: var(--r-s); background: var(--flaeche);
  min-height: 40px; width: 100%; max-width: 100%; transition: border-color .15s, box-shadow .15s;
}
.tt-content textarea { min-height: 90px; resize: vertical; }
.tt-content input:focus, .tt-content select:focus, .tt-content textarea:focus { outline: none; border-color: var(--amt); box-shadow: 0 0 0 3px var(--amt-hauch); }
input[type=checkbox], input[type=radio] { accent-color: var(--amt); width: 17px; height: 17px; }
input[type=file] { font-size: .88rem; max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; border: 1px solid var(--linie-stark); background: var(--flaeche-2); color: var(--tinte); border-radius: var(--r-s); padding: .45rem .8rem; margin-right: .7rem; cursor: pointer; }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; min-height: 40px;
  border-radius: var(--r-s); border: 1px solid transparent; font-weight: 600; font-size: .9rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .12s var(--ease), box-shadow .12s, background .15s, border-color .15s;
}
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn-primary { background: var(--amt); color: #fff; border-color: var(--tinte); box-shadow: var(--kante); }
.btn-primary:hover { background: var(--amt-tief); color: #fff; transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--tinte); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tinte); }
.btn-accent { background: var(--knopf); color: var(--knopf-text); border-color: var(--knopf); }
.btn-accent:hover { background: var(--tinte-2); color: var(--knopf-text); }
.btn-ghost { background: var(--flaeche); color: var(--tinte); border-color: var(--linie-stark); }
.btn-ghost:hover { border-color: var(--amt); color: var(--amt); background: var(--flaeche); }
.btn-danger { background: var(--rot); color: #fff; border-color: var(--rot); }
.btn-danger:hover { filter: brightness(.92); color: #fff; }
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #0d1418; border-color: #000; }
  .btn-primary:hover { color: #0d1418; }
  .btn-danger { color: #0d1418; }
}
.toolbar { display: flex; gap: .55rem; flex-wrap: wrap; align-items: center; margin: .6rem 0; }

/* ---------- Hinweise & Etiketten ---------- */
.badge { display: inline-block; padding: .16rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--flaeche-2); color: var(--tinte-2); border: 1px solid var(--linie); white-space: nowrap; }
.badge-stat { background: var(--gruen-bg); color: var(--gruen); border-color: transparent; }
.badge-amb { background: var(--blau-bg); color: var(--blau); border-color: transparent; }
.badge-warn { background: var(--gelb-bg); color: var(--gelb); border-color: transparent; }
.note { background: var(--flaeche-2); border: 1px solid var(--linie); border-left: 3px solid var(--amt); border-radius: var(--r-s); padding: .7rem .9rem; font-size: .88rem; color: var(--tinte-2); }
.note-ok { background: var(--gruen-bg); color: var(--gruen); border: 1px solid transparent; border-radius: var(--r-s); padding: .7rem .9rem; }
.note-err { background: var(--rot-bg); color: var(--rot); border: 1px solid transparent; border-radius: var(--r-s); padding: .7rem .9rem; }
.tt-card.note-ok, .tt-card.note-err { box-shadow: none; }
.total-line { font-family: var(--ff-titel); font-size: 1.7rem; font-weight: 600; color: var(--gruen); font-variant-numeric: tabular-nums; }
.tt-liste { padding-left: 1.2rem; margin: 0 0 .8rem; }
.tt-liste li { margin-bottom: .35rem; }

/* ---------- Sicherheit, Zugänge, Hinweise ---------- */
.tt-recovery, .auth-recovery {
  font-family: var(--ff-mono); font-size: clamp(1rem, .7rem + 1.4vw, 1.35rem); letter-spacing: .06em; font-weight: 600; text-align: center;
  padding: 1rem; margin: .8rem 0; border: 2px dashed var(--siegel); border-radius: var(--r); background: var(--flaeche); color: var(--tinte); word-break: break-all;
}
.tt-linkbox { border-color: var(--amt); }
.tt-linkfeld { font-family: var(--ff-mono); font-size: .82rem !important; }
.tt-timeout {
  position: sticky; top: 0; z-index: 30; display: flex; gap: 1rem; align-items: center; justify-content: center; flex-wrap: wrap;
  background: var(--gelb-bg); backdrop-filter: blur(6px); color: var(--tinte); border-bottom: 1px solid var(--linie-stark); padding: .6rem 1rem; font-weight: 600;
}
.tt-dateiknopf { position: relative; overflow: hidden; cursor: pointer; }
.tt-dateiinput { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

/* ---------- Fehlerleiste ---------- */
#blazor-error-ui { background: var(--rot); color: #fff; bottom: 0; display: none; left: 0; padding: .8rem 1.2rem; position: fixed; width: 100%; z-index: 1000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .75rem; }
#blazor-error-ui .reload { color: #fff; }

/* ---------- Mobil (eigener Ast: Kopfzeile + Schublade) ---------- */
@media (max-width: 960px) {
  body { font-size: 16px; hyphens: auto; -webkit-hyphens: auto; }
  h1, h2, h3, h4 { hyphens: auto; -webkit-hyphens: auto; }   /* iOS zoomt Eingaben < 16px */
  .tt-sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(86vw, 320px); z-index: 60; transform: translateX(-102%);
    transition: transform .28s var(--ease), box-shadow .28s, visibility 0s linear .28s; box-shadow: none; visibility: hidden;
  }
  .tt-menue-schalter:checked ~ .tt-page .tt-sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .35); visibility: visible; transition-delay: 0s; }
  .tt-schleier { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 18, .5); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .tt-menue-schalter:checked ~ .tt-page .tt-schleier { opacity: 1; pointer-events: auto; }
  .tt-menue-zu { display: grid; place-items: center; width: 44px; height: 44px; margin-right: -.6rem; cursor: pointer; font-size: 1.1rem; color: var(--schrank-dunst); }
  .tt-nav-item { padding: .62rem .7rem; font-size: .97rem; }
  .tt-topbar {
    position: sticky; top: 0; z-index: 40; justify-content: space-between; padding: .45rem .9rem; min-height: 56px;
    background: color-mix(in srgb, var(--papier) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--linie);
  }
  .tt-menue-auf { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 44px; height: 44px; padding: 0 11px; cursor: pointer; margin-left: -.5rem; }
  .tt-menue-auf span { display: block; height: 2px; background: var(--tinte); border-radius: 2px; }
  .tt-wortmarke-mobil { display: block; font-size: 1.45rem; color: var(--tinte); }
  .tt-tresor-text { display: none; }
  .tt-content { padding: 1.1rem .9rem 5rem; }
  .tt-card { padding: 1rem; border-radius: var(--r); }
  .tt-card[style*="padding:0"] { padding: 0 !important; }
  .page-head { margin-top: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid > .fld[style*="grid-column"] { grid-column: auto !important; }
  .toolbar .btn { flex: 1 1 auto; }
  .tt-table { font-size: .9rem; }
  .tt-table th, .tt-table td { padding: .55rem .7rem; }
  .tt-table td { white-space: nowrap; }
  .tt-table td:first-child { position: sticky; left: 0; background: var(--flaeche); z-index: 1; box-shadow: 1px 0 0 var(--linie); white-space: normal; min-width: 9rem; }
  .tt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .tt-tile { padding: .8rem; }
  .tt-tile .num { font-size: 1.55rem; }
  .btn { min-height: 44px; }
}
@media (max-width: 380px) { .tt-tiles { grid-template-columns: 1fr; } }

/* ==========================================================================
   Anmeldung (statisch, ohne JavaScript) – geteilte Fläche wie Aktendeckel
   ========================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; }
.auth-seite {
  grid-column: 1; grid-row: 1 / span 2; position: relative; overflow: hidden; color: var(--schrank-tinte);
  display: flex; flex-direction: column; justify-content: space-between; padding: 2.4rem 3rem;
  background:
    linear-gradient(160deg, transparent 52%, rgba(124, 194, 169, .07) 52.2%, transparent 78%),
    radial-gradient(rgba(230, 236, 234, .07) 1px, transparent 1px) 0 0 / 22px 22px, var(--schrank);
}
.auth-seite-marke { font-family: var(--ff-titel); font-size: 1.7rem; font-weight: 650; letter-spacing: -.02em; }
.auth-seite .tt-punkt { color: #ff7a63; }
.auth-seite-zeile { font-family: var(--ff-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--schrank-dunst); margin-bottom: 1.1rem; }
.auth-seite-zeile::before { content: ""; display: inline-block; width: 22px; height: 2px; background: #ff7a63; vertical-align: middle; margin-right: .6rem; }
.auth-seite-titel { font-family: var(--ff-titel); font-size: clamp(2.4rem, 1.2rem + 2.6vw, 3.6rem); font-weight: 560; line-height: 1.04; letter-spacing: -.025em; margin-bottom: 1.2rem; }
.auth-seite-text { color: var(--schrank-dunst); max-width: 30ch; font-size: 1.02rem; }
.auth-seite-fuss { font-family: var(--ff-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; color: var(--schrank-dunst); margin: 0; }
.auth-card { grid-column: 2; grid-row: 1; align-self: center; justify-self: center; width: min(100%, 480px); padding: 3rem 1.5rem 2rem; }
.auth-foot { grid-column: 2; grid-row: 2; justify-self: center; width: min(100%, 480px); padding: 0 1.5rem 1.6rem; margin: 0; font-family: var(--ff-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--dunst); }
.auth-brand { display: flex; align-items: baseline; gap: .8rem; margin-bottom: 2.2rem; }
.auth-brand .tt-logo { display: none; }
.auth-title { font-family: var(--ff-titel); font-size: 2rem; font-weight: 650; letter-spacing: -.02em; line-height: 1; }
.auth-title::after { content: "."; color: var(--siegel); }
.auth-sub { font-family: var(--ff-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dunst); }
.auth-h { font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem); margin-bottom: .8rem; }
.auth-h::before { content: ""; display: block; width: 28px; height: 2px; background: var(--siegel); margin-bottom: .9rem; }
.auth-form { display: flex; flex-direction: column; gap: .35rem; margin: 1.1rem 0 .6rem; }
.auth-form label, .auth-label { font-size: .82rem; font-weight: 600; color: var(--tinte-2); margin-top: .55rem; }
.auth-form input {
  padding: .7rem .8rem; border: 1px solid var(--linie-stark); border-radius: var(--r-s); background: var(--flaeche); min-height: 46px; font-size: 1rem;
}
.auth-form input:focus { outline: none; border-color: var(--amt); box-shadow: 0 0 0 3px var(--amt-hauch); }
.auth-code, .auth-mono { font-family: var(--ff-mono); letter-spacing: .25em; font-size: 1.25rem !important; }
.auth-mono { letter-spacing: .06em; font-size: 1rem !important; }
.auth-btn {
  margin-top: 1rem; min-height: 48px; border-radius: var(--r-s); border: 1px solid var(--tinte); background: var(--amt); color: #fff;
  font-weight: 700; font-size: 1rem; cursor: pointer; box-shadow: var(--kante); transition: transform .12s var(--ease), box-shadow .12s;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 1.2rem; text-decoration: none; text-align: center;
}
.auth-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--tinte); color: #fff; }
.auth-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--tinte); }
.auth-btn-link { width: 100%; }
.auth-btn-ghost { background: var(--flaeche); color: var(--tinte); }
.auth-btn-ghost:hover { color: var(--tinte); }
@media (prefers-color-scheme: dark) { .auth-btn { color: #0d1418; border-color: #000; } .auth-btn:hover { color: #0d1418; } .auth-btn-ghost { color: var(--tinte); } }
.auth-inline { margin: .4rem 0; }
.auth-linkbtn { background: none; border: 0; padding: 0; color: var(--amt); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .92rem; }
.auth-links { margin-top: 1.2rem; font-size: .92rem; }
.auth-note, .auth-mini { font-size: .84rem; color: var(--dunst); }
.auth-err { background: var(--rot-bg); color: var(--rot); padding: .7rem .9rem; border-radius: var(--r-s); font-size: .92rem; }
.auth-ok { background: var(--gruen-bg); color: var(--gruen); padding: .7rem .9rem; border-radius: var(--r-s); font-size: .92rem; }
.auth-tipps { padding-left: 1.1rem; font-size: .9rem; color: var(--tinte-2); }
.auth-tipps li { margin-bottom: .3rem; }
.auth-option { border: 1px solid var(--linie-stark); border-radius: var(--r-l); padding: 1.1rem 1.2rem; margin: 1rem 0; background: var(--flaeche); }
.auth-option h2 { font-size: 1.12rem; display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.auth-option-aktiv { border-color: var(--amt); box-shadow: 0 0 0 3px var(--amt-hauch); }
.auth-badge { font-family: var(--ff-mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; background: var(--gruen-bg); color: var(--gruen); border-radius: 999px; padding: .15rem .55rem; }
.auth-steps { padding-left: 1.2rem; font-size: .9rem; color: var(--tinte-2); }
.auth-steps li { margin-bottom: .5rem; }
.auth-totp { display: flex; gap: 1.2rem; align-items: center; flex-wrap: wrap; margin: .6rem 0; }
.auth-totp img { background: #fff; padding: 8px; border-radius: var(--r-s); border: 1px solid var(--linie-stark); width: 180px; height: 180px; }
.auth-secret { display: block; font-family: var(--ff-mono); font-size: 1.02rem; letter-spacing: .08em; background: var(--flaeche-2); border: 1px dashed var(--linie-stark); padding: .5rem .7rem; border-radius: var(--r-s); margin: .3rem 0; word-break: break-all; user-select: all; }
.auth-card code { word-break: break-all; }
@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; }
  .auth-seite { grid-row: 1; grid-column: 1; padding: .9rem 1.2rem; flex-direction: row; align-items: center; }
  .auth-seite-mitte, .auth-seite-fuss { display: none; }
  .auth-seite-marke { font-size: 1.35rem; }
  .auth-brand { display: none; }
  .auth-card { grid-column: 1; grid-row: 2; align-self: start; padding: 2rem 1.2rem 1.5rem; }
  .auth-foot { grid-column: 1; grid-row: 3; padding: 0 1.2rem 1.4rem; }
  .auth-brand { margin-bottom: 1.6rem; }
  .auth-totp { justify-content: center; }
}

/* ---------- Amtliche Vorgänge (Gericht) ---------- */
.tt-eyebrow { font-family: var(--ff-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--dunst); margin-bottom: .45rem; }
.tt-eyebrow::before { content: ""; display: inline-block; width: 22px; height: 2px; background: var(--siegel); vertical-align: middle; margin-right: .55rem; }
.tt-amtlich { border-color: var(--linie-stark); border-top: 3px solid var(--amt); }
