:root {
  --bg: #FFFFFF;
  --surface: #F6F7F8;
  --surface-2: #EDEFF1;
  --ink: #1C2126;
  --ink-soft: #5A636C;
  --line: #DDE1E5;
  --accent: #C13B4A;
  --accent-ink: #FFFFFF;
  --ins-ink: #1D6B40;
  --ins-bg: #DFF2E5;
  --ins-mark: #B9E4C6;
  --del-ink: #A33036;
  --del-bg: #FBE7E8;
  --del-mark: #F4C6C9;
  --chg-ink: #8A5800;
  --chg-bg: #FBF3DC;
  --chg-mark: #F2DFA9;
  --law-ink: #23282E;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171A;
    --surface: #1C2025;
    --surface-2: #23282E;
    --ink: #E8E6E1;
    --ink-soft: #9AA3AC;
    --line: #2E343B;
    --accent: #D26470;
    --accent-ink: #14171A;
    --ins-ink: #7ECD9A;
    --ins-bg: #16281D;
    --ins-mark: #1F4A2E;
    --del-ink: #E39599;
    --del-bg: #301B1D;
    --del-mark: #57282B;
    --chg-ink: #E5BE6A;
    --chg-bg: #2C2310;
    --chg-mark: #56451D;
    --law-ink: #DCDAD4;
  }
}
:root[data-theme="dark"] {
  --bg: #14171A;
  --surface: #1C2025;
  --surface-2: #23282E;
  --ink: #E8E6E1;
  --ink-soft: #9AA3AC;
  --line: #2E343B;
  --accent: #D26470;
  --accent-ink: #14171A;
  --ins-ink: #7ECD9A;
  --ins-bg: #16281D;
  --ins-mark: #1F4A2E;
  --del-ink: #E39599;
  --del-bg: #301B1D;
  --del-mark: #57282B;
  --chg-ink: #E5BE6A;
  --chg-bg: #2C2310;
  --chg-mark: #56451D;
  --law-ink: #DCDAD4;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}
.mono { font-family: "IBM Plex Mono", ui-monospace, Menlo, monospace; }

header.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 20px 12px;
  display: flex; flex-direction: column; gap: 12px;
}
.brandrow { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.brand {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent);
}
.lawpick {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 18px; font-weight: 600;
  color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 6px 8px; max-width: 70ch;
}
.lawpick:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lawpick-wrap { position: relative; display: inline-block; max-width: 70ch; flex: 1; }
.typ-filter {
  font-family: "IBM Plex Mono", monospace; font-size: 12px;
  color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 6px 6px; align-self: center;
}
.typ-filter:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-wrap { position: relative; align-self: center; }
.filter-btn {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 6px 7px; cursor: pointer;
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { color: var(--accent); border-color: var(--accent); }
.filter-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.filter-panel[hidden] { display: none; }
.filter-panel {
  position: absolute; z-index: 40; top: calc(100% + 4px); left: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 14px; white-space: nowrap;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
.filter-panel .filter-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink); cursor: pointer;
}
.filter-panel input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; }
.filter-panel .filter-sep { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 2px; }
.lawpick-wrap .lawpick { width: 100%; }
.lawlist {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0;
  min-width: 100%; max-width: min(96ch, calc(100vw - 40px));
  max-height: 340px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none;
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
}
.lawlist li {
  padding: 5px 10px; border-radius: 4px; cursor: pointer;
  font-size: 13px; font-weight: 400;
  /* wrap instead of ellipsis: long historical titles (e.g. the 1925 B-VG
     Wiederverlautbarung, ~110 chars) must stay fully readable */
}
.lawlist li.active, .lawlist li:hover { background: var(--surface); color: var(--accent); }
.lawlist li .abk { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--ink-soft); }
.lawlist li.empty { color: var(--ink-soft); font-style: italic; cursor: default; }
.proto {
  font-size: 11px; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: 3px;
  padding: 1px 7px; letter-spacing: .05em; text-transform: uppercase;
}
.controls {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  width: 100%;
}
.controls[hidden] { display: none; }  /* author grid would beat the hidden attribute */
.toggle[hidden] { display: none; }
.side-ctl { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.controls select {
  font-family: "IBM Plex Mono", monospace; font-size: 13px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 7px 9px; max-width: 46ch;
}
.controls select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.arrow { color: var(--accent); font-size: 17px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.step-btn {
  font-family: "IBM Plex Mono", monospace; font-size: 15px; line-height: 1;
  color: var(--accent); background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 4px 9px; cursor: pointer;
}
.step-btn:hover:not(:disabled) { border-color: var(--accent); }
.step-btn:disabled { color: var(--ink-soft); opacity: .45; cursor: default; }
.step-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bgbl-btn {
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px; font-weight: 500;
  letter-spacing: .05em; text-decoration: none;
  color: var(--accent); background: var(--surface);
  border: 1px solid var(--accent); border-radius: 4px;
  padding: 6px 9px; line-height: 1;
}
.bgbl-btn:hover { background: var(--accent); color: var(--accent-ink); }
.bgbl-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bgbl-btn[aria-disabled="true"] { color: var(--ink-soft); border-color: var(--line); pointer-events: none; }
.toggle { display: flex; align-items: center; gap: 7px; margin-left: auto; font-size: 13px; color: var(--ink-soft); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 15px; height: 15px; }
.jump {
  font-family: "IBM Plex Mono", monospace; font-size: 12px;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 4px;
  padding: 4px 6px; max-width: 12ch; margin-right: 6px;
}
.jump:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.para-block { scroll-margin-top: 130px; }

.stats { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 20px 0; }
.chip {
  font-family: "IBM Plex Mono", monospace; font-size: 12.5px;
  padding: 3px 10px; border-radius: 20px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.chip.c-chg { color: var(--chg-ink); border-color: var(--chg-ink); background: var(--chg-bg); }
.chip.c-ins { color: var(--ins-ink); border-color: var(--ins-ink); background: var(--ins-bg); }
.chip.c-del { color: var(--del-ink); border-color: var(--del-ink); background: var(--del-bg); }

main { padding: 14px 20px 60px; display: flex; flex-direction: column; gap: 10px; }

.para-block { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--bg); }
.para-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  cursor: default;
}
.para-block.is-collapsed .para-head { border-bottom: none; cursor: pointer; }
.para-key { font-family: "IBM Plex Mono", monospace; font-weight: 500; font-size: 14px; }
.badge {
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  padding: 1px 8px; border-radius: 3px;
}
.badge.b-chg { background: var(--chg-mark); color: var(--chg-ink); }
.badge.b-ins { background: var(--ins-mark); color: var(--ins-ink); }
.badge.b-del { background: var(--del-mark); color: var(--del-ink); }
.badge.b-eq  { background: var(--surface-2); color: var(--ink-soft); font-weight: 500; }
.para-meta { margin-left: auto; font-family: "IBM Plex Mono", monospace; font-size: 11.5px; color: var(--ink-soft); }
.expander { background: none; border: none; color: var(--ink-soft); font: inherit; font-size: 12.5px; cursor: pointer; padding: 0; }
.expander:hover, .para-block.is-collapsed .para-head:hover .expander { color: var(--accent); }
.expander:focus-visible { outline: 2px solid var(--accent); border-radius: 2px; }

.panes { display: grid; grid-template-columns: 1fr 1fr; }
/* aligned row pairs: one row per corresponding Absatz/Ziffer block; the
   shorter cell leaves whitespace so both sides stay in lockstep */
.rowset { }
.prow { display: grid; grid-template-columns: 1fr 1fr; }
.prow .cell { min-width: 0; padding: 0 18px; }
.prow .cell.cellL { background: color-mix(in srgb, var(--del-bg) 18%, var(--bg)); }
.prow .cell.cellR { background: color-mix(in srgb, var(--ins-bg) 18%, var(--bg)); border-left: 1px solid var(--line); }
.rowset .prow:first-child .cell { padding-top: 14px; }
.rowset .prow:last-child .cell { padding-bottom: 18px; }
.pane { padding: 14px 18px 18px; min-width: 0; }
.pane-meta {
  font-family: "IBM Plex Mono", monospace; font-size: 11.5px;
  color: var(--ink-soft); margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px dashed var(--line);
}
.pane + .pane { border-left: 1px solid var(--line); }
.pane.side-del { background: color-mix(in srgb, var(--del-bg) 18%, var(--bg)); }
.pane.side-ins { background: color-mix(in srgb, var(--ins-bg) 18%, var(--bg)); }
.pane.missing { display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: 13px; font-style: italic; }
.single { padding: 14px 18px 18px; }

.lawtext {
  /* canonical law-text typography = RIS website (measured live 2026-08-30):
     Verdana 12.8px justified, 945px column; list content widths result from
     the level margins (945-56=889 / -76=869 / -101=844), symbols hang in the
     left gutter OUTSIDE the measure; vertical rhythm from the RIS document
     stylesheet (pt values). Break-congruence verified word-by-word. */
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-size: 12.8px; line-height: normal;
  text-align: justify;
  color: var(--law-ink);
  max-width: 945px;
  overflow-wrap: break-word;
}
.lawtext .blk { text-indent: 30.67px; margin: 4pt 0 2pt; }
.lawtext .blk-h { text-align: center; font-weight: 700; text-indent: 0; margin: 4pt 0 0; }
.lawtext .blk-gld { float: left; font-weight: 700; text-indent: 0; margin: 0 4px 0 0; }
.lawtext .blk-gld + div.blk { text-indent: 0; }
.lawtext .blk-anm { font-style: italic; }
/* trailer metadata (Anmerkung, Schlagworte): RIS-style bold label + plain lines */
.lawtext .blk-label { font-weight: 700; text-indent: 0; text-align: left; margin-top: 10px; }
.lawtext .blk-meta { text-indent: 0; text-align: left; margin: 1pt 0; }
.ris-link { color: var(--accent); text-decoration: none; font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.ris-link:hover { text-decoration: underline; }
.ris-link[aria-disabled="true"] { color: var(--ink-soft); pointer-events: none; }
.lawtext [class*="blk-l"], .lawtext [class*="blk-s"] {
  position: relative; text-indent: 0; margin: 1.5pt 0 1pt;
}
.lawtext .blk-l1, .lawtext .blk-s1 { margin-left: 56px; }
.lawtext .blk-l2, .lawtext .blk-s2 { margin-left: 76px; }
.lawtext .blk-l3, .lawtext .blk-s3 { margin-left: 101px; }
.lawtext .blk-l4, .lawtext .blk-s4 { margin-left: 126px; }
.lawtext .blk-l5, .lawtext .blk-s5 { margin-left: 151px; }
.lawtext .blk-l6, .lawtext .blk-s6 { margin-left: 176px; }
.lawtext .blk-l7, .lawtext .blk-s7 { margin-left: 201px; }
.lawtext [class*="blk-s"] { margin-top: 3pt; }
.lawtext .sym { position: absolute; right: calc(100% + 6px); white-space: nowrap; }
.lawtext::after { content: ""; display: block; clear: both; }
ins.d {
  text-decoration: none;
  background: var(--ins-mark); color: var(--ins-ink);
  border-radius: 2px; padding: 0 1px;
}
del.d {
  background: var(--del-mark); color: var(--del-ink);
  border-radius: 2px; padding: 0 1px;
}

footer {
  padding: 18px 20px 34px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-soft);
  display: flex; gap: 6px; flex-direction: column;
}
@media (max-width: 760px) {
  .panes { grid-template-columns: 1fr; }
  .prow { grid-template-columns: 1fr; }
  .prow .cell.cellR { border-left: none; }
  .controls { grid-template-columns: 1fr; }
  .controls .arrow { text-align: center; }
  .pane + .pane { border-left: none; border-top: 1px solid var(--line); }
  .controls select { max-width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .para-block { transition: border-color .15s; }
}

/* header navigation between the pages (Start / sibling tool) */
.nav-link {
  font-family: "IBM Plex Mono", monospace; font-size: 12px; letter-spacing: .05em;
  color: var(--ink-soft); text-decoration: none; text-transform: uppercase;
}
.nav-link:hover { color: var(--accent); }

/* legal footer (Impressum / CC-BY attribution / disclaimer) */
.site-foot {
  display: block;  /* overrides the generic flex-column footer rule above */
  margin: 40px 0 0; padding: 12px 20px 20px; border-top: 1px solid var(--line);
  font-size: 12px; color: var(--ink-soft); text-align: center;
}
.site-foot a { color: var(--ink-soft); text-decoration: underline; }
.site-foot a:hover { color: var(--accent); }
