/* Talk2Form Mobile-First Design System */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --bg-dark: #1a1a2e;
  --bg-darker: #0f172a;
  --bg-card: #1e293b;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;

  --text-primary: #1a202c;
  --text-secondary: #94a3b8;
  --text-light: #e2e8f0;
  --text-muted: #64748b;
  --text-muted-3: #475569;

  --primary: #3b82f6;
  --primary-hover: #2563eb;

  --success: #22c55e;
  --success-bg: #dcfce7;
  --success-text: #15803d;

  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --warning-text: #92400e;

  --error: #ef4444;
  --error-bg: #fee2e2;
  --error-text: #991b1b;

  /* Status colors (extended for mockup) */
  --processing-bg: #ede9fe;
  --processing-text: #6d28d9;

  --review-bg: #dbeafe;
  --review-text: #1d4ed8;

  --danger: #ef4444;
  --danger-bg: #fff5f5;
  --danger-border: #fca5a5;

  --border: #e2e8f0;
  --border-dark: #334155;

  /* Dark screen aliases */
  --dark-secondary: #1e293b;

  /* Spacing */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;

  /* Border radius (legacy - kept for PlatformAdmin compatibility) */
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  --radius-xl: 2rem;

  /* Border radius (Mockup-aligned tokens for mobile screens) */
  --radius-card: 16px;
  --radius-field: 14px;
  --radius-icon: 12px;
  --radius-cta: 20px;
  --radius-pill: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
  --shadow-blue: 0 8px 24px rgba(59,130,246,0.4);

  /* Typography scale (Mockup-aligned) */
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 14px;
  --font-size-md: 15px;
  --font-size-lg: 17px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 22px;
  --font-size-timer: 42px;

  --font-weight-normal: 400;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Finales Farbschema: Petrol-Akzent (Referenzmockup v1). --chrome-dark bleibt fuer dunkle Content-Elemente
     (z. B. Paketkarte "Abo & Paket") erhalten - das App-Chrome nutzt seit "Clean White" die --chrome-*-Tokens. */
  --chrome-dark: #1e222b;
  /* App-Chrome "Clean White" (mockup_app_redesign_weiss_final_v1.html): Header, Tabs, Bottom-Navigation, Build-Zeile */
  --chrome-bg: #ffffff;
  --chrome-line: #ebebe7;
  --chrome-shadow: 0 1px 3px rgba(20, 20, 25, 0.04);
  --chrome-text: #1a1f2e;
  --chrome-muted: #9aa0a6;
  --chrome-icon: #6b7280;
  /* Gemeinsame Hoehe aller WebApp-Seitenheader (.app-header, Firma verwalten .company-header), abgeleitet vom
     bestehenden zweizeiligen Firmenheader: Padding 16 + 14, Titel 16.5px x 1.25, Abstand 1px, Untertitel 11px x
     Zeilenhoehe 1.6 (body), Trennlinie 1px. border-box (Bootstrap-Reboot). */
  --app-header-height: calc(16px + 16.5px * 1.25 + 1px + 11px * 1.6 + 14px + 1px);
  --accent: #2b6e66;
  --accent-on-dark: #a9ecdd;
  --danger: #a13f35;
  --icon-badge-bg: #f0f0ec;
  --icon-badge-fg: #33383f;
  --success-soft: #ddf3ee;
  --success-soft-text: #12463d;
  --warn-text: #9a4a1d;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-light);
  color: var(--text-primary);
  line-height: 1.6;
}

/* App Container */
.app-container {
  max-width: 430px;
  margin: 0 auto;
  background: var(--bg-white);
  height: 100vh;              /* FIX: Changed from min-height to height - prevents body scroll */
  display: flex;
  flex-direction: column;
}

/* PWA top safe area (installed/standalone mode only - does NOT affect browser rendering).
   Pushes the entire app shell (headers, screen-page, admin pages) below the iOS/Android
   status bar. Reuses the existing viewport-fit=cover (index.html) + display:standalone
   (manifest.webmanifest) setup, mirroring the existing bottom safe-area pattern used by
   .bottom-nav (env(safe-area-inset-bottom)). */
@media (display-mode: standalone) {
  .app-container {
    padding-top: env(safe-area-inset-top, 0px);
  }
}

/* App Header ("Clean White": weiss mit Trennlinie und leichtem Schatten wie .app-header im Mockup) */
.app-header {
  background: var(--chrome-bg);
  color: var(--chrome-text);
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--chrome-line);
  box-shadow: var(--chrome-shadow);
  flex-shrink: 0;
  /* Einheitliche Hoehe: Titel, "Auswaehlen" bzw. Zurueck-Pfeil vertikal zentriert in der gemeinsamen Headerhoehe -
     die Trennlinie liegt auf jeder Seite gleich. Mindesthoehe statt fester Hoehe, damit eine umbrechende Kopfzeile
     (sehr schmale Darstellung, siehe max-width: 300px) weiterhin vollstaendig sichtbar bleibt. */
  min-height: var(--app-header-height);
  display: flex;
  align-items: center;
}

.app-header > .app-header-row,
.app-header > .header-row {
  flex: 1 1 auto;
  min-width: 0;
}

.app-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.header-status-col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.app-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--chrome-text);
  letter-spacing: -0.3px;
}

.app-name span {
  color: var(--accent);
}

/* Header Row for Title + Resume Chip */
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Role Chip */
.role-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 1.25rem;
  font-weight: 600;
  flex-shrink: 0;
}

.role-technician {
  background: #dbeafe;
  color: #1e40af;
}

.role-tenantadmin {
  background: #fef3c7;
  color: #92400e;
}

.role-office {
  background: #e0e7ff;
  color: #3730a3;
}

.role-platformadmin {
  background: #f3e8ff;
  color: #6b21a8;
}

.role-unknown {
  background: #f3f4f6;
  color: #6b7280;
}

/* Sync Badge */
.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 1.25rem;
  font-weight: 600;
  margin-top: 3px;
  flex-shrink: 0;
}

.sync-ok {
  background: var(--success-soft);
  color: var(--success-soft-text);
}

.sync-pending {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.sync-error {
  background: var(--error-bg);
  color: var(--error-text);
}

/* Sync Status Dots */
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.dot-green {
  background: #22c55e;
}

.dot-yellow {
  background: #f59e0b;
  animation: pulse 1.5s infinite;
}

.dot-red {
  background: #ef4444;
}

/* Legacy dot classes (fallback) */
.sync-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  display: inline-block;
}

.sync-dot-green {
  background: var(--success);
}

.sync-dot-yellow {
  background: var(--warning);
  animation: pulse 1.5s infinite;
}

.sync-dot-red {
  background: var(--error);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Powered by Logo */
.powered-by {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 500;
}

.powered-by-logo {
  height: 18px;
  width: auto;
  object-fit: contain;
  opacity: 0.85;
}

/* CTA Section */
.cta-section {
  background: var(--bg-white);
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

/* Dashboard "Neuen Bericht aufnehmen" (einziger Verbraucher, Dashboard.razor) - Variante A "Politur"
   (mockup_aufnahme_button_redesign_v1.html): kompakter, weicher Teal-Schatten, Mikrofon-SVG 17 px. */
.btn-record-main {
  width: 100%;
  padding: 13px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 22px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 4px 14px rgba(43,110,102,0.28);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s;
}

.btn-record-main:hover {
  transform: translateY(-2px);
  background: var(--accent);
}

.btn-record-main::after {
  content: '';
  position: absolute;
  inset: 0;
  background: none;
  border-radius: inherit;
}

.btn-record-main.offline-mode {
  background: #64748b;
  box-shadow: 0 4px 16px rgba(100, 116, 139, 0.3);
}

.btn-record-main.offline-mode:hover {
  background: #475569;
}

.mic-icon-large {
  font-size: 1.5rem;           /* 24px - vorher 1.75rem (28px) */
}

/* Section Title */
.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1rem 1.5rem 0.625rem;
}

/* Pending Card */
/* Scrollbare Dashboard-Sektionen - volle Breite mit Innenabstand */
.scroll-section {
  width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

.pending-card {
  margin: 0 0 0.625rem;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.pending-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.pending-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--warning-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.pending-info {
  flex: 1;
}

.pending-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pending-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

/* Status Pills */
.status-pill {
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.25rem 0.625rem;
  border-radius: 1.25rem;
  white-space: nowrap;
}

.pill-pending {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.pill-done {
  background: var(--success-bg);
  color: var(--success-text);
}

.pill-processing {
  background: #ede9fe;
  color: #6d28d9;
}

.pill-review {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Report Card */
.report-card {
  margin: 0 0 0.625rem;
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.report-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: #dbeafe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.report-info {
  flex: 1;
}

.report-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.report-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.125rem;
}

.report-author {
  color: #94a3b8;
  font-weight: 600;
}

/* Bottom Navigation */
/* FIX (PWA Bottom-Nav zu hoch): Ueberschuessige Fest-Abstaende entfernt/verkleinert.
   env(safe-area-inset-bottom) bleibt unveraendert erhalten (Home-Indicator-Schutz auf iOS
   bleibt korrekt) - es wird ausschliesslich der zusaetzliche Abstand VOR der Safe-Area
   reduziert, nicht die Safe-Area selbst. */
.bottom-nav {
  background: var(--chrome-bg);
  border-top: 1px solid var(--chrome-line);
  /* Oben 4px statt 9px (Mockup): die fruehere Kompaktheits-Korrektur der PWA-Navigation bleibt verbindlich
     (BottomNavigationCompactHeightRegressionTests); unten wie im Mockup 4px vor der Safe-Area. */
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom, 0px));
  display: flex;
  justify-content: space-around;
  flex-shrink: 0;
  margin-top: auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* FIX (PWA Bottom-Nav zu hoch): line-height explizit gesetzt statt vom body (1.6) geerbt -
     bei 9px Schriftgroesse erzeugte 1.6 eine unnoetig hohe Zeilenbox (~14.4px) fuer eine
     einzeilige Beschriftung. 1.0 haelt das Label vollstaendig lesbar ohne Leerraum. */
  line-height: 1;
  color: var(--chrome-muted);
  padding: 3px 14px;
  border-radius: 0.75rem;
  cursor: pointer;
  font-size: 9.5px;
  font-weight: 700;
  gap: 4px;
  position: relative;
  /* Eintraege sind native Links (<a>): keine Unterstreichung, Farbe ausschliesslich aus diesen Regeln. */
  text-decoration: none;
  transition: color 0.2s;
}

/* Sichtbare Tastatur-Fokusmarkierung; Offset bleibt innerhalb des Navigations-Innenabstands (nicht abgeschnitten). */
.nav-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.nav-item:hover {
  color: var(--accent);
}

/* Aktiver Eintrag: nur Farbe und Punkt - kein gefuelltes Pill (Mockup .nav-item.active / .nav-dot). */
.nav-item.active {
  color: var(--accent);
}

/* Dekorativer Punkt oberhalb des aktiven Icons; absolut positioniert, daher kein Layoutsprung. */
.nav-dot {
  position: absolute;
  top: -2px;
  left: 50%;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
}

.nav-icon {
  font-size: 19px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

/* Sehr schmale Darstellung (z. B. 200 % Browserzoom auf 360 px): Navigation und Kopfzeile bleiben vollstaendig
   sichtbar - weniger Innenabstand der Eintraege, Kopfzeilen-Aktionen duerfen in eine zweite Zeile umbrechen. */
@media (max-width: 300px) {
  .nav-item {
    padding: 3px 6px;
  }

  .app-header-row,
  .app-header .header-row {
    flex-wrap: wrap;
  }
}

/* Dunkle Variante nur fuer die dunkle Aufnahme-Ansicht (BottomNavigation DarkMode) - Werte wie bisher. */
.bottom-nav.bottom-nav--dark {
  background: #0f172a;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-nav--dark .nav-item {
  color: #9aa3b2;
}

.bottom-nav--dark .nav-item:hover,
.bottom-nav--dark .nav-item.active {
  color: var(--accent-on-dark);
}

.bottom-nav--dark .nav-dot {
  background: var(--accent-on-dark);
}

.bottom-nav--dark .nav-item:focus-visible {
  outline-color: var(--accent-on-dark);
}

.nav-icon svg {
  display: block;
}

/* Offline Banner
   ✅ FORENSIK (Mockup v3): .offline-banner wird von Dashboard.razor nicht mehr verwendet - die
   Seite nutzt jetzt die kompakte .offline-banner-compact-Zeile (co-located Dashboard.razor.css,
   Tokens aus talk2form_offline_modus_mockup_v3.html). Die Regel bleibt zur Vermeidung von
   Nebenwirkungen auf andere, evtl. noch referenzierende alte Mockup-/Doku-Dateien bestehen, ist
   aber im produktiven UI-Fluss nicht mehr aktiv. */
.offline-banner {
  background: rgba(251, 146, 60, 0.1);
  color: #f97316;
  border-bottom: 1px solid rgba(251, 146, 60, 0.2);
  padding: 0.625rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.8125rem;
  font-weight: 600;
  animation: pulse-offline 2s ease-in-out infinite;
}

@keyframes pulse-offline {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

.offline-icon {
  font-size: 1rem;
  animation: rotate-icon 3s linear infinite;
}

@keyframes rotate-icon {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* Auth Page */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  background: var(--bg-darker);
}

.auth-container {
  width: 100%;
  max-width: 400px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.auth-header p {
  color: var(--text-muted);
}

.auth-form {
  background: var(--bg-white);
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-danger {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid var(--error);
}

/* Quick Management Card (TenantAdmin) */
.quick-mgmt-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.quick-mgmt-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.quick-mgmt-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
}

.quick-mgmt-info {
  flex: 1;
}

.quick-mgmt-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.quick-mgmt-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.quick-mgmt-arrow {
  font-size: 1.5rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Tenant Detail Card */
.tenant-detail-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin: 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.tenant-detail-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.tenant-detail-meta {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Seat Card */
.seat-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin: 0 0 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.seat-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #2563eb);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.seat-info {
  flex: 1;
  min-width: 0;
}

.seat-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.seat-role {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.status-pill-sm {
  padding: 0.25rem 0.5rem;
  border-radius: 0.75rem;
  font-size: 0.6875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.pill-active {
  background: #dcfce7;
  color: #15803d;
}

/* Plan Version Card */
.plan-version-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin: 0 1rem 1rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.plan-version-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.plan-version-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Responsive */
@media (min-width: 768px) {
  .app-container {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    /* Tablet hochkant: Rahmen 768 px (box-sizing: border-box - Rahmenlinien liegen innerhalb). */
    max-width: 768px;
  }
}

@media (min-width: 1024px) {
  .app-container {
    /* Tablet quer / Desktop: Rahmen max. 1072 px, zentriert (margin: 0 auto). */
    max-width: 1072px;
  }
}

/* Edge-to-edge override for specific screens (e.g., ReportReview) */
.app-container:has(.edge-to-edge) {
  max-width: 100%;
  margin: 0;
}

@media (min-width: 768px) {
  .app-container:has(.edge-to-edge) {
    border-left: none;
    border-right: none;
  }
}


/* ─────────────────────────────────────────────────────────────────────
   REPORT REVIEW (SCREEN 3) – Mockup-aligned styles
──────────────────────────────────────────────────────────────────── */

.review-header {
  background: #fff;
  padding: 10px 24px 8px;
  border-bottom: 1px solid #e2e8f0;
  border-radius: 0;
  box-shadow: none;
}

.review-title {
  font-size: 16px;
  font-weight: 700;
  color: #1a202c;
}

.review-subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 10px;
}

.photo-section {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  min-height: 0;
  height: auto;
}

.photo-section-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.photo-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.photo-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.photo-add {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 2px dashed #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #94a3b8;
  flex-shrink: 0;
  cursor: pointer;
}

.photos-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}

.review-sections {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  background: #f8fafc;
}

.scroll-fade::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(transparent, #f8fafc);
  pointer-events: none;
}

/* ✅ Forensische UI-Korrektur: .field-card/.field-label/.field-value/.field-empty/.field-missing/
   .missing-hint wurden hier entfernt. Diese Klassen werden ausschliesslich von
   ReportFieldCard.razor gerendert, das bereits eine eigene, CSS-isolierte Definition in
   ReportFieldCard.razor.css besitzt. Da diese globalen Regeln (mobile-design.css wird als
   letztes Stylesheet in index.html geladen) dieselben Klassennamen wie die isolierte
   Komponente verwendeten, ueberschrieben sie deren Styling vollstaendig (Icon/Typ-Kopfzeile,
   Mikrofon-Position etc. gingen verloren) - siehe Phase-4-Forensik-Befund.
*/

.review-actions {
  padding: 16px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
}

.skip-signature-link {
  text-align: center;
  padding: 0 16px 14px;
}

.link-button {
  background: transparent;
  border: none;
  font-size: 12px;
  color: #94a3b8;
  text-decoration: underline;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.link-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  flex: 2;
  padding: 16px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.btn-primary:hover:not(:disabled) {
  background: #2563eb;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  flex: 1;
  padding: 16px;
  background: #fff;
  color: #3b82f6;
  border: 2px solid #bfdbfe;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.btn-outline:hover {
  background: #eff6ff;
}

/* ═══════════════════════════════════════════════════════════════════
   ADDITIONAL REVIEW SCREEN STRUCTURE STYLES
════════════════════════════════════════════════════════════════════ */

/* Container Structure - THIS IS CRITICAL */
.report-review-page {
  width: 100%;
  max-width: 375px;
  margin: 0 auto;
  background: #f8fafc;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.review-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #f8fafc;
}

/* Step Progress Bar */
.step-progress {
  display: flex;
  gap: 6px;
  background: transparent;
  margin-top: 10px;
}

.step-seg {
  flex: 1;
}

.step-bar {
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
}

.step-bar.done,
.step-bar.active {
  background: #3b82f6;
}

/* Fortschritt der Unterseiten "Bericht pruefen" und "Unterschrift" (Mockup .header-progress) als eigenes Band direkt
   unter der Header-Trennlinie, damit die Linie auf allen Seiten gleich liegt (--app-header-height). Farben und Abstaende
   wie bisher im Header (12 px ueber dem Balken, 14 px darunter). Bewusst nur hier: die gleichnamigen .step-bar-Schritte
   im Dashboard-Content und die dunkle Aufnahme-Ansicht (.on-dark) bleiben unveraendert. */
.header-progress-band {
  background: var(--chrome-bg);
  padding: 12px 18px 14px;
  border-bottom: 1px solid var(--chrome-line);
  box-shadow: var(--chrome-shadow);
  flex-shrink: 0;
}

.header-progress-band .step-progress {
  gap: 5px;
  margin-top: 0;
}

/* Segmente ueber die volle Breite wie im Mockup; die Begrenzung der Dashboard-Schritte (app.css .step-seg) gilt hier nicht. */
.header-progress-band .step-seg {
  max-width: none;
}

.header-progress-band .step-bar {
  background: #e6e6e2;
}

.header-progress-band .step-bar.done,
.header-progress-band .step-bar.active {
  background: var(--accent);
}

/* Dark header for Recording screen */
.dark-header {
  background: #0f172a;
  padding: 10px 24px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.back-btn {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: #e2e8f0;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
}

.dark-title {
  font-size: 16px;
  font-weight: 700;
  color: #e2e8f0;
}

/* Step-bar override for dark background */
.on-dark .step-bar {
  background: rgba(255,255,255,0.18);
}

.on-dark .step-bar.done,
.on-dark .step-bar.active {
  background: #3b82f6;
}

/* ─── SCREEN 2: RECORDING ─── */
.recording-screen {
  background: #0f172a;
  flex: 1;
  min-height: 0;              /* FIX: Allows flex child to shrink below content size */
  overflow: hidden;           /* FIX: Prevents entire screen from scrolling */
  display: flex;
  flex-direction: column;
  color: #fff;
}

.recording-scroll-content {
  flex: 1;
  min-height: 0;              /* CRITICAL: Allows scrolling when content overflows */
  overflow-y: auto;
  padding: 20px 24px;         /* Reduced from 32px to 20px per reference */
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.recording-hint {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #94a3b8;
  text-align: center;
  width: 100%;
  flex-shrink: 0;
}

.recording-hint em,
.recording-hint strong {
  font-style: normal;
  font-weight: 600;
  color: #e2e8f0;
}

.waveform-area {
  width: 100%;
  height: 80px;
  background: rgba(255,255,255,0.04);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0 20px;
  overflow: hidden;
  flex-shrink: 0;
}

/* Dock Waveform (NEW - compact version for the fixed dock) */
.dock-waveform-area {
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
}

.dock-wave-bar {
  width: 2.5px;
  border-radius: 2px;
  background: #3b82f6;
  opacity: 0.85;
  transition: height 0.1s ease;
}

.recording-action-dock {
  width: 100%;                /* CRITICAL: Ensures full width */
  flex-shrink: 0;              /* CRITICAL FIX (State-Shift): Dock ist jetzt Geschwister
                                   von .recording-scroll-content (nicht mehr dessen Kind),
                                   damit seine Position unabhaengig vom Scroll-Inhalt und
                                   dessen Overflow-Zustand ist. margin-top:auto wurde
                                   entfernt, weil es bei ueberlaufendem Scroll-Inhalt
                                   (z. B. Fehlermeldung + viele Tracks + Audio-Player
                                   gleichzeitig sichtbar) seine Wirkung verliert und der
                                   Dock dann faelschlich mit dem Content mitrutscht (siehe
                                   RecordingDockLayoutProof, Zustand "worst-combo" bei
                                   kleinen Viewports). Als eigenstaendiges Flex-Kind von
                                   .recording-screen bleibt der Dock bei JEDEM Scroll-
                                   Zustand am unteren Rand fixiert; nur eine echte
                                   Aenderung der verfuegbaren Viewport-Hoehe (dvh) darf ihn
                                   verschieben - das ist weiterhin gewolltes Verhalten. */
  background: #0f172a;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 12px 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.mic-button-wrap {
  position: relative;
  margin-bottom: 0;
}

.mic-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(161,63,53,0.3);
  animation: ring-pulse 1.5s ease-out infinite;
}

.mic-ring-2 {
  position: absolute;
  inset: -16px;
  border-radius: 50%;
  border: 2px solid rgba(161,63,53,0.15);
  animation: ring-pulse 1.5s ease-out infinite 0.5s;
}

@keyframes ring-pulse {
  0% { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

.mic-button-active {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 24px rgba(43,110,102,0.5);
  cursor: pointer;
  position: relative;
  z-index: 1;
  border: none;
}

.mic-button-active.mic-button-recording {
  background: var(--danger);
  box-shadow: 0 0 24px rgba(161,63,53,0.5);
}

.mic-plus-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-on-dark);
  color: #1a202c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  border: 2px solid #0f172a;
  z-index: 2;
}

.recording-caption {
  font-size: 13px;
  color: #64748b;
  text-align: center;
  width: 100%;
}

/* C2-FIX (nur Layout): Fester Slot fuer Caption + Chip, damit .recording-action-dock in allen
   3 Aufnahme-Zustaenden dieselbe Gesamthoehe hat (margin-top:auto verankert den Dock sonst je
   nach Anzahl sichtbarer Zeilen unterschiedlich hoch). min-height reserviert immer den Platz
   fuer die maximal moegliche Auspraegung (Caption-Zeile + Chip-Zeile), auch wenn im
   Recording-Zustand beide Kinder gar nicht gerendert werden. Keine neue Logik, nur
   Layout-Reservierung. */
.recording-caption-slot {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 44px;
  justify-content: center;
}

.recording-caption.recording-caption-accent {
  color: var(--accent-on-dark);
  font-weight: 600;
}

.recording-count-chip {
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
  width: 100%;
}

.recording-timer {
  font-size: 19px;
  font-weight: 200;
  letter-spacing: 0.04em;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}

.recording-timer-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;                /* Ensures full width alignment */
  justify-content: center;    /* Centers timer horizontally */
}

.recording-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rec-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.dock-actions-row {
  display: flex;
  gap: 10px;
  width: 100%;
  align-items: stretch;       /* Ensures buttons take full height */
}

.btn-icon-secondary-dark {
  min-width: 110px;           /* Reduced from 118px to 110px per reference */
  width: auto;
  white-space: nowrap;
  flex-shrink: 0;
  border-radius: 14px;        /* Reduced from 16px to 14px per reference */
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;            /* Reduced from 14px to 13px per reference */
  font-weight: 600;
  padding: 0 14px;            /* Reduced from 16px to 14px per reference */
  cursor: pointer;
  line-height: 1;
  height: 48px;               /* Fixed height: 48px */
}

.btn-secondary {
  flex: 1;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: #94a3b8;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.btn-primary-large-dark {
  flex: 1;
  border-radius: 14px;        /* Reduced from 16px to 14px per reference */
  background: #fff;
  color: #1a202c;
  font-size: 13px;            /* Reduced from 14px to 13px per reference */
  font-weight: 700;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;            /* Reduced from 16px to 14px per reference */
  cursor: pointer;
  border: none;
  line-height: 1;
  height: 42px;
}

.btn-primary-large-dark.btn-primary-accent {
  background: var(--accent);
  color: #fff;
}

.btn-stop {
  flex: 2;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  color: #1a202c;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Ensure review-actions stays at bottom */
.review-actions {
  flex-shrink: 0;
}

/* Loading/Error/Warning States */
.loading-state,
.error-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: #f8fafc;
  text-align: center;
  gap: 16px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-icon {
  font-size: 64px;
}

.loading-state h2,
.error-state h2 {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin: 0;
}

.loading-state p,
.error-state p {
  font-size: 15px;
  color: #64748b;
  margin: 0;
}

.warning-box,
.info-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 14px;
  padding: 16px;
  margin: 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  flex-shrink: 0;
}

.info-box {
  background: #eff6ff;
  border-color: #93c5fd;
}

.warning-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.warning-content {
  flex: 1;
}

.warning-content strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}

.warning-content p {
  font-size: 14px;
  color: #78350f;
  margin: 0;
}

/* Document Generation Section */
.document-generation-section {
  background: #fff;
  padding: 16px;
  border-top: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.section-title {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.generated-docs-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.doc-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-info {
  flex: 1;
}

.doc-type {
  font-size: 14px;
  font-weight: 700;
  color: #1a202c;
}

.doc-date {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 2px;
}

.doc-actions {
  display: flex;
  gap: 8px;
}

.btn-outline-sm {
  padding: 8px 12px;
  background: #fff;
  color: #3b82f6;
  border: 1.5px solid #bfdbfe;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-outline-sm:hover {
  background: #eff6ff;
}

/* Deaktiviert (z. B. "Lizenz uebertragen" ohne geeigneten Empfaenger) - gleiches Muster wie .btn-danger-sm:disabled. */
.btn-outline-sm:disabled,
.btn-outline-sm:disabled:hover {
  background: #fff;
  opacity: 0.5;
  cursor: not-allowed;
}

.save-error {
  background: #fee2e2;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 16px;
  font-size: 14px;
  color: #991b1b;
  text-align: center;
  flex-shrink: 0;
}

/* ================================================================
   GENERIC SCREEN ARCHITECTURE (Top / Content / Bottom)
   Used by all 5 mobile screens: Dashboard, Recording, Review, Export, Offline
   ================================================================ */

/* Main screen container - fixed viewport height, no body scroll */
.screen-page {
  height: 100vh;                /* Fallback for browsers without dvh support */
  height: 100dvh;               /* Use dynamic viewport height for mobile (must come last to win the cascade) */
  display: flex;
  flex-direction: column;
  overflow: hidden;            /* Page itself never scrolls */
  background: #f9f9f7;
}

/* Dark variant for Recording + Offline screens */
.screen-page--dark {
  background: var(--bg-darker);
}

/* Top section - fixed, always visible */
.screen-top {
  flex-shrink: 0;              /* Never compress */
  z-index: 10;                 /* Stay above content */
}

/* Content section - scrollable area */
.screen-content {
  flex: 1;                     /* Take all remaining space */
  min-height: 0;               /* Critical: allows flex child to overflow */
  overflow-y: auto;            /* Only content scrolls */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}

/* Content scroll behavior variants */
.screen-content--no-padding {
  padding: 0;
}

/* Override for recording screen: disable scroll on outer container */
.screen-content--no-scroll {
  overflow: hidden;           /* Fix: allows inner .recording-screen flex column to work properly */
  display: flex;              /* CRITICAL: Makes this a flex container so child flex:1 works */
  flex-direction: column;     /* CRITICAL: Allows .recording-screen to stretch vertically */
}

.screen-content--with-padding {
  padding: 16px;
}

/* Bottom section - fixed, always visible */
.screen-bottom {
  flex-shrink: 0;              /* Never compress */
  z-index: 10;                 /* Stay above content */
}

/* ================================================================
   USAGE RULES (for developers):

   1. Every mobile screen MUST use this structure:
      <div class="screen-page [screen-page--dark]">
        <div class="screen-top">...</div>
        <div class="screen-content [modifiers]">...</div>
        <div class="screen-bottom">...</div>
      </div>

   2. NEVER add overflow/scroll to .screen-page or body
   3. ONLY .screen-content scrolls
   4. Top and Bottom are ALWAYS visible (sticky)
   5. Content height adapts to available space
   ================================================================ */

/* ═══════════════════════════════════════════════════════════════════
   TABLET-LAYOUT der WebApp (nur Anordnung, Stil unveraendert)
   Vorlage: talk2form-webapp-tablet-mockup.html
   - Rahmen: 768 px ab 768 px Viewport, max. 1072 px ab 1024 px (siehe .app-container oben).
   - Nur Klassen tb-*; alle Layoutregeln stehen ausschliesslich in min-width-Media-Queries.
   - Die tb-*-Huellen sind unterhalb von 768 px mit display: contents transparent
     (keine eigene Box, Kinder bleiben Kinder des bisherigen Elternelements).
   - Alle Regeln sind unter .app-container verankert (AdminLayout/.admin-frame nutzt ihn nicht).
═══════════════════════════════════════════════════════════════════ */
.tb-grid2,
.tb-st,
.tb-col,
.tb-toolbar {
  display: contents;
}

/* Ab 768 px (Tablet hochkant und breiter): Listen und Kacheln zweispaltig */
@media (min-width: 768px) {
  .app-container .tb-grid2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
  }

  .app-container .tb-grid2 > .tb-span {
    grid-column: 1 / -1;
  }

  /* Bericht Details: Abstand wie der bisherige Spaltenabstand (.export-screen gap) */
  .app-container .tb-grid2.tb-gap12 {
    row-gap: 12px;
  }

  /* Konto: Profil links, Einstellungen rechts */
  .app-container .tb-grid2 > .tb-col {
    display: block;
    min-width: 0;
  }

  /* Berichte: Suche und Zeitfilter in einer Zeile */
  .app-container .tb-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
  }

  .app-container .tb-toolbar .search-bar {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
  }

  .app-container .tb-toolbar .filter-chips {
    margin-bottom: 0;
  }

  /* Mitarbeiter: Titel links, "Mitarbeiter einladen" rechts oben, Liste darunter */
  .app-container .tb-emp {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
    align-items: center;
  }

  .app-container .tb-emp > .tb-emp-title {
    grid-column: 1;
    grid-row: 1;
  }

  .app-container .tb-emp > .tb-emp-invite {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    margin: 0 0 8px;
    padding: 12px 22px;
  }

  .app-container .tb-emp > .tb-emp-list {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .app-container .tb-emp > .tb-emp-note {
    grid-column: 1 / -1;
  }

  /* Bericht pruefen: Felder zweispaltig (Listenfelder ueber die volle Breite) */
  .app-container .review-sections.tb-review {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px 16px;
    align-content: start;
    align-items: start;
  }

  .app-container .review-sections.tb-review > .tb-span {
    grid-column: 1 / -1;
  }

  /* Bericht pruefen: Aktionsleiste rechtsbuendig, Buttons in normaler Breite */
  .app-container .tb-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 16px;
    align-items: center;
  }

  .app-container .tb-bar > .action-row {
    grid-column: 2;
    grid-row: 1;
  }

  .app-container .tb-bar > .skip-link-refined {
    grid-column: 1;
    grid-row: 1;
    margin-top: 0;
    width: auto;
    justify-self: start;
  }

  .app-container .tb-bar > .save-error {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .app-container .tb-bar .btn-primary-large {
    flex: 0 0 auto;
    min-width: 300px;
  }

  /* Unterschrift: Aktionsleiste rechtsbuendig */
  .app-container .tb-foot {
    justify-content: flex-end;
  }

  .app-container .tb-foot .sig-btn {
    flex: 0 0 auto;
    min-width: 180px;
  }

  .app-container .tb-foot .sig-btn-accent {
    min-width: 300px;
  }

  /* Aufnahme: Buttons in normaler Breite, als Gruppe auf der Achse von Mikrofon und Timer */
  .app-container .tb-rec .dock-actions-row {
    justify-content: center;
  }

  .app-container .tb-rec .dock-actions-row .btn-primary-large-dark {
    flex: 0 0 auto;
    min-width: 300px;
  }
}

/* Ab 1024 px (Tablet quer): Nebeneinander-Anordnungen */
@media (min-width: 1024px) {
  .app-container .tb-st {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
  }

  .app-container .tb-st > .tb-col {
    display: block;
    min-width: 0;
  }

  /* Unterschrift: PDF/Hinweis/Name links, Unterschriftsfeld rechts */
  .app-container .tb-sign > .tb-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  /* Dashboard: Formular-Auswahl und "Neuen Bericht aufnehmen" nebeneinander */
  .app-container .tb-cta {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .app-container .tb-cta .form-chip {
    flex: 1;
    margin-bottom: 0;
  }

  /* flex-basis 44px (border-box) = bisheriger nicht-flexibler Anteil des Buttons (horizontales Padding 2 x 22 px vor
     Variante A). Bei flex-basis 0 verteilt der Browser den freien Platz gleich auf die Inhaltsboxen; das kompaktere
     Padding (2 x 13 px) haette sonst die Formular-Karte verbreitert. So bleibt die Aufteilung bei jeder Tablet-Breite
     wie bisher und der Button fuellt weiterhin den Rest der Zeile. */
  .app-container .tb-cta .btn-record-main {
    flex: 1 1 44px;
    width: auto;
  }

  /* Aufnahme: Hinweis links, Mikrofon und Timer rechts */
  .app-container .tb-rec {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .app-container .tb-rec > .recording-action-dock {
    border-top: 0;
    min-height: 0;
  }

  /* Mikrofon/Timer mittig in der Spalte, Buttons am unteren Rand; Hinweis mittig neben dem Mikrofon */
  .app-container .tb-rec .mic-button-wrap {
    margin-top: auto;
  }

  .app-container .tb-rec .dock-actions-row {
    margin-top: auto;
  }

  .app-container .tb-rec .recording-hint {
    margin-block: auto;
  }
}
