/* Eigentümerportal im Aussehen von Mietra.
   Farben, Rundungen, Schrift und Bauteile stammen aus Mietra (src/styles/globals.css, shadcn „radix-luma“).
   Abweichung mit Absicht: Grundschrift 16 px statt 14 px und Bedienflächen ab 40 px,
   weil viele Eigentümer älter sind und das Portal auch am Handy bedienen. */

@font-face {
  font-family: Geist; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/schrift/geist-latin.woff2) format("woff2");
  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: Geist; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/schrift/geist-latin-ext.woff2) format("woff2");
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.44 0 0); /* Lesbarkeit: dunkler als Mietra (0.556), Kontrast ca. 8:1 */
  --accent: oklch(0.97 0 0);
  --border: oklch(0.922 0 0);
  --border-strong: oklch(0.868 0.012 58);
  --ring: oklch(0.708 0 0);
  --radius: 0.625rem;
  --r-lg: calc(var(--radius) * 1.5);
  --r-xl: calc(var(--radius) + 4px);
  --sidebar: oklch(0.985 0 0);
  --sidebar-border: oklch(0.922 0 0);
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --accent-mid: oklch(0.6 0.118 184.704);
  --warn-text: oklch(0.45 0.13 60);
  --warn-bg: oklch(0.97 0.03 80);
  --warn-border: oklch(0.84 0.09 75);
  --ok-text: oklch(0.38 0.12 145);
  --ok-bg: oklch(0.96 0.03 145);
  --danger-text: oklch(0.42 0.18 25);
  --danger-bg: oklch(0.97 0.04 25);
  --shadow: 0 1px 3px oklch(0 0 0 / 7%), 0 0 0 0.5px oklch(0 0 0 / 5%);
  --btn-border: oklch(0 0 0 / 15%);
  --neu: oklch(0.577 0.245 27.325);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: Geist, "Helvetica Neue", Arial, -apple-system, sans-serif;
  background: var(--background); color: var(--foreground); line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: inherit; text-underline-offset: 3px; }
p + p { margin-top: 0.6rem; }
h1 { font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 1rem; font-weight: 600; margin-bottom: 0.6rem; }
h3 {
  font-size: 0.75rem; font-weight: 500; color: var(--muted-foreground);
  text-transform: uppercase; letter-spacing: 0.06em; margin: 1.4rem 0 0.5rem;
}
:focus-visible { outline: 3px solid oklch(from var(--ring) l c h / 60%); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ── Rahmen: Seitenleiste + Kopfleiste + Inhalt (wie Mietra .sidebar/.main/.topbar/.content) ── */
/* Die Spalte der Seitenleiste malt .app, damit sie auch bei langen Seiten bis ganz unten reicht. */
.app {
  display: flex; min-height: 100vh;
  background: linear-gradient(to right, var(--sidebar) calc(var(--sidebar-w) - 1px), var(--sidebar-border) calc(var(--sidebar-w) - 1px),
    var(--sidebar-border) var(--sidebar-w), var(--background) var(--sidebar-w));
}
.sidebar {
  width: var(--sidebar-w);
  position: fixed; top: 0; left: 0; bottom: 0; display: flex; flex-direction: column; z-index: 10;
}
.sidebar-logo { padding: 20px 16px 16px; border-bottom: 1px solid var(--sidebar-border); }
.sidebar-logo img { display: block; width: 150px; height: auto; }
.sidebar-logo p {
  font-size: 10px; color: var(--muted-foreground); margin-top: 8px; letter-spacing: 0.06em; text-transform: uppercase;
}
.sidebar-nav { padding: 8px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; font-size: 14px;
  border-radius: var(--r-xl); text-decoration: none; background: none; border: 0; font-family: inherit;
  justify-content: flex-start; font-weight: 400; min-height: 0; line-height: 1.4;
  color: color-mix(in oklch, var(--foreground) 65%, transparent); cursor: pointer; width: 100%; text-align: left;
}
.nav-item:hover, .nav-item.aktiv { background: var(--accent); color: var(--foreground); }
.nav-item.aktiv { font-weight: 500; }
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.sidebar-footer {
  padding: 16px; border-top: 1px solid var(--sidebar-border); font-size: 12px; color: var(--muted-foreground);
  display: flex; flex-direction: column; gap: 6px;
}
.sidebar-footer a { color: var(--muted-foreground); }
.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5; min-height: var(--topbar-h); background: var(--card);
  border-bottom: 0.5px solid var(--border); padding: 0 24px; display: flex; align-items: center; gap: 12px;
}
.content { flex: 1; padding: 24px 24px 48px; max-width: 1100px; width: 100%; }
.uebersicht > * { min-width: 0; }

/* Ohne Anmeldung: Karte mittig wie die Mietra-Anmeldung */
.solo { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 48px 16px 24px; background: var(--sidebar); }
.solo-logo { width: 180px; height: auto; margin-bottom: 24px; }
.solo-karte {
  width: 100%; max-width: 440px; background: var(--card); border: 0.5px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 28px 24px;
}
.solo-karte h1 { margin-bottom: 16px; }
.solo-karte.breit { max-width: 720px; }
.solo-fuss { margin-top: 20px; font-size: 13px; color: var(--muted-foreground); }
.solo-fuss a { color: var(--muted-foreground); }

/* ── Knöpfe (Mietra .btn / .btn.primary) ── */
.knopf, button {
  font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.2;
  min-height: 40px; padding: 9px 16px; border-radius: var(--radius);
  border: 1px solid transparent; background: var(--primary); color: var(--primary-foreground);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; white-space: nowrap; transition: background 0.12s;
}
.knopf:hover, button:hover { background: var(--accent-mid); }
.knopf:active, button:active { transform: scale(0.98); }
.knopf.zweit, button.zweit { background: var(--card); color: var(--foreground); border-color: var(--btn-border); }
.knopf.zweit:hover, button.zweit:hover { background: var(--muted); }
.knopf.gross, button.gross { width: 100%; min-height: 44px; font-size: 15px; margin-top: 16px; }
.knopf.klein { min-height: 34px; padding: 6px 12px; font-size: 13px; }
button.link {
  background: none; border: 0; padding: 0; min-height: 0; color: inherit; font-weight: 400;
  text-decoration: underline; text-underline-offset: 3px;
}
button:disabled { opacity: 0.4; cursor: not-allowed; }
form.inline { display: inline; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.knopfreihe form { display: contents; }

/* ── Felder (Mietra .form-label / .input) ── */
label { display: block; font-size: 12px; font-weight: 500; color: var(--muted-foreground); letter-spacing: 0.03em; text-transform: uppercase; margin: 16px 0 6px; }
input {
  font-family: inherit; font-size: 16px; width: 100%; min-height: 44px; padding: 9px 12px;
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--card); color: var(--foreground);
}
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / 12%); }

/* ── Karten (Mietra .card) ── */
.karte {
  background: var(--card); border: 0.5px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px;
}
.hinweis { color: var(--muted-foreground); font-size: 14px; }

/* ── Meldungen (Mietra .alert) ── */
.meldung { padding: 10px 14px; border-radius: var(--radius); font-size: 14px; margin: 12px 0; border: 0.5px solid; }
.meldung.fehler { background: var(--danger-bg); color: var(--danger-text); border-color: oklch(0.42 0.18 25 / 18%); }
.meldung.ok { background: var(--ok-bg); color: var(--ok-text); border-color: oklch(0.38 0.12 145 / 18%); }
.meldung.info { background: var(--muted); color: var(--primary); border-color: oklch(from var(--primary) l c h / 18%); }

/* ── Listen ── */
.liste { list-style: none; }
.liste li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 0.5px solid var(--border); }
.liste li:last-child { border-bottom: 0; }

/* ── Abzeichen (Mietra .badge) ── */
.badge {
  font-size: 12px; padding: 2px 9px; border-radius: 20px; font-weight: 500; white-space: nowrap;
  display: inline-flex; align-items: center; background: var(--muted); color: var(--muted-foreground); border: 0.5px solid var(--border);
}
.badge.eigenes { background: var(--ok-bg); color: var(--ok-text); border-color: transparent; font-weight: 600; }
.badge.wohnung { background: oklch(0.96 0.03 185); color: oklch(0.4 0.08 188); border-color: oklch(0.4 0.08 188 / 18%); }
.marke-neu { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 600; background: var(--neu); color: #fff; }

/* ── Meine Unterlagen: Liste links, Filter rechts ── */
.uebersicht { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; align-items: start; }
.filter { position: sticky; top: calc(var(--topbar-h) + 16px); }
.filter h2 { font-size: 12px; font-weight: 500; color: var(--muted-foreground); text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 8px; }
.filter h2 + .chips { margin-bottom: 18px; }
.chips { display: flex; flex-direction: column; gap: 2px; }
.chip {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: var(--r-xl); text-decoration: none; font-size: 14px;
  color: color-mix(in oklch, var(--foreground) 70%, transparent);
}
.chip:hover { background: var(--accent); color: var(--foreground); }
.chip.aktiv { background: var(--primary); color: var(--primary-foreground); font-weight: 500; }
.chip .zahl { font-size: 12px; opacity: 0.7; }
.dokliste { list-style: none; background: var(--card); border: 0.5px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); }
.dok { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 0.5px solid var(--border); }
.dok:last-child { border-bottom: 0; }
.dok:hover { background: oklch(from var(--primary) l c h / 3%); }
.dok-symbol {
  width: 38px; height: 38px; flex-shrink: 0; border-radius: var(--radius); background: var(--muted);
  display: flex; align-items: center; justify-content: center; color: var(--muted-foreground);
}
.dok-symbol svg { width: 18px; height: 18px; }
.dok-text { flex: 1; min-width: 0; }
.doktitel { font-weight: 500; font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.doktitel a { text-decoration: none; }
.doktitel a:hover { text-decoration: underline; }
.dokinfo { color: var(--muted-foreground); font-size: 13px; margin-top: 3px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dokknoepfe { display: flex; gap: 8px; flex-shrink: 0; }
.leer { padding: 32px 16px; text-align: center; color: var(--muted-foreground); }
.ergebnis { font-size: 13px; color: var(--muted-foreground); margin-bottom: 10px; }

/* ── Dokument ── */
.zurueck { font-size: 14px; color: var(--muted-foreground); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.zurueck:hover { color: var(--foreground); }
.dok-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 12px 0 16px; }
.dok-kopf h2 { font-size: 1.15rem; margin: 0 0 4px; }
.ansicht {
  width: 100%; height: 78vh; min-height: 480px; border: 0.5px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow); background: var(--muted);
}
img.ansicht { height: auto; min-height: 0; object-fit: contain; }
.angaben { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.angaben dt { color: var(--muted-foreground); }

pre { white-space: pre-wrap; font-size: 14px; }

/* ── Handy (wie Mietra ≤ 768 px: volle Breite, Navigation oben) ── */
@media (max-width: 768px) {
  .app { background: var(--background); }
  .sidebar { position: static; width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; background: var(--sidebar); border-bottom: 1px solid var(--sidebar-border); }
  .app { flex-direction: column; }
  .sidebar-logo { border: 0; padding: 12px 16px; }
  .sidebar-logo img { width: 110px; }
  .sidebar-logo p { display: none; }
  .sidebar-nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; padding: 0 8px 8px; gap: 2px; }
  .sidebar-nav form { display: contents; }
  .nav-item { width: auto; white-space: nowrap; padding: 8px 10px; gap: 6px; font-size: 14px; }
  .sidebar-footer { display: none; }
  .main { margin-left: 0; }
  .topbar { position: static; padding: 0 16px; }
  .content { padding: 16px; }
  .uebersicht { grid-template-columns: 1fr; gap: 12px; }
  .filter { position: static; order: -1; }
  .chips { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .chip { flex-shrink: 0; border: 0.5px solid var(--border); background: var(--card); padding: 7px 12px; }
  .filter h2 { margin-top: 0; }
  .filter h2 + .chips { margin-bottom: 12px; }
  .dok { flex-wrap: wrap; }
  .dokknoepfe { width: 100%; }
  .dokknoepfe .knopf { flex: 1; }
  .ansicht { height: 60vh; min-height: 320px; }
  .seite-fuss-handy { display: block; }
}
.seite-fuss-handy { display: none; text-align: center; font-size: 13px; color: var(--muted-foreground); padding: 16px; }
.seite-fuss-handy a { color: var(--muted-foreground); }

/* Formulare in der Anmelde-Karte: keine Karte in der Karte */
.solo-karte .karte { border: 0; box-shadow: none; padding: 0; margin: 0 0 16px; border-radius: 0; background: none; }
.solo-karte .karte + .karte { border-top: 0.5px solid var(--border); padding-top: 16px; }
.solo-karte > p { margin-top: 16px; font-size: 14px; color: var(--muted-foreground); }
.solo-karte > p .knopf { margin-top: 8px; }
.solo-karte .hinweis { margin-top: 8px; }

/* ── Etappe A (05.12.2026): Sprunglink, Tippflächen ab 44 px, Suche, Liste mit Vorschau, Fehlerseiten ── */
.sprung {
  position: absolute; left: 12px; top: -100px; z-index: 50; padding: 10px 16px; min-height: 44px;
  background: var(--primary); color: var(--primary-foreground); border-radius: var(--radius); font-size: 14px; font-weight: 500;
}
.sprung:focus { top: 12px; }
#inhalt:focus { outline: none; }

/* Tippflächen: alle Bedienelemente mindestens 44 px hoch */
.knopf, button, .knopf.klein, .nav-item, .chip, select { min-height: 44px; }
.knopf.klein { padding: 8px 14px; }
.zurueck, .sidebar-footer a, .solo-fuss a, .seite-fuss-handy a { display: inline-flex; align-items: center; min-height: 44px; }
.solo-logo-link { display: inline-block; }
.sidebar-logo a { display: inline-block; min-height: 44px; }
@media (pointer: coarse) {
  .doktitel a { display: inline-flex; align-items: center; min-height: 44px; }
  .dok-symbol { width: 44px; height: 44px; }
}

/* Abstände in Karten: Knopf nicht direkt am Text oder Feld */
.karte form button[type=submit], .karte form .knopf { margin-top: 16px; }
.karte .knopfreihe { margin-top: 12px; }
.karte .liste + .hinweis, .karte .liste + p { margin-top: 12px; }
.liste li form.inline button { margin-top: 0; }
.content .karte form:not(.inline) { max-width: 520px; }
.content > form > .knopf.gross { margin-top: 8px; }

/* Auswahllisten (Mietra .input/.select) */
select {
  font-family: inherit; font-size: 15px; width: 100%; padding: 9px 36px 9px 12px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); background-color: var(--card); color: var(--foreground); cursor: pointer;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / 12%); }
input[type=search] { -webkit-appearance: none; appearance: none; }

/* Suchleiste über der Liste */
.suchleiste {
  background: var(--card); border: 0.5px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 12px 16px 16px; margin-bottom: 16px; display: grid; grid-template-columns: minmax(220px, 1.4fr) 3fr; gap: 0 16px; align-items: end;
}
.suchleiste label { margin: 0 0 6px; }
.auswahl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.auswahl-knoepfe { display: flex; gap: 8px; }

/* Liste links, Vorschau rechts */
.content.weit { max-width: 1680px; }
.unterlagen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.listenteil h3:first-of-type { margin-top: 0; }
.vorschau { display: none; }
.dok.gewaehlt { background: oklch(from var(--primary) l c h / 5%); box-shadow: inset 3px 0 0 var(--primary); }
.dok.gewaehlt .doktitel a { text-decoration: underline; }
a.dok-symbol { text-decoration: none; }
a.dok-symbol:hover { background: var(--accent); color: var(--foreground); }
.ausschnitt { font-size: 13px; color: var(--muted-foreground); margin-top: 6px; overflow-wrap: anywhere; }
.ausschnitt-art { font-weight: 500; color: var(--foreground); }
.ausschnitt mark { background: oklch(0.93 0.09 95); color: var(--foreground); border-radius: 3px; padding: 0 2px; }
/* Zwei Spalten ab 960 px. unterlagen.js liest nur, ob .vorschau sichtbar ist (eine Quelle für die Grenze). */
@media (min-width: 960px) {
  .unterlagen { grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr); }
  .vorschau {
    display: flex; flex-direction: column; position: sticky; top: calc(var(--topbar-h) + 16px);
    height: calc(100vh - var(--topbar-h) - 32px); min-height: 520px;
    background: var(--card); border: 0.5px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
  }
  /* Knopf nur bei Zeiger/Fokus zeigen, aber Platz immer freihalten: kein Verrutschen beim Darüberfahren
     (sonst lag „Herunterladen“ plötzlich unter dem Zeiger und der Klick lud die Datei, statt die Vorschau zu öffnen) */
  .unterlagen .dok { position: relative; }
  .unterlagen .dokknoepfe { visibility: hidden; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); }
  /* Gewählte Zeile: Platz für den Knopf freihalten, damit er das Ende des Dateinamens nicht überdeckt.
     Nur hier, sonst würden alle Titel schmaler. Beim Wählen verrutscht nichts unter dem Zeiger: der Klick ist schon erfolgt. */
  .unterlagen .dok.gewaehlt:has(> .dokknoepfe) > .dok-text { padding-right: 140px; }
  .unterlagen .dok:hover .dokknoepfe, .unterlagen .dok.gewaehlt .dokknoepfe, .unterlagen .dok:focus-within .dokknoepfe { visibility: visible; }
}
.vorschau-kopf {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-bottom: 0.5px solid var(--border);
}
.vorschau-kopf h2 { font-size: 15px; margin: 0 0 2px; }
.vorschau-kopf .knopfreihe { margin-top: 0; }
.vorschau-rahmen { flex: 1; width: 100%; border: 0; background: var(--muted); }
.vorschau-bild { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; background: var(--muted); padding: 16px; }
.vorschau-bild img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--radius); }
.vorschau .meldung { margin: 16px; }
.vorschau-leer {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  color: var(--muted-foreground); text-align: center; font-size: 14px; padding: 24px;
}
.vorschau-leer svg { width: 40px; height: 40px; opacity: 0.5; }

/* Fehlerseiten */
.fehlerbild { max-width: 520px; }
.fehlercode { font-size: 56px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; color: var(--border-strong); margin-bottom: 12px; }
.fehlerbild .hinweis { margin-top: 8px; }
.fehlerbild .knopfreihe { margin-top: 20px; }
.solo-karte .fehlerbild .knopf { width: 100%; }

@media (max-width: 1099px) {
  .suchleiste { grid-template-columns: 1fr; gap: 12px; }
}
@media (max-width: 768px) {
  .suchleiste { padding: 12px; }
  .auswahl { grid-template-columns: 1fr 1fr; }
  .auswahl > div:nth-child(1) { grid-column: 1 / -1; }
  .dok { align-items: flex-start; }
  .auswahl-knoepfe { grid-column: 1 / -1; }
  .auswahl-knoepfe .knopf { flex: 1; }
  .nav-item { padding: 10px 12px; }
  .dok { padding: 10px 12px; gap: 10px; }
}

/* ── Etappe B: An die Verwaltung ── */
.listenkopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.listenkopf .ergebnis { margin: 0; }
.blaettern { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 16px 0 8px; }
.blaettern > :last-child { justify-self: end; }
.blaettern-stand { font-size: 13px; color: var(--muted-foreground); }
.senden-knopf svg, button svg { width: 16px; height: 16px; flex-shrink: 0; }
.listenteil { border-radius: var(--r-lg); transition: box-shadow 0.12s; }
.listenteil.ziehen { box-shadow: 0 0 0 3px var(--accent-mid); background: oklch(0.97 0.02 185); }
.zieh-hinweis { padding: 14px 16px; margin-bottom: 10px; border: 2px dashed var(--accent-mid); border-radius: var(--r-lg); text-align: center; font-weight: 500; color: oklch(0.4 0.08 188); }

/* Quelle und Status in der Liste */
.marke-quelle { font-size: 11px; padding: 2px 8px; border-radius: 20px; font-weight: 500; white-space: nowrap; background: var(--muted); color: var(--muted-foreground); border: 0.5px solid var(--border); }
.marke-quelle.eigen { background: oklch(0.95 0.04 250); color: oklch(0.42 0.12 255); border-color: oklch(0.42 0.12 255 / 22%); font-weight: 600; }
.dok-symbol.eigen { background: oklch(0.95 0.04 250); color: oklch(0.42 0.12 255); }
.status-marke { font-size: 12px; padding: 2px 9px; border-radius: 20px; font-weight: 500; white-space: normal; border: 0.5px solid; }
.status-marke.pruefung { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border); }
.status-marke.ok { background: var(--ok-bg); color: var(--ok-text); border-color: oklch(0.38 0.12 145 / 18%); }
.status-marke.fehler { background: var(--danger-bg); color: var(--danger-text); border-color: oklch(0.42 0.18 25 / 18%); }
.status-marke.info { background: var(--muted); color: var(--muted-foreground); border-color: var(--border); }
/* Etappe D: ganze Zeile anklickbar, Ordner für Sendungen mit mehreren Dateien, Grund bei „nicht angenommen“ */
.dok[data-zeile] { cursor: pointer; }
.dok-symbol.ordner { background: oklch(0.95 0.05 85); color: oklch(0.45 0.1 75); }
.grund { font-size: 13px; color: var(--danger-text); margin-top: 4px; display: block; }
.ordner-kopf { background: var(--card); border: 0.5px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 16px; }
.ordner-kopf .dokinfo { margin-top: 0; }
.listenteil .ordner-kopf h3 { margin: 14px 0 6px; }
.vorschau-nachricht { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; margin-top: 8px; max-height: 6.5em; overflow: auto; }

/* Eingang: Vorschau und eigene Seite */
.eingang-kopf .dokinfo { margin-top: 4px; }
.eingang-inhalt { padding: 4px 16px 16px; overflow: auto; }
.eingang-karte .eingang-inhalt { padding: 0; }
.eingang-inhalt h3 { margin-top: 1rem; }
.eingang-nachricht { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--muted); border-radius: var(--radius); padding: 12px 14px; font-size: 15px; }
.eingang-dateien { list-style: none; border: 0.5px solid var(--border); border-radius: var(--radius); }
.eingang-datei { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 0.5px solid var(--border); }
.eingang-datei:last-child { border-bottom: 0; }
.eingang-datei-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; align-items: flex-start; }
.eingang-datei-name, .upload-name { font-weight: 500; overflow-wrap: anywhere; }
.pruefsumme { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11px; overflow-wrap: anywhere; word-break: break-all; color: var(--muted-foreground); }

/* Dialog */
.eingang-dialog {
  border: 0.5px solid var(--border); border-radius: var(--r-xl); box-shadow: 0 20px 60px oklch(0 0 0 / 20%);
  padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); margin: auto; color: var(--foreground); background: var(--card);
}
.eingang-dialog::backdrop { background: oklch(0 0 0 / 40%); }
.eingang-dialog .eingang-form { padding: 20px 24px 24px; }
.dialog-kopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-kopf h2 { font-size: 1.15rem; margin: 0; }
.eingang-form textarea {
  font-family: inherit; font-size: 16px; width: 100%; min-height: 96px; padding: 9px 12px; resize: vertical;
  border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--card); color: var(--foreground);
}
.eingang-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px oklch(from var(--primary) l c h / 12%); }
.ziehflaeche {
  border: 2px dashed var(--border-strong); border-radius: var(--r-lg); padding: 12px 16px; text-align: center;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px 12px; background: var(--sidebar); transition: background 0.12s, border-color 0.12s;
}
.ziehflaeche svg { width: 28px; height: 28px; color: var(--muted-foreground); }
.ziehflaeche p { font-size: 14px; margin: 0; }
.ziehflaeche.aktiv { border-color: var(--accent-mid); background: oklch(0.97 0.02 185); }
.ziehflaeche.gesperrt { opacity: 0.5; pointer-events: none; }
.eingang-form > .eingang-schritt > .hinweis { margin-top: 6px; font-size: 13px; }
.zieh-knoepfe { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.upload-liste { list-style: none; margin-top: 12px; }
.upload-ordner { margin-bottom: 8px; }
.upload-ordner-kopf { background: var(--sidebar); margin-bottom: 0; }
.upload-liste.ordner-inhalt { margin: 6px 0 0 16px; }
.upload-liste:empty { display: none; }
.upload-datei { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 0.5px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; }
.upload-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.upload-text .hinweis { font-size: 13px; }
.upload-status { font-size: 13px; color: var(--muted-foreground); }
.upload-status:empty { display: none; }
.upload-datei.fehlerhaft { border-color: oklch(0.42 0.18 25 / 35%); background: var(--danger-bg); }
.upload-datei.fehlerhaft .upload-status { color: var(--danger-text); font-weight: 500; }
.upload-datei.erledigt .upload-status { color: var(--ok-text); font-weight: 500; }
.upload-datei.wartet .upload-status { color: var(--warn-text); }
.fortschritt { height: 6px; border-radius: 3px; background: var(--muted); overflow: hidden; }
.fortschritt span { display: block; height: 100%; width: 0; background: var(--accent-mid); transition: width 0.2s; }
.upload-datei.erledigt .fortschritt span { background: var(--ok-text); }
.speicher { margin-top: 14px; font-size: 13px; }
.speicher-text { display: flex; flex-wrap: wrap; gap: 4px 8px; justify-content: space-between; margin-bottom: 6px; }
.speicher-balken { height: 6px; border-radius: 3px; background: var(--muted); overflow: hidden; }
.speicher-balken span { display: block; height: 100%; width: 0; background: var(--primary); }
.speicher-balken.voll span { background: var(--danger-text); }
.eingang-form.laeuft #eingang-senden { opacity: 0.6; }
#eingang-fertig { text-align: center; outline: none; }
#eingang-fertig h2 { font-size: 1.15rem; margin: 8px 0; }
#eingang-fertig .upload-liste { text-align: left; }
#eingang-fertig .knopfreihe { justify-content: center; }
.fertig-symbol { width: 52px; height: 52px; border-radius: 50%; margin: 4px auto 0; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 600; background: var(--ok-bg); color: var(--ok-text); }
.fertig-symbol.fehler { background: var(--danger-bg); color: var(--danger-text); }
@media (max-width: 768px) {
  .listenkopf { flex-wrap: wrap; }
  .listenkopf .senden-knopf { width: 100%; min-height: 48px; font-size: 15px; order: -1; }
  .eingang-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .eingang-dialog .eingang-form { padding: 16px; }
  .eingang-datei { flex-wrap: wrap; }
}

/* Lesbarkeit (Betreiber 05.12.2026): Mietra-Aussehen bleibt (runde Ecken, Geist),
   kleine Schrift größer, Beschriftungen nicht mehr in Großbuchstaben. */
label, .filter h2 { font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--foreground); }
h3 { font-size: 14px; letter-spacing: 0.03em; }
.sidebar-logo p { font-size: 12px; }
.nav-item { font-size: 15px; }
.doktitel { font-size: 16px; }
.dokinfo, .ergebnis, .ausschnitt, .solo-fuss { font-size: 14px; }
.badge, .status-marke { font-size: 13px; }
.marke-neu, .marke-quelle { font-size: 12px; }
.knopf, button { font-size: 15px; }
.knopf.klein { font-size: 14px; }
.sidebar-footer { font-size: 13px; }
.vorschau-kopf h2 { font-size: 16px; }
.angaben, .hinweis { font-size: 15px; }

/* Handy (Nachtrag 05.12.2026): Menü in einer Zeile, „Eigentümerportal“ neben dem Logo. */
@media (max-width: 768px) {
  .sidebar-logo { display: flex; align-items: center; gap: 12px; }
  .sidebar-logo p { display: block; margin: 0; font-size: 12px; }
  .sidebar-nav { flex-wrap: nowrap; }
  .nav-item { padding: 8px 10px; gap: 6px; }
}
@media (max-width: 480px) {
  .nav-item { padding: 8px; font-size: 14px; }
  .nav-item svg { display: none; }
}

/* ── Rückfrage vor dem Abmelden (natives <dialog>) ── */
dialog.rueckfrage {
  border: 0.5px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow);
  background: var(--card); color: var(--foreground); padding: 24px; width: min(360px, calc(100vw - 32px));
  /* margin: auto zentriert das modale <dialog>; die Grundeinstellung * { margin: 0 } hebt das sonst auf */
  margin: auto;
}
dialog.rueckfrage::backdrop { background: oklch(0 0 0 / 35%); }
dialog.rueckfrage h2 { margin: 0 0 8px; }
dialog.rueckfrage .knopfreihe { justify-content: flex-end; margin-top: 16px; }

/* ── Häkchen (Checkbox mit Text) ── */
label.haekchen { display: flex; gap: 10px; align-items: flex-start; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--foreground); }
label.haekchen input { width: 20px; min-height: 20px; height: 20px; margin: 0; flex-shrink: 0; accent-color: var(--primary); }
/* Ordner aufklappen (06.12.2026): Pfeil vor dem Ordner, Dateien eingerückt darunter */
.ordner-pfeil {
  flex-shrink: 0; width: 28px; height: 28px; margin-right: -6px; padding: 0; border: 0; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--muted-foreground); border-radius: var(--radius);
}
.ordner-pfeil[hidden] { display: none; }
.ordner-pfeil:hover { background: var(--accent); color: var(--foreground); }
.ordner-pfeil svg { width: 18px; height: 18px; transition: transform 0.15s; }
.ordner-pfeil[aria-expanded="true"] svg { transform: rotate(90deg); }
.ordner-inhalt { border-bottom: 0.5px solid var(--border); }
.ordner-inhalt:last-child { border-bottom: 0; }
.ordner-inhalt[hidden] { display: none; }
.dokliste.ordner-dateien { border: 0; border-radius: 0; box-shadow: none; background: transparent; padding-left: 36px; }
.ordner-dateien .dok { padding-top: 10px; padding-bottom: 10px; }
@media (max-width: 480px) {
  .dokliste.ordner-dateien { padding-left: 16px; }
  .ordner-pfeil { width: 32px; height: 32px; } /* Fingerziel */
}

/* PDF-Vorschau: Ladehinweis über dem Rahmen, verschwindet beim load-Ereignis */
.pdf-rahmen { position: relative; }
.vorschau .pdf-rahmen { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.vorschau .pdf-rahmen > iframe { flex: 1; }
.vorschau-laden {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1; margin: 0;
  padding: 8px 14px; border-radius: 20px; font-size: 13px; background: var(--card); color: var(--muted-foreground);
  border: 0.5px solid var(--border); box-shadow: var(--shadow); white-space: nowrap;
  /* Rückfall: Feuert der Browser kein load (manche Handys), verschwindet der Hinweis nach 20 s von selbst */
  animation: vorschau-laden-weg 0s linear 20s forwards;
}
@keyframes vorschau-laden-weg { to { visibility: hidden; opacity: 0; } }
/* Große Datei: Hinweis mit Knopf „Dauert zu lange? Herunterladen“; bleibt länger stehen (2 Minuten) */
.vorschau-laden.gross {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 16px; border-radius: var(--r-lg);
  white-space: normal; text-align: center; max-width: calc(100% - 32px); animation-delay: 120s;
}
.vorschau-laden.gross p { margin: 0; }
.vorschau-fehlseite { padding: 24px; font-family: system-ui, sans-serif; background: var(--muted); }

/* Hinweis nach Anmeldung: Upload nicht angenommen */
.ablehnung { margin: 0 0 16px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid oklch(0.42 0.18 25 / 35%); background: var(--danger-bg); color: var(--danger-text); }
.ablehnung + .ablehnung { margin-top: -8px; }
.ablehnung p { margin: 0 0 6px; }
.ablehnung form { margin-top: 8px; }

/* Eingangsbestätigung: Mietra hat die Sendung sauber übernommen */
.eingegangen { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 500; color: var(--ok-text); }
.eingegangen-zeile { display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 13px; font-weight: 500; color: var(--ok-text); }
.eingegangen-zeile.offen { color: var(--muted-foreground); font-weight: 400; }

/* ── Bedienung (Review 6, 05.12.2026): Schrift ab 14 px, Tippziele ab 44 px, deutlicher Fokus ── */
.sidebar-logo p, .marke-neu, .marke-quelle, .badge, .status-marke, .eingegangen, .eingegangen-zeile, .grund,
.upload-status, .upload-text .hinweis, .speicher, .vorschau-laden, .blaettern-stand, .seite-fuss-handy, .sidebar-footer,
.chip .zahl, .eingang-form > .eingang-schritt > .hinweis, .solo-fuss { font-size: 14px; }
.status-marke, .marke-neu, .eingegangen { font-weight: 600; }
.grund { font-weight: 500; }
.chip .zahl { opacity: 0.85; }
.ergebnis { font-size: 15px; }
@media (max-width: 768px) { .sidebar-logo p { font-size: 14px; } .nav-item { font-size: 15px; } }
@media (max-width: 480px) { .nav-item { font-size: 15px; } }

/* Fokus: dunkle Akzentfarbe, 3 px, auf weißem Grund deutlich (Kontrast über 3:1) */
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
input:focus-visible, select:focus-visible, .eingang-form textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary);
}

/* Tippziele: Titel in der Liste, Häkchen, Ordner-Pfeil */
.doktitel a { display: inline-flex; align-items: center; min-height: 44px; }
.dok { padding-top: 6px; padding-bottom: 6px; }
label.haekchen { align-items: center; min-height: 48px; cursor: pointer; }
label.haekchen input { width: 24px; height: 24px; min-height: 24px; }
.ordner-pfeil { width: 44px; height: 44px; margin-right: -10px; }
@media (max-width: 480px) { .ordner-pfeil { width: 44px; height: 44px; } }
.ordner-pfeil svg { width: 20px; height: 20px; }

/* Leere Auswahl: Knopf direkt unter dem Hinweis */
.leer-knopf { text-align: center; padding: 0 16px 24px; }

/* Abgelehnte Dateien: ein kompakter Kasten, aufklappbar, nur auf „Meine Unterlagen“ */
details.ablehnung { margin: 0 0 16px; padding: 0; }
details.ablehnung > summary {
  list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start;
  gap: 4px 12px; min-height: 48px; padding: 10px 16px; font-weight: 600; border-radius: var(--r-lg);
}
details.ablehnung > summary::-webkit-details-marker { display: none; }
details.ablehnung > summary::before { content: "!"; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: var(--danger-text); color: #fff; font-size: 14px; margin-right: -4px; }
.ablehnung-mehr { margin-left: auto; font-weight: 500; text-decoration: underline; }
details.ablehnung[open] .ablehnung-mehr { display: none; }
details.ablehnung ul { list-style: none; padding: 0 16px 8px; }
details.ablehnung li { padding: 10px 0; border-top: 1px solid oklch(0.42 0.18 25 / 20%); overflow-wrap: anywhere; }
details.ablehnung li p { margin: 0 0 4px; }
details.ablehnung li form { margin-top: 8px; }

/* Anmeldung: „Passwort vergessen?“ direkt unter dem Passwortfeld, große Tippfläche */
.vergessen { margin: 4px 0 0; font-size: 15px; }
.vergessen a { display: inline-flex; align-items: center; min-height: 44px; }
