/* Nervura – Frame-Katalog. Hell/Dunkel über Variablen; data-theme="hell|dunkel" überschreibt das System. */

:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceff3;
  --text: #14181d;
  --text-2: #56606d;
  --line: #d8dde4;
  --accent: #1d5ea8;
  --accent-text: #ffffff;
  --accent-soft: #e2ecf8;
  --best-bg: #dcefe1;
  --best-text: #145a2b;
  --warn-bg: #fbefd5;
  --warn-text: #7a4d00;
  --test-bg: #b3261e;
  --image-bg: #ffffff;
  --shadow: 0 1px 2px rgb(20 24 29 / 6%), 0 4px 16px rgb(20 24 29 / 6%);
  --radius: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="hell"]) {
    color-scheme: dark;
    --bg: #0e1115;
    --surface: #161a20;
    --surface-2: #1e242c;
    --text: #e6e9ed;
    --text-2: #9ba5b1;
    --line: #2b323c;
    --accent: #7db0ef;
    --accent-text: #0e1115;
    --accent-soft: #1b2a3d;
    --best-bg: #163a23;
    --best-text: #98dcaa;
    --warn-bg: #3a2c0d;
    --warn-text: #f0c66a;
    --image-bg: #f2f3f5;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 16px rgb(0 0 0 / 30%);
  }
}

:root[data-theme="dunkel"] {
  color-scheme: dark;
  --bg: #0e1115;
  --surface: #161a20;
  --surface-2: #1e242c;
  --text: #e6e9ed;
  --text-2: #9ba5b1;
  --line: #2b323c;
  --accent: #7db0ef;
  --accent-text: #0e1115;
  --accent-soft: #1b2a3d;
  --best-bg: #163a23;
  --best-text: #98dcaa;
  --warn-bg: #3a2c0d;
  --warn-text: #f0c66a;
  --image-bg: #f2f3f5;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 16px rgb(0 0 0 / 30%);
}

/* ------------------------------------------------------------ Grundlagen */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  font-variant-numeric: tabular-nums;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.4vw, 2.6rem); margin: 0.2em 0 0.35em; }
h2 { font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.6rem); margin: 2.4rem 0 0.8rem; }
h3 { font-size: 1.1rem; margin: 1.6rem 0 0.5rem; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
sub { font-size: 0.75em; }

.wrap { width: 100%; max-width: 76rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 48rem) { .wrap { padding: 0 28px; } }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip-link { position: absolute; left: 8px; top: -40px; background: var(--surface); padding: 6px 10px; z-index: 50; border-radius: 6px; }
.skip-link:focus { top: 8px; }
html:not(.js) .js-only { display: none !important; }

.test-banner {
  margin: 0; padding: 8px 16px; background: var(--test-bg); color: #fff;
  font-weight: 700; text-align: center; letter-spacing: 0.02em;
}

/* ------------------------------------------------------------ Kopf und Fuß */

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { display: flex; align-items: center; gap: 12px 20px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.wordmark {
  font-weight: 800; font-size: 1.3rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--text); text-decoration: none; margin-right: auto;
}
.wordmark::after { content: ""; display: inline-block; width: 0.32em; height: 0.32em; margin-left: 0.12em; background: var(--accent); border-radius: 50%; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a {
  color: var(--text-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-weight: 550;
}
.main-nav a:hover { color: var(--text); background: var(--surface-2); }
.main-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-llm { font-family: var(--mono); font-size: 0.92em; }
.theme-toggle {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: transparent;
  color: var(--text-2); border-radius: 999px; padding: 5px 10px; font: inherit; font-size: 0.85rem; cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--text-2); }
@media (max-width: 30rem) {
  .header-inner { gap: 6px 10px; }
  .main-nav { order: 3; width: 100%; margin: 0 -10px; }
  .theme-label { display: none; }
}

.site-footer { margin-top: 4rem; border-top: 1px solid var(--line); background: var(--surface); color: var(--text-2); font-size: 0.92rem; }
.footer-inner { padding-top: 24px; padding-bottom: 32px; }
.footer-note { max-width: 46rem; margin: 0 0 12px; }
.footer-links { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-meta { margin: 0; font-size: 0.85rem; }
.wordmark-small { font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }

/* ------------------------------------------------------------ Bausteine */

.intro { padding: 2.2rem 0 0.5rem; max-width: 48rem; }
.intro-compact { padding-top: 1.6rem; }
.eyebrow { margin: 0; color: var(--accent); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; }
.lead { font-size: 1.1rem; color: var(--text-2); margin: 0 0 0.8rem; }
.meta-line, .fine { color: var(--text-2); font-size: 0.88rem; }
.fine.block { display: block; }
.section-lead { color: var(--text-2); margin: -0.3rem 0 1rem; max-width: 48rem; }
.note { color: var(--text-2); font-size: 0.92rem; }
.h-small { font-size: 0.95rem; margin: 0 0 0.4rem; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em; }

.badges { margin: 0 0 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 0.78rem; font-weight: 650;
  background: var(--surface-2); color: var(--text-2); white-space: nowrap; line-height: 1.6;
}
.badge-version { font-family: var(--mono); background: var(--accent-soft); color: var(--accent); }
.badge-new { background: var(--best-bg); color: var(--best-text); }
.badge-estimate, .status-prototyp, .status-erprobung { background: var(--warn-bg); color: var(--warn-text); }
.status-erhaeltlich { background: var(--best-bg); color: var(--best-text); }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px;
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent);
  color: var(--accent-text); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer;
}
.button:hover { filter: brightness(1.08); }
.button-quiet { background: transparent; color: var(--accent); border-color: var(--line); }
.button-quiet:hover { border-color: var(--accent); filter: none; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 1rem 0 0; }

.callout {
  border-left: 3px solid var(--warn-text); background: var(--warn-bg); color: var(--text);
  padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 0.93rem; margin: 0.8rem 0;
}
.callout-erhaeltlich { border-left-color: var(--best-text); background: var(--best-bg); }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 0.82rem; white-space: nowrap;
}

.key-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.key-figures > div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.key-figures dt { font-size: 0.76rem; color: var(--text-2); line-height: 1.3; }
.key-figures dd { margin: 2px 0 0; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }

.spec-list { margin: 0.5rem 0; display: grid; gap: 0; }
.spec-list > div { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr; gap: 4px 16px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.spec-list dt { color: var(--text-2); }
.spec-list dd { margin: 0; }
@media (max-width: 30rem) { .spec-list > div { grid-template-columns: 1fr; gap: 0; } }

.notes { padding-left: 1.2rem; margin: 0.6rem 0; }
.notes li { margin: 0.25rem 0; }
.no-image {
  display: grid; place-items: center; aspect-ratio: 16 / 10; width: 100%;
  background: repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--surface) 10px 20px);
  color: var(--text-2); font-size: 0.9rem;
}

/* ------------------------------------------------------------ Filter */

.finder { margin-top: 1.4rem; }
.finder h2 { margin-top: 1rem; }
.filter {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr)); gap: 10px 12px; align-items: end;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px;
}
.field { display: grid; gap: 4px; }
.field-label { font-size: 0.8rem; font-weight: 650; color: var(--text-2); }
.field select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  min-height: 40px; padding: 6px 8px; width: 100%;
}
.field select:focus-visible { border-color: var(--accent); }
.field select.is-set { border-color: var(--accent); background: var(--accent-soft); }
.filter-status { margin: 10px 0 0; font-weight: 600; }
.empty-state {
  background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius);
  padding: 18px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between;
}
.empty-state p { margin: 0; }

/* ------------------------------------------------------------ Katalog-Karten */

.card-grid { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.card-media { display: block; background: var(--image-bg); border-bottom: 1px solid var(--line); }
.card-img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card-title { margin: 2px 0 2px; font-size: 1.25rem; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a:hover { color: var(--accent); }
.spec-line { margin: 0 0 6px; color: var(--text-2); font-size: 0.9rem; }
.card-desc { margin: 0 0 4px; font-size: 0.95rem; }
.compat-line { margin: 4px 0 10px; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.compat-label { font-size: 0.78rem; color: var(--text-2); font-weight: 650; margin-right: 2px; }
.chip-key { color: var(--text-2); font-size: 0.92em; }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.price { font-weight: 650; color: var(--text-2); }
.compare-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; cursor: pointer; min-height: 32px; }
.compare-pick input, .chip-check input, .switch input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.older { margin: 8px 0 0; font-size: 0.85rem; color: var(--text-2); }

.compare-bar { position: sticky; bottom: 12px; z-index: 20; margin-top: 16px; display: flex; justify-content: center; pointer-events: none; }
.compare-bar-inner {
  pointer-events: auto; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow); font-weight: 600;
}
.compare-bar .button { border-radius: 999px; }

/* ------------------------------------------------------------ Tabellen */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 0.5rem 0 1rem; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
.data th, .data td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.data thead th { font-size: 0.8rem; color: var(--text-2); font-weight: 650; background: var(--surface-2); white-space: nowrap; }
.data tbody tr:last-child > * { border-bottom: 0; }
.data tbody th { font-weight: 550; }
.data .nowrap { white-space: nowrap; }
.data .num { text-align: right; white-space: nowrap; }
.data .wrap-cell { min-width: 16rem; }
.data tr.sum > * { font-weight: 700; background: var(--surface-2); }
.sticky-first th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.sticky-first thead th:first-child { background: var(--surface-2); }
.sticky-first td, .sticky-first th { white-space: nowrap; }

/* ------------------------------------------------------------ Frame- und Detailseite */

.breadcrumb { margin: 18px 0 0; font-size: 0.88rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0; color: var(--text-2); }
.breadcrumb li + li::before { content: "›"; margin: 0 6px 0 2px; }

.frame-head, .product-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-top: 12px; align-items: start; }
@media (min-width: 56rem) {
  .frame-head { grid-template-columns: minmax(0, 28rem) minmax(0, 1fr); }
  .product-head { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 36px; }
}
.frame-media, .hero-media { display: block; background: var(--image-bg); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.hero-img, .frame-img { width: 100%; aspect-ratio: 16 / 11; object-fit: contain; }
.product-summary h1 { margin-top: 0.1em; }
.title-version { font-family: var(--mono); font-weight: 600; color: var(--accent); font-size: 0.7em; vertical-align: 0.12em; }
.price-line { margin: 0.6rem 0 0; }

.toc { display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; margin: 28px 0 0; padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.toc a { white-space: nowrap; padding: 4px 10px; border-radius: 999px; text-decoration: none; color: var(--text-2); font-size: 0.9rem; }
.toc a:hover { background: var(--surface-2); color: var(--text); }
section[id] { scroll-margin-top: 16px; }

.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(46%, 13rem), 1fr)); }
.gallery figure, .layout-figure { margin: 0; }
.gallery a, .layout-figure a { display: block; background: var(--image-bg); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.gallery img { width: 100%; aspect-ratio: 16 / 11; object-fit: contain; }
.gallery figcaption, .layout-figure figcaption { font-size: 0.85rem; color: var(--text-2); margin-top: 4px; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 56rem) { .two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; } }
.layout-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.layout-grid > *, .two-col > *, .frame-head > *, .product-head > * { min-width: 0; }
@media (min-width: 64rem) { .layout-grid { grid-template-columns: minmax(0, 26rem) minmax(0, 1fr); } }
.stress { font-size: 0.92rem; color: var(--text-2); margin: -0.4rem 0 0.4rem; }
.version-list { padding-left: 1.2rem; }

/* ------------------------------------------------------------ Vergleich */

.compare-picker {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 1rem 0;
}
.compare-picker fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.compare-picker legend { font-size: 0.8rem; font-weight: 650; color: var(--text-2); padding: 0; margin-bottom: 6px; }
.pick-groups { display: grid; gap: 8px; }
.pick-group { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pick-frame { font-weight: 650; min-width: 11rem; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-check { cursor: pointer; min-height: 34px; padding: 4px 12px; font-family: var(--mono); font-size: 0.88rem; }
.chip-check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.picker-foot { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 32px; }
.pick-status { color: var(--text-2); font-size: 0.9rem; }

.scroll-hint { display: none; margin: 0 0 4px; font-size: 0.8rem; color: var(--text-2); text-align: right; }
@media (max-width: 48rem) { .scroll-hint { display: block; } }

.compare { width: max-content; min-width: 100%; font-size: 0.93rem; }
.compare th, .compare td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare td, .compare thead th[data-col] { width: 13rem; min-width: 13rem; max-width: 13rem; }
.compare thead th { vertical-align: bottom; background: var(--surface); }
.compare th[scope="row"], .compare .corner {
  position: sticky; left: 0; z-index: 2; background: var(--surface); font-weight: 550;
  width: 13rem; min-width: 13rem; max-width: 13rem; border-right: 1px solid var(--line);
}
.compare .corner { color: var(--text-2); font-size: 0.8rem; z-index: 3; }
.col-head { display: grid; gap: 2px; text-decoration: none; color: var(--text); }
.col-img { width: 100%; max-width: 11rem; aspect-ratio: 16 / 10; object-fit: contain; background: var(--image-bg); border-radius: 6px; margin-bottom: 4px; }
.col-name { font-weight: 700; line-height: 1.25; }
.col-version { font-family: var(--mono); font-size: 0.82rem; color: var(--accent); }
.group-row th { background: var(--surface-2); padding: 6px 12px; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-2); }
.group-row th > span { position: sticky; left: 12px; }
.compare td.best { background: var(--best-bg); color: var(--best-text); font-weight: 700; }
.better-hint { margin-left: 6px; color: var(--text-2); font-size: 0.85em; }
.row-note { display: block; font-size: 0.78rem; color: var(--text-2); font-weight: 400; }
.legend { font-size: 0.85rem; color: var(--text-2); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.best-swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: var(--best-bg); border: 1px solid var(--best-text); }

@media (max-width: 40rem) {
  .compare th[scope="row"], .compare .corner { width: 7.75rem; min-width: 7.75rem; max-width: 7.75rem; font-size: 0.84rem; padding: 8px; }
  .compare td, .compare thead th[data-col] { width: 9.5rem; min-width: 9.5rem; max-width: 9.5rem; padding: 8px; }
  .col-img { max-width: 8rem; }
  .table-scroll.compare-scroll { margin-left: -16px; margin-right: -16px; border-radius: 0; border-left: 0; border-right: 0; }
}

@media print {
  .site-header, .site-footer, .compare-picker, .compare-bar, .filter, .toc, .actions { display: none !important; }
  body { background: #fff; color: #000; }
}
