/* ==========================================================================
   BELEGTRESOR DESIGN SYSTEM 2.0 — EDITORIAL KANZLEI-EDITION
   Swiss/German FinTech & Steuerkanzlei Precision (Light-First)
   Strictly Zero CDN / Offline First / CSP connect-src 'none' Compatible
   ========================================================================== */

:root {
  color-scheme: light;

  /* Hintergrund & Kanzlei-Arbeitsflächen (Warm Archival Paper) */
  --bg: #FAF9F6;
  --surface: #FFFFFF;
  --surface-alt: #F4F5F2;
  --surface-hover: #ECEEEA;

  /* Grenzen & Haarlinien */
  --border: #DCDFD9;
  --border-strong: #C5CAC2;
  --border-focus: #0F5132;

  /* Typografische Tinte */
  --text: #182026;
  --text-muted: #4A5562;
  --text-faint: #6B7785;

  /* Primär-Akzent: Kanzlei-Tannengrün */
  --brand: #0F5132;
  --brand-hover: #0B3D26;
  --brand-soft: #ECF5F0;
  --brand-border: #B9DCC7;
  --brand-on: #FFFFFF;

  /* Trojaner-Alarm: Ruhiges Kanzlei-Burgund (kein grelles Warnrot) */
  --danger: #9B1C1C;
  --danger-strong: #7F1D1D;
  --danger-bg: #FEF2F2;
  --danger-border: #F5C2C2;

  /* Schema-Warnungen & KoSIT-Prüfung */
  --warn: #9A6700;
  --warn-bg: #FFFBEB;
  --warn-border: #FEEA9F;

  /* Erfolgszustände & GoBD-Freigaben */
  --ok: #0F5132;
  --ok-bg: #EAF4EE;
  --ok-border: #B7DFC8;

  /* Info & Meta */
  --info: #1D5C8A;
  --info-bg: #F0F7FC;
  --info-border: #C2E0F5;

  /* Typografie Stacks (100 % lokal, 0 Byte Netzwerk) */
  --font-serif: "Iowan Old Style", "Palatino Linotype", "URW Palladio L", P052, Georgia, "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Menlo, Monaco, Consolas, monospace;

  /* Schatten & Haptik */
  --shadow-sm: 0 1px 2px rgba(24, 32, 38, 0.04);
  --shadow-card: 0 1px 3px rgba(24, 32, 38, 0.05), 0 4px 12px rgba(24, 32, 38, 0.02);
  --shadow-raised: 0 8px 24px rgba(24, 32, 38, 0.06), 0 2px 6px rgba(24, 32, 38, 0.03);

  /* Zurückhaltende Radien (Kanzlei-Klassik) */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* Dark Mode (Ausschließlich wenn explizit vom Nutzer gewählt) */
:root:has(> head > meta[name="color-scheme"][content="dark"]),
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #11171E;
  --surface: #18222C;
  --surface-alt: #1F2C38;
  --surface-hover: #263645;
  --border: #2C3E50;
  --border-strong: #3E546B;
  --border-focus: #2ECC71;

  --text: #F4F7F9;
  --text-muted: #9EAFBF;
  --text-faint: #6D8296;

  --brand: #2ECC71;
  --brand-hover: #27AE60;
  --brand-soft: #143324;
  --brand-border: #1E5C3B;
  --brand-on: #0B1912;

  --danger: #FF6B6B;
  --danger-strong: #FF5252;
  --danger-bg: #381A1C;
  --danger-border: #6B272B;

  --warn: #F1C40F;
  --warn-bg: #332B14;
  --warn-border: #635219;

  --ok: #2ECC71;
  --ok-bg: #143324;
  --ok-border: #1E5C3B;

  --info: #5DADE2;
  --info-bg: #152736;
  --info-border: #244763;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-raised: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* Base Reset & Box-Sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  width: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  width: 100%;
}

:target {
  scroll-margin-top: 4.5rem;
}

/* Typografie */
h1, h2, h3, h4 {
  color: var(--text);
  margin: 0 0 10px;
  font-feature-settings: "kern" 1, "liga" 1;
  overflow-wrap: break-word;
}

h1 {
  font-family: var(--font-serif);
  font-size: 2.125rem;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.015em;
  hyphens: none;
}

.no-break {
  white-space: nowrap;
}

h2 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.01em;
}

h3 {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  line-height: 1.4;
  font-weight: 600;
}

p {
  margin: 0 0 12px;
  overflow-wrap: break-word;
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  text-decoration: underline;
  color: var(--brand-hover);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

/* Layout Container */
.container {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 20px 36px;
  flex: 1;
}

/* Header & Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-icon svg {
  width: 100%;
  height: 100%;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  display: block;
  line-height: 1.2;
}

.brand-sub {
  font-family: var(--font-sans);
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--text-muted);
  display: block;
  line-height: 1.2;
  margin-top: 2px;
}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.nav-link {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: var(--radius-xs);
  transition: color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: var(--surface-alt);
  text-decoration: none;
}

.nav-link[aria-current="page"] {
  color: var(--brand);
  font-weight: 700;
  background: var(--brand-soft);
  box-shadow: inset 0 -2px 0 var(--brand);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.trust-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent);
}

/* Theme Toggle Icons */
.theme-icon-dark {
  display: none;
}
.theme-icon-light {
  display: inline-block;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-dark,
[data-theme="dark"] .theme-icon-dark {
  display: inline-block;
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-icon-light,
[data-theme="dark"] .theme-icon-light {
  display: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  white-space: normal;
  word-break: normal;
}

.btn:hover {
  background: var(--surface-alt);
  border-color: var(--border-strong);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-on);
  border-color: var(--brand-hover);
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: var(--brand-on);
}

.btn-cta {
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 25%, transparent);
  text-align: center;
  white-space: normal !important;
  line-height: 1.35;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: var(--danger-border);
}

.btn-danger:hover {
  background: var(--danger);
  color: #FFFFFF;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  line-height: 1.3;
  white-space: nowrap;
}

.badge-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}

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

.badge-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid var(--warn-border);
}

.badge-info {
  background: var(--info-bg);
  color: var(--info);
  border: 1px solid var(--info-border);
}

/* Hero Section (Above the fold 2-column Kanzlei-Prüftisch) */
.hero {
  margin-bottom: 32px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: start;
  margin-bottom: 28px;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hero-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
  overflow-wrap: break-word;
}

.hero-lead {
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* The Archival Dropzone */
.dropzone {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  margin-top: 4px;
}

.dropzone-inner {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  padding: 22px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all 0.15s ease;
}

.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--brand-border);
}

.dropzone:hover .dropzone-inner,
.dropzone:focus-visible .dropzone-inner {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.dropzone.dragover {
  border-color: var(--brand);
}

.dropzone.dragover .dropzone-inner {
  background: var(--brand-soft);
  border-color: var(--brand);
  border-style: solid;
}

.dropzone-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.dropzone-text-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
}

.dropzone-title {
  font-size: 1.0rem;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: break-word;
}

.dropzone-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  overflow-wrap: break-word;
}

/* Hero CTA Strip */
.hero-cta-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.hero-cta-hint {
  font-size: 0.8rem;
  color: var(--text-faint);
  font-weight: 500;
}

/* Right Column: Hero Visual Card */
.hero-right {
  display: flex;
  flex-direction: column;
}

.hero-visual-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-visual-img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  display: block;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.hero-trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.trust-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.76rem;
  line-height: 1.3;
}

.trust-check {
  color: var(--ok);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.trust-item strong {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.trust-item span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

/* Samples Section (Cards Grid) */
.samples-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.samples-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.samples-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.samples-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 2px 0 0;
}

.samples-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.sample-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.sample-card:hover {
  background: var(--surface);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.sample-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.sample-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.sample-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.sample-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kpi-card.kpi-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.kpi-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

/* Panels (General White Card Container) */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0;
}

.panel-body {
  padding: 18px;
}

/* Workspace Master-Detail Grid */
.workspace-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

.invoice-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 520px;
  overflow-y: auto;
}

.invoice-item {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background-color 0.1s ease;
}

.invoice-item:hover {
  background: var(--surface-hover);
}

.invoice-item[aria-current="true"] {
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
}

.invoice-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.invoice-name {
  font-size: 0.86rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.invoice-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Trojaner Alarm Banner */
.trojan-banner {
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 18px;
}

.trojan-banner.danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}

.trojan-banner.safe {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
}

/* Tables & Cells */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: 16px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

th, td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--surface-alt);
  font-size: 0.76rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-hover);
}

.mismatch-cell {
  background: var(--danger-bg) !important;
  color: var(--danger) !important;
  font-weight: 700;
}

/* Issue Cards */
.issue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.issue-card {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.issue-card.error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}

.issue-card.warning {
  background: var(--warn-bg);
  border-color: var(--warn-border);
}

.issue-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.issue-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--border);
}

.issue-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.issue-msg {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0 0 4px;
}

.issue-fix {
  font-size: 0.82rem;
  color: var(--text);
  margin: 0;
  background: var(--surface);
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

/* Metadata Grid */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 0 0 16px;
}

.meta-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.meta-box dt {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 2px;
}

.meta-box dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

/* DATEV Console Controls */
.datev-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea {
  padding: 7px 10px;
  font-size: 0.86rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--border-focus);
}

.code-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  overflow-x: auto;
  max-height: 240px;
  margin: 8px 0 16px;
  white-space: pre;
}

/* Export Bar */
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.export-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Status Messages */
.status-msg {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.status-msg.ok {
  background: var(--ok-bg);
  border: 1px solid var(--ok-border);
  color: var(--ok);
}

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

/* Native Modal Dialog */
dialog {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 0;
  background: var(--surface);
  color: var(--text);
  max-width: 600px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-raised);
}

dialog::backdrop {
  background: rgba(24, 32, 38, 0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.dialog-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-alt);
}

.dialog-head h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 0;
}

.dialog-body {
  padding: 20px;
}

.dialog-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.pro-list {
  margin: 8px 0 16px;
  padding-left: 20px;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 20px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: auto;
  width: 100%;
}

.footer-row {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-secondary {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-faint);
}

.footer-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--text-muted);
}

.footer-nav a:hover {
  color: var(--text);
}

/* Workflow & Pricing Sections (Kanzlei Editorial 2.0) */
.workflow-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  margin-top: 28px;
}

.workflow-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 28px;
}

.workflow-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 4px 0 6px;
}

.workflow-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.workflow-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.step-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.step-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Pricing Section */
.pricing-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 36px 28px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
  margin-bottom: 32px;
}

.pricing-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 32px;
}

.pricing-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  margin: 4px 0 6px;
}

.pricing-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
  align-items: stretch;
  max-width: 960px;
  margin: 0 auto;
}

.pricing-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface-alt);
  position: relative;
}

.pricing-card.pro-card {
  background: var(--surface);
  border: 2px solid var(--brand);
  box-shadow: var(--shadow-raised);
}

.pricing-badge-popular {
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--brand);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 12px;
  border-radius: 12px;
}

.pricing-card-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pricing-tier-name {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 4px 0 0;
  color: var(--text);
}

.pricing-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin: 4px 0;
}

.price-val {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}

.free-card .price-val {
  color: var(--text);
}

.price-period {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.pricing-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

.pricing-features li {
  position: relative;
  padding-left: 22px;
  line-height: 1.45;
}

.pricing-features li .p-check,
.pricing-features li .p-cross {
  position: absolute;
  left: 0;
  top: 1px;
}

.p-check {
  color: var(--ok);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  line-height: 1.2;
}

.p-cross {
  color: var(--text-faint);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
  line-height: 1.2;
}

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

.pricing-card-action {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.w-100 {
  width: 100%;
}

.pricing-guarantee {
  font-size: 0.72rem;
  color: var(--text-faint);
  text-align: center;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .workspace-grid {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .samples-grid {
    grid-template-columns: 1fr;
  }
  .meta-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .workflow-grid {
    grid-template-columns: 1fr;
  }
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
}

@media (max-width: 768px) {
  .topbar-nav {
    display: none;
  }
  .topbar-inner {
    flex-wrap: nowrap;
    padding: 8px 14px;
    gap: 8px;
  }
  .brand-sub {
    display: none;
  }
  .topbar-actions {
    width: auto;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .trust-pill {
    display: none;
  }
  .btn-sm {
    font-size: 0.72rem;
    padding: 4px 7px;
    flex-shrink: 0;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 14px 12px 32px;
  }
  h1 {
    font-size: 1.35rem;
    line-height: 1.25;
    hyphens: none !important;
  }
  h2 {
    font-size: 1.2rem;
  }
  .hero-kicker {
    font-size: 0.70rem;
    line-height: 1.3;
  }
  .hero-lead {
    font-size: 0.90rem;
    line-height: 1.45;
  }
  .chip {
    font-size: 0.72rem;
    padding: 3px 7px;
    white-space: normal;
  }
  .hero-cta-strip {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-cta {
    width: 100%;
    font-size: 0.88rem;
    padding: 11px 14px;
    white-space: normal !important;
  }
  .dropzone {
    padding: 4px;
  }
  .dropzone-inner {
    padding: 14px 12px;
    gap: 12px;
  }
  .dropzone-icon-wrap {
    width: 38px;
    height: 38px;
  }
  .dropzone-icon-wrap svg {
    width: 24px;
    height: 24px;
  }
  .dropzone-title {
    font-size: 0.88rem;
    line-height: 1.3;
  }
  .dropzone-sub {
    font-size: 0.74rem;
    line-height: 1.35;
  }
  .hero-visual-card {
    padding: 8px;
  }
  .hero-trust-strip {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }
  .meta-grid {
    grid-template-columns: 1fr;
  }
  .export-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .export-actions {
    flex-direction: column;
  }
  .export-actions .btn {
    width: 100%;
  }
}

/* ==========================================================================
   FLAGSHIP v2.0 — DEMO MODE, SPLIT-SCREEN INSPECTOR, EDITABLE DATEV & GUIDES
   ========================================================================== */

.results-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-sub-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.meta-sub {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.hash-preview {
  font-size: 0.78rem;
  word-break: break-all;
}

.detail-head-meta {
  min-width: 0;
}

.detail-head-meta h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.btn-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok-border);
}

.btn-ok:hover {
  background: var(--ok);
  color: #FFFFFF;
}

.btn-print {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--brand-border);
}

.btn-print:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-hover);
}

/* ?demo=1 Compact Interactive Stage */
body.demo-compact .hero {
  display: none;
}

body.demo-compact .container {
  padding-top: 12px;
}

body.demo-compact .kpi-card {
  padding: 10px 14px;
}

body.demo-compact .kpi-value {
  font-size: 1.24rem;
}

body.demo-compact .panel-header {
  padding: 11px 16px;
}

body.demo-compact .panel-body {
  padding: 14px 16px;
}

.demo-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  margin-bottom: 12px;
  background: var(--surface);
  border: 1px solid var(--brand-border);
  border-left: 3.5px solid var(--brand);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}

.demo-mode-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-mode-text {
  font-size: 0.84rem;
  color: var(--text);
}

.demo-mode-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.invoice-item-trojan[aria-current="true"] {
  background: var(--danger-bg);
  border-left: 3px solid var(--danger);
}

/* Interactive Split-Screen Invoice Inspector ("Druck-PDF vs. XML-Wahrheit") */
.split-inspector-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
  margin-bottom: 16px;
}

.split-inspector-wrap.tone-danger {
  border-color: var(--danger-border);
}

.split-inspector-wrap.tone-ok {
  border-color: var(--ok-border);
}

.split-inspector-wrap.tone-warn {
  border-color: var(--warn-border);
}

.split-verdict-bar {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.tone-danger .split-verdict-bar {
  background: var(--danger-bg);
  border-bottom-color: var(--danger-border);
}

.tone-ok .split-verdict-bar {
  background: var(--ok-bg);
  border-bottom-color: var(--ok-border);
}

.tone-warn .split-verdict-bar {
  background: var(--warn-bg);
  border-bottom-color: var(--warn-border);
}

.split-verdict-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.split-verdict-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-xs);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.tone-danger .split-verdict-icon {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.tone-ok .split-verdict-icon {
  background: color-mix(in srgb, var(--ok) 12%, var(--surface));
  color: var(--ok);
  border: 1px solid var(--ok-border);
}

.tone-warn .split-verdict-icon {
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  color: var(--warn);
  border: 1px solid var(--warn-border);
}

.split-verdict-title {
  font-family: var(--font-serif);
  font-size: 1.04rem;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.3;
}

.tone-danger .split-verdict-title {
  color: var(--danger-strong);
}

.tone-ok .split-verdict-title {
  color: var(--ok);
}

.tone-warn .split-verdict-title {
  color: var(--warn);
}

.split-verdict-sub {
  margin: 0;
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.split-verdict-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.delta-pill {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  color: var(--danger-strong);
  border: 1px solid var(--danger-border);
  white-space: nowrap;
}

.verdict-stamp {
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.stamp-danger {
  background: var(--surface);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

.stamp-ok {
  background: var(--surface);
  color: var(--ok);
  border: 1px solid var(--ok-border);
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  gap: 0;
  padding: 12px;
  align-items: stretch;
}

.split-pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pane-xml-danger {
  border-color: var(--danger-border);
}

.pane-xml-ok {
  border-color: var(--ok-border);
}

.split-pane-head {
  padding: 10px 13px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pane-xml-danger .split-pane-head {
  background: var(--danger-bg);
  border-bottom-color: var(--danger-border);
}

.split-pane-title-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.pane-eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.pane-xml-danger .pane-eyebrow {
  color: var(--danger);
}

.pane-heading {
  font-family: var(--font-serif);
  font-size: 0.96rem;
  color: var(--text);
}

.pane-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.invoice-paper,
.xml-truth-sheet {
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.paper-letterhead {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}

.paper-seller {
  font-weight: 700;
  color: var(--text);
  font-size: 0.85rem;
}

.paper-addr {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 1px;
}

.paper-doc-meta {
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.paper-lines {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 7px 10px;
}

.paper-lines-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  margin-bottom: 4px;
}

.paper-lines ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.paper-lines li {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.xml-meta-bar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--border);
}

.xml-meta-k {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 600;
}

.xml-meta-v {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
}

.text-danger {
  color: var(--danger) !important;
}

.xml-fiscal-mini {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 7px 9px;
}

.xml-fiscal-mini div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.xml-fiscal-mini span {
  font-size: 0.68rem;
  color: var(--text-faint);
  font-weight: 600;
}

.xml-fiscal-mini strong {
  font-size: 0.8rem;
  color: var(--text);
}

.compare-field {
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.compare-field.field-pdf-ref {
  background: var(--surface-alt);
  border-color: var(--border-strong);
}

.compare-field.field-ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
}

.compare-field.field-mismatch {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-left: 3px solid var(--danger);
}

.compare-field-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.compare-field-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.field-mismatch .compare-field-label {
  color: var(--danger-strong);
}

.compare-field-tag {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.ok-pill {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ok);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  background: var(--surface);
  border: 1px solid var(--ok-border);
  white-space: nowrap;
}

.mismatch-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--danger-strong);
  background: color-mix(in srgb, var(--danger) 12%, var(--surface));
  border: 1px solid var(--danger-border);
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

.compare-field-val {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.compare-field-val.iban-val {
  font-size: 0.86rem;
  word-break: break-word;
}

.field-mismatch .compare-field-val {
  color: var(--danger);
}

.compare-field-note {
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.field-mismatch .compare-field-note {
  color: var(--danger-strong);
}

.split-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.split-connector::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 1px;
  background: var(--border);
}

.connector-badge {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}

.connector-badge.is-mismatch {
  background: var(--danger);
  color: #FFFFFF;
}

.connector-badge.is-match {
  background: var(--ok);
  color: #FFFFFF;
}

.split-alerts-box {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.split-raw-details {
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  background: var(--surface);
  font-size: 0.82rem;
}

.split-raw-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
}

.split-raw-inner {
  margin-top: 10px;
}

.detail-subhead {
  margin: 14px 0 10px;
  font-size: 0.95rem;
}

.detail-disclosure {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}

.detail-disclosure summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
}

.passed-rules-list {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Editable DATEV Controls & Inline Inputs */
.datev-panel-header {
  flex-wrap: wrap;
}

.datev-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.skr-segmented {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--surface);
}

.skr-seg-btn {
  border: 0;
  background: transparent;
  padding: 4px 11px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.skr-seg-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.skr-seg-btn.active {
  background: var(--brand);
  color: var(--brand-on);
}

.datev-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
}

.datev-edit-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  padding: 3px 9px;
  border-radius: var(--radius-xs);
}

/* Sticky Table Headers (Modern Web Guidance: responsive-table) */
.table-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.datev-inline-input {
  padding: 4px 7px;
  font-size: 0.82rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.datev-inline-input:hover {
  border-color: var(--brand);
}

.datev-inline-input:focus {
  border-color: var(--brand);
  background: var(--surface);
  outline: 2px solid color-mix(in srgb, var(--brand) 22%, transparent);
  outline-offset: 0;
}

.datev-inline-input.is-edited {
  background: var(--brand-soft);
  border-color: var(--brand);
  font-weight: 600;
}

.datev-acct-input {
  width: 78px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.datev-text-input {
  min-width: 190px;
  width: 100%;
}

.export-gate-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 58ch;
}

/* ==========================================================================
   SWISS KANZLEI EDITORIAL SUBPAGES (Guides & Impressum — 100 % CI Parity)
   ========================================================================== */

.guide-page {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 56px;
  flex: 1;
}

.guide-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.guide-breadcrumb:hover {
  color: var(--brand);
  text-decoration: none;
}

.guide-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 28px 30px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
}

.guide-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  margin-bottom: 12px;
}

.guide-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0 0 12px;
}

.guide-lead {
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.guide-hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.guide-card h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.guide-card h3 {
  font-family: var(--font-sans);
  font-size: 1.02rem;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--text);
}

.guide-card p {
  font-size: 0.94rem;
  line-height: 1.65;
  color: var(--text);
}

.guide-card ul,
.guide-card ol {
  margin: 0 0 14px;
  padding-left: 22px;
  line-height: 1.65;
  color: var(--text-muted);
  font-size: 0.93rem;
}

.guide-card li {
  margin-bottom: 6px;
}

.guide-card li strong {
  color: var(--text);
}

.guide-card code,
.guide-lead code,
.guide-tldr code,
.guide-faq-answer code,
.guide-callout code,
.guide-table code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  color: var(--text);
  overflow-wrap: anywhere;
}

.guide-page,
.guide-hero,
.guide-card,
.guide-faq,
.related-guides,
.cta-box {
  min-width: 0;
}

.guide-meta-bar {
  margin: 12px 0 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-faint);
}

.guide-meta-sep {
  display: inline;
  margin: 0 6px;
  color: var(--border-strong);
  user-select: none;
}

.guide-trust-strip {
  margin: 0 0 22px;
  padding: 16px 4px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.guide-checklist {
  list-style: none;
  margin: 14px 0 6px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-checklist li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 13px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0;
  font-size: 0.91rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.guide-check-box {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  border: 1.5px solid var(--brand-border);
  background: var(--surface);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 1px;
}

.guide-checklist li strong {
  color: var(--text);
  display: block;
  margin-bottom: 2px;
}

/* Inline Client-Side Leitweg-ID Format-Prüfer (Zero Network / CSP connect-src 'none') */
.leitweg-checker {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 14px 0 8px;
}

.leitweg-checker-form {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}

.leitweg-input {
  flex: 1 1 240px;
  min-width: 0;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-size: 0.94rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
}

.leitweg-input:focus {
  border-color: var(--brand);
  outline: 2px solid color-mix(in srgb, var(--brand) 22%, transparent);
  outline-offset: 0;
}

.leitweg-samples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 10px;
  font-size: 0.79rem;
  color: var(--text-muted);
}

.leitweg-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  line-height: 1.55;
  border: 1px solid var(--border);
  background: var(--surface);
}

.leitweg-result.is-ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  border-left: 3.5px solid var(--ok);
}

.leitweg-result.is-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  border-left: 3.5px solid var(--danger);
  color: var(--danger-strong);
}

.leitweg-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.leitweg-part {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 7px 10px;
  min-width: 0;
}

.leitweg-part span {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  font-weight: 600;
}

.leitweg-part strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text);
  overflow-wrap: anywhere;
  margin-top: 2px;
}

.guide-callout {
  margin: 16px 0 4px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  border-left: 3.5px solid var(--info);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.guide-callout.alert {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  border-left-color: var(--danger);
  color: var(--danger-strong);
}

.guide-callout.ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  border-left-color: var(--ok);
  color: var(--text);
}

.guide-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 16px 0;
  background: var(--surface);
}

.guide-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.guide-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}

.guide-table th {
  background: var(--surface-alt);
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: normal;
  vertical-align: top;
}

.guide-table tbody th {
  background: var(--surface);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  vertical-align: top;
}

.guide-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.guide-table tr:last-child td,
.guide-table tr:last-child th {
  border-bottom: 0;
}

.guide-tldr {
  margin-top: 16px;
  padding: 13px 16px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  border-left: 3.5px solid var(--brand);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
}

.guide-tldr strong {
  color: var(--brand);
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 14px 0 4px;
}

.guide-step-card {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.guide-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-on);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

.guide-step-title {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text);
  margin: 2px 0 0;
}

.guide-step-card p {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0;
}

/* Accessible Native <details> FAQ Accordion (Modern Web Guidance) */
.guide-faq {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.guide-faq > h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text);
}

.guide-faq details {
  border-top: 1px solid var(--border);
}

.guide-faq details:last-of-type {
  border-bottom: 1px solid var(--border);
}

.guide-faq summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 4px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: color 0.15s ease;
}

.guide-faq summary::-webkit-details-marker {
  display: none;
}

.guide-faq summary:hover {
  color: var(--brand);
}

.guide-faq summary::before {
  content: "";
  inline-size: 1em;
  block-size: 1em;
  flex-shrink: 0;
  background-color: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}

.guide-faq details[open] > summary::before {
  rotate: 0deg;
}

.guide-faq details::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.guide-faq details:not([open])::details-content {
  block-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .guide-faq summary::before {
    transition: rotate 0.2s ease;
  }
  .guide-faq details::details-content {
    transition: block-size 0.28s ease, content-visibility 0.28s ease;
    transition-behavior: allow-discrete;
  }
}

.guide-faq-answer {
  padding: 0 4px 14px 26px;
  font-size: 0.91rem;
  line-height: 1.62;
  color: var(--text-muted);
}

.guide-faq-answer p {
  margin: 0;
}

/* Related Guides & Index Knowledge Hub */
.related-guides {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-top: 22px;
  box-shadow: var(--shadow-sm);
}

.related-guides h2 {
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text);
}

.related-guides-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.related-guide-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.related-guide-link:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}

.related-guide-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand);
}

.related-guide-title {
  font-family: var(--font-serif);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

.related-guide-desc {
  font-size: 0.79rem;
  line-height: 1.42;
  color: var(--text-muted);
}

.guides-hub-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 28px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
  margin-bottom: 32px;
}

.guides-hub-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.guides-hub-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 4px 0 4px;
  color: var(--text);
}

.guides-hub-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.footer-guides-row {
  max-width: 1240px;
  margin: 14px auto 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  font-size: 0.79rem;
}

.footer-guides-label {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.footer-guides-row a {
  color: var(--text-muted);
}

.footer-guides-row a:hover {
  color: var(--brand);
}

.guide-code {
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
  margin: 12px 0;
}

.cta-box {
  background: var(--surface);
  border: 2px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 26px 28px;
  margin-top: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cta-box h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

.cta-box p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 66ch;
}

.cta-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

@media (max-width: 900px) {
  .split-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .split-connector {
    height: 26px;
  }
  .split-connector::before {
    top: 50%;
    bottom: auto;
    left: 12px;
    right: 12px;
    width: auto;
    height: 1px;
  }
  .guide-steps {
    grid-template-columns: 1fr;
  }
  .related-guides-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .guide-page {
    padding: 16px 12px 36px;
  }
  .guide-hero,
  .guide-card,
  .guide-faq,
  .related-guides,
  .guides-hub-section,
  .cta-box {
    padding: 18px 16px;
  }
  .guide-title {
    font-size: 1.45rem;
  }
  .related-guides-grid {
    grid-template-columns: 1fr;
  }
  .xml-fiscal-mini,
  .leitweg-result-grid {
    grid-template-columns: 1fr;
  }
  .leitweg-checker {
    padding: 13px 12px;
  }
  .leitweg-checker-form .btn {
    width: 100%;
  }
  .guide-code {
    max-width: 100%;
    font-size: 0.75rem;
    padding: 12px;
  }
  .guide-table-wrap {
    max-width: 100%;
  }
}

/* ==========================================================================
   KANZLEI-MINIMALISMUS v3.0 — RUHIGE DEUTSCHE B2B-PRÄZISION
   Centered Prüf-Fokus · Generous Whitespace · Zero Mobile Overflow (390px)
   ========================================================================== */

/* Calm Topbar (Single-line brand, 3 quiet links, 1 calm Pro button) */
.topbar-minimal {
  box-shadow: none;
  background: color-mix(in srgb, var(--bg) 94%, transparent);
}

.topbar-minimal .topbar-inner {
  max-width: 1120px;
  padding: 11px 20px;
  gap: 16px;
}

.topbar-minimal .brand {
  gap: 9px;
  min-width: 0;
}

.topbar-minimal .brand-icon {
  width: 30px;
  height: 30px;
}

.topbar-minimal .brand-name {
  font-size: 1.15rem;
  letter-spacing: -0.015em;
}

.topbar-minimal .topbar-nav {
  gap: 24px;
}

.topbar-minimal .nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 2px;
  background: transparent;
}

.topbar-minimal .nav-link:hover {
  color: var(--text);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-license {
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}

.btn-license:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--surface);
}

.btn-license.btn-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: var(--ok-border);
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
}

/* Centered Single-Column Prüf-Fokus Hero */
.hero-focus {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 0 30px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
  margin: 0 0 10px;
}

.hero-focus h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3.1vw, 2.32rem);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 auto 12px;
  max-width: 720px;
}

.hero-focus .hero-lead {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 660px;
  margin: 0 auto 24px;
  text-wrap: pretty;
}

/* Single Generous Centered Dropzone */
.dropzone-focus {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px;
  box-shadow: 0 2px 10px rgba(24, 32, 38, 0.03);
  margin: 0;
  width: 100%;
}

.dropzone-focus .dropzone-inner {
  border: 1.5px dashed var(--border-strong);
  border-radius: 7px;
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 7px;
}

.dropzone-focus:hover,
.dropzone-focus:focus-visible {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(15, 81, 50, 0.07);
}

.dropzone-focus:hover .dropzone-inner,
.dropzone-focus:focus-visible .dropzone-inner {
  background: var(--brand-soft);
  border-color: var(--brand);
}

.dropzone-focus .dropzone-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--brand);
  margin-bottom: 2px;
  box-shadow: none;
}

.dropzone-focus .dropzone-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}

.dropzone-focus .dropzone-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0 0 6px;
}

.dropzone-select-btn {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  pointer-events: none;
}

.dropzone-focus:hover .dropzone-select-btn {
  border-color: var(--brand);
  color: var(--brand);
}

/* Calm Inline Sample Row */
.sample-inline-row {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.sample-inline-label {
  color: var(--text-faint);
  font-weight: 500;
}

.sample-inline-links {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 7px;
}

.sample-pill {
  border: 1px solid var(--brand-border);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sample-pill:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-on);
}

.sample-link {
  border: 0;
  background: transparent;
  padding: 2px 2px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

.sample-link:hover {
  color: var(--brand);
  text-decoration-color: var(--brand);
}

.sample-sep {
  color: var(--border-strong);
  user-select: none;
}

/* Serene 3-Column German B2B Trust Strip */
.trust-strip {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  text-align: left;
}

.trust-strip-item {
  min-width: 0;
}

.trust-strip-head {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
}

.trust-strip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
}

.trust-strip-item strong {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
}

.trust-strip-item p {
  margin: 0;
  font-size: 0.79rem;
  line-height: 1.48;
  color: var(--text-muted);
}

.trust-strip-item a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 2px;
}

.trust-strip-item a:hover {
  color: var(--brand);
  text-decoration-color: var(--brand);
}

/* Hide Below-the-Fold Marketing Sections when Workspace is Active */
body.has-files:not(.reveal-landing-sections) .landing-below-fold {
  display: none;
}

/* Below-the-Fold: Calm Open Layout on Archival Paper (No nested boxes!) */
.landing-below-fold {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.section-intro {
  margin-bottom: 18px;
}

.section-kicker {
  display: block;
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 4px;
}

.section-intro h2 {
  font-family: var(--font-serif);
  font-size: 1.42rem;
  line-height: 1.25;
  font-weight: 700;
  margin: 0;
  color: var(--text);
}

/* Section 1: Ruhige Fakten-Erklärung */
.facts-section {
  border-top: 1px solid var(--border);
  padding: 28px 0 30px;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.fact-col {
  min-width: 0;
}

.fact-index {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.fact-col h3 {
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 5px;
}

.fact-col p {
  font-size: 0.84rem;
  line-height: 1.54;
  color: var(--text-muted);
  margin: 0;
}

/* Section 2: Kompakte, vertrauenswürdige Preis-Sektion */
.pricing-clean {
  border-top: 1px solid var(--border);
  padding: 28px 0 12px;
}

.pricing-clean-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.plan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.plan-card-pro {
  border-color: var(--brand-border);
  border-top: 2.5px solid var(--brand);
  box-shadow: var(--shadow-sm);
}

.plan-name {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.plan-card-pro .plan-name {
  color: var(--brand);
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.plan-amount {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}

.plan-card-pro .plan-amount {
  color: var(--brand);
}

.plan-term {
  font-size: 0.83rem;
  color: var(--text-muted);
}

.plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text);
}

.plan-list li {
  position: relative;
  padding-left: 18px;
}

.plan-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--brand);
  font-weight: 700;
  font-size: 0.82rem;
}

.plan-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-caption {
  margin: 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-faint);
  text-align: center;
}

/* Collapsible DATEV Parameter Drawer (Modern Web Guidance: accordion) */
.datev-settings-drawer {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  margin-bottom: 14px;
}

.datev-settings-drawer summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease;
}

.datev-settings-drawer summary::-webkit-details-marker {
  display: none;
}

.datev-settings-drawer summary:hover {
  color: var(--brand);
}

.datev-settings-drawer summary::before {
  content: "";
  inline-size: 1em;
  block-size: 1em;
  flex-shrink: 0;
  background-color: var(--brand);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center / contain;
  rotate: -90deg;
}

.datev-settings-drawer[open] > summary::before {
  rotate: 0deg;
}

.datev-settings-drawer::details-content {
  interpolate-size: allow-keywords;
  overflow: clip;
  contain: layout;
}

.datev-settings-drawer:not([open])::details-content {
  block-size: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .datev-settings-drawer summary::before {
    transition: rotate 0.2s ease;
  }
  .datev-settings-drawer::details-content {
    transition: block-size 0.25s ease, content-visibility 0.25s ease;
    transition-behavior: allow-discrete;
  }
}

.datev-settings-body {
  padding: 12px 13px 4px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.raw-csv-details {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.raw-csv-details summary {
  cursor: pointer;
  font-weight: 500;
}

/* Pro Dialog Activation Box (Zero overflow on mobile URLs) */
.activation-box {
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.5;
}

.activation-title {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.activation-steps {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.activation-steps li {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.activation-steps li:last-child {
  margin-bottom: 0;
}

.activation-steps a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

/* Structured Calm Footer with 2-Column Fachratgeber Directory */
.site-footer-minimal {
  padding: 24px 20px 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer-directory {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.48fr);
  gap: 24px;
  align-items: start;
}

.footer-brand-line {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.footer-dir-note {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.footer-dir-heading {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.footer-guides-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px;
}

.footer-guides-list a {
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.footer-guides-list a:hover {
  color: var(--brand);
}

.site-footer-minimal .footer-row {
  max-width: 960px;
}

/* Strict Zero-Overflow Hardening on All Grid/Flex Workspaces */
.workspace-grid > *,
.split-grid > *,
.kpi-grid > *,
.meta-grid > *,
.hero-grid > *,
.panel,
.detail-panel {
  min-width: 0;
}

@media (max-width: 768px) {
  .topbar-minimal .topbar-inner {
    padding: 9px 14px;
    gap: 10px;
  }
  .topbar-minimal .brand-name {
    font-size: 1.08rem;
  }
  .btn-license {
    padding: 5px 10px;
    font-size: 0.78rem;
  }
  .hero-focus {
    padding: 20px 0 28px;
  }
  .hero-focus h1 {
    font-size: 1.56rem;
    line-height: 1.22;
    max-width: 100%;
  }
  .hero-br {
    display: none;
  }
  .panel-header {
    flex-wrap: wrap;
    padding: 12px 14px;
  }
  .detail-head-meta {
    width: 100%;
  }
  .detail-head-meta h2 {
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .detail-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .split-verdict-pills {
    max-width: 100%;
  }
  .delta-pill,
  .verdict-stamp {
    white-space: normal;
  }
  .hero-focus .hero-lead {
    font-size: 0.92rem;
    margin-bottom: 20px;
  }
  .dropzone-focus .dropzone-inner {
    padding: 22px 14px 20px;
  }
  .dropzone-focus .dropzone-title {
    font-size: 0.93rem;
  }
  .dropzone-focus .dropzone-sub {
    font-size: 0.78rem;
  }
  .sample-inline-row {
    font-size: 0.8rem;
    gap: 6px 8px;
  }
  .trust-strip {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 24px;
    padding-top: 18px;
  }
  .facts-section,
  .pricing-clean {
    padding: 28px 0 28px;
  }
  .facts-grid,
  .pricing-clean-grid,
  .footer-directory,
  .footer-guides-list {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .footer-guides-list {
    gap: 8px;
  }
  .plan-card {
    padding: 20px 18px;
  }
}

/* ==========================================================================
   KANZLEI INTERACTIVE MINI-TOOLS & FOOTER PRÜFER-ROW (v3.1)
   100 % Browser-Local · Zero External Dependencies · Zero 390px Overflow
   ========================================================================== */

/* Footer Mini-Row: Kostenlose Kanzlei-Prüfer (compact 1-line bar on desktop) */
.footer-tools-row {
  max-width: 960px;
  margin: 14px auto 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 0.81rem;
}

.footer-tools-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  white-space: nowrap;
}

.footer-tools-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
}

.footer-tools-list a {
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-tools-list a:hover,
.footer-tools-list a[aria-current="page"] {
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Tool-First Hero Workbench (interactive tool visible above the fold) */
.guide-hero.tool-hero {
  padding: 24px 28px 24px;
}

.tool-hero .guide-title {
  font-size: clamp(1.52rem, 2.7vw, 1.94rem);
  text-wrap: balance;
  margin-bottom: 8px;
}

.tool-hero .guide-lead {
  font-size: 0.96rem;
  line-height: 1.56;
  max-width: 72ch;
}

.tool-workbench {
  margin-top: 18px;
  padding: 18px 20px;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.tool-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.tool-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.tool-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tool-input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}

.tool-input {
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  padding: 9px 12px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: max(1rem, 1em);
  line-height: 1.35;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-input-row .tool-input {
  flex: 1 1 260px;
  width: auto;
}

.tool-input:focus-visible {
  border-color: var(--brand);
  outline: 2px solid color-mix(in srgb, var(--brand) 28%, transparent);
  outline-offset: 0;
}

.tool-input[aria-invalid="true"] {
  border-color: var(--danger);
}

.tool-input-row .btn {
  min-height: 44px;
  padding: 0 18px;
  white-space: nowrap;
}

.tool-samples {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 11px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tool-sample-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.tool-sample-link:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}

/* Result Panels & Tabular Readout Grids */
.tool-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.89rem;
  line-height: 1.52;
}

.tool-result.is-ok {
  background: var(--ok-bg);
  border-color: var(--ok-border);
  border-left: 3.5px solid var(--ok);
}

.tool-result.is-warn {
  background: var(--warn-bg);
  border-color: var(--warn-border);
  border-left: 3.5px solid var(--warn);
}

.tool-result.is-error {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  border-left: 3.5px solid var(--danger);
  color: var(--danger-strong);
}

.tool-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.tool-result-title {
  font-weight: 700;
  font-size: 0.93rem;
  color: var(--text);
}

.tool-result.is-ok .tool-result-title {
  color: var(--ok);
}

.tool-result.is-warn .tool-result-title {
  color: var(--warn);
}

.tool-result.is-error .tool-result-title {
  color: var(--danger-strong);
}

.tool-result-sub {
  margin: 5px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.tool-result.is-error .tool-result-sub {
  color: var(--danger-strong);
}

.tool-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.tool-result-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tool-result-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tool-stat-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 9px 11px;
  min-width: 0;
}

.tool-stat-cell.is-highlight {
  border-color: var(--brand-border);
  background: var(--surface);
  border-top: 2px solid var(--brand);
}

.tool-stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-faint);
  line-height: 1.3;
}

.tool-stat-value {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.tool-stat-cell.is-highlight .tool-stat-value {
  font-size: 1.08rem;
  color: var(--brand);
}

.tool-stat-note {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

/* Skonto Calculator Form Grid & Radio Fieldset */
.calc-form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.35fr) minmax(0, 0.85fr) minmax(0, 0.85fr);
  gap: 12px;
  align-items: end;
}

.calc-fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.calc-fieldset legend {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  padding: 0;
  margin-bottom: 5px;
  line-height: 1.3;
}

.tool-radio-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.tool-radio-option {
  position: relative;
  min-width: 0;
}

.tool-radio-option input {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.tool-radio-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.tool-radio-option input:checked + label {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-on);
}

.tool-radio-option input:focus-visible + label {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.tool-radio-option label:hover {
  border-color: var(--brand);
}

.calc-optional-drawer {
  margin-top: 11px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.calc-optional-drawer summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calc-optional-drawer summary:hover {
  color: var(--brand);
}

.calc-optional-body {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 10px 14px;
  align-items: center;
}

/* Copyable Code Output Bar (Modern Web Guidance: copy-button) */
.bt20-box {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--brand-border);
  border-radius: var(--radius-sm);
}

.bt20-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.bt20-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--brand);
}

.bt20-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bt20-code {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  padding: 9px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
}

.copy-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.copy-btn {
  min-inline-size: 36px;
  min-block-size: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--brand-on);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.copy-btn:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
}

.copy-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.copy-btn[data-copied] {
  background: var(--ok);
  border-color: var(--ok);
}

.copy-btn[data-failed] {
  background: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF;
}

.copy-btn .icon-check {
  display: none;
}

.copy-btn[data-copied] .icon-copy {
  display: none;
}

.copy-btn[data-copied] .icon-check {
  display: inline-flex;
}

.copy-tip {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ok);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  white-space: nowrap;
}

.copy-btn[data-copied] + .copy-tip {
  opacity: 1;
  color: var(--ok);
}

.copy-btn[data-failed] + .copy-tip {
  opacity: 1;
  color: var(--danger);
}

@media (prefers-reduced-motion: reduce) {
  .copy-tip {
    transition: none;
  }
}

.tool-inline-bridge {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tool-inline-bridge strong {
  color: var(--text);
}

.tool-inline-bridge-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .calc-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .tool-result-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .guide-hero.tool-hero {
    padding: 18px 15px 18px;
  }
  .tool-workbench {
    padding: 14px 12px;
  }
  .tool-input-row .btn {
    width: 100%;
  }
  .calc-form-grid,
  .calc-optional-body,
  .tool-result-grid,
  .tool-result-grid.cols-4,
  .tool-result-grid.cols-2 {
    grid-template-columns: 1fr;
  }
  .bt20-row {
    flex-direction: column;
    align-items: stretch;
  }
  .copy-wrap {
    justify-content: flex-start;
  }
  .footer-tools-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .footer-tools-list {
    gap: 6px 14px;
  }
}

/* ==========================================================================
   ARCHIVAL GoBD PRINT SHEET (@media print — DIN A4)
   ========================================================================== */

.gobd-print-sheet {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 13mm 15mm;
  }

  * {
    print-color-adjust: exact !important;
    -webkit-print-color-adjust: exact !important;
  }

  html,
  body {
    background: #FFFFFF !important;
    color: #182026 !important;
    font-size: 10pt;
    line-height: 1.4;
    overflow: visible !important;
  }

  .topbar,
  main.container,
  .site-footer,
  dialog {
    display: none !important;
  }

  .gobd-print-sheet {
    display: block !important;
  }

  .print-doc {
    max-width: 100%;
    color: #182026;
    font-family: var(--font-sans);
  }

  .print-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #0F5132;
    margin-bottom: 12px;
  }

  .print-brand {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .print-brand-name {
    font-family: var(--font-serif);
    font-size: 15pt;
    font-weight: 700;
    color: #182026;
  }

  .print-brand-sub {
    font-size: 8.5pt;
    color: #52606D;
  }

  .print-meta-right {
    text-align: right;
    font-size: 8pt;
    color: #52606D;
    line-height: 1.45;
  }

  .print-verdict {
    padding: 10px 12px;
    border-radius: 5px;
    margin-bottom: 12px;
    break-inside: avoid;
  }

  .print-verdict-ok {
    background: #EAF4EE;
    border: 1.5px solid #0F5132;
    color: #0F5132;
  }

  .print-verdict-danger {
    background: #FEF3F2;
    border: 1.5px solid #B42318;
    color: #911A12;
  }

  .print-verdict-warn {
    background: #FFFBEB;
    border: 1.5px solid #9A6700;
    color: #7A5000;
  }

  .print-verdict-badge {
    font-weight: 700;
    font-size: 10.5pt;
    letter-spacing: 0.03em;
    margin-bottom: 3px;
  }

  .print-verdict p {
    margin: 0;
    font-size: 9pt;
  }

  .print-section {
    margin-bottom: 11px;
    break-inside: avoid;
  }

  .print-section h2 {
    font-family: var(--font-serif);
    font-size: 11pt;
    font-weight: 700;
    margin: 0 0 6px;
    padding-bottom: 3px;
    border-bottom: 1px solid #CCD1CA;
    color: #182026;
  }

  .print-kv-table,
  .print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 8.5pt;
  }

  .print-kv-table th,
  .print-kv-table td,
  .print-table th,
  .print-table td {
    padding: 5px 7px;
    border: 1px solid #CCD1CA;
    text-align: left;
    vertical-align: top;
  }

  .print-kv-table th,
  .print-table th {
    background: #F4F5F2;
    color: #344054;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
  }

  .print-hash {
    font-size: 7.8pt;
    word-break: break-all;
  }

  .print-row-danger td {
    background: #FEF3F2;
    color: #911A12;
  }

  .print-summary-line {
    font-size: 8.5pt;
    margin: 0 0 6px;
  }

  .print-ok-note {
    font-size: 8.5pt;
    color: #0F5132;
    margin: 0;
  }

  .print-blocked-note {
    font-size: 8.5pt;
    color: #B42318;
    font-weight: 600;
    margin: 0;
  }

  .print-footer {
    margin-top: 16px;
    padding-top: 10px;
    border-top: 1px solid #CCD1CA;
    break-inside: avoid;
  }

  .print-sign-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 12px;
  }

  .print-sign-box {
    border-top: 1px solid #52606D;
    padding-top: 4px;
    margin-top: 22px;
    font-size: 8pt;
    color: #52606D;
  }

  .print-legal {
    font-size: 7.5pt;
    color: #7B8A99;
  }
}
