/* ============================================================
   Familienarchiv · gemeinsames Stylesheet
   Basis: Landingpage (Fraunces / Inter / warmes Beige)
   ============================================================ */

:root {
  --bg:         #efe7d8;
  --bg-soft:    #f3ecdf;
  --bg-deep:    #e6dcc7;
  --ink:        #1f1a14;
  --ink-soft:   #4a3f30;
  --ink-faint:  #8a7c61;
  --rule:       #cabf9e;
  --rule-soft:  #d8cdab;
  --warn-bg:    #f0e3bc;
  --warn-edge:  #b08a2e;
  --warn-ink:   #6f5418;
  --tip-bg:     #e6dcc7;
  --serif:      'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --sans:       'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Layout
   ============================================================ */

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 80px 80px 48px;
}

@media (max-width: 720px) {
  .page { padding: 56px 32px 36px; }
}

/* ============================================================
   Header-Elemente: Eyebrow, Hero, Subtitle, Intro
   ============================================================ */

.eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 64px;
}
.eyebrow::before { content: "—  "; color: var(--ink-soft); }
.eyebrow a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.eyebrow a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}
.eyebrow .sep {
  margin: 0 0.5em;
  color: var(--ink-faint);
}

.hero {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 48px;
}
.hero-text { flex: 1; min-width: 0; }
.hero-logo { flex-shrink: 0; width: clamp(110px, 14vw, 150px); }
.hero-logo img { width: 100%; height: auto; display: block; }

.latin-motto {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  line-height: 1;
  margin-bottom: 16px;
  cursor: help;
  transition: color 0.2s ease;
}
.latin-motto:hover { color: var(--ink); }

h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(56px, 8vw, 96px);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: -6px;
}

/* Kleinerer h1 für Handbuch-Innenseiten */
.page--doc h1 {
  font-size: clamp(40px, 6vw, 68px);
  margin-bottom: 4px;
}

.subtitle {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
}
.page--doc .subtitle { font-size: 22px; }

.intro p {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.intro p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  .hero { gap: 20px; }
  .hero-logo { width: clamp(80px, 22vw, 110px); }
  h1 { font-size: clamp(44px, 11vw, 72px); }
  .subtitle { font-size: 19px; }
  .intro p { font-size: 16px; }
}

/* ============================================================
   Trennlinien
   ============================================================ */

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 36px 0;
}
@media (max-width: 720px) { .rule { margin: 44px 0; } }

/* ============================================================
   Statistik-Kacheln (Landingpage)
   ============================================================ */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 32px;
  row-gap: 44px;
}
.stat-number {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  min-height: 30px;
  display: flex;
  align-items: flex-end;
}
.stat-number.period { font-size: 24px; }
.stat-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr 1fr; column-gap: 24px; row-gap: 32px; }
  .stat-number { font-size: 26px; min-height: 26px; }
  .stat-number.period { font-size: 22px; }
}

/* ============================================================
   Landingpage-Akkordeon (Intro-Themen wie „Warum das Ganze?")
   ============================================================ */

.accordion { margin: 0; }
.accordion details {
  border-bottom: 1px solid var(--rule-soft);
  padding: 22px 0;
}
.accordion details:first-child { padding-top: 0; }
.accordion details:last-child { border-bottom: none; padding-bottom: 0; }
.accordion summary {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.3;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  letter-spacing: 0.01em;
  outline: none;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary .accordion-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--ink-soft);
  transition: transform 0.25s ease, color 0.2s ease;
}
.accordion details[open] summary .accordion-icon {
  transform: rotate(180deg);
  color: var(--ink);
}
.accordion summary:hover { color: var(--ink); }
.accordion summary:hover .accordion-icon { color: var(--ink); }
.accordion-content { padding-top: 18px; }
.accordion-content p {
  font-family: var(--sans);
  font-size: 17px;
  color: var(--ink-soft);
  line-height: 1.65;
  margin-bottom: 16px;
}
.accordion-content p:last-child { margin-bottom: 0; }
.accordion-content em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
}
.accordion-content a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.accordion-content a:hover { text-decoration-color: var(--ink); }
.accordion-content strong { font-weight: 600; color: var(--ink); }
.accordion-content .note-block {
  border-left: 2px solid var(--rule);
  padding: 2px 0 2px 18px;
  margin-top: 24px;
}
.accordion-content .note-block p {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 10px;
}
.accordion-content .note-block p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
  .accordion summary { font-size: 19px; gap: 16px; }
  .accordion summary::after { font-size: 22px; }
  .accordion-content p { font-size: 16px; }
}

/* ============================================================
   CTA-Button + Zugangshinweis (Landingpage)
   ============================================================ */

.cta-wrap { margin-top: 8px; }
.cta {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  padding: 18px 28px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transition: background 0.2s ease, transform 0.2s ease;
}
.cta:hover { background: #000; transform: translateY(-1px); }
.cta-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.access {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  margin-top: 20px;
}
.access a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.access a:hover {
  text-decoration-color: var(--ink);
}

/* Mehrere CTAs nebeneinander (Landingpage „Zum Stammbaum / Bedienung / Daten") */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 4px;
}
.cta--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.cta--ghost:hover { background: var(--ink); color: var(--bg); }

/* ============================================================
   Handbuch — Toolbar (Suche, Alle öffnen/zu)
   ============================================================ */

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 32px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 50;
}
.toolbar input[type="search"] {
  flex: 1;
  min-width: 200px;
  background: var(--bg-soft);
  border: 1px solid var(--rule);
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  border-radius: 0;
  outline: none;
  transition: border-color 0.2s ease;
}
.toolbar input[type="search"]:focus { border-color: var(--ink); }
.toolbar input[type="search"]::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}
.toolbar button,
.toolbar-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink-soft);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1;
  height: 40px;
  box-sizing: border-box;
}
.toolbar button:hover,
.toolbar-home:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.toolbar-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.toolbar input[type="search"] {
  height: 40px;
  box-sizing: border-box;
}

/* ============================================================
   Handbuch — Sektion-Klappebene (I, II, III…)
   ============================================================ */

details.section {
  margin: 36px 0 0;
  border-top: 1px solid var(--rule);
}
details.section:first-of-type { margin-top: 0; border-top: none; }
details.section > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 4px 14px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  border-bottom: 1px solid var(--rule-soft);
  transition: border-color 0.2s ease;
}
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary:hover { border-bottom-color: var(--ink); }
details.section > summary .section-mark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.6rem;
  color: var(--ink);
  line-height: 1;
  flex-shrink: 0;
  min-width: 32px;
}
.section-theme-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--ink-soft);
  margin-right: 2px;
  transition: color 0.2s ease;
}
details.section > summary:hover .section-theme-icon { color: var(--ink); }
details.section[open] > summary .section-theme-icon { color: var(--ink); }
details.section > summary h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.55rem;
  color: var(--ink);
  letter-spacing: 0.01em;
  margin: 0;
  flex: 1;
}
details.section > summary .section-hint {
  font-size: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
details.section > summary .section-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--ink-faint);
  transition: transform 0.25s ease, color 0.2s ease;
  margin-left: 4px;
}
details.section[open] > summary .section-icon {
  transform: rotate(180deg);
  color: var(--ink);
}
details.section > summary:hover .section-icon { color: var(--ink); }
.section-body { padding: 4px 0 24px; }

/* ============================================================
   Handbuch — Kapitel-Klappebene
   ============================================================ */

details.chapter {
  border-bottom: 1px solid var(--rule-soft);
  transition: background 0.2s ease;
}
details.chapter[open] { background: var(--bg-soft); }
details.chapter > summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 8px 18px 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--ink);
  display: flex;
  align-items: baseline;
  gap: 16px;
  transition: color 0.2s ease;
}
details.chapter > summary::-webkit-details-marker { display: none; }
details.chapter > summary:hover { color: var(--ink-soft); }
.chapter-num {
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  color: var(--ink);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 36px;
  padding-top: 6px;
}
.chapter-title { flex: 1; }
.chapter-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--ink-faint);
  transition: transform 0.25s ease, color 0.2s ease;
  align-self: center;
}
details.chapter[open] > summary .chapter-icon {
  transform: rotate(180deg);
  color: var(--ink);
}
.chapter-body {
  padding: 8px 8px 32px 52px;
  max-width: 720px;
}
@media (max-width: 720px) { .chapter-body { padding-left: 8px; } }

.chapter-body h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.1rem;
  color: var(--ink);
  margin: 22px 0 10px;
  letter-spacing: 0.005em;
}
.chapter-body p {
  margin-bottom: 14px;
  color: var(--ink-soft);
  font-size: 16px;
}
.chapter-body p strong { color: var(--ink); font-weight: 600; }
.chapter-body p em {
  color: var(--ink-soft);
  font-family: var(--serif);
  font-style: italic;
}
.chapter-body ul, .chapter-body ol {
  margin: 0 0 16px 1.2em;
  color: var(--ink-soft);
  font-size: 16px;
}
.chapter-body ul li, .chapter-body ol li { margin-bottom: 6px; }
.chapter-body code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--bg-deep);
  padding: 1px 5px;
  color: var(--ink);
}

/* ============================================================
   Schnelleinstieg — wie ein Kapitel, aber hervorgehoben
   ============================================================ */

details.chapter.quickstart {
  background: var(--bg-soft);
  border-left: 4px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  margin: 0 0 36px;
}
details.chapter.quickstart[open] { background: var(--bg-soft); }
details.chapter.quickstart > summary { padding: 20px 22px; }
details.chapter.quickstart .chapter-num {
  color: var(--ink);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  min-width: 24px;
  padding-top: 2px;
  letter-spacing: 0;
}
details.chapter.quickstart .chapter-title { color: var(--ink); }
details.chapter.quickstart .chapter-body {
  padding: 4px 22px 22px 22px;
  max-width: none;
}
.quickstart .qs-question {
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.qs-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ink-faint);
}
.quickstart a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.quickstart a:hover { text-decoration-color: var(--ink); }

/* ============================================================
   Tabellen
   ============================================================ */

.table-wrap {
  margin: 16px 0 20px;
  overflow-x: auto;
  border: 1px solid var(--rule);
}
table.handbuch {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
}
table.handbuch th {
  background: var(--ink);
  color: var(--bg);
  text-align: left;
  padding: 12px 14px;
  font-weight: 500;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-right: 1px solid rgba(255,255,255,0.1);
  font-family: var(--sans);
}
table.handbuch th:last-child { border-right: none; }
table.handbuch td {
  padding: 12px 14px;
  border-top: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
  color: var(--ink-soft);
  vertical-align: top;
}
table.handbuch td:last-child { border-right: none; }
table.handbuch tbody tr:nth-child(odd) td { background: rgba(230, 220, 199, 0.4); }
table.handbuch td strong { color: var(--ink); font-weight: 600; }
table.handbuch td em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
}

/* ============================================================
   Callouts (Tipp, Warnung) — Icons via JS injiziert
   ============================================================ */

.callout {
  background: var(--warn-bg);
  border-left: 4px solid var(--warn-edge);
  padding: 16px 20px;
  margin: 18px 0 20px;
  color: var(--warn-ink);
}
.callout.tip {
  background: var(--tip-bg);
  border-left-color: var(--ink);
  color: var(--ink-soft);
}
.callout.tip .callout-title { color: var(--ink); }
.callout-title {
  font-weight: 600;
  color: var(--warn-ink);
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-family: var(--sans);
  display: flex;
  align-items: center;
  gap: 10px;
}
.callout-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.callout p { color: inherit; margin-bottom: 6px; font-size: 0.95rem; }
.callout p:last-child { margin-bottom: 0; }
.callout ul, .callout ol { color: inherit; margin: 4px 0 0 1.2em; font-size: 0.95rem; }

/* ============================================================
   Screenshot-Figuren
   ============================================================ */

figure.screenshot {
  margin: 18px 0 22px;
  border: 1px solid var(--rule);
  background: var(--bg-soft);
  padding: 8px;
}
figure.screenshot img {
  display: block;
  width: 100%;
  height: auto;
}
figure.screenshot figcaption {
  margin-top: 10px;
  padding: 4px 6px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-style: italic;
  font-family: var(--serif);
  border-top: 1px solid var(--rule-soft);
}
figure.screenshot figcaption strong {
  color: var(--ink);
  font-style: normal;
  font-family: var(--sans);
  font-weight: 600;
}

/* Bild klickbar machen */
figure.screenshot img {
  cursor: zoom-in;
  transition: opacity 0.15s ease;
}
figure.screenshot img:hover { opacity: 0.92; }

/* ============================================================
   Lightbox (Bilder in Originalgröße)
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(31, 26, 20, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 40px 32px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  cursor: zoom-out;
}
.lightbox.visible {
  opacity: 1;
  pointer-events: auto;
}
.lightbox img {
  max-width: 95vw;
  max-height: 82vh;
  object-fit: contain;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: default;
  transform: scale(0.97);
  transition: transform 0.25s ease;
  background: var(--bg-soft);
}
.lightbox.visible img {
  transform: scale(1);
}
.lightbox-caption {
  margin-top: 18px;
  max-width: 800px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--bg-soft);
  text-align: center;
  line-height: 1.5;
  cursor: default;
}
.lightbox-caption strong {
  font-style: normal;
  color: var(--bg);
  font-family: var(--sans);
  font-weight: 600;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  color: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 1;
}
.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}
.lightbox-close:focus-visible {
  outline: 2px solid var(--bg);
  outline-offset: 3px;
}
.lightbox-close svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 720px) {
  .lightbox { padding: 20px 12px 16px; }
  .lightbox img { max-width: 100vw; max-height: 72vh; }
  .lightbox-caption { font-size: 0.85rem; margin-top: 14px; }
  .lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; }
}

/* ============================================================
   Such-Treffer markieren
   ============================================================ */

details.chapter.hidden { display: none; }
details.chapter mark {
  background: var(--warn-bg);
  color: var(--ink);
  padding: 1px 2px;
}

/* ============================================================
   Schwebe-Button „nach oben"
   ============================================================ */

.to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(31, 26, 20, 0.25), 0 1px 3px rgba(31, 26, 20, 0.15);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
  z-index: 90;
}
.to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.to-top:hover { background: #000; }
.to-top:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.to-top svg { width: 18px; height: 18px; }
@media (max-width: 720px) {
  .to-top { bottom: 18px; right: 18px; width: 42px; height: 42px; }
}

/* ============================================================
   Footer
   ============================================================ */

.foot-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 72px 0 28px;
}
.page-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  font-size: 13px;
  color: var(--ink-soft);
}
.foot-left { font-family: var(--sans); }
.foot-left a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}
.foot-left a:hover { text-decoration-color: var(--ink); }
.foot-right {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  cursor: help;
  transition: color 0.2s ease;
}
.foot-right:hover { color: var(--ink); }
@media (max-width: 720px) {
  .page-footer { flex-direction: column; align-items: flex-start; gap: 12px; }
  .foot-rule { margin: 56px 0 24px; }
}

/* ============================================================
   Druck
   ============================================================ */

@media print {
  .toolbar { display: none; }
  .to-top { display: none; }
  details.chapter, details.section { break-inside: avoid; border: none; }
  details.chapter:not([open]) > .chapter-body,
  details.section:not([open]) > .section-body { display: block !important; }
  .chapter-icon, .section-icon { display: none; }
  figure.screenshot { break-inside: avoid; }
  .page-footer { display: none; }
}

/* ============================================================
   Stats-Admin Modal — geheimer Editor für stats.json
   ============================================================ */

.stats-admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.stats-admin-modal[hidden] { display: none; }

.sam-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 26, 20, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  animation: samFadeIn 0.18s ease-out;
}

.sam-box {
  position: relative;
  max-width: 560px;
  margin: 8vh auto;
  background: var(--bg);
  border: 1px solid var(--ink);
  padding: 30px 36px 26px;
  box-shadow: 0 24px 60px rgba(31, 26, 20, 0.25);
  animation: samFadeIn 0.22s ease-out;
}

@keyframes samFadeIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sam-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sam-head h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 1.4rem;
  color: var(--ink);
  margin: 0;
  letter-spacing: 0.005em;
}
.sam-close {
  background: none;
  border: 0;
  font-size: 1.6rem;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  font-family: inherit;
}
.sam-close:hover { color: var(--ink); }

.sam-hint {
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0 0 24px;
  line-height: 1.55;
}
.sam-hint code {
  background: var(--rule-soft);
  padding: 2px 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--ink);
}

.sam-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 20px;
  margin-bottom: 26px;
}
.sam-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sam-grid label span {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}
.sam-grid input {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 4px 0;
  outline: none;
  transition: border-color 0.2s ease;
  -moz-appearance: textfield;
}
.sam-grid input::-webkit-outer-spin-button,
.sam-grid input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.sam-grid input:focus { border-bottom-color: var(--ink); }

.sam-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-bottom: 16px;
}
.sam-actions button {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--rule);
  white-space: nowrap;
}
.sam-cancel {
  background: transparent;
  color: var(--ink-soft);
}
.sam-cancel:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.sam-save {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.sam-save:hover {
  background: transparent;
  color: var(--ink);
}

.sam-keyhint {
  font-size: 0.72rem;
  color: var(--ink-faint);
  text-align: center;
  margin: 0;
  letter-spacing: 0.02em;
}
.sam-keyhint kbd {
  background: var(--rule-soft);
  padding: 1px 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85em;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
}
.sam-keyhint code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95em;
  color: var(--ink-soft);
}

@media (max-width: 600px) {
  .sam-box { margin: 4vh 16px; padding: 22px 22px 18px; }
  .sam-grid { grid-template-columns: 1fr; gap: 12px; }
  .sam-actions { flex-direction: column-reverse; align-items: stretch; }
}
