/* ════════════════════════════════════════════════════════
   judic.css — Zentrales Stylesheet für alle Seiten
   Eingebunden in: index.html · viewer.html
   ════════════════════════════════════════════════════════ */

/* ══ VARIABLEN ══════════════════════════════════════════ */
:root {
  --red:     #8B0000;
  --red-lt:  #f9f0f0;
  --red-mid: #c0392b;
  --gold:    #b8860b;
  --ink:     #1a1a1a;
  --muted:   #555;
  --light:   #666;
  --lighter: #999;
  --border:  #ddd;
  --bg:      #fffefb;
  --surface: #ffffff;
  /* Einheitliche leichte Vergrösserung der Typografie (Viewer, Index, statische Seiten) */
  --fs-scale: 1.068;
  --serif:   'Libre Baskerville', Georgia, serif;
  --sans:    'DM Sans', system-ui, sans-serif;
}



/* ══ RESET ══════════════════════════════════════════════ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ══ BASIS-BODY ═════════════════════════════════════════ */
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

#viewer-loader {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.viewer-loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: viewer-loader-spin .8s linear infinite;
}
@keyframes viewer-loader-spin {
  to { transform: rotate(360deg); }
}

/* Zentriertes Seiten-Layout */
body.page-centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 60px;
}

/* ══ TOPBAR ═════════════════════════════════════════════ */
#topbar a,
#topbar a:hover { text-decoration: none; }

#topbar {
  background: var(--red);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 32px;
  height: 52px;
  width: 100%;
  position: fixed;
  top: 0;
  z-index: 100;
}

#topbar .logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-weight: 500;
  font-size: calc(14px * var(--fs-scale));
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-decoration: none;
}

#topbar .logo img {
  max-width: 25px;
  height: auto;
  display: block;
}

#topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ══ LOGO ═══════════════════════════════════════════════ */
.logo-img { max-width: 25px; height: auto; display: block; }

.logo-text {
  font-family: var(--sans);
  font-weight: 500;
  font-size: calc(14px * var(--fs-scale));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1;
}

/* ══ FOOTER ═════════════════════════════════════════════ */
footer {
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 99;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  color: var(--light);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-left img {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

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

footer a:hover { color: var(--red); }

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

/* ══ TOPBAR NAV LINKS ═══════════════════════════════════ */
.topbar-links {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: 24px;
}

.topbar-links a {
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  transition: color 0.15s;
}

.topbar-links a:hover { color: #fff; }

/* ══ LANGUAGE SWITCHER ══════════════════════════════════ */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

.lang-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  padding: 3px 7px;
  border-radius: 3px;
  transition: color 0.15s, background 0.15s;
}

.lang-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }
.lang-btn.active { color: #fff; background: rgba(255,255,255,0.18); }

/* ══ HERO ═══════════════════════════════════════════════ */
.hero {
  margin-top: 15vh;
  width: 100%;
  max-width: 700px;
  padding: 0 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-title {
  font-family: var(--serif);
  font-size: calc(48px * var(--fs-scale));
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
  display: inline-block;
  position: relative;
  padding-right: 0;
}

.hero-beta-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #e15d47, #b22222);
  color: #fff;
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  position: absolute;
  top: -14px;
  right: -52px;
  transform: none;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(139, 0, 0, 0.25);
}

.hero-subtitle {
  font-family: var(--sans);
  font-size: calc(30px * var(--fs-scale));
  line-height: 1.2;
  min-height: 1.2em;
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 40px;
  font-weight: 300;
}

.tw-cursor {
  display: inline-block;
  margin-left: 1px;
  animation: tw-blink 1s step-end infinite;
}
@keyframes tw-blink { 50% { opacity: 0; } }

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body[data-page="index"] .hero-fade-in,
body[data-page="api"] .hero-fade-in {
  opacity: 0;
  animation: heroFadeUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body[data-page="index"] .hero-fade-in-delay-1 { animation-delay: 0.08s; }
body[data-page="index"] .hero-fade-in-delay-2 { animation-delay: 0.16s; }
body[data-page="index"] .hero-fade-in-delay-3 { animation-delay: 0.24s; }
body[data-page="index"] .hero-fade-in-delay-4 { animation-delay: 0.32s; }
body[data-page="index"] .hero-fade-in-delay-5 { animation-delay: 0.40s; }
body[data-page="index"] .hero-fade-in-delay-6 { animation-delay: 0.48s; }
body[data-page="index"] .hero-fade-in-delay-7 { animation-delay: 0.56s; }

body[data-page="index"] .fn-fade-in {
  opacity: 0;
  animation: heroFadeUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.65s forwards;
}

.hero-stat-value.is-counting {
  transition: color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
  body[data-page="index"] .hero-fade-in,
  body[data-page="api"] .hero-fade-in,
  body[data-page="index"] .fn-fade-in {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .tw-cursor { animation: none; }
}

/* ══ SEARCH ═════════════════════════════════════════════ */
.search-container {
  width: 100%;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  border-radius: 8px;
}

.search-input {
  width: 100%;
  padding: 20px 24px;
  padding-right: 60px;
  font-family: var(--sans);
  font-size: calc(18px * var(--fs-scale));
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px var(--red-lt);
}

.search-button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--red);
  color: white;
  border: none;
  border-radius: 6px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.search-button:hover { background: var(--red-mid); }

.search-examples {
  width: 100%;
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.search-ex-chip {
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  padding: 5px 11px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  line-height: 1.3;
}

.search-ex-chip:hover {
  border-color: var(--red);
  color: var(--red);
  background: #fff;
}

.search-ex-bge:hover { border-color: #7C2D12; color: #7C2D12; }
.search-ex-bger:hover { border-color: #B91C1C; color: #B91C1C; }
.search-ex-erw {
  background: #f5f7f0;
  border-color: #c8d4b0;
  color: #4a5a30;
  font-variant-numeric: tabular-nums;
}
.search-ex-erw:hover {
  border-color: #4a5a30;
  color: #3a4820;
  background: #eaf0d8;
}
.search-ex-bstger:hover { border-color: #059669; color: #059669; }
.search-ex-law {
  background: #f0f4ff;
  border-color: #c5d0f0;
  color: #3a4a9a;
}
.search-ex-law:hover {
  border-color: #3a4a9a;
  color: #2a3a8a;
  background: #e0e8ff;
}
.search-ex-canton {
  background: #f3f0ff;
  border-color: #d4c8f0;
  color: #5b3d8a;
}
.search-ex-canton:hover {
  border-color: #5b3d8a;
  color: #4a2d7a;
  background: #ebe4ff;
}

.search-hint {
  font-family: var(--sans);
  font-size: calc(13px * var(--fs-scale));
  color: var(--light);
  margin-top: 16px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin-top: 28px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px 12px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top-width: 3px;
}

.hero-stat-bger { border-top-color: #B91C1C; }
.hero-stat-bge { border-top-color: #7C2D12; }
.hero-stat-bstger { border-top-color: #059669; }
.hero-stat-laws { border-top-color: #3a4a9a; }

.hero-stat-value {
  font-family: var(--sans);
  font-size: calc(22px * var(--fs-scale));
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.hero-stat-label {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light);
}

.hero-stats-footnote {
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  color: var(--light);
  margin-top: 10px;
  margin-bottom: 0;
}

/* ══ NEUHEITEN (index.html) ═════════════════════════════ */
.neuheiten-section {
  margin-top: 64px;
  width: 100%;
  max-width: 700px;
  padding: 0 24px;
}

.neuheiten-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
}

.neuheiten-title {
  font-family: var(--sans);
  font-size: calc(16px * var(--fs-scale));
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--red);
}

.neuheiten-subtitle {
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  color: var(--light);
}

.neuheiten-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.neuheiten-table thead th {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light);
  padding: 12px 16px;
  text-align: left;
  background: #eeecea;
  border-bottom: 1px solid var(--border);
  position: static;
}

.neuheiten-table thead th .th-main,
.neuheiten-sticky-head-table th .th-main {
  display: block;
}

.neuheiten-table thead th .th-sub,
.neuheiten-sticky-head-table th .th-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.9em;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--lighter);
  text-transform: none;
}

.neuheiten-table thead th .th-sub-empty,
.neuheiten-sticky-head-table th .th-sub-empty {
  visibility: hidden;
}

.neuheiten-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
  cursor: pointer;
}

.neuheiten-table tbody tr td:first-child {
  border-left: 3px solid transparent;
  padding-left: 13px;
}

.neuheiten-table tbody tr.court-row-bger td:first-child { border-left-color: #B91C1C; }
.neuheiten-table tbody tr.court-row-bge td:first-child { border-left-color: #7C2D12; }
.neuheiten-table tbody tr.court-row-bge_egmr td:first-child { border-left-color: #6D28D9; }
.neuheiten-table tbody tr.court-row-bstger td:first-child { border-left-color: #059669; }

.neuheiten-table tbody tr.court-row-bger:hover { background: rgba(185, 28, 28, 0.05); }
.neuheiten-table tbody tr.court-row-bge:hover { background: rgba(124, 45, 18, 0.05); }
.neuheiten-table tbody tr.court-row-bge_egmr:hover { background: rgba(109, 40, 217, 0.05); }
.neuheiten-table tbody tr.court-row-bstger:hover { background: rgba(5, 150, 105, 0.05); }
.neuheiten-table tbody tr.row-bge-planned:hover { background: #fff2d7; }

.neuheiten-table tbody tr:last-child { border-bottom: none; }
.neuheiten-table td {
  padding: 14px 16px;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.td-pub  {
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  color: var(--light);
  white-space: normal;
}
.pub-date-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pub-meta-row {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.pub-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ca24f;
  box-shadow: 0 0 0 2px rgba(44, 162, 79, 0.18);
  flex-shrink: 0;
}
.td-ref  { font-family: var(--sans); font-size: calc(13px * var(--fs-scale)); font-weight: 500; white-space: normal; }
.td-ref a { color: var(--red); text-decoration: none; }
.td-ref a:hover { text-decoration: underline; }
.ref-urteilsdatum {
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  color: var(--light);
  margin-top: 2px;
  font-weight: 400;
}
.ref-hint {
  margin-top: 6px;
  font-size: calc(11px * var(--fs-scale));
  color: #8b6b2d;
  font-family: var(--sans);
  font-weight: 500;
}
.ref-vorinstanz {
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  color: var(--muted);
  margin-top: 4px;
  line-height: 1.35;
  font-weight: 400;
  white-space: normal;
}
.mini-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #f5f4f3;
  color: var(--muted);
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  min-height: 19px;
}
.mini-pill-lang { min-width: 36px; }
.mini-pill-lang-de { background: #eef5ff; border-color: #cbdcf5; color: #2b4f86; }
.mini-pill-lang-fr { background: #f5f0ff; border-color: #ddd0f5; color: #5a3d8a; }
.mini-pill-lang-it { background: #edf8ee; border-color: #cde7d0; color: #2f6b3c; }
.mini-pill-richter { background: #fdf3ef; border-color: #f0d4c7; color: #8d3f21; }
.mini-pill-neutral { background: #f6f6f6; color: #8a8a8a; }
.mini-pill-richter { white-space: nowrap; }
.td-date { font-family: var(--sans); font-size: calc(12px * var(--fs-scale)); color: var(--muted); white-space: nowrap; }
.td-sach { font-family: var(--sans); font-size: calc(12px * var(--fs-scale)); }
.td-sach .sach-name   { color: var(--muted); font-weight: 500; }
.td-sach .themen-text { margin-top: 4px; font-size: calc(11.5px * var(--fs-scale)); color: var(--light); line-height: 1.45; }
.row-bge-planned {
  background: #fff8e9;
}
.row-bge-planned:hover {
  background: #fff2d7;
}

.skeleton-row td { padding: 16px; }
.skeleton {
  height: 13px;
  border-radius: 4px;
  background: linear-gradient(90deg, #ebebeb 25%, #f5f5f5 50%, #ebebeb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ══ ABOUT ════════════════════════════════════════════════ */
.about-section {
  margin-top: 80px;
  margin-bottom: 60px;
  width: 100%;
  max-width: 800px;
  padding: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.about-title {
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 24px;
  text-align: center;
}

.about-content { font-size: calc(16px * var(--fs-scale)); line-height: 1.8; color: var(--ink); }
.about-content p  { margin-bottom: 24px; }
.about-content a  { color: var(--red); }

.about-content h3 {
  font-family: var(--sans);
  font-size: calc(18px * var(--fs-scale));
  font-weight: 500;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--ink);
}

.about-content h4 {
  font-family: var(--sans);
  font-size: calc(15px * var(--fs-scale));
  font-weight: 600;
  margin-top: 20px;
  margin-bottom: 8px;
  color: var(--ink);
}

.about-content ul { padding-left: 20px; margin-bottom: 20px; }
.about-content ul li { font-size: calc(15px * var(--fs-scale)); color: var(--muted); margin-bottom: 6px; }

.feature-list { list-style: none; margin-bottom: 24px; }
.feature-list li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 12px;
  font-size: calc(15px * var(--fs-scale));
  color: var(--muted);
}
.feature-list li::before {
  content: "•";
  color: var(--red);
  position: absolute;
  left: 0;
  font-size: calc(18px * var(--fs-scale));
  line-height: 1;
  top: 2px;
}

/* ══ VIEWER: 3-Spalten-Layout ═══════════════════════════ */
#layout {
  display: grid;
  grid-template-columns: 300px 1fr 260px;
  min-height: calc(100vh - 52px);
  max-width: 1400px;
  margin: 0 auto;
  box-shadow: 0 0 0 1px var(--border);
}

/* ── Linke Sidebar ── */
#sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 28px 24px;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
}

/* Court-Chip in der linken Spalte: kennzeichnet das Gericht der Decision.
   Farben so gewaehlt, dass sie sich auf einen Blick unterscheiden lassen. */
.court-chip {
  display: inline-block;
  padding: 5px 12px;
  margin-bottom: 24px;
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
  border-radius: 6px;
  background: #6b7280;  /* fallback grey */
}
.court-chip:empty { display: none; }
.court-chip.court-bger     { background: #B91C1C; }   /* dunkelrot (Brand) */
.court-chip.court-bge      { background: #7C2D12; }   /* burgundy */
.court-chip.court-bge_egmr { background: #6D28D9; }   /* violet */
.court-chip.court-bstger   { background: #059669; }   /* gruen */

.meta-block { margin-bottom: 24px; }
.meta-label {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 5px;
}
.meta-value {
  font-family: var(--sans);
  font-size: calc(12.5px * var(--fs-scale));
  color: var(--ink);
  line-height: 1.5;
}
.meta-value a { color: var(--red); text-decoration: none; }
.meta-value a:hover { text-decoration: underline; }

.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

.richter-item { font-family: var(--sans); font-size: calc(12.5px * var(--fs-scale)); color: var(--muted); line-height: 1.8; }
.richter-item.gs { color: var(--light); }

/* Nav */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: calc(13px * var(--fs-scale));
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  text-decoration: none;
}
.nav-item:hover { background: var(--bg); color: var(--ink); }
.nav-item.active { background: var(--red-lt); color: var(--red); font-weight: 500; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; flex-shrink: 0; }
.nav-item.active .nav-dot { opacity: 1; }
.nav-item.nav-hidden { display: none; }

/* ── Hauptinhalt ── */
#main {
  padding: 80px 48px 80px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#main > * {
  width: 100%;
  max-width: 600px;
}

.urteil-titel {
  font-family: var(--serif);
  font-size: calc(20px * var(--fs-scale));
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 48px;
  line-height: 1.3;
}

.section-block { margin-bottom: 64px; scroll-margin-top: 68px; }
.section-block.section-empty { display: none; }

.section-head {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.abschnitt { margin-bottom: 28px; }
.abschnitt[id^="E-"] { scroll-margin-top: 80px; }
.abschnitt.anchor-flash { animation: anchorFlash 1.5s ease-out; }
@keyframes anchorFlash {
  0%   { background-color: rgba(139, 0, 0, 0.10); }
  100% { background-color: transparent; }
}
.abschnitt-id {
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  font-weight: 500;
  color: var(--red);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.abschnitt-text { font-size: calc(15px * var(--fs-scale)); line-height: 1.85; color: var(--ink); margin: 0 0 0.9em; }

/* Translate-Button pro Abschnitt — dezenter Icon-Button in der oberen rechten Ecke */
.abschnitt { position: relative; }
.abschnitt-translate-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  color: #888;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s, border-color .15s;
}
.abschnitt:hover .abschnitt-translate-btn,
.abschnitt-translate-btn:focus,
.abschnitt-translate-btn.is-active { opacity: 1; }
.abschnitt-translate-btn:hover { background: #f5f5f5; color: #333; border-color: #bbb; }
.abschnitt-translate-btn.is-active { color: var(--primary, #2563eb); border-color: var(--primary, #2563eb); }
.abschnitt-translate-btn.is-loading { opacity: 0.6; cursor: progress; }

/* Ladezustand / Fehlertext beim Uebersetzen — visuell dezent abgesetzt */
.abschnitt-text.abschnitt-loading { color: #888; font-style: italic; }
.abschnitt-text.abschnitt-error   { color: #b91c1c; }

/* Wenn der Abschnitt aktuell die Uebersetzung zeigt, dezenter Akzent links */
.abschnitt[data-translate-state="translated"] {
  border-left: 3px solid var(--primary, #2563eb);
  padding-left: 0.8em;
  background: rgba(37, 99, 235, 0.03);
}
.abschnitt-text:last-child { margin-bottom: 0; }
.abschnitt[data-depth="2"] { padding-left: 20px; }
.abschnitt[data-depth="3"] { padding-left: 40px; }

/* BGE-Regeste */
.regeste-main {
  margin-bottom: 48px;
  padding: 20px 24px;
  background: var(--bg);
  border-left: 3px solid var(--border);
  border-radius: 0 6px 6px 0;
}

.regeste-main-text { /*font-family: var(--sans); font-size: calc(13px * var(--fs-scale)); */ line-height: 1.65; color: var(--muted); }
.regeste-main + .regeste-main { margin-top: -36px; }

/* Strukturierte Sub-Bloecke: "Regeste a", "Regeste b" als Zwischentitel */
.regeste-sub-titel {
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 18px 0 6px;
}
.regeste-sub-titel:first-child { margin-top: 0; }
.regeste-sub-text {
  font-family: var(--sans);
  font-size: calc(13px * var(--fs-scale));
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 0;
}

/* BGE-Kopf */
.bge-kopf { margin-bottom: 40px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.bge-kopf-auszug { font-family: var(--sans); font-size: calc(13px * var(--fs-scale)); color: var(--muted); line-height: 1.55; margin-bottom: 20px; }

/* Seitenmarker */
.page-marker {
  text-align: center;
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  color: var(--light);
  letter-spacing: 0.06em;
  margin: 24px 0;
  padding: 6px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}
.page-markers-hidden .page-marker { display: none; }

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.toggle-row input[type=checkbox] { accent-color: var(--red); cursor: pointer; }

/* Regeste-Block (Sidebar) */
.regeste-block { font-family: var(--sans); font-size: calc(12px * var(--fs-scale)); color: var(--muted); line-height: 1.6; margin-top: 4px; }
.regeste-block details summary { cursor: pointer; color: var(--light); font-size: calc(11px * var(--fs-scale)); letter-spacing: 0.04em; list-style: none; margin-bottom: 4px; }
.regeste-block details summary::before { content: '\25B6 '; font-size: calc(9px * var(--fs-scale)); }
.regeste-block details[open] summary::before { content: '\25BC '; }

/* Inline Links */
.lnk-bge, .lnk-bger, .lnk-law { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color 0.12s, text-decoration-color 0.12s, text-decoration-style 0.12s; }
.lnk-bge  { color: inherit; text-decoration-color: #c9a0a0; }
.lnk-bge:hover  { color: var(--red); text-decoration-color: var(--red); text-decoration-style: solid; }
.lnk-bger { color: inherit; font-style: italic; text-decoration-color: #c9a0a0; }
.lnk-bger:hover { color: var(--red); text-decoration-color: var(--red); text-decoration-style: solid; }
.lnk-law  { color: inherit; text-decoration-color: #8090c8; }
.lnk-law:hover  { color: #2a3a8a; text-decoration-color: #2a3a8a; text-decoration-style: solid; }
.lnk-erw  { color: inherit; text-decoration-color: #a0b480; }
.lnk-erw:hover  { color: #4a5a30; text-decoration-color: #4a5a30; text-decoration-style: solid; }

/* Dispositiv */
.disp-punkt { display: flex; margin-bottom: 20px; }
.disp-punkt.abschnitt { padding-right: 34px; }
.disp-nr    { font-family: var(--sans); font-weight: 500; font-size: calc(13px * var(--fs-scale)); color: var(--red); min-width: 20px; margin-top: 4px; }
.disp-text  { font-size: calc(15px * var(--fs-scale)); line-height: 1.75; }

/* ── Rechtes Panel: Referenzen ── */
#refpanel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 28px 20px;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
}

.ref-panel-head {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.ref-section { margin-bottom: 12px; }
.ref-section[open] { margin-bottom: 20px; }
.ref-section-title {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 10px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 5px;
  user-select: none;
}
.ref-section-title::-webkit-details-marker { display: none; }
.ref-section-title::before {
  content: '▶';
  font-size: calc(7px * var(--fs-scale));
  transition: transform 0.15s;
  display: inline-block;
}
.ref-section[open] > .ref-section-title::before {
  transform: rotate(90deg);
}

.ref-chips::after { content: ''; display: table; clear: both; }
.ref-chip {
  float: left;
  font-family: var(--sans);
  font-size: calc(11.5px * var(--fs-scale));
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
  margin: 0 5px 6px 0;
  white-space: nowrap;
}
.ref-chip:hover      { border-color: var(--red); color: var(--red); }
.ref-chip.bge        { background: var(--bg); }
.ref-chip.law        { background: #f0f4ff; border-color: #c5d0f0; color: #3a4a9a; }
.ref-chip.law:hover  { background: #e0e8ff; border-color: #3a4a9a; color: #2a3a8a; }
.ref-chip.bger-urt   { font-style: italic; }
.ref-chip.erw        { background: #f5f7f0; border-color: #c8d4b0; color: #4a5a30; font-variant-numeric: tabular-nums; }
.ref-chip.erw:hover  { background: #eaf0d8; border-color: #4a5a30; color: #3a4820; }
.ref-chip-wrap { display: inline-flex; align-items: center; gap: 2px; }
.ref-chip-ext {
  font-size: 10px;
  color: var(--light);
  text-decoration: none;
  padding: 2px 3px;
  border-radius: 2px;
}
.ref-chip-ext:hover { color: var(--red); }
.ref-more-btn {
  margin-top: 12px;
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--light);
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.ref-more-btn:hover { border-color: var(--red); color: var(--red); }
.ref-chip.cited-by   { background: #eef6fb; border-color: #9dc8e0; color: #1a5f80; }
.ref-chip.cited-by:hover { background: #d8edf8; border-color: #1a5f80; color: #0e3f5c; }

#ref-cited-by {
  margin-bottom: 16px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
#ref-cited-by summary {
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--light);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
}
#ref-cited-by summary::-webkit-details-marker { display: none; }
#ref-cited-by summary::before {
  content: '▶';
  font-size: 9px;
  transition: transform .15s;
  display: inline-block;
}
#ref-cited-by[open] > summary::before { transform: rotate(90deg); }
#ref-cited-by-list { padding-top: 6px; }

/* ── Translation buttons ── */
.tr-btn {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 7px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.4;
}
.tr-btn:hover  { border-color: var(--red); color: var(--red); }
.tr-btn.active { background: #f5f7f0; border-color: #a0b480; color: #4a5a30; }
.tr-btn.loading { opacity: 0.6; cursor: wait; }
.tr-btn[disabled] { cursor: wait; }

/* ── Dropzone ── */
#dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 52px);
  grid-column: 1 / -1;
  gap: 16px;
}
#dropzone.hidden { display: none; }

.drop-box {
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 48px 64px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--surface);
}
.drop-box:hover, .drop-box.drag-over { border-color: var(--red); background: var(--red-lt); }
.drop-icon  { font-size: calc(36px * var(--fs-scale)); margin-bottom: 12px; color: var(--border); }
.drop-title { font-family: var(--sans); font-size: calc(16px * var(--fs-scale)); color: var(--ink); margin-bottom: 6px; }
.drop-sub   { font-family: var(--sans); font-size: calc(13px * var(--fs-scale)); color: var(--light); }
#file-input { display: none; }

/* ── Erledigung-Filter-Sektion ── */
#fp-erl-body {
  padding: 4px 0 8px;
}
.fp-section-hdr {
  padding: 8px 16px 4px;
  font-size: calc(11px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--light);
}
.fp-erl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  font-size: calc(13px * var(--fs-scale));
  font-family: var(--sans);
  cursor: pointer;
  user-select: none;
  transition: background .12s;
}
.fp-erl-item:hover { background: var(--hover, rgba(0,0,0,.04)); }
.fp-erl-item.active { color: var(--accent); font-weight: 500; }
.fp-erl-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  flex-shrink: 0;
  transition: background .12s;
}
.fp-erl-item.active .fp-erl-dot { background: currentColor; }

.fp-court-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
  border: 1.5px solid transparent;
  background: transparent;
  transition: background .12s, border-color .12s;
}

.fp-court-dot-bger { border-color: #B91C1C; }
.fp-court-dot-bge { border-color: #7C2D12; }
.fp-court-dot-bstger { border-color: #059669; }

.fp-court-item:not(.active) { color: var(--light); font-weight: 400; }
.fp-court-item.active.fp-court-bger { color: #B91C1C; font-weight: 500; }
.fp-court-item.active.fp-court-bge { color: #7C2D12; font-weight: 500; }
.fp-court-item.active.fp-court-bstger { color: #059669; font-weight: 500; }

.fp-court-item.active .fp-court-dot-bger { background: #B91C1C; }
.fp-court-item.active .fp-court-dot-bge { background: #7C2D12; }
.fp-court-item.active .fp-court-dot-bstger { background: #059669; }

.fp-vi-group-title {
  padding: 10px 16px 4px;
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--light);
  line-height: 1.35;
}
.fp-vi-empty {
  padding: 8px 16px 12px;
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  color: var(--light);
  line-height: 1.4;
}

/* ── Vorinstanz-Dropdown ─────────────────────────────────── */
.vi-dropdown { padding: 6px 0 4px; }

.vi-search-wrap { padding: 0 12px 6px; }

.vi-search {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  color: var(--ink);
  background: var(--card);
  outline: none;
  transition: border-color .15s;
}
.vi-search:focus { border-color: var(--red); }
.vi-search::placeholder { color: var(--light); }

.vi-options {
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.vi-gericht-label {
  padding: 8px 16px 3px;
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--light);
}

.vi-option.vi-hidden,
.vi-gericht-group.vi-hidden { display: none; }

.klammer { color: var(--lighter); }

/* ══ FILTER + NEUHEITEN (index.html) ═══════════════════ */
.fn-wrapper {
  width: 100%;
  max-width: 1080px;
  padding: 0 24px;
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.fp {
  width: 264px;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: 68px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.fp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.fp-title {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.fp-badge {
  background: var(--red);
  color: #fff;
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.fp-badge.fp-hidden { display: none; }

.fp-reset {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  color: var(--light);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.fp-reset:hover { color: var(--red); }

.fp-group { border-bottom: 1px solid var(--border); }
.fp-group:last-child { border-bottom: none; }
#fp-body { border-bottom: 1px solid var(--border); }

.fp-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s;
}
.fp-group-head:hover { background: var(--bg); }

.fp-group-name {
  font-family: var(--sans);
  font-size: calc(12.5px * var(--fs-scale));
  font-weight: 500;
  color: var(--ink);
  flex: 1;
  line-height: 1.3;
}

.fp-group-count {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  color: var(--red);
  font-weight: 600;
  background: var(--red-lt);
  padding: 1px 6px;
  border-radius: 10px;
  display: none;
}
.fp-group-count.visible { display: inline-block; }

.fp-select-all {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  color: var(--red);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
}
.fp-group-head:hover .fp-select-all { opacity: 1; }

.fp-clear-section {
  background: none;
  border: 0;
  padding: 0;
  margin: 0 6px 0 0;
  cursor: pointer;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.fp-clear-section:hover { opacity: 1; }
.fp-clear-section img { width: 14px; height: 14px; display: block; }
.fp-clear-section.fp-hidden { display: none; }


.fp-arrow {
  font-size: calc(9px * var(--fs-scale));
  color: var(--light);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.fp-group.open .fp-arrow { transform: rotate(90deg); }

.fp-items {
  display: none;
  padding: 2px 0 8px;
}
.fp-group.open .fp-items { display: block; }

.fp-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 5px 16px 5px 20px;
  cursor: pointer;
  transition: background 0.1s;
}
.fp-item:hover { background: var(--bg); }

.fp-item input[type="checkbox"] {
  accent-color: var(--red);
  cursor: pointer;
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 1px;
}

.fp-item label {
  font-family: var(--sans);
  font-size: calc(11.5px * var(--fs-scale));
  color: var(--muted);
  cursor: pointer;
  line-height: 1.4;
}

.fn-neuheiten { flex: 1; min-width: 0; }
.neuheiten-table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.neuheiten-sticky-head {
  position: fixed;
  left: 0;
  top: 52px;
  z-index: 95;
  display: none;
  pointer-events: none;
}
.neuheiten-sticky-head.visible { display: block; }
.neuheiten-sticky-head-inner {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px 10px 0 0;
  border-bottom: none;
  background: #eeecea;
}
.neuheiten-sticky-head-table {
  border-collapse: separate;
  border-spacing: 0;
  background: #eeecea;
}
.neuheiten-sticky-head-table th {
  font-family: var(--sans);
  font-size: calc(10px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--light);
  padding: 12px 16px;
  text-align: left;
  background: #eeecea;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table-scroll-hint {
  display: none;
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  color: var(--light);
  margin: 0 0 8px;
}

.fn-header-row {
  width: 100%;
  max-width: 1080px;
  padding: 0 24px;
  margin-top: 56px;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.fn-display-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  color: var(--light);
}

.fn-display-sep {
  opacity: 0.5;
  user-select: none;
}

.fn-display-btn {
  border: 0;
  background: transparent;
  color: var(--light);
  font: inherit;
  padding: 0;
  cursor: pointer;
  opacity: 0.72;
}

.fn-display-btn:hover { opacity: 1; }
.fn-display-btn.active {
  color: var(--muted);
  opacity: 1;
  font-weight: 600;
}

.fn-no-results {
  display: none;
  text-align: center;
  padding: 48px 32px;
  font-family: var(--sans);
  font-size: calc(13px * var(--fs-scale));
  color: var(--light);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  line-height: 1.7;
}
.fn-no-results strong { color: var(--muted); display: block; margin-bottom: 6px; }

.fp-date-body, .fp-count-body { padding: 10px 16px 14px; }

.fp-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.fp-date-row:last-child { margin-bottom: 0; }

.fp-date-row label {
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  color: var(--light);
  width: 28px;
  flex-shrink: 0;
}

.fp-date-row input[type="date"] {
  flex: 1;
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

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

.fp-count-row label {
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  color: var(--light);
}

.fp-count-row select {
  font-family: var(--sans);
  font-size: calc(12px * var(--fs-scale));
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
}

@media (max-width: 800px) {
  #topbar {
    height: 48px;
    padding: 0 12px;
  }
  #topbar-inner {
    gap: 10px;
    padding: 0;
  }
  .logo-text {
    font-size: calc(13px * var(--fs-scale));
    letter-spacing: 0.06em;
  }
  .lang-btn {
    font-size: calc(10px * var(--fs-scale));
    padding: 2px 6px;
  }
  .neuheiten-sticky-head {
    top: 48px;
  }
  .neuheiten-sticky-head-table th {
    font-size: calc(9px * var(--fs-scale));
    letter-spacing: 0.06em;
    padding: 8px 8px;
  }

  .hero {
    margin-top: 88px;
    padding: 0 16px;
  }
  .hero-title {
    font-size: calc(34px * var(--fs-scale));
    margin-bottom: 10px;
    max-width: 100%;
  }
  .hero-beta-badge {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    z-index: auto;
    font-size: calc(10px * var(--fs-scale));
    padding: 2px 7px;
    vertical-align: middle;
    margin-left: 6px;
  }
  .hero-subtitle {
    font-size: calc(24px * var(--fs-scale));
    margin-bottom: 28px;
  }
  .search-input {
    font-size: calc(16px * var(--fs-scale));
    padding: 16px 18px;
    padding-right: 56px;
  }

  .search-examples {
    gap: 5px;
    margin-top: 16px;
  }

  .search-ex-chip {
    font-size: calc(11px * var(--fs-scale));
    padding: 4px 9px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 22px;
  }

  .hero-stat {
    padding: 12px 6px 10px;
  }

  .hero-stat-value {
    font-size: calc(18px * var(--fs-scale));
  }

  .fn-wrapper {
    flex-direction: column;
    margin-top: 36px;
    padding: 0 14px;
    gap: 16px;
  }
  .fp {
    width: 100%;
    position: static;
    max-height: none;
  }
  .fn-neuheiten { width: 100%; }
  .neuheiten-table-wrap {
  overflow-x: hidden;
  }
  .neuheiten-table {
  min-width: 0;
  }
  .table-scroll-hint {
  display: none;
  }
  .neuheiten-table thead th,
  .neuheiten-table td {
    padding: 8px 8px;
    font-size: calc(11px * var(--fs-scale));
  }
  .neuheiten-table thead th {
    font-size: calc(9px * var(--fs-scale));
    letter-spacing: 0.06em;
  }
  .td-ref {
    font-size: calc(12px * var(--fs-scale));
    white-space: normal;
  }
  .td-sach .themen-text {
    font-size: calc(10.5px * var(--fs-scale));
    line-height: 1.35;
  }
  .td-date,
  .td-pub {
  white-space: normal;
    font-size: calc(10.5px * var(--fs-scale));
  }
  .mini-pill {
    font-size: calc(9px * var(--fs-scale));
    padding: 2px 6px;
    min-height: 17px;
  }
  .about-section {
    margin-top: 72px;
    padding: 28px 20px;
    border-radius: 10px;
  }
}

@media (max-width: 640px) {
  .neuheiten-table {
    border: 0;
    box-shadow: none;
    background: transparent;
  }
  .neuheiten-table thead {
    display: none;
  }
  .neuheiten-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .neuheiten-table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    overflow: hidden;
  }
  .neuheiten-table tbody tr td:first-child {
    padding-left: 12px;
  }
  .neuheiten-table td {
    display: block;
    width: 100%;
    padding: 8px 12px;
  }
  .neuheiten-table td + td {
    border-top: 1px solid var(--bg);
  }
  .table-scroll-hint {
    display: none;
  }
}

@media (max-width: 1100px) {
  #layout {
    grid-template-columns: 1fr;
    min-height: auto;
    max-width: 100%;
    box-shadow: none;
    margin-top: 52px;
    padding: 12px;
    gap: 12px;
  }

  #main,
  #sidebar,
  #refpanel {
    position: static;
    top: auto;
    height: auto;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
  }

  #main {
    order: 1;
    padding: 32px 22px 36px;
    align-items: stretch;
  }
  #main > * {
    max-width: none;
  }

  #sidebar {
    order: 2;
    border-right: 1px solid var(--border);
    padding: 18px 16px;
  }

  #refpanel {
    order: 3;
    border-left: 1px solid var(--border);
    padding: 18px 16px;
    margin-bottom: 72px;
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .nav-item {
    width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    border: 1px solid var(--border);
  }

  .urteil-titel {
    margin-bottom: 30px;
  }
  .section-block {
    margin-bottom: 44px;
  }
}

@media (max-width: 700px) {
  #layout {
    margin-top: 48px;
    padding: 8px;
    gap: 8px;
  }

  #main {
    padding: 20px 14px 28px;
  }
  .urteil-titel {
    font-size: calc(19px * var(--fs-scale));
    margin-bottom: 22px;
  }
  .section-head {
    font-size: calc(9px * var(--fs-scale));
    letter-spacing: 0.12em;
    margin-bottom: 16px;
    padding-bottom: 8px;
  }

  .abschnitt {
    margin-bottom: 20px;
  }
  .abschnitt-text,
  .disp-text {
    font-size: calc(14px * var(--fs-scale));
    line-height: 1.7;
  }
  .abschnitt[data-depth="2"] {
    padding-left: 12px;
  }
  .abschnitt[data-depth="3"] {
    padding-left: 24px;
  }

  .meta-block {
    margin-bottom: 16px;
  }
  .meta-value,
  .richter-item {
    font-size: calc(12px * var(--fs-scale));
  }

  .ref-chip {
    font-size: calc(11px * var(--fs-scale));
    padding: 4px 8px;
  }

  footer {
    position: static;
  }
  .footer-inner {
    padding: 14px 16px;
    flex-wrap: wrap;
    gap: 8px 14px;
    justify-content: center;
    text-align: center;
  }
  .footer-right {
    flex-wrap: wrap;
    justify-content: center;
  }
  body.page-centered {
    padding-bottom: 18px;
  }
}

/* ══ ABOUT / API PAGE (about.html) ══════════════════════ */
.api-endpoint { margin-bottom: 36px; }

.api-method {
  display: inline-block;
  font-family: monospace;
  font-size: calc(12px * var(--fs-scale));
  font-weight: 700;
  background: var(--red);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 8px;
  vertical-align: middle;
  letter-spacing: 0.04em;
}
.api-method.get  { background: #2e7d32; }
.api-method.post { background: #1565c0; }

.api-path {
  font-family: monospace;
  font-size: calc(15px * var(--fs-scale));
  font-weight: 600;
  color: var(--ink);
  vertical-align: middle;
}

.api-desc {
  margin-top: 8px;
  font-size: calc(14px * var(--fs-scale));
  color: var(--muted);
  line-height: 1.7;
}

.api-params { margin-top: 10px; font-size: calc(13px * var(--fs-scale)); color: var(--muted); }

.api-params table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.api-params th {
  font-family: var(--sans);
  font-size: calc(11px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--light);
  text-align: left;
  padding: 6px 10px;
  background: #f5f4f1;
  border: 1px solid var(--border);
}

.api-params td {
  font-size: calc(13px * var(--fs-scale));
  padding: 7px 10px;
  border: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

.api-params td:first-child {
  font-family: monospace;
  font-size: calc(12px * var(--fs-scale));
  color: var(--red);
  white-space: nowrap;
}

pre.api-example {
  background: #f5f4f1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 16px;
  font-family: monospace;
  font-size: calc(12.5px * var(--fs-scale));
  line-height: 1.6;
  color: var(--ink);
  overflow-x: auto;
  margin-top: 10px;
  white-space: pre;
}

.api-example-label {
  font-size: calc(11px * var(--fs-scale));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--light);
  margin-top: 12px;
  margin-bottom: 4px;
}

.api-divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

.api-note {
  background: #f9f0f0;
  border-left: 3px solid var(--red);
  padding: 10px 14px;
  font-size: calc(13px * var(--fs-scale));
  color: var(--muted);
  border-radius: 0 6px 6px 0;
  margin-top: 10px;
  line-height: 1.6;
}

/* ══ LOADING OVERLAY ════════════════════════════════════ */
#loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
}
#loading-overlay.hidden { display: none; }
.loading-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 14px;
}
.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══ DRUCKLAYOUT ════════════════════════════════════════ */
@media print {

  /* Alles ausblenden ausser main */
  #topbar, #sidebar, #refpanel, footer, #loading-overlay { display: none !important; }

  /* Layout zurücksetzen: main nimmt die ganze Seite */
  #layout {
    display: block !important;
    max-width: 100%;
    box-shadow: none;
  }

  #main {
    display: block !important;
    max-width: 600px !important;
    width: 600px !important;
    margin: 0 auto !important;
    padding: 0 !important;
    font-family: var(--serif);
  }

  #main > * {
    max-width: 600px !important;
    width: 600px !important;
  }

  /* Zwischentitel Sachverhalt / Erwägungen / Dispositiv */
  .section-head {
    display: block !important;
    font-family: var(--serif);
    font-size: calc(11pt * var(--fs-scale));
    font-weight: 700;
    color: #000;
    letter-spacing: 0;
    text-transform: none;
    border-bottom: 0.5pt solid #000;
    padding-bottom: 4pt;
    margin-bottom: 12pt;
    margin-top: 24pt;
  }

  /* Seitenränder */
  @page {
    margin: 2.5cm 2.8cm 2.5cm 2.8cm;
    orphans: 3;
    widows: 3;
  }

  /* Haupttitel */
  .urteil-titel {
    font-family: var(--serif);
    font-size: calc(16pt * var(--fs-scale));
    font-weight: 700;
    color: #000;
    margin-bottom: 6pt;
    border-bottom: 1pt solid #000;
    padding-bottom: 6pt;
  }

  /* Abschnitte */
  .section-block {
    margin-bottom: 18pt;
  }

  /* Abschnitts-ID (Nummerierung) */
  .abschnitt-id {
    font-family: var(--serif);
    font-size: calc(9pt * var(--fs-scale));
    font-weight: 700;
    color: #000;
    letter-spacing: 0;
    margin-bottom: 3pt;
    page-break-after: avoid;
    break-after: avoid;
  }

  /* Fliesstext */
  .abschnitt-text {
    font-family: var(--serif);
    font-size: calc(10.5pt * var(--fs-scale));
    line-height: 1.65;
    color: #000;
    text-align: justify;
    hyphens: auto;
    margin: 0 0 7pt;
  }
  .abschnitt-text:last-child { margin-bottom: 0; }

  .abschnitt {
    margin-bottom: 10pt;
  }

  /* Klammer-Text im Druck nicht grau */
  .klammer { color: #000; }

  /* Dispositiv */
  .disp-punkt {
    margin-bottom: 8pt;
    page-break-inside: avoid;
  }
  .disp-nr {
    font-family: var(--serif);
    font-size: calc(10.5pt * var(--fs-scale));
    font-weight: 700;
    color: #000;
    min-width: 18pt;
  }
  .disp-text {
    font-family: var(--serif);
    font-size: calc(10.5pt * var(--fs-scale));
    line-height: 1.65;
    color: #000;
  }

  /* Seitenmarker ausblenden */
  .page-marker { display: none; }

  /* Regeste */
  .regeste-main {
    border-left: 2pt solid #999;
    padding: 6pt 10pt;
    margin-bottom: 14pt;
    background: none;
  }
  .regeste-main-titel {
    font-size: calc(8pt * var(--fs-scale));
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 4pt;
  }
  .regeste-main-text {
    font-family: var(--serif);
    font-size: calc(9.5pt * var(--fs-scale));
    line-height: 1.55;
    color: #222;
  }

  /* Links schlicht */
  a { color: #000; text-decoration: none; }
  .lnk-bge, .lnk-bger, .lnk-law, .lnk-erw {
    color: #000;
    text-decoration: none;
    border-bottom: none;
  }

  /* Keine Animationen */
  * { animation: none !important; transition: none !important; }
}
/* ════════════════════════════════════════════════════════
   GESETZ — Layout & Sidebar
   ════════════════════════════════════════════════════════ */
.gesetz-layout {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 0;
  max-width: 1400px;
  margin: 52px auto 0;
  min-height: calc(100vh - 52px);
}
.gesetz-sidebar-left {
  padding: 28px 20px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
}
.gesetz-main {
  padding: 28px 40px;
  max-width: 860px;
}
.gesetz-sidebar-right {
  padding: 20px 16px;
  border-left: 1px solid var(--border);
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
}
.gesetz-sr-big {
  font-size: 13px;
  color: var(--light);
  letter-spacing: .05em;
  margin-bottom: 6px;
}
.gesetz-abbr {
  font-size: 24px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 4px;
}
.gesetz-abbr-alt {
  font-size: 13px;
  color: var(--light);
  margin-bottom: 20px;
}
.gesetz-law-header { margin-bottom: 20px; }
.gesetz-law-title-full {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.4;
  margin-bottom: 4px;
}
.gesetz-law-short {
  font-size: 12px;
  color: var(--light);
  margin-bottom: 4px;
}
.gesetz-law-dates {
  font-size: 11px;
  color: var(--light);
  line-height: 1.5;
}
.gesetz-fedlex-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--light);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 5px 10px;
  margin-bottom: 24px;
}
.gesetz-fedlex-link:hover { border-color: var(--red); color: var(--red); }
.gesetz-sidebar-notice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 11px;
  line-height: 1.5;
  color: var(--light);
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.gesetz-sidebar-notice-icon {
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--red-mid);
}
.gesetz-h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 40px;
  line-height: 1.2;
}
.gesetz-overview-header { margin-bottom: 28px; }
.gesetz-overview-header .gesetz-h1 { font-size: 24px; margin-bottom: 8px; }
.gesetz-overview-short { font-size: 16px; color: var(--light); margin-bottom: 6px; }
.gesetz-overview-dates { font-size: 13px; color: var(--light); line-height: 1.5; }
.gesetz-article-nav-bar {
  margin: -8px -40px 28px;
  padding: 0 40px 18px;
  border-bottom: 1px solid var(--border);
}
.gesetz-article-nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.gesetz-article-nav-link {
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
  color: var(--fg);
  max-width: 48%;
}
.gesetz-article-nav-prev { text-align: left; }
.gesetz-article-nav-next { text-align: right; margin-left: auto; }
.gesetz-article-nav-link:hover { color: var(--red); }
.gesetz-article-nav-heading { font-weight: 400; color: var(--light); }
.gesetz-article-nav-spacer { flex: 1; }
.gesetz-article-block { margin-top: 0; }
.gesetz-article-context {
  font-size: 12px;
  line-height: 1.5;
  color: var(--light);
  margin: 0 -40px 10px;
  padding: 0 40px;
  width: auto;
}
.gesetz-article-crumb-law {
  color: var(--light);
  font-weight: 500;
  text-decoration: none;
}
.gesetz-article-crumb-law:hover { color: var(--red); }
.gesetz-article-crumb-sep { margin: 0 5px; opacity: 0.6; }
.gesetz-article-crumb { color: var(--light); }
.gesetz-article-crumb-link {
  text-decoration: none;
  color: var(--light);
}
.gesetz-article-crumb-link:hover { color: var(--red); }
.gesetz-article-crumb-current { color: var(--text); font-weight: 500; }
.gesetz-toc-summary[id],
.gesetz-toc-leaf[id] { scroll-margin-top: 72px; }
.gesetz-article-h1 { margin-top: 0; }
.gesetz-article-h1 .gesetz-h1-fn-ref,
.gesetz-article-h1 .gesetz-fn-ref {
  font-size: 0.42em;
  font-weight: 400;
  line-height: 0;
  vertical-align: baseline;
  position: relative;
  top: -0.65em;
  color: var(--light);
  margin-left: 0.08em;
  text-decoration: none;
}
.gesetz-article-h1 .gesetz-h1-fn-ref sup,
.gesetz-article-h1 .gesetz-fn-ref sup {
  font-size: 1em;
  line-height: 0;
  position: relative;
  top: -.50em;
}
.gesetz-article-h1 .gesetz-h1-fn-ref:hover,
.gesetz-article-h1 .gesetz-fn-ref:hover {
  color: var(--red);
  text-decoration: none;
}
.gesetz-h1-name {
  font-weight: 400;
}
.gesetz-subtitle {
  font-size: 14px;
  color: var(--light);
  margin-bottom: 32px;
}
.gesetz-stat {
  font-size: 13px;
  color: var(--light);
  margin: 8px 0 24px;
}
.gesetz-skeleton-section {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 24px;
  color: var(--light);
  font-size: 13px;
}
.gesetz-cited-by-section { margin-top: 32px; }
.gesetz-section-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 12px;
}
.gesetz-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 32px;
}
.gesetz-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 10px;
  text-decoration: none;
  color: var(--fg);
  transition: border-color .15s, background .15s;
  min-height: 72px;
}
.gesetz-tile:hover { border-color: var(--red); background: #fafafa; }
.gesetz-tile-art { font-size: 17px; font-weight: 600; }
.gesetz-tile-cnt { font-size: 11px; color: var(--light); margin-top: 3px; }
.gesetz-toc { margin-bottom: 32px; line-height: 1.55; }
.gesetz-toc-loading { margin-bottom: 32px; }
.gesetz-toc-empty { color: var(--light); font-size: 14px; margin-bottom: 32px; }
.gesetz-toc-details { margin: 0; }
.gesetz-toc-summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  color: var(--fg);
  margin: 5px 0 2px;
}
.gesetz-toc-summary::-webkit-details-marker { display: none; }
.gesetz-toc-summary::before {
  content: '▶';
  font-size: 9px;
  display: inline-block;
  margin-right: 5px;
  transition: transform .15s;
}
.gesetz-toc-details[open] > .gesetz-toc-summary::before { transform: rotate(90deg); }
.gesetz-toc-leaf { margin: 5px 0 2px; color: var(--fg); }
.gesetz-toc-title > .gesetz-toc-summary,
.gesetz-toc-title.gesetz-toc-leaf { font-size: 16px; font-weight: 700; }
.gesetz-toc-book > .gesetz-toc-summary,
.gesetz-toc-book.gesetz-toc-leaf,
.gesetz-toc-part > .gesetz-toc-summary,
.gesetz-toc-part.gesetz-toc-leaf { font-size: 15px; font-weight: 700; }
.gesetz-toc-chapter > .gesetz-toc-summary,
.gesetz-toc-chapter.gesetz-toc-leaf { font-size: 14px; font-weight: 600; }
.gesetz-toc-section > .gesetz-toc-summary,
.gesetz-toc-section.gesetz-toc-leaf { font-size: 14px; font-weight: 600; color: var(--fg); }
.gesetz-toc-level > .gesetz-toc-summary,
.gesetz-toc-level.gesetz-toc-leaf { font-size: 13px; font-weight: 500; font-style: italic; }
.gesetz-toc-proviso > .gesetz-toc-summary,
.gesetz-toc-proviso.gesetz-toc-leaf,
.gesetz-toc-transitional > .gesetz-toc-summary,
.gesetz-toc-transitional.gesetz-toc-leaf { font-size: 13px; font-weight: 600; font-style: italic; }
.gesetz-toc-children { margin-bottom: 2px; }
.gesetz-toc-article {
  display: block;
  font-size: 13px;
  font-weight: 400;
  padding: 1px 0;
  text-decoration: none;
  color: var(--fg);
}
.gesetz-toc-article:hover { color: var(--red); }
.gesetz-nav-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--light);
  margin-bottom: 8px;
}
.gesetz-nav-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.gesetz-nav-chip {
  font-size: 11px;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 7px;
  text-decoration: none;
  color: var(--fg);
}
.gesetz-nav-chip:hover { border-color: var(--red); color: var(--red); }
.gesetz-nav-chip.active { border-color: var(--red); color: var(--red); background: #fff5f5; }
#gesetz-cited-list .ref-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#g-mobile-cited-by { display: none; margin-top: 28px; }
@media (max-width: 900px) {
  .gesetz-layout { grid-template-columns: 1fr; }
  .gesetz-sidebar-left, .gesetz-sidebar-right { display: none; }
  #g-mobile-cited-by { display: block; }
}
.g-loading {
  padding: 40px 0;
  color: var(--light);
  font-size: 14px;
}
.gesetz-error-msg { color: var(--light); }
.gesetz-chip-date { color: var(--light); font-size: 11px; }

/* ════════════════════════════════════════════════════════
   GESETZ PHASE 2 — MCP-Anreicherung
   ════════════════════════════════════════════════════════ */
.gesetz-section {
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 24px;
}
.gesetz-section:last-child { border-bottom: none; }
.gesetz-details-section {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.gesetz-details-summary {
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.gesetz-details-summary::-webkit-details-marker { display: none; }
.gesetz-details-summary::before {
  content: '▶';
  font-size: 9px;
  transition: transform .15s;
  display: inline-block;
}
.gesetz-details-section[open] > .gesetz-details-summary::before { transform: rotate(90deg); }
.gesetz-details-section .gesetz-section-body { padding: 0 16px 16px; }
.gesetz-source-badge {
  font-size: 11px;
  font-weight: 400;
  color: var(--light);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1px 7px;
  margin-left: 4px;
}
.gesetz-skeleton {
  color: var(--light);
  font-family: var(--sans);
  font-size: 13px;
  padding: 12px 0;
}
.gesetz-unavail {
  color: var(--light);
  font-family: var(--sans);
  font-size: 13px;
  font-style: italic;
}
.gesetz-law-title {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--light);
  margin-bottom: 8px;
}
.gesetz-art-heading {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 15px;
  margin: 12px 0 6px;
}
.gesetz-art-text {
  font-family: var(--sans);
  font-size: calc(15px * var(--fs-scale));
  line-height: 1.85;
  color: var(--ink);
}
.gesetz-mat-block { margin-bottom: 20px; }
.gesetz-mat-block h4 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--light);
  margin-bottom: 6px;
}
.gesetz-mat-text {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
  max-height: 400px;
  overflow-y: auto;
}
.gesetz-mat-source {
  font-size: 11px;
  color: var(--light);
  margin-top: 8px;
  font-family: var(--sans);
}
.gesetz-mat-date {
  font-weight: 400;
  font-size: 11px;
  color: var(--light);
  margin-left: 4px;
}
.gesetz-mat-author {
  display: block;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  color: var(--light);
  margin-bottom: 4px;
}

.gesetz-mat-history { border-top: 1px solid var(--line); padding-top: 14px; }
.gesetz-mat-refs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gesetz-mat-refs li {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
}
.gesetz-mat-ref-link {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}
.gesetz-mat-ref-link:hover { text-decoration: underline; }
.gesetz-mat-bbl-link {
  font-size: 11px;
  font-weight: 500;
  color: var(--light);
  text-decoration: none;
  margin-left: 6px;
  white-space: nowrap;
}
.gesetz-mat-bbl-link:hover { color: var(--accent); text-decoration: underline; }
.gesetz-mat-ref-ctx {
  color: var(--ink);
}

/* ── Kommentar (OnlineKommentar.ch) ─────────────────────────────────────── */
.gesetz-k-ref {
  font-family: var(--sans);
}
.gesetz-k-cite-main {
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 6px;
  font-style: italic;
}
.gesetz-hist-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  font-size: 13px;
}
.gesetz-hist-table th {
  text-align: left;
  padding: 6px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--light);
}
.gesetz-hist-table td { padding: 6px 12px; border-bottom: 1px solid #f0f0f0; }
.gesetz-hist-date { color: var(--light); white-space: nowrap; width: 120px; }

/* ── Gesetz Wortlaut — strukturierte Darstellung ─────────────────────────── */
.gesetz-abs {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: 0.9em;
  font-family: var(--sans);
  font-size: calc(15px * var(--fs-scale));
  line-height: 1.85;
  color: var(--ink);
}
.gesetz-absnum {
  position: absolute;
  left: 0;
  top: 0.18em;
  font-size: 0.65em;
  font-family: var(--sans);
  color: var(--light);
  line-height: 1;
}

/* Lateinische Ordinalsuffixe (269quater, 9bis, ...) — klein und hochgestellt */
.gesetz-art-suffix {
  font-size: 0.65em;
  font-weight: inherit;
  text-transform: lowercase;
  vertical-align: super;
  line-height: 0;
  margin-left: 0.05em;
}

/* Fussnoten-Marker im Fliesstext und im H1 — klickbar, dezent eingefaerbt */
.gesetz-fn-ref,
a.gesetz-fn-ref {
  color: var(--primary, #2563eb);
  text-decoration: none;
  font-size: 0.8em;
  margin-left: 0.1em;
}
.gesetz-fn-ref:hover { text-decoration: underline; }
.gesetz-abs a.gesetz-fn-ref-link {
  color: var(--primary, #2563eb);
  text-decoration: none;
  font-size: 0.65em;
  line-height: 0;
  vertical-align: super;
  margin-left: 0.08em;
}
.gesetz-abs a.gesetz-fn-ref-link:hover { text-decoration: underline; }
.gesetz-litlist {
  margin: 0.5em 0 0;
  padding-left: 1em;
  list-style: none;
}
.gesetz-lititem {
  display: grid;
  grid-template-columns: 3em 1fr;
  gap: 0 0.25em;
  margin-bottom: 0.45em;
  align-items: baseline;
}
.gesetz-lit-letter {
  font-size: 1em;
  color: var(--ink);
}
.gesetz-lit-body {
  display: block;
}
.gesetz-lexfind-intro {
  font-style: italic;
}
.gesetz-litlist-sub {
  margin-top: 0.4em;
  padding-left: 1.6em;
}
.gesetz-subitem {
  grid-template-columns: 1.8em 1fr;
  margin-bottom: 0.35em;
}
.gesetz-annotation {
  display: block;
  font-size: 11px;
  color: var(--light);
  font-family: var(--sans);
  font-style: italic;
  line-height: 1.4;
  margin-bottom: 3px;
}

/* Gesetz Wortlaut — Fussnoten */
.gesetz-fn-ref {
  font-size: 0.65em;
  line-height: 0;
  vertical-align: super;
  font-family: var(--sans);
  color: var(--light);
}
.gesetz-fn-list {
  margin-top: 20px;
  padding: 12px 0 0;
  border-top: 1px solid var(--border);
  list-style: none;
  padding-left: 0;
}
.gesetz-fn-item {
  font-size: 11px;
  font-family: var(--sans);
  color: var(--light);
  line-height: 1.5;
  margin-bottom: 4px;
  display: grid;
  grid-template-columns: 1.4em 1fr;
  gap: 0 0.2em;
}
.gesetz-fn-item > sup {
  padding-top: 1px;
  font-size: 0.8em;
}
a.gesetz-fn-ref-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
}
a.gesetz-fn-ref-link:hover { border-bottom-color: var(--red); color: var(--red); }

/* ── Gesetz Leitentscheide ───────────────────────────────────────────────── */
.gesetz-lc-group { display: flex; flex-direction: column; gap: 8px; }
.gesetz-lc-card {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}
a.gesetz-lc-card:hover { border-color: var(--red); background: #fdf8f8; }
.gesetz-lc-citation {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  color: var(--red);
}
a.gesetz-lc-card .gesetz-lc-citation { color: var(--red); }
.gesetz-lc-von { font-weight: 400; color: var(--ink); }
.gesetz-lc-meta {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--light);
  margin-top: 2px;
}
.gesetz-lc-regeste {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink);
  margin-top: 6px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gesetz-lc-sep {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--light);
  margin: 16px 0 6px;
}
.gesetz-lc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  transition: border-color .15s;
}
.gesetz-lc-row:hover { border-color: var(--red); }
.gesetz-lc-docket {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
  white-space: nowrap;
}
.gesetz-lc-row-meta {
  font-family: var(--sans);
  font-size: 11px;
  color: var(--light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
