/* rockindaw Handbuch – Lesefläche für das Intranet, dunkel wie das Studio, ohne Fremdquellen. */
@font-face { font-family: "Noto Sans"; src: url("fonts/NotoSans.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Noto Sans Mono"; src: url("fonts/NotoSansMono.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: dark light;
  --bg: oklch(0.19 0.012 255);
  --bg-raise: oklch(0.225 0.014 255);
  --bg-sunk: oklch(0.165 0.012 255);
  --line: oklch(0.32 0.016 255);
  --text: oklch(0.93 0.008 255);
  --dim: oklch(0.72 0.014 255);
  --accent: oklch(0.78 0.15 60);
  --accent-ink: oklch(0.2 0.03 60);
  --info: oklch(0.76 0.11 240);
  --ok: oklch(0.78 0.14 150);
  --warn: oklch(0.8 0.14 85);
  --bad: oklch(0.72 0.17 25);
  --sel: oklch(0.45 0.09 60 / 0.55);
  --radius: 6px;
  --measure: 70ch;
  --sans: "Noto Sans", system-ui, sans-serif;
  --mono: "Noto Sans Mono", ui-monospace, monospace;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: oklch(0.985 0.004 255);
    --bg-raise: oklch(0.96 0.006 255);
    --bg-sunk: oklch(0.94 0.008 255);
    --line: oklch(0.86 0.01 255);
    --text: oklch(0.25 0.015 255);
    --dim: oklch(0.45 0.02 255);
    --accent: oklch(0.5 0.15 55);
    --accent-ink: oklch(0.98 0.01 60);
    --info: oklch(0.48 0.12 245);
    --ok: oklch(0.45 0.12 150);
    --warn: oklch(0.5 0.12 80);
    --bad: oklch(0.5 0.17 25);
    --sel: oklch(0.85 0.09 70 / 0.6);
  }
}
:root[data-theme="light"] {
  --bg: oklch(0.985 0.004 255); --bg-raise: oklch(0.96 0.006 255); --bg-sunk: oklch(0.94 0.008 255); --line: oklch(0.86 0.01 255);
  --text: oklch(0.25 0.015 255); --dim: oklch(0.45 0.02 255); --accent: oklch(0.5 0.15 55); --accent-ink: oklch(0.98 0.01 60);
  --info: oklch(0.48 0.12 245); --ok: oklch(0.45 0.12 150); --warn: oklch(0.5 0.12 80); --bad: oklch(0.5 0.17 25); --sel: oklch(0.85 0.09 70 / 0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 1.0625rem/1.65 var(--sans); font-variant-numeric: proportional-nums; -webkit-font-smoothing: antialiased; }
::selection { background: var(--sel); color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: .5rem 1rem; z-index: 50; }
.skip:focus { left: .5rem; top: .5rem; }

/* Kopf */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; padding: .55rem 1.25rem; background: color-mix(in oklch, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top .brand { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none; font-weight: 600; letter-spacing: -.01em; }
.top .brand img { height: 30px; width: auto; display: block; background: #1b1e24; padding: 4px 10px; border-radius: var(--radius); box-sizing: content-box; }
.top .brand span { color: var(--dim); font-weight: 400; font-size: .95rem; }
.top .spacer { flex: 1; }
.search { position: relative; width: min(26rem, 40vw); }
.search input { width: 100%; padding: .5rem .8rem; background: var(--bg-sunk); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: .95rem; }
.search input::placeholder { color: var(--dim); }
.search ul { position: absolute; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .3rem; list-style: none; background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px oklch(0 0 0 / .35); max-height: 60vh; overflow: auto; }
.search li a { display: block; padding: .45rem .6rem; color: var(--text); text-decoration: none; border-radius: 4px; }
.search li a:hover, .search li a[aria-selected="true"] { background: var(--sel); }
.search li small { display: block; color: var(--dim); font-size: .82rem; line-height: 1.35; }
.theme { background: transparent; color: var(--dim); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .65rem; font: inherit; font-size: .85rem; cursor: pointer; }
.theme:hover { color: var(--text); border-color: var(--dim); }
.menu-btn { display: none; }

/* Seitenaufbau */
.shell { display: grid; grid-template-columns: 17rem minmax(0, 1fr); max-width: 90rem; margin: 0 auto; }
nav.side { position: sticky; top: 3.6rem; align-self: start; height: calc(100vh - 3.6rem); overflow: auto; padding: 1.25rem 1rem 3rem 1.25rem; border-right: 1px solid var(--line); font-size: .95rem; }
nav.side h2 { margin: 1.4rem 0 .35rem; font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
nav.side h2:first-child { margin-top: 0; }
nav.side ul { list-style: none; margin: 0; padding: 0; }
nav.side a { display: block; padding: .28rem .6rem; margin: 1px 0; color: var(--text); text-decoration: none; border-radius: 4px; }
nav.side a:hover { background: var(--bg-raise); }
nav.side a[aria-current="page"] { background: var(--sel); font-weight: 600; }
main { padding: 2.2rem clamp(1rem, 4vw, 3.5rem) 5rem; min-width: 0; }
main > * { max-width: var(--measure); }
main > .wide, main > table.wide, main > .tests, main > .feat, main > .tablewrap, main > figure, main > .diagram, main > pre { max-width: 62rem; }

/* Schrift */
h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); line-height: 1.1; letter-spacing: -.03em; margin: 0 0 .7rem; font-weight: 650; text-wrap: balance; }
h2 { font-size: 1.55rem; line-height: 1.25; letter-spacing: -.02em; margin: 3rem 0 .8rem; font-weight: 620; text-wrap: balance; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 2rem 0 .5rem; font-weight: 620; }
p, li { text-wrap: pretty; }
p { margin: 0 0 1rem; }
.lead { font-size: 1.22rem; line-height: 1.55; color: var(--dim); margin-bottom: 1.6rem; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
ul, ol { padding-left: 1.4rem; margin: 0 0 1.1rem; }
li { margin: .25rem 0; }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; font-variant-numeric: tabular-nums; }
code { background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 4px; padding: .08em .35em; }
kbd { background: var(--bg-raise); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: .05em .4em; white-space: nowrap; }
pre { background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; overflow: auto; line-height: 1.5; font-size: .88rem; }
pre code { background: none; border: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* Tabellen */
table { border-collapse: collapse; width: 100%; margin: 0 0 1.5rem; font-size: .95rem; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: .82rem; letter-spacing: .03em; color: var(--dim); background: var(--bg-raise); }
tbody tr:hover td { background: color-mix(in oklch, var(--bg-raise) 70%, transparent); }
td.num, th.num { text-align: right; }
.tablewrap { overflow-x: auto; margin: 0 0 1.5rem; }
.tablewrap table { margin: 0; min-width: 34rem; }

/* Hinweise ohne seitliche Farbleiste: Fläche + Beschriftung */
.note { background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem 1rem; margin: 1.2rem 0; }
.note strong:first-child { display: inline-block; margin-right: .5rem; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--info); }
.note.warn strong:first-child { color: var(--warn); }
.note.bad strong:first-child { color: var(--bad); }
.note.ok strong:first-child { color: var(--ok); }
.note > :last-child { margin-bottom: 0; }

/* Status */
.st { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; font-size: .85rem; font-weight: 600; }
.st::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; flex: none; }
.st.bestaetigt { color: var(--ok); }
.st.geprueft { color: var(--info); }
.st.gebaut { color: var(--warn); }
.st.grenze { color: var(--bad); }
.st.geplant { color: var(--dim); }
.st.geplant::before { background: transparent; border: 2px solid currentColor; }
.st.grenze::before { border-radius: 2px; }
.st.gebaut::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.st.geprueft::before { border-radius: 2px; transform: rotate(45deg) scale(.85); }

/* Funktionsliste */
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; padding: .8rem 1rem; background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 1.2rem; font-size: .9rem; }
.legend span { color: var(--dim); }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1.2rem; }
.filters button, .chip { background: var(--bg-raise); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: .3rem .85rem; font: inherit; font-size: .88rem; cursor: pointer; }
.filters button:hover { border-color: var(--dim); }
.filters button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.filters input[type="search"] { padding: .4rem .8rem; background: var(--bg-sunk); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: .92rem; min-width: 14rem; }
.feat h3 { margin-top: 2.2rem; }
.feat td:nth-child(2) { width: 9.5rem; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; margin: 1.4rem 0 2rem; max-width: 62rem; }
.counts div { padding: .75rem .9rem; background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); }
.counts b { display: block; font-size: 1.9rem; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.counts span { font-size: .85rem; color: var(--dim); }

/* Testplan */
.progress { position: sticky; top: 3.6rem; z-index: 5; display: flex; align-items: center; gap: 1rem; padding: .7rem 0; background: var(--bg); border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.bar { flex: 1; min-width: 10rem; height: .55rem; background: var(--bg-sunk); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .35s cubic-bezier(.16, 1, .3, 1); }
.progress button { background: var(--bg-raise); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: .35rem .8rem; font: inherit; font-size: .88rem; cursor: pointer; }
.progress button:hover { border-color: var(--dim); }
.tests ol { list-style: none; padding: 0; }
.t { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raise); margin: .5rem 0; }
.t.done { opacity: .72; }
.t.done .t-title { text-decoration: line-through; text-decoration-color: var(--dim); }
.t.over { background: transparent; border-style: dashed; }
.t > label { display: flex; gap: .8rem; padding: .75rem .9rem .35rem; cursor: pointer; align-items: flex-start; }
.t input[type="checkbox"] { width: 1.25rem; height: 1.25rem; margin: .2rem 0 0; accent-color: var(--ok); flex: none; cursor: pointer; }
.t-num { font-family: var(--mono); color: var(--dim); font-size: .85rem; min-width: 2rem; padding-top: .15rem; }
.t-title { font-weight: 620; }
.t-body { padding: 0 .9rem .5rem 3.9rem; color: var(--dim); font-size: .95rem; }
.t-body p { margin: 0 0 .4rem; }
.t-note { display: block; width: calc(100% - 4.8rem); margin: 0 .9rem .8rem 3.9rem; padding: .4rem .6rem; background: var(--bg-sunk); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); font: inherit; font-size: .9rem; }
.badge { display: inline-block; font-size: .75rem; font-weight: 600; padding: .05rem .5rem; border-radius: 999px; border: 1px solid var(--line); color: var(--dim); margin-left: .5rem; vertical-align: .1em; }
.tests h2 { margin-top: 2.4rem; }
dialog { background: var(--bg-raise); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); width: min(46rem, 94vw); padding: 1.2rem; }
dialog::backdrop { background: oklch(0 0 0 / .55); }
dialog textarea { width: 100%; min-height: 16rem; background: var(--bg-sunk); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; font: .85rem/1.5 var(--mono); }

/* Startseite */
.hero { padding: .5rem 0 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .7rem; margin: 1rem 0 2rem; max-width: 62rem; }
.cards a { display: block; padding: 1rem 1.1rem; background: var(--bg-raise); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .15s, background .15s; }
.cards a:hover { border-color: var(--accent); background: color-mix(in oklch, var(--bg-raise) 80%, var(--accent) 6%); }
.cards b { display: block; margin-bottom: .2rem; font-weight: 620; }
.cards span { color: var(--dim); font-size: .93rem; line-height: 1.45; }

/* Anleitungs-Bausteine */
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps > li { counter-increment: s; position: relative; padding: .1rem 0 .1rem 2.6rem; margin: .9rem 0; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: .05rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--bg-raise); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 650; font-size: .88rem; font-variant-numeric: tabular-nums; }
.ui { font-weight: 600; color: var(--text); background: color-mix(in oklch, var(--info) 14%, transparent); border-radius: 3px; padding: 0 .3em; white-space: nowrap; }
figure { margin: 1.4rem 0; max-width: 62rem; }
figure img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); display: block; }
figcaption { color: var(--dim); font-size: .9rem; margin-top: .4rem; }
.diagram { max-width: 62rem; margin: 1.4rem 0; }
.diagram svg { width: 100%; height: auto; display: block; }
.diagram text { font-family: var(--sans); fill: var(--text); }
.diagram .box { fill: var(--bg-raise); stroke: var(--line); }
.diagram .acc { stroke: var(--accent); fill: color-mix(in oklch, var(--accent) 12%, var(--bg-raise)); }
.diagram .ln { stroke: var(--dim); fill: none; stroke-width: 1.5; }
.diagram .dim { fill: var(--dim); }

footer.foot { max-width: 90rem; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; color: var(--dim); font-size: .88rem; border-top: 1px solid var(--line); }

@media (max-width: 62rem) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  nav.side { position: fixed; inset: 3.6rem 0 0 0; z-index: 15; height: auto; background: var(--bg); transform: translateX(-100%); transition: transform .25s cubic-bezier(.16, 1, .3, 1); border-right: 0; }
  body.nav-open nav.side { transform: none; }
  .menu-btn { display: inline-block; }
  .top { gap: .5rem; padding: .5rem .75rem; }
  .search { width: auto; flex: 1 1 5rem; min-width: 0; }
  .top .brand span { display: none; }
  .top .brand img { height: 22px; }
  .theme { padding: .35rem .55rem; font-size: .8rem; }
  .top .spacer { display: none; }
  .t-body { padding-left: .9rem; }
  .t-note { width: calc(100% - 1.8rem); margin-left: .9rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print {
  .top, nav.side, .filters, .progress button, .search, footer.foot { display: none !important; }
  .shell { display: block; }
  body { background: #fff; color: #000; font-size: 11pt; }
}

/* Lizenztexte */
pre.lic { max-height: 26rem; white-space: pre-wrap; word-break: break-word; font-size: .78rem; }
details { margin: .35rem 0; }
details > summary { cursor: pointer; padding: .3rem 0; overflow-wrap: anywhere; }
details > summary .dim { color: var(--text-dim, var(--muted, inherit)); opacity: .7; }

/* Offene Fragen */
.fq { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.fq > li { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.fq .f-text { display: flex; gap: .8rem; align-items: baseline; }
.fq .f-text p { margin: 0; }
.fq textarea { width: 100%; box-sizing: border-box; margin-top: .6rem; padding: .6rem .7rem; font: inherit; color: inherit; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: var(--radius); resize: vertical; }
.fq textarea:disabled { opacity: .65; }
.fq .f-row { display: flex; gap: .8rem; align-items: center; margin-top: .4rem; }
.fq .f-status { font-size: .85rem; opacity: .75; }
.fq li.frozen .f-status { opacity: 1; }
.fq.done small { opacity: .7; }

.fq .f-answer { margin: .4rem 0 0 2.2rem; padding: .5rem .7rem; border-left: 3px solid var(--accent, #c9531b); background: var(--bg-sunk); border-radius: 0 var(--radius) var(--radius) 0; white-space: pre-wrap; }
.fq .f-answer:empty { display: none; }

.t-claude { margin: 0 .9rem .8rem 3.9rem; padding: .45rem .7rem; border-left: 3px solid var(--accent, #3b8eea); background: var(--bg-sunk); border-radius: 0 var(--radius) var(--radius) 0; font-size: .88rem; color: var(--text); }
.t-claude b { color: var(--accent, #3b8eea); font-weight: 600; }
.t-done-box { margin: 2rem 0 1rem; border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem .9rem; }
.t-done-box > summary { cursor: pointer; font-weight: 600; padding: .4rem 0; }
@media (max-width: 720px) { .t-claude { margin-left: .9rem; } }
