/*
 * Access Read — öffentliche Oberfläche (5-State-Funnel).
 *
 * Design-Quelle: docs/design-system-referenz.md (verbindlicher Standard der IFDB Access Suite,
 * abgeleitet aus Access Contrast Pro `app-dashboard/`). Token-Werte 1:1 aus den Abschnitten
 * A (Farben), B (Typografie), C (Spacing), D (Radien/Schatten/Rahmen), E (Layout), F (Komponenten),
 * H.2/H.3 (Motion/Fokus). Keine neue visuelle Sprache; ein Button-System, eine Severity-Palette.
 *
 * rem-Basis 18px (html 112.5%). WCAG 2.2 AA: Fokusring 2px solid #1a3a2a / offset 2px,
 * prefers-reduced-motion, Reflow @≤600px/Zoom (feste Höhe wird gelöst), kein Lime-Text.
 */

@font-face {
  font-family: 'DM Sans';
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Serif Display';
  src: url('/fonts/dm-serif-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Mono';
  src: url('/fonts/dm-mono-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── A · Farben (HEX 1:1 aus der Referenz, Template-Token-Name in Klammern) ── */
  --c-primary: #005e29; /* purple-1  Forest: Links/Icons/aktiv; als Text 7.7:1 */
  --c-primary-dark: #00451f; /* purple-2  Hover-Tiefe / sicherer Grün-Text */
  --c-primary-tint: #e3efe7; /* purple-3  dezenter Aktiv-/Info-Grund */
  --c-lime: #c6fc00; /* lime-1   Signal-Lime: NUR Fläche mit Ink-Text (10.29:1) */
  --c-lime-dark: #b3e600; /* lime-2   Lime-Hover */
  --c-coral: #ff5a3c; /* orange-1 Linie/Punkt/Fläche ≥3:1 */
  --c-coral-text: #c0371d; /* orange-2 warmer Text ≥4.5:1 */

  --c-text: #1a3a2a; /* n-1  Primärtext 12:1 (= Ink) */
  --c-text-dark: #102219; /* n-2  dunkler (Titel) */
  --c-text-muted: #3f4f47; /* n-3  Sekundärtext ≈8:1 */
  --c-border-warm: #dcd2c2; /* n-4  warmer heller Rahmen */
  --c-bg: #e8f7ec; /* echter Body-Grund (Mint) */

  --c-error: #b42318; /* pink-1 */
  --c-error-bg: #fbe7e1; /* pink-2 */
  --c-warning: #8a5a12; /* yellow-1 */
  --c-warning-bg: #fbf0da; /* yellow-2 */
  --c-success: #1f8a4d; /* green-1 (Fläche/Häkchen — nicht als Kleintext) */
  --c-success-bg: #e3f3e8; /* green-2 */

  /* ── D.3 / F.4 · Glas-Flächen & Hairlines ── */
  --glass-panel: rgba(255, 255, 255, 0.88);
  --glass-chrome: rgba(255, 255, 255, 0.8);
  --glass-soft: rgba(255, 255, 255, 0.7);
  --hairline: rgba(26, 58, 42, 0.16);
  --hairline-soft: rgba(26, 58, 42, 0.12);
  --hairline-faint: rgba(26, 58, 42, 0.1);
  --hairline-strong: rgba(26, 58, 42, 0.2);

  --blur-chrome: blur(20px) saturate(1.5);
  --blur-card: blur(16px) saturate(1.5) brightness(1.05);
  --blur-input: blur(10px);

  /* ── D.2 · Schatten (rgba(26,40,30,…) wie im Standard) ── */
  --shadow-4: 0 8px 24px -10px rgba(26, 40, 30, 0.2);
  --shadow-6: 0 14px 34px -14px rgba(26, 40, 30, 0.24);
  --shadow-card: 0 8px 28px -10px rgba(26, 40, 30, 0.18), inset 0 1px 0 0 rgba(255, 255, 255, 0.8);

  /* ── B · Typografie ── */
  --font-sans: 'DM Sans', ui-sans-serif, system-ui, sans-serif;
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-mono: 'DM Mono', ui-monospace, monospace;

  /* ── D.1 · Radien ── */
  --radius-control: 0.125rem; /* rounded-sm */
  --radius-md: 0.75rem; /* rounded-xl */
  --radius-card: 1rem; /* rounded-2xl */
  --radius-full: 9999px;

  /* ── E · Layout ── */
  --sidebar-w: 18.75rem; /* AC-Standard 337.5px@18 */
  --content-max: 52rem; /* fokussierte Tool-/Funnel-Spalte */

  /* ── H.2 · Motion ── */
  --dur: 200ms;
  --ease: linear;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  font-size: 112.5%; /* rem-Basis 18px */
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--c-text);
  /* 1:1 wie AC Pro (globals.css body): Mint + Mesh-SVG mit 55 %-Wash, der den Verlauf glättet.
     KEIN background-attachment: fixed (AC nutzt es nicht). */
  background-color: var(--c-bg);
  background-image: linear-gradient(rgba(249, 252, 248, 0.55), rgba(249, 252, 248, 0.55)),
    url('/assets/ifdb_access-suite_client-dashboard.svg');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--c-text-dark);
  line-height: 1.2;
  margin: 0 0 0.5rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.25rem;
}
h3 {
  font-size: 1.125rem;
}
p {
  margin: 0 0 1rem;
}
a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color var(--dur) var(--ease);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3.5rem;
  z-index: 100;
  background: var(--c-primary);
  color: #fff;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-control);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus {
  top: 1rem;
  color: #fff;
}
/* H.3 · Fokusring global */
:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
[hidden] {
  display: none !important;
}

/* ════════════════════════════════════════════════════════════════
   App-Shell: Sidebar + Canvas
   ════════════════════════════════════════════════════════════════ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

/* Hamburger nur im schmalen Viewport (siehe Media-Query). */
.nav-toggle {
  display: none;
  position: fixed;
  top: 0.85rem;
  left: 0.85rem;
  z-index: 70;
  width: 2.9rem;
  height: 2.9rem;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: var(--glass-chrome);
  backdrop-filter: var(--blur-chrome);
  -webkit-backdrop-filter: var(--blur-chrome);
  color: var(--c-text);
  cursor: pointer;
  box-shadow: var(--shadow-4);
}
.nav-toggle svg {
  width: 1.4rem;
  height: 1.4rem;
}
.nav-scrim {
  display: none;
}

/* ── E.3 · Sidebar (Glas-Chrome, eigener Scroll-Container) ─────── */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  /* AC nutzt KEIN flex-gap, sondern Margins (mb-5 Kopf · mt-0.4/mt-6 Labels · mt-auto Foot)
     → identischer Rhythmus, nichts springt. */
  padding: 1.5rem 1.25rem 1.125rem;
  background: var(--glass-chrome);
  backdrop-filter: var(--blur-chrome);
  -webkit-backdrop-filter: var(--blur-chrome);
  border-right: 1px solid var(--hairline-soft);
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 2.5rem;
  margin-bottom: 1.25rem; /* mb-5 */
  padding: 0.25rem 0.4rem;
}
.sidebar-brand img {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: var(--radius-md);
}
.sidebar-brand-name {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--c-text-dark);
  line-height: 1.1;
}
.sidebar-brand-sub {
  display: block;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}

/* Nav-Abschnitte (Menü / Weiteres) */
.sidebar-docs {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
/* „Weiteres" steht 1.5rem unter dem Menü-Block (AC mt-6). */
.sidebar-section-more {
  margin-top: 1.1rem;
}
.nav-label {
  font-size: 0.7rem;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin: 0.4rem 0.6rem 0.55rem; /* mt-0.4 mx-0.6 mb-0.55 */
}

/* Nav-Eintrag — 1:1 nach Access Contrast Pro (Sidebar/Menu/index.tsx):
   min-h 2.5rem · px 0.85 / py 0.5 · rounded-xl · 0.95rem/700 (Ink) · Icon 1.25rem gedämpft (n-3)
   · Icon↔Text 0.7rem · hover Forest-7% · aktiv Lime-Pille. */
.nav-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.5rem;
  padding: 0.5rem 0.85rem;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 220ms var(--ease-spring);
}
.nav-item:hover {
  background: rgba(0, 94, 41, 0.07);
}
.nav-item.is-active {
  background: var(--c-lime);
  color: var(--c-text);
}
/* Icons: gefüllte 16×16-Glyphen wie AC (icon-20 = 1.25rem, fill-n-3 gedämpft). */
.nav-icon {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  margin-right: 0.7rem;
  fill: var(--c-text-muted);
}
.nav-item.is-active .nav-icon {
  fill: var(--c-text);
}
.doc-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.doc-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  min-height: 2.4rem;
  padding: 0.5rem 0.7rem;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 220ms var(--ease-spring);
}
.doc-nav-item:hover {
  background: rgba(0, 94, 41, 0.07);
}
.doc-nav-item .dot {
  margin-top: 0.32rem;
}
.doc-nav-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.doc-nav-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-nav-status {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--c-text-muted);
}
.doc-nav-empty {
  margin: 0.2rem 0.7rem;
  font-size: 0.84rem;
  color: var(--c-text-muted);
}

/* Ampel-Punkt (Grafik ≥3:1; Status immer auch im Text) */
.dot {
  flex: none;
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 50%;
  display: inline-block;
}
.dot.is-rot {
  background: var(--c-error);
}
.dot.is-gelb {
  background: var(--c-warning);
}
.dot.is-gruen {
  background: var(--c-success);
}
.dot.is-failed {
  background: var(--c-text-muted);
}
.dot.is-pending {
  background: var(--c-border-warm);
  box-shadow: inset 0 0 0 2px var(--c-text-muted); /* ≥3:1 als Grafik, auch ohne Farbe erkennbar */
}

/* Foot-Block — einheitlich für alle Suite-Produkte (1:1 nach AC Pro Sidebar/index.tsx:
   mt-auto pt-5). Werbe-Karte + Legal-Footer; identische Maße/Abstände überall. */
.sidebar-foot {
  margin-top: auto;
  padding-top: 1.25rem; /* pt-5 */
}

/* Werbe-/Cross-Sell-Karte (AC Pro PromoCard.tsx): dunkle Karte, Suite-Motiv 25 % + Verlauf. */
.promo-card {
  position: relative;
  display: block;
  overflow: hidden;
  padding: 1rem; /* p-4 */
  border-radius: var(--radius-card); /* rounded-2xl */
  background: var(--c-text); /* bg-n-1 */
  color: #fff;
  text-decoration: none;
  box-shadow: 0 10px 28px -14px rgba(16, 34, 25, 0.55);
  transition: box-shadow 200ms var(--ease-spring);
}
.promo-card:hover {
  box-shadow: 0 16px 36px -14px rgba(16, 34, 25, 0.7);
}
.promo-card-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.25;
  pointer-events: none;
}
.promo-card-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  /* 1:1 wie AC (kompiliert): oben TRANSPARENT, damit das Motiv durchleuchtet; unten dunkel. */
  background: linear-gradient(
    to top,
    rgba(16, 34, 25, 0.95),
    rgba(26, 58, 42, 0.85),
    rgba(26, 58, 42, 0)
  );
}
.promo-card-body {
  position: relative;
  display: block;
}
.promo-card-title {
  display: block;
  font-family: var(--font-serif);
  font-size: 1rem; /* text-base */
  line-height: 1.25; /* leading-tight */
}
.promo-card-text {
  display: block;
  margin-top: 0.375rem; /* mt-1.5 */
  font-size: 0.75rem; /* text-xs */
  line-height: 1.625; /* leading-relaxed */
  color: rgba(255, 255, 255, 0.85);
}
.promo-card-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 0.75rem; /* mt-3 */
  padding: 0.375rem 0.75rem; /* py-1.5 px-3 */
  border-radius: 0.5rem; /* rounded-lg */
  background: var(--c-lime);
  color: var(--c-text);
  font-size: 0.75rem; /* text-xs */
  line-height: 1rem; /* text-xs line-height (sonst zu hoch) */
  font-weight: 700;
  transition: background 200ms var(--ease-spring);
}
.promo-card:hover .promo-card-pill {
  background: var(--c-lime-dark);
}

/* Legal-Footer (AC Pro: mt-3 px-[0.6rem] text-[0.7rem] text-n-3). */
.sidebar-legal-wrap {
  margin-top: 0.75rem; /* mt-3 */
  padding: 0 0.6rem;
  font-size: 0.7rem;
  line-height: 1.625; /* leading-relaxed */
  color: var(--c-text-muted); /* n-3 */
}
.sidebar-copy {
  margin: 0;
}
.sidebar-copy a {
  color: var(--c-text); /* n-1 */
  font-weight: 700;
  text-decoration: none;
}
.sidebar-copy a:hover {
  color: var(--c-text-dark);
}
.sidebar-legal {
  margin-top: 0.375rem; /* mt-1.5 */
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem; /* gap-y-1 gap-x-3 */
}
.sidebar-legal a {
  color: rgba(26, 58, 42, 0.7); /* n-1/70 */
  font-weight: 700;
  text-decoration: none;
}
.sidebar-legal a:hover {
  color: var(--c-text);
}

/* ════════════════════════════════════════════════════════════════
   Canvas: die 5-State-Maschine (genau ein Panel sichtbar)
   ════════════════════════════════════════════════════════════════ */
.canvas {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 2rem;
  overflow: hidden; /* Desktop: der Funnel-Fluss scrollt nicht */
}
.panel {
  width: 100%;
  max-width: var(--content-max);
  /* Desktop-Großtext-Fallback: passt ein State nicht in 100dvh, scrollt das Panel intern
     (statt zu clippen) — garantiert 1.4.4 ohne Inhaltsverlust. */
  max-height: calc(100dvh - 4rem);
  overflow: auto;
}
.panel:not([hidden]) {
  animation: panel-in var(--dur) var(--ease) both;
}
@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.panel--loading,
.panel--handoff {
  text-align: center;
}
.panel--loading {
  max-width: 34rem;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-primary);
  margin: 0 0 0.5rem;
}
.panel-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.7rem;
  color: var(--c-text-dark);
  line-height: 1.15;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}
.panel--upload .panel-title {
  font-size: 2.2rem;
}
.panel-lead {
  font-size: 1rem;
  color: var(--c-text-muted);
  margin: 0 0 1.5rem;
  max-width: 38rem;
}

/* ── F.4 · Glas-Karte ─────────────────────────────────────────── */
.card {
  background: var(--glass-panel);
  backdrop-filter: var(--blur-card);
  -webkit-backdrop-filter: var(--blur-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.75rem;
}

/* ── Dropzone ─────────────────────────────────────────────────── */
.dropzone {
  border: 1.5px dashed rgba(0, 94, 41, 0.32);
  border-radius: var(--radius-md);
  background: var(--glass-soft);
  padding: 2rem 1.5rem;
  text-align: center;
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.dropzone.is-dragover {
  background: var(--c-primary-tint);
  border-color: var(--c-primary);
  transform: translateY(-2px);
}
.dropzone-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-full);
  background: rgba(0, 94, 41, 0.1);
  color: var(--c-primary);
  margin-bottom: 0.5rem;
}
.dropzone-icon svg {
  width: 1.6rem;
  height: 1.6rem;
}
.dropzone-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--c-text-dark);
  margin: 0.25rem 0;
}
.dropzone .hint {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin: 0 0 1rem;
}
.dropzone-action {
  margin: 0;
}
.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.file-input:focus-visible + .btn {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}

/* ── F.1 · Buttons — 1:1 nach Access Contrast Pro (ui.tsx buttonClasses, System 2):
   inline-flex · gap .5 · rounded-xl · px 1.25 / py .625 · text-sm (.875rem/1.3125) · 700 ·
   KEINE feste Höhe, KEIN Rand, KEIN Schatten. ─────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem; /* gap-2 */
  padding: 0.625rem 1.25rem; /* py-2.5 px-5 */
  border: 1px solid transparent;
  border-radius: var(--radius-md); /* rounded-xl */
  background: transparent;
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 0.875rem; /* text-sm */
  line-height: 1.3125rem; /* text-sm line-height */
  font-weight: 700;
  cursor: pointer;
  transition:
    background var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}
.btn-primary {
  background: var(--c-lime);
  color: var(--c-text);
}
.btn-primary:hover {
  background: var(--c-lime-dark);
}
.btn-secondary {
  background: var(--glass-soft); /* rgba(255,255,255,0.7) */
  color: var(--c-text);
  border-color: rgba(26, 58, 42, 0.15);
}
.btn-secondary:hover {
  border-color: var(--c-primary); /* hover:border-purple-1 */
}
.btn-dark {
  background: var(--c-text);
  color: #fff;
}
.btn-dark:hover {
  background: var(--c-text-dark);
}
.btn-on-dark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}
.btn-on-dark:hover {
  background: #fff;
  color: var(--c-text-dark);
}
.btn-ghost {
  color: var(--c-text);
  text-underline-offset: 2px;
}
.btn-ghost:hover {
  text-decoration: underline;
}
/* Kompakter Button (Matrix-Aktion, Dateiliste) — Klickziel bleibt ≥24px (WCAG 2.5.8). */
.btn-small {
  min-height: 2.4rem;
  padding: 0 0.85rem;
  font-size: 0.85rem;
}
.btn-block {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
}

/* Icon-Button (Modal-Schließen) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  flex: none;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-full);
  background: var(--glass-soft);
  color: var(--c-text);
  cursor: pointer;
}
.icon-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}
.icon-btn:hover {
  background: var(--c-primary);
  color: #fff;
}

/* ── Dateiliste ───────────────────────────────────────────────── */
.file-list {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
.file-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--glass-panel);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.95rem;
}
.file-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.file-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}
.file-size {
  font-size: 0.82rem;
  color: var(--c-text-muted);
  font-family: var(--font-mono);
}
.turnstile-wrap {
  margin-top: 1.25rem;
  min-height: 1px;
}

/* ── Meldungen (Notices) ──────────────────────────────────────── */
.notice {
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin: 1.25rem 0 0;
  border: 1px solid transparent;
  font-size: 0.95rem;
  text-align: left;
}
.notice-error {
  background: var(--c-error-bg);
  border-color: rgba(180, 35, 24, 0.3);
  color: var(--c-error);
}
.notice-info {
  background: var(--c-primary-tint);
  border-color: rgba(0, 94, 41, 0.25);
  color: var(--c-primary-dark);
}
.notice-warning {
  background: var(--c-warning-bg);
  border-color: rgba(138, 90, 18, 0.3);
  color: var(--c-warning);
}
.disclaimer {
  font-size: 0.84rem;
  color: var(--c-text-muted);
  margin: 1.25rem 0 0;
}
.disclaimer-small {
  margin: 1.25rem 0 0;
  font-size: 0.82rem;
  color: var(--c-text-muted);
}

/* ── State 2 · Loading ────────────────────────────────────────── */
.loading-progress {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--c-text-dark);
  margin: 0.4rem 0 0.2rem;
}
.loading-time {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--c-text-muted);
  margin: 0 0 1.5rem;
}
.loading-hint {
  font-size: 0.95rem;
  color: var(--c-text-muted);
  margin: 0 auto;
  max-width: 28rem;
  min-height: 2.8em;
}

/* ── State 3 · Matrix ─────────────────────────────────────────── */
.matrix-headline {
  font-size: 1.02rem;
  color: var(--c-text);
  margin: 0.7rem 0 0;
}
/* AC-Pro-Listenmuster: EINE Glas-Karte mit Kopf (Legende) + zarten Zeilen-Hairlines. Der Kopf liegt
   nicht mehr auf dem nackten Hintergrund → kein Durchscheinen, keine störenden „Linien". */
.matrix-card {
  padding: 0;
  overflow: hidden;
}
.matrix-card-head {
  padding: 1.15rem 1.25rem 1.2rem;
  border-bottom: 1px solid var(--hairline-soft);
}
.matrix-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
}
.matrix-title {
  font-size: 1.6rem;
  margin: 0;
}
/* Info-„?" am Spaltenkopf „Index" → öffnet die Legende als Pop-up. */
.th-index {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--c-text-muted);
  cursor: pointer;
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.info-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}
.info-btn:hover {
  background: rgba(0, 94, 41, 0.1);
  color: var(--c-primary);
}
.info-btn:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}
.matrix-scroll {
  overflow-x: auto;
}
.matrix-scroll:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: -2px;
}

/* Desktop: Übersicht füllt höchstens den Viewport; NUR die Tabelle scrollt bei vielen Zeilen/kurzem
   Fenster — Kopf, CTA und Hinweis bleiben sichtbar, die Seite selbst scrollt nicht. Auf hohen
   Viewports bleibt alles ohne Scrollen und ohne Leerraum (Karte wächst nicht). */
@media (min-width: 901px) {
  .panel--matrix {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .matrix-card {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-height: 0;
  }
  .matrix-card-head {
    flex: none;
  }
  .matrix-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
  }
  .matrix-cta,
  .panel--matrix .disclaimer {
    flex: none;
  }
  /* Spaltenköpfe bleiben beim Scrollen der Tabelle sichtbar. */
  .matrix thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.97);
  }
}
.matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  /* Fixes Layout: die Tabelle passt sich IMMER der Kartenbreite an (kein horizontales Scrollen).
     Index/Aktion bekommen feste Breiten (Ring bzw. Button geschützt), die restlichen drei Spalten
     teilen sich den Platz gleichmäßig; lange Inhalte kürzen (Name) bzw. brechen um (Status/Befunde). */
  table-layout: fixed;
}
.col-datei {
  width: 30%;
}
.col-index {
  width: 5rem;
}
.col-aktion {
  width: 6.5rem;
}
.matrix th,
.matrix td {
  padding: 0.7rem 0.7rem;
  text-align: left;
  vertical-align: middle;
}
.matrix thead th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  border-bottom: 1px solid var(--hairline-soft);
}
.matrix tbody tr + tr th,
.matrix tbody tr + tr td {
  border-top: 1px solid var(--hairline-soft);
}
.matrix th:first-child,
.matrix td:first-child {
  padding-left: 1rem;
}
.matrix th:last-child,
.matrix td:last-child {
  padding-right: 1rem;
}
/* Datei-Zelle: Vorschau/Icon und Name immer in EINER Zeile nebeneinander (innerer Flex-Wrapper,
   damit die <th>-Zelle eine echte Tabellenzelle bleibt). */
.m-file {
  font-weight: 700;
  color: var(--c-text-dark);
}
.m-file-inner {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.m-file svg {
  flex: none;
  width: 1.35rem;
  height: 1.75rem;
  color: var(--c-text-muted);
}
/* Seiten-Vorschau (erste Seite) als kleines Thumbnail statt Icon. */
.m-thumb {
  flex: none;
  width: 1.9rem;
  height: 2.5rem;
  object-fit: cover;
  object-position: top;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 0.25rem;
}
.m-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Status/Befunde dürfen umbrechen (kein nowrap); ein Wort wird nur gebrochen, wenn es allein nicht
   in die Spalte passt (break-word statt anywhere → saubere Umbrüche an Leerzeichen, kein Scrollen). */
.m-status,
.m-counts {
  overflow-wrap: break-word;
}
.m-status-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.m-counts {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--c-text);
}
.m-action {
  text-align: right;
}

/* ── Index-Legende (im Karten-Kopf der Übersicht) ─────────────── */
.index-legend-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
}
.index-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
}
.index-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--c-text);
}
/* Im Index-Pop-up: Bänder untereinander, mit Erklärtext. */
.index-legend--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
}
.index-legend--stack li {
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

/* ── Bewertungssicht-Umschalter (barrierearm ↔ barrierefrei) ──── */
.mode-switch {
  display: inline-flex;
  margin: 0;
}
.mode-switch-track {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.2rem;
  background: var(--glass-soft);
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-md);
}
.mode-opt {
  min-height: 2.3rem;
  padding: 0 0.95rem;
  border: 0;
  border-radius: 0.55rem;
  background: transparent;
  color: var(--c-text-muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    background var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.mode-opt:hover {
  color: var(--c-text);
}
.mode-opt[aria-pressed='true'] {
  background: var(--c-primary);
  color: #fff;
}
.mode-opt:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}
.mode-switch-note {
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  color: var(--c-text-muted);
}

/* Volle-Breite-CTA der Übersicht (stimmig zur Kartenbreite). */
.matrix-cta {
  margin-top: 1.25rem;
}

/* Score-Ring als Button (öffnet die Erklärung). */
.score-ring-btn {
  display: inline-flex;
  padding: 0;
  border: 0;
  background: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
}
.score-ring-btn:hover {
  transform: scale(1.05);
}
.score-ring-btn:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 3px;
}

/* ── Score-Ring (Barrierefreiheits-Index) ─────────────────────── */
.score-ring {
  position: relative;
  width: 112px;
  height: 112px;
  flex: none;
  border-radius: 50%;
  background: conic-gradient(
    var(--ring, var(--c-primary)) calc(var(--p, 0) * 1%),
    var(--hairline-faint) 0
  );
}
.score-ring-inner {
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 3px rgba(16, 34, 25, 0.08);
}
.score-num {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  line-height: 1;
  color: var(--c-text-dark);
}
.score-den {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--c-text-muted);
  margin-top: 0.1rem;
}
.score-ring--sm {
  width: 3rem;
  height: 3rem;
}
.score-ring--sm .score-ring-inner {
  inset: 5px;
}
.score-ring--sm .score-num {
  font-size: 1rem;
}

/* ── Score-Erklärung (Modal mit abgedunkeltem Hintergrund, AC-Pro-Overlay) ── */
.score-dialog {
  width: min(28rem, 92vw);
  max-width: 28rem;
  margin: auto;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-6);
  overflow: hidden;
}
.score-dialog::backdrop {
  background: rgba(26, 58, 42, 0.85); /* Forest 85 % (AC-Pro-Overlay) */
}
.score-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.05rem 1.25rem;
  border-bottom: 1px solid var(--hairline-soft);
}
.score-dialog-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--c-text-dark);
  margin: 0;
}
.score-dialog-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.4rem 1.25rem 1.5rem;
}
.score-dialog-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--c-text);
}
/* Hero: großer Score + Maßstab + Stufen-Badge (rechtsbündig) */
.score-pop-hero {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}
.score-pop-num {
  font-family: var(--font-serif);
  font-size: 3rem;
  line-height: 1;
}
.score-pop-scale {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--c-text-muted);
}
.score-pop-badge {
  margin-left: auto;
}
/* Befunde als klar abgesetzte Statistik (eigener Block über einer feinen Linie) */
.score-pop-stats {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--hairline-soft);
}
.score-pop-stat {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.92rem;
  color: var(--c-text);
}

/* ── State 4 · Detail-Modal ───────────────────────────────────── */
.detail-dialog {
  width: min(46rem, 94vw);
  max-width: 46rem;
  max-height: 90dvh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-6);
  overflow: hidden;
}
.detail-dialog::backdrop {
  background: rgba(26, 40, 30, 0.6);
}
.detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--hairline-soft);
}
.detail-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  color: var(--c-text-dark);
  margin: 0;
  overflow-wrap: anywhere;
}
.detail-body {
  padding: 1.25rem;
  overflow: auto;
  max-height: calc(90dvh - 4.5rem);
}
.detail-summary {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.detail-summary-meta {
  min-width: 0;
}
.detail-counts {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--c-text);
  margin: 0.5rem 0 0;
}
.traffic-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  border: 1px solid;
}
.traffic-badge.is-rot {
  background: var(--c-error-bg);
  border-color: rgba(180, 35, 24, 0.35);
  color: var(--c-error);
}
.traffic-badge.is-gelb {
  background: var(--c-warning-bg);
  border-color: rgba(138, 90, 18, 0.35);
  color: var(--c-warning);
}
.traffic-badge.is-gruen {
  background: var(--c-success-bg);
  border-color: rgba(31, 138, 77, 0.4);
  color: var(--c-primary-dark);
}

/* Prüfbereiche */
.pruefbereiche {
  margin-top: 1.25rem;
}
.pruef-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
}
.pruef-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.pruef-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 0.7rem;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--hairline-soft);
  border-radius: var(--radius-md);
  background: var(--glass-panel);
}
.pruef-row .dot {
  margin-top: 0.32rem;
}
/* Konforme Bereiche: einzeilig, kompakt. */
.pruef-row--ok {
  align-items: center;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
.pruef-row--ok .dot {
  margin-top: 0;
}
.pruef-main {
  min-width: 0;
}
.pruef-name {
  margin: 0;
  font-weight: 700;
  color: var(--c-text-dark);
}
.pruef-text {
  margin: 0.2rem 0 0;
  font-size: 0.88rem;
  color: var(--c-text-muted);
}
/* Betroffene Seiten je Befund (Phase 2): echtes Seitenbild aus dem Dokument, „Seite N" beschriftet,
   per Klick vergrößerbar. Der Verstoß steht im Befundtitel direkt darüber. */
.pruef-shots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.pruef-shot {
  width: 8rem;
}
.pruef-doc {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--c-text-muted);
}
/* Ausschnitt: Bildfläche croppt das Seitenbild per CSS (aspect-ratio inline), Caption darunter
   (überlappt nie — auch bei flachen Link-Ausschnitten). */
.crop-view {
  display: flex;
  flex-direction: column;
  width: 11rem;
  max-width: 100%;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.crop-view:hover {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-4);
  transform: translateY(-2px);
}
.crop-view:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}
.crop-view-fig {
  width: 100%;
  background-color: #fff;
}
.crop-cap {
  padding: 0.3rem 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--c-text-muted);
  text-align: center;
  border-top: 1px solid var(--hairline-faint);
}

/* Markierte Seite: Rahmen (Schweregrad-Farbe) + Label-Chip über dem Seitenbild. */
.pruef-mark {
  display: flex;
  flex-direction: column;
  width: 10.5rem;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.pruef-mark:hover {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-4);
  transform: translateY(-2px);
}
.pruef-mark:focus-visible {
  outline: 2px solid var(--c-text);
  outline-offset: 2px;
}
.pruef-mark-fig {
  position: relative;
  display: block;
}
.pruef-mark-fig img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 12rem;
  object-fit: cover;
  object-position: top;
  background: #fff;
}
.pruef-mark-frame {
  position: absolute;
  inset: 5%;
  border: 3px solid var(--c-error);
  border-radius: 3px;
  pointer-events: none;
}
.pruef-mark-frame.is-gelb {
  border-color: var(--c-warning);
}
.pruef-mark-chip {
  position: absolute;
  top: 5%;
  left: 5%;
  max-width: 86%;
  padding: 0.1rem 0.4rem;
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  background: var(--c-error);
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pruef-mark-chip.is-gelb {
  background: var(--c-warning);
}
.pruef-count {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--c-text-muted);
  white-space: nowrap;
}
.manual-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--c-primary-dark);
  background: var(--c-primary-tint);
  border-radius: var(--radius-full);
  padding: 0.05rem 0.5rem;
  vertical-align: 0.05rem;
}

/* ── Teilprüfungs-Hinweis ─────────────────────────────────────── */
.sample-note {
  background: var(--c-warning-bg);
  border: 1px solid rgba(138, 90, 18, 0.3);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.95rem;
  margin: 1.25rem 0;
  font-size: 0.9rem;
  color: var(--c-warning);
}

/* ── Seiten-Screenshot-Thumbnails (in den Befunden) ───────────── */
.preview-thumb {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  width: 7.5rem;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: start;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}
.preview-thumb img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 11rem;
  object-fit: cover;
  object-position: top;
  background: #fff;
}
.preview-cap {
  padding: 0.35rem 0.4rem 0.45rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--c-text-muted);
  text-align: center;
}
.preview-thumb:hover {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-4);
  transform: translateY(-2px);
}

/* ── Lightbox (natives <dialog>) ──────────────────────────────── */
.lightbox {
  position: fixed;
  max-width: min(92vw, 60rem);
  max-height: 92vh;
  margin: auto;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-card);
  background: #fff;
  box-shadow: var(--shadow-6);
}
.lightbox::backdrop {
  background: rgba(26, 40, 30, 0.6);
}
.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 88vh;
  border-radius: var(--radius-card);
}
.lightbox-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--hairline);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.92);
  color: var(--c-text);
  cursor: pointer;
  box-shadow: var(--shadow-4);
}
.lightbox-close svg {
  width: 1.25rem;
  height: 1.25rem;
}
.lightbox-close:hover {
  background: var(--c-primary);
  color: #fff;
}

/* ── F.8 · Spinner ────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(0, 94, 41, 0.25);
  border-top-color: var(--c-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
  vertical-align: -0.15rem;
  margin-right: 0.45rem;
}
.spinner-lg {
  width: 2.6rem;
  height: 2.6rem;
  border-width: 3px;
  margin: 0 0 1rem;
  vertical-align: middle;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* H.2 · Reduzierte Bewegung */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ════════════════════════════════════════════════════════════════
   Responsiv
   ════════════════════════════════════════════════════════════════ */

/* ≤900px: Sidebar wird zum barrierefreien Off-Canvas-Drawer (Hamburger). px-Breakpoint, damit der
   Wert nicht von der 18px-rem-Basis bzw. der MQ-rem-Auslegung abhängt. */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
  }
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(20rem, 86vw);
    transform: translateX(-100%);
    transition: transform var(--dur) var(--ease);
    z-index: 60;
    box-shadow: var(--shadow-6);
  }
  .app[data-nav='open'] .sidebar {
    transform: translateX(0);
  }
  .app[data-nav='open'] .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 50;
    border: 0;
    background: rgba(26, 40, 30, 0.5);
    cursor: pointer;
  }
  .canvas {
    padding-top: 4.75rem; /* Platz für den fixierten Hamburger */
  }
}

/* ════════════════════════════════════════════════════════════════
   Höhen-adaptiver Upload-State (NUR Desktop ≥901px Breite, wo die Sidebar steht und kein Hamburger
   das Canvas-Padding beansprucht). Ziel: der Upload-Funnel scrollt auf realistischen Desktop- und
   Laptop-Viewports NIE — auch nicht in nicht-voll-hohen Fenstern großer Monitore oder mit
   eingeblendeter Meldung. Verdichtet wird nur das vertikale Rhythmus-Maß; Farben/Tokens bleiben.
   Mobile/Zoom nutzt weiterhin den natürlichen Fluss (≤600px-Breiten-Query unten).
   ════════════════════════════════════════════════════════════════ */

/* Desktop-Grundregel: die (max. 5) gewählten Dateien bekommen eine gedeckelte, EIGENSTÄNDIG
   scrollbare Liste. So sprengt kein Mehr-Datei-Fall das Panel — Dropzone, Turnstile und Button
   bleiben immer sichtbar, das Panel selbst bleibt stabil. Eine Liste zu scrollen ist erwartbar. */
@media (min-width: 901px) {
  .panel--upload .file-list {
    max-height: 13.5rem;
    overflow-y: auto;
  }
}

/* Tier 1 — kurze/halbe Viewports: moderate Verdichtung. Breakpoint hoch genug (≤1090px), dass am
   Übergang auch der unverdichtete 5-Datei-Zustand noch ohne Scrollen passt (keine Klippe). */
@media (min-width: 901px) and (max-height: 1090px) {
  .canvas {
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }
  .panel {
    max-height: calc(100dvh - 2.5rem);
  }
  .panel--upload .eyebrow {
    margin-bottom: 0.3rem;
  }
  .panel--upload .panel-title {
    font-size: 1.85rem;
  }
  .panel--upload .panel-lead {
    margin-bottom: 0.85rem;
  }
  .card.upload-card {
    padding: 1.2rem;
  }
  .panel--upload .dropzone {
    padding: 1.1rem 1.5rem;
  }
  .panel--upload .dropzone-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0.3rem;
  }
  .panel--upload .dropzone-icon svg {
    width: 1.3rem;
    height: 1.3rem;
  }
  .panel--upload .dropzone-title {
    font-size: 1.05rem;
    margin: 0.1rem 0;
  }
  .panel--upload .dropzone .hint {
    margin-bottom: 0.6rem;
  }
  .panel--upload .file-list {
    margin-top: 0.8rem;
    max-height: 9.5rem;
  }
  .turnstile-wrap {
    margin-top: 0.8rem;
  }
  .panel--upload .actions {
    margin-top: 0.8rem;
  }
  .panel--upload .disclaimer {
    margin-top: 0.8rem;
  }
}

/* Tier 2 — kleine Laptops / deutlich verkleinerte Fenster. */
@media (min-width: 901px) and (max-height: 860px) {
  .canvas {
    padding-top: 0.9rem;
    padding-bottom: 0.9rem;
  }
  .panel {
    max-height: calc(100dvh - 1.8rem);
  }
  .panel--upload .panel-title {
    font-size: 1.6rem;
  }
  .panel--upload .panel-lead {
    font-size: 0.95rem;
    margin-bottom: 0.6rem;
  }
  .card.upload-card {
    padding: 0.95rem;
  }
  .panel--upload .dropzone {
    padding: 0.85rem 1.25rem;
  }
  .panel--upload .dropzone-icon {
    width: 2.1rem;
    height: 2.1rem;
    margin-bottom: 0.15rem;
  }
  .panel--upload .dropzone-title {
    font-size: 1rem;
  }
  .panel--upload .dropzone .hint {
    margin-bottom: 0.45rem;
  }
  .panel--upload .file-list {
    max-height: 7rem;
  }
  .panel--upload .btn {
    min-height: 2.9rem;
  }
}

/* Tier 3 — sehr kurze Fenster (stark verkleinert). Hält leer + Meldung bis ~640px scrollfrei. */
@media (min-width: 901px) and (max-height: 740px) {
  .canvas {
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }
  .panel {
    max-height: calc(100dvh - 1.2rem);
  }
  .panel--upload .panel-title {
    font-size: 1.35rem;
  }
  .panel--upload .panel-lead {
    font-size: 0.88rem;
    margin-bottom: 0.45rem;
  }
  .card.upload-card {
    padding: 0.7rem;
  }
  .panel--upload .dropzone {
    padding: 0.6rem 1rem;
  }
  .panel--upload .dropzone-icon {
    width: 1.6rem;
    height: 1.6rem;
    margin-bottom: 0.1rem;
  }
  .panel--upload .dropzone-title {
    font-size: 0.95rem;
  }
  .panel--upload .dropzone .hint {
    margin-bottom: 0.35rem;
  }
  .panel--upload .file-list {
    max-height: 5rem;
  }
  .panel--upload .btn {
    min-height: 2.7rem;
  }
  .panel--upload .disclaimer {
    font-size: 0.76rem;
    margin-top: 0.6rem;
  }
}

/* ≤600px ODER starker Zoom (Reflow 1.4.10 / Resize 1.4.4): feste Höhe lösen, in den natürlichen
   Dokumentfluss wechseln, vertikales Scrollen erlauben — kein Inhalt/Fokus außerhalb des
   Sichtbereichs, Zoom bleibt aktiv. (Zoom verkleinert die CSS-Viewport-Breite → dieselbe Query feuert
   auch bei 400 %.) px-Breakpoint für eindeutige Auslösung. */
@media (max-width: 600px) {
  .canvas {
    min-height: 0;
    display: block;
    overflow: visible;
    padding: 4.75rem 1.1rem 3rem;
  }
  .panel {
    max-height: none;
    overflow: visible;
  }
  .panel--upload .panel-title {
    font-size: 1.8rem;
  }
  .card {
    padding: 1.25rem;
  }
  .detail-summary {
    gap: 0.85rem;
  }
}
