/* AI Risk (ai-risk.ch). Systemschriften, keine externen Ressourcen. Muster, die ich meide: Creme-Grund, kursive Akzentwörter,
   01/02/03-Nummern, Mono-Etiketten, Pillen, Lila-Blau-Verlauf. Farbe trägt Bedeutung: Blau = Handlung, Rot = Risiko oder Fund, Grün = bestanden. */
:root {
  --bg: #ffffff;
  --band: #f2f5f8;
  --ink: #0f1720;
  --ink2: #4a5666;
  --line: #d6dde5;
  --btn: #0f3d6e;
  --btn-ink: #ffffff;
  --link: #0b4f8a;
  --red: #b3261e;
  --red-bg: #fbe9e7;
  --green: #0b6b45;
  --green-bg: #e2f3ea;
  --code-bg: #0b1118;
  --code-ink: #e8eef5;
  --dark: #0f1720;
  --dark-ink: #e8eef5;
  --radius: 4px;
  --wrap: 72rem;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1118; --band: #111a24; --ink: #e8eef5; --ink2: #a8b4c3; --line: #243140;
    --btn: #5aa2e6; --btn-ink: #07121d; --link: #86bdf2;
    --red: #ff8a80; --red-bg: #3a1c1a; --green: #4fd1a0; --green-bg: #12332a; --code-bg: #060a0f; --dark: #060a0f;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--link); text-underline-offset: .18em; }
img, svg { max-width: 100%; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.sr { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem 1rem; z-index: 20; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 48rem) { .wrap { padding-inline: 2rem; } }
.narrow-copy { max-width: 48rem; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 48rem) { .narrow-copy { padding-inline: 2rem; } }
.narrow-copy-wide { max-width: 60rem; margin-inline: auto; padding-inline: 1rem; }
@media (min-width: 48rem) { .narrow-copy-wide { padding-inline: 2rem; } }
.narrow { max-width: 48rem; }

/* Typo */
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .75rem; font-weight: 780; }
h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); letter-spacing: -.03em; font-weight: 800; max-width: 22ch; text-wrap: balance; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.2rem; margin-top: 2rem; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.2rem; color: var(--ink2); max-width: 62ch; }
.note { color: var(--ink2); font-size: .92rem; }
.meta { color: var(--ink2); font-size: .9rem; }
.kicker { display: flex; align-items: center; gap: .6rem; font-weight: 700; font-size: .95rem; color: var(--ink2); margin-bottom: 1rem; }
.kicker::before { content: ""; width: .7rem; height: .7rem; background: var(--red); flex: none; }
.more { font-weight: 650; }
.src { font-size: .92rem; }

/* Kopf */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-row { display: flex; align-items: center; gap: 1rem; min-height: 3.6rem; padding-block: .4rem; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: .5rem; color: var(--ink); font-weight: 800; letter-spacing: -.02em; font-size: 1.15rem; text-decoration: none; }
.mark { color: var(--btn); flex: none; }
.nav { display: none; margin-left: 1rem; }
.nav ul, .burger ul { list-style: none; margin: 0; padding: 0; }
.nav ul { display: flex; gap: 1.2rem; }
.nav a { color: var(--ink2); text-decoration: none; font-size: .95rem; padding: .3rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); border-bottom-color: var(--red); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
/* Sprachauswahl: aufklappbar, ohne JavaScript nutzbar */
.langsel { position: relative; background: transparent; border: 0; }
.langsel summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .35rem; height: 2.4rem; padding: 0 .65rem; font-weight: 700; font-size: .85rem; color: var(--ink2); border: 1px solid var(--line); border-radius: var(--radius); }
.langsel summary::-webkit-details-marker { display: none; }
.langsel summary::after { content: ""; position: static; width: .45rem; height: .45rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); transition: none; }
.langsel[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
.langsel summary:hover { color: var(--ink); border-color: var(--ink2); }
.langsel[open] summary { padding-bottom: 0; color: var(--ink); border-color: var(--ink2); }
.langsel ul { list-style: none; margin: 0; padding: .35rem; position: absolute; right: 0; top: calc(100% + .4rem); min-width: 11rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.12); z-index: 12; }
.langsel a { display: flex; gap: .6rem; align-items: baseline; padding: .55rem .7rem; text-decoration: none; color: var(--ink); border-radius: 3px; }
.langsel a:hover { background: var(--band); }
.langsel a[aria-current] { font-weight: 700; background: var(--band); }
.langsel-code { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 1.6rem; }
@media (min-width: 66rem) { .nav { display: block; } .burger { display: none; } }
.burger { position: relative; }
.burger summary { list-style: none; cursor: pointer; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); }
.burger summary::-webkit-details-marker { display: none; }
.burger summary span, .burger summary span::before, .burger summary span::after { display: block; width: 1.1rem; height: 2px; background: var(--ink); position: relative; content: ""; }
.burger summary span::before { position: absolute; top: -6px; }
.burger summary span::after { position: absolute; top: 6px; }
.burger ul { position: absolute; right: 0; top: calc(100% + .4rem); min-width: 14rem; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.burger a { display: block; padding: .55rem .75rem; text-decoration: none; color: var(--ink); }
.burger a:hover, .burger a[aria-current] { background: var(--band); }

/* Buttons: rechteckig, kein Pillen-Look */
.btn { display: inline-block; padding: .75rem 1.2rem; background: var(--btn); color: var(--btn-ink); font-weight: 700; text-decoration: none; border: 2px solid var(--btn); border-radius: var(--radius); }
.btn:hover { filter: brightness(1.1); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-small { padding: .45rem .8rem; font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
@media (max-width: 30rem) { .top-right .btn-small { display: none; } .top-row { gap: .5rem; } }

/* Abschnitte */
.sec { padding-block: clamp(2.5rem, 6vw, 4.5rem); scroll-margin-top: 4.5rem; }
.band { background: var(--band); }
.page-head { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 3vw, 2rem); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1.5rem; font-size: .88rem; color: var(--ink2); }
.crumbs li + li::before { content: "/"; margin-right: .4rem; color: var(--line); }
.crumbs a { color: var(--ink2); }
.crumbs [aria-current] { color: var(--ink); }

/* Einstieg */
.hero { padding-block: clamp(2.5rem, 7vw, 5rem) clamp(2rem, 5vw, 3rem); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; align-items: center; }
.hero-grid > * { min-width: 0; }
@media (min-width: 62rem) { .hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3.5rem; } }
.hero-evidence { margin: 0; border: 1px solid var(--line); border-top: 4px solid var(--red); border-radius: var(--radius); padding: 1rem; background: var(--bg); }
.hero-cap { font-size: .9rem; color: var(--ink2); margin-bottom: .75rem; }
.hero-cap strong { color: var(--ink); display: block; font-size: 1rem; }
.strip { border-block: 1px solid var(--line); background: var(--band); }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem 1.5rem; margin-block: 0; padding-block: 1.5rem; }
@media (min-width: 48rem) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts div { border-top: 2px solid var(--ink); padding-top: .6rem; }
.facts dt { font-size: 1.9rem; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.facts dd { margin: .15rem 0 0; color: var(--ink2); font-size: .9rem; }

/* Karten */
.cards { list-style: none; padding: 0; margin: 1.5rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
@media (min-width: 40rem) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { border: 1px solid var(--line); border-top: 3px solid var(--btn); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: .4rem; background: var(--bg); }
.card h3 { margin: 0; font-size: 1.25rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
.card p { color: var(--ink2); flex: 1; margin: 0; }

/* Listen */
.plus, .plain, .steps-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.plus li { position: relative; padding: 0 0 .7rem 1.7rem; }
.plus li::before { content: "+"; position: absolute; left: 0; top: -.05rem; font-weight: 800; font-size: 1.25rem; color: var(--green); }
.plus.minus li::before { content: "–"; color: var(--ink2); }
.plain li { padding: 0 0 .8rem 1.2rem; border-left: 3px solid var(--line); margin-bottom: .8rem; }
.steps-list { counter-reset: s; }
.steps-list li { counter-increment: s; position: relative; padding: 0 0 .8rem 2.2rem; }
.steps-list li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; background: var(--btn); color: var(--btn-ink); font-weight: 700; font-size: .85rem; border-radius: var(--radius); }
.thesen { margin: 0; padding-left: 1.5rem; }
.thesen li { padding: .7rem 0 .7rem .3rem; border-bottom: 1px solid var(--line); color: var(--ink2); }
.thesen li:last-child { border-bottom: 0; }
.thesen li::marker { font-weight: 800; color: var(--red); }
.thesen strong { display: block; color: var(--ink); font-size: 1.1rem; }
.defs { list-style: none; padding: 0; margin: 0; }
.defs li { display: grid; gap: .1rem; padding: .85rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 48rem) { .defs li { grid-template-columns: 14rem 1fr; gap: 1.5rem; } }
.defs strong { color: var(--ink); }
.defs span { color: var(--ink2); }
.linklist { list-style: none; padding: 0; }
.linklist a { display: block; padding: .8rem 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink2); }
.linklist strong { display: block; color: var(--link); }
.linklist a:hover strong { text-decoration: underline; }
.steps { list-style: none; padding: 0; margin: 0; border-left: 3px solid var(--btn); }
.steps li { position: relative; padding: .2rem 0 1.2rem 1.5rem; color: var(--ink2); }
.steps li::before { content: ""; position: absolute; left: -.55rem; top: .55rem; width: .8rem; height: .8rem; background: var(--red); }
.steps strong { display: block; color: var(--ink); }
.steps em { font-style: normal; font-weight: 650; color: var(--ink); }

/* Leiter: Risiko von oben nach unten */
.ladder { list-style: none; margin: 0 0 1rem; padding: 0; }
.ladder li { display: grid; gap: .1rem; padding: .7rem 1rem; margin-bottom: .4rem; background: var(--band); border-left: 4px solid var(--btn); border-radius: 0 var(--radius) var(--radius) 0; }
.ladder span { color: var(--ink2); font-size: .95rem; }
@media (min-width: 40rem) {
  .ladder li { grid-template-columns: 10rem 1fr; gap: 1rem; align-items: baseline; }
  .ladder li:nth-child(2) { margin-left: 1rem; } .ladder li:nth-child(3) { margin-left: 2rem; } .ladder li:nth-child(4) { margin-left: 3rem; }
  .ladder li:nth-child(5) { margin-left: 4rem; } .ladder li:nth-child(6) { margin-left: 5rem; } .ladder li:nth-child(7) { margin-left: 6rem; border-left-color: var(--red); }
}

/* Antworten */
.faq { display: grid; gap: .75rem; max-width: 52rem; }
details { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
summary { cursor: pointer; padding: 1rem 3rem 1rem 1.25rem; font-weight: 650; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 1.25rem; top: .8rem; font-size: 1.4rem; color: var(--btn); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
details[open] { border-color: var(--btn); }
details[open] summary { padding-bottom: .5rem; }
details > p { padding: 0 1.25rem 1rem; margin: 0; color: var(--ink2); }
summary:hover { color: var(--link); }
.burger summary::after { content: none; }
@media (prefers-reduced-motion: reduce) { summary::after { transition: none; } }

/* Tabellen: auf kleinen Schirmen als Karten */
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--radius); }
.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
.data th, .data td { text-align: left; vertical-align: top; padding: .65rem .8rem; border-bottom: 1px solid var(--line); color: var(--ink2); }
.data thead th { background: var(--band); color: var(--ink); font-size: .85rem; }
.data td strong { color: var(--ink); }
.data tbody:last-child tr:last-child td { border-bottom: 0; }
.data .grp th { background: var(--band); color: var(--red); font-size: .85rem; }
.narrow-table { max-width: 32rem; }
.tag { display: inline-block; margin-top: .25rem; padding: .05rem .4rem; font-size: .75rem; font-weight: 700; color: var(--green); background: var(--green-bg); border-radius: 3px; }
@media (max-width: 79.99rem) {
  .table-wrap:has(.stack) { border: 0; overflow: visible; }
  .stack thead { display: none; }
  .stack, .stack tbody, .stack tr { display: block; width: 100%; }
  .stack tr { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: .7rem; padding: .35rem 0; background: var(--bg); }
  .stack td { display: block; border: 0; padding: .3rem .9rem; }
  .stack td::before { content: attr(data-label); display: block; font-size: .75rem; font-weight: 700; color: var(--ink2); }
  .stack .grp { border: 0; background: none; padding: 0; }
  .stack .grp th { display: block; border-radius: var(--radius); }
}
@media (min-width: 40rem) and (max-width: 79.99rem) {
  .stack td { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; }
  .stack td::before { padding-top: .1rem; }
}

/* Status und Matrix: Symbol plus Farbe, nie nur Farbe */
.state { display: inline-block; padding: .05rem .5rem; border-radius: 3px; font-weight: 650; white-space: nowrap; }
.state.ok { color: var(--green); background: var(--green-bg); }
.state.bad { color: var(--red); background: var(--red-bg); }
.matrix { width: 100%; min-width: 34rem; border-collapse: collapse; font-size: .9rem; }
.matrix th, .matrix td { padding: .5rem .55rem; border-bottom: 1px solid var(--line); color: var(--ink2); text-align: left; }
.matrix thead th { background: var(--band); color: var(--ink); font-size: .8rem; }
.matrix thead th:not(:first-child), .matrix td.m { text-align: center; }
.matrix th[scope="row"] { color: var(--ink); font-weight: 650; }
.matrix td.m { font-weight: 800; position: relative; }
.matrix td.ok { color: var(--green); background: var(--green-bg); }
.matrix td.bad { color: var(--red); background: var(--red-bg); }
.matrix .cand th { color: var(--btn); }
.matrix tbody tr:last-child > * { border-bottom: 0; }
.matrix-wrap.compact { border: 0; margin: 0; }
.matrix-wrap.compact .matrix { min-width: 0; font-size: .8rem; }
.matrix-wrap.compact .matrix th, .matrix-wrap.compact .matrix td { padding: .38rem .3rem; }
.matrix-wrap.compact th[scope="row"] { padding-left: .5rem; }
@media (max-width: 47.99rem) {
  .table-wrap:has(.matrix) { overflow-x: auto; }
  .matrix { min-width: 0; font-size: .8rem; }
  .matrix th, .matrix td { padding: .4rem .25rem; }
  .matrix th[scope="row"] { padding-left: .5rem; }
}
@media (max-width: 30rem) {
  .matrix-wrap.compact .matrix { font-size: .72rem; }
  .matrix-wrap.compact .matrix th, .matrix-wrap.compact .matrix td { padding: .35rem .1rem; }
  .matrix-wrap.compact th[scope="row"] { width: 6.2rem; padding-left: .4rem; }
}
/* Einmaliger Aufbau der Matrix im Einstieg, Zeile für Zeile */
@media (prefers-reduced-motion: no-preference) {
  .matrix-wrap.compact tbody tr { animation: row .45s ease-out both; }
  .matrix-wrap.compact tbody tr:nth-child(2) { animation-delay: .08s; } .matrix-wrap.compact tbody tr:nth-child(3) { animation-delay: .16s; }
  .matrix-wrap.compact tbody tr:nth-child(4) { animation-delay: .24s; } .matrix-wrap.compact tbody tr:nth-child(5) { animation-delay: .32s; }
  .matrix-wrap.compact tbody tr:nth-child(6) { animation-delay: .4s; } .matrix-wrap.compact tbody tr:nth-child(7) { animation-delay: .48s; }
  .matrix-wrap.compact tbody tr:nth-child(8) { animation-delay: .56s; }
  @keyframes row { from { opacity: 0; transform: translateY(.4rem); } to { opacity: 1; transform: none; } }
}
.lessons { padding-left: 1.1rem; color: var(--ink2); }
.lessons li { margin-bottom: .5rem; }
.lessons strong { color: var(--ink); }

/* Beleg-Seite */
.beleg h3 { margin-top: 2.25rem; }
.beleg p, .beleg li { color: var(--ink2); }
.code { margin: .8rem 0 1rem; padding: 1rem 1.1rem; background: var(--code-bg); color: var(--code-ink); border-radius: var(--radius); overflow-x: auto; font: .82rem/1.55 var(--mono); tab-size: 4; }
.code code { font: inherit; }
.code:focus-visible { outline-offset: 2px; }
.raw { margin-top: .5rem; }
.raw > summary { font-weight: 600; }

/* Kontakt */
.cta { background: var(--dark); color: var(--dark-ink); }
.cta .lead { color: #b6c2d1; }
.cta a { color: #ffffff; text-decoration-thickness: 2px; }
.contact { font-size: 1.4rem; font-weight: 700; line-height: 1.5; }

/* Rechtstexte */
.legal { padding-block: clamp(2rem, 5vw, 4rem); }
.legal h1 { font-size: clamp(2rem, 5vw, 3rem); }
.legal h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal p, .legal li, .legal td { color: var(--ink2); }
.legal table { width: 100%; border-collapse: collapse; }
.legal td, .legal th { text-align: left; vertical-align: top; padding: .45rem .6rem .45rem 0; border-bottom: 1px solid var(--line); }
.legal thead { display: none; }
.legal td:first-child { font-weight: 600; color: var(--ink); width: 9rem; }
mark.offen { background: #ffe08a; color: #3a2a00; padding: 0 .25em; border-radius: 3px; font-size: .9em; }

/* Fuss */
.foot { border-top: 1px solid var(--line); background: var(--band); padding-block: 2rem 1.25rem; font-size: .92rem; color: var(--ink2); }
.foot a { color: inherit; }
.foot-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
@media (min-width: 48rem) { .foot-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); } }
.foot-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; color: var(--ink); }
.foot-h { font-weight: 700; color: var(--ink); margin-bottom: .4rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { padding: .15rem 0; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
@media print { .top, .foot, .cta { display: none; } details > * { display: block; } }

.disclaimer { font-size: .85rem; color: var(--ink2); max-width: 60rem; margin: 0; }
