/* Lindra (Arbeitstitel) – Oberfläche. Nutzt ausschließlich Marken aus tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  min-height: 100vh;
}
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: var(--lh-tight); margin: 0 0 var(--s4); }
h1 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h1); letter-spacing: -0.01em; }
h2 { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-weight: 700; }
p { margin: 0 0 var(--s4); max-width: var(--measure); }
/* Lange deutsche Wörter (Konzentrationsprobleme) dürfen bei großer Schrift trennen statt die Seite zu verbreitern */
h1, h2, h3, legend, label, th, td, dt, dd { hyphens: auto; overflow-wrap: anywhere; }
h1, h2 { hyphens: manual; }
a { color: var(--moss-deep); text-underline-offset: 0.18em; text-decoration-thickness: 0.08em; }
a:hover { text-decoration-thickness: 0.14em; }
small, .small { font-size: var(--fs-small); }
.soft { color: var(--ink-soft); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }
h1:focus { outline: none; }

/* ---------- Sprunglink und Prototyp-Hinweis ---------- */
.skip { position: absolute; left: var(--s4); top: -10rem; z-index: 50; background: var(--ink); color: #fff; padding: var(--s3) var(--s4); border-radius: var(--radius); }
.skip:focus { top: var(--s3); }
.proto-note { background: var(--notice-tint); border-bottom: 1px solid var(--rule); font-size: var(--fs-small); padding: var(--s2) var(--s4); }
.proto-note p { margin: 0 auto; max-width: 72rem; }

/* ---------- Kopf ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding: var(--s3) var(--s4); max-width: 72rem; margin: 0 auto; }
.wordmark { display: inline-flex; align-items: baseline; gap: var(--s2); color: var(--ink); text-decoration: none; min-height: var(--target); align-items: center; }
.wordmark b { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; letter-spacing: -0.01em; }
.wordmark span { font-size: var(--fs-small); color: var(--ink-soft); }
.where { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--target); padding: 0 var(--s3); border: 1px solid var(--edge); border-radius: 999px; color: var(--ink); text-decoration: none; font-size: var(--fs-small); background: var(--sheet); }
.where svg { flex: none; }

/* ---------- Rahmen ---------- */
.frame { max-width: 72rem; margin: 0 auto; padding: 0 var(--s4) calc(var(--s8) + var(--s6)); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
.page { min-width: 0; padding-top: var(--s4); }
.page > header { margin-bottom: var(--s5); }
.kicker { font-size: var(--fs-small); color: var(--ink-soft); margin: 0 0 var(--s2); letter-spacing: 0.02em; }
.lead { font-size: var(--fs-lead); }

/* Hauptnavigation: unten auf dem Handy, links ab 960 px */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--sheet); border-top: 1px solid var(--edge); }
.nav ul { list-style: none; margin: 0 auto; padding: 0 var(--s1); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 40rem; }
.nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 3.75rem; padding: var(--s1) 2px; color: var(--ink-soft); text-decoration: none; font-size: 0.875rem; line-height: 1.1; text-align: center; overflow-wrap: normal; hyphens: manual; }
.nav a[aria-current='page'] { color: var(--moss-deep); font-weight: 700; box-shadow: inset 0 3px 0 var(--moss); }
.nav svg { width: 1.5rem; height: 1.5rem; }
.nav .nav-wide { display: none; }

@media (min-width: 60rem) {
  .frame { grid-template-columns: 14rem minmax(0, 1fr); padding-bottom: var(--s8); }
  .nav { position: sticky; top: var(--s4); align-self: start; border: 0; background: transparent; }
  .nav ul { display: flex; flex-direction: column; gap: var(--s1); padding: var(--s4) 0 0; }
  .nav a { flex-direction: row; justify-content: flex-start; gap: var(--s3); min-height: var(--target); padding: var(--s2) var(--s3); font-size: var(--fs-body); border-radius: var(--radius); }
  .nav a[aria-current='page'] { box-shadow: inset 3px 0 0 var(--moss); background: var(--moss-tint); }
  .nav .nav-wide { display: block; }
  .nav .nav-more { display: none; }
}
/* Unter 360 px zeigt die untere Leiste nur Symbole mit sichtbarer Kurzbeschriftung in kleiner Größe – Text bleibt im Barrierebaum. */
@media (max-width: 22.4rem) { .nav a { font-size: 0.8125rem; } }

/* ---------- Blatt, Abschnitte ---------- */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow-sheet); padding: var(--s5) var(--s4); }
@media (min-width: 40rem) { .sheet { padding: var(--s6); } }
.section { margin: 0 0 var(--s7); }
.section > h2 { padding-bottom: var(--s2); border-bottom: 2px solid var(--ink); }
.stack > * + * { margin-top: var(--s4); }
.sheet > :first-child { margin-top: 0; }
.two { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); }
/* zwei Spalten nur, wenn beide mindestens 22rem breit sind – bei großer Schrift automatisch eine */
@media (min-width: 48rem) { .two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); } }

/* ---------- Schaltflächen ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: var(--target); min-width: var(--target); padding: var(--s2) var(--s5); border-radius: var(--radius); border: 2px solid var(--moss); background: var(--moss); color: var(--on-moss); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background var(--t-fast); text-align: center; }
.btn:hover { background: var(--moss-deep); border-color: var(--moss-deep); }
.btn--quiet { background: var(--sheet); color: var(--moss-deep); }
.btn--quiet:hover { background: var(--moss-tint); }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: #861f16; border-color: #861f16; }
.btn--ghost-danger { background: var(--sheet); color: var(--danger); border-color: var(--danger); }
.btn[disabled], .btn[aria-disabled='true'] { background: var(--paper-sunk); border-color: var(--edge); color: var(--ink-soft); cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-top: var(--s5); }
.actions > a:not(.btn), .actions > li > a:not(.btn) { display: inline-flex; align-items: center; min-height: var(--target); padding: 0 var(--s2); }
.linkbtn { background: none; border: 0; padding: 0 var(--s2); min-height: var(--target); color: var(--moss-deep); font: inherit; text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }

/* ---------- Formulare ---------- */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 700; }
label { font-weight: 600; }
.field { display: grid; gap: var(--s2); margin-bottom: var(--s5); }
.field .hint { font-size: var(--fs-small); color: var(--ink-soft); font-weight: 400; }
input[type='text'], input[type='email'], input[type='time'], input[type='date'], textarea, select {
  font: inherit; color: var(--ink); background: var(--sheet); border: 2px solid var(--edge); border-radius: var(--radius);
  min-height: var(--target); padding: var(--s2) var(--s3); width: 100%; max-width: 32rem;
}
textarea { min-height: 6rem; resize: vertical; }

/* Stärke-Auswahl: Tintenpunkt wächst mit der Stärke, Text darunter. Kein Ziehen, nur Antippen. */
.scale-row { padding: var(--s4) 0; border-bottom: 1px solid var(--rule); }
.scale-row:last-child { border-bottom: 0; }
.scale-row legend { display: block; margin-bottom: var(--s1); }
.scale-row .hint { display: block; font-size: var(--fs-small); color: var(--ink-soft); margin-bottom: var(--s3); }
.scale { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: var(--s2); }
.scale label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: var(--s1); min-height: 4.25rem; padding: var(--s2) var(--s1); border: 2px solid var(--edge); border-radius: var(--radius); background: var(--sheet); font-weight: 400; font-size: var(--fs-small); cursor: pointer; text-align: center; overflow-wrap: anywhere; line-height: 1.15; }
.scale input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.scale .dot { display: block; border-radius: 50%; border: 2px solid var(--dot); background: transparent; flex: none; }
.scale label:has(input:checked) { border-color: var(--moss); border-width: 3px; background: var(--moss-tint); font-weight: 700; }
.scale label:has(input:checked) .dot { background: var(--dot); }
.scale label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.d0 { width: 0.5rem; height: 0.5rem; } .d1 { width: 0.875rem; height: 0.875rem; } .d2 { width: 1.25rem; height: 1.25rem; } .d3 { width: 1.75rem; height: 1.75rem; } .d4 { width: 2.125rem; height: 2.125rem; }
.scale--words { grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr)); }
.scale--words label { justify-content: center; min-height: var(--target); font-size: var(--fs-body); overflow-wrap: normal; hyphens: auto; }
.slot { display: flex; align-items: center; justify-content: center; width: 2.125rem; height: 2.125rem; flex: none; }

/* Zahl ändern ohne Ziehen: − / + */
.stepper { display: inline-flex; align-items: stretch; max-width: 100%; border: 2px solid var(--edge); border-radius: var(--radius); background: var(--sheet); }
.stepper button { flex: none; min-width: var(--target); min-height: var(--target); border: 0; background: transparent; font: inherit; font-size: 1.5rem; color: var(--moss-deep); cursor: pointer; }
.stepper output { display: flex; align-items: center; justify-content: center; min-width: 0; flex: 1 1 6.5rem; white-space: nowrap; padding: 0 var(--s2); border-left: 1px solid var(--rule); border-right: 1px solid var(--rule); font-weight: 700; }

.check { display: flex; align-items: center; gap: var(--s3); min-height: var(--target); font-weight: 400; cursor: pointer; }
.check input { width: 1.5rem; height: 1.5rem; accent-color: var(--moss); flex: none; margin: 0; }

.status { min-height: 1.6em; font-weight: 700; color: var(--moss-deep); }
.error { color: var(--danger); font-weight: 700; }

/* ---------- Tag wechseln ---------- */
.daybar { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s4); flex-wrap: wrap; }
.daybar .day { font-weight: 700; font-size: var(--fs-lead); }

/* ---------- Punktraster (Verlauf) ---------- */
.raster { --cols: 28; }
.raster-row { padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
.raster-row h3 { font-size: var(--fs-body); margin: 0; }
.raster-row .sum { font-size: var(--fs-small); color: var(--ink-soft); margin: 0 0 var(--s2); }
.strip { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); align-items: center; height: 2rem; background: var(--paper-sunk); border-radius: 3px; padding: 0 2px; }
.strip i { display: block; justify-self: center; border-radius: 50%; background: var(--dot); }
.strip i.l0 { width: 3px; height: 3px; background: var(--edge); }
.strip i.l1 { width: 30%; aspect-ratio: 1; max-width: 6px; min-width: 3px; }
.strip i.l2 { width: 55%; aspect-ratio: 1; max-width: 11px; min-width: 5px; }
.strip i.l3 { width: 85%; aspect-ratio: 1; max-width: 17px; min-width: 7px; }
.strip i.gap { width: 100%; height: 2px; border-radius: 0; background: transparent; border-top: 2px dotted var(--edge); }
.strip i.bleed-schmier { width: 40%; height: 0.5rem; border-radius: 1px; background: var(--clay); opacity: 1; }
.strip i.bleed-leicht { width: 60%; height: 0.875rem; border-radius: 1px; background: var(--clay); }
.strip i.bleed-stark { width: 85%; height: 1.375rem; border-radius: 1px; background: var(--clay); }
.strip i.bleed-keine { width: 3px; height: 3px; background: var(--edge); }
.strip--tall { height: 3rem; }
.strip i.sleep { width: 60%; border-radius: 1px 1px 0 0; align-self: end; background: var(--moss); }
.strip i.sleep.short { background: var(--clay); }
.axis { max-width: none; display: flex; justify-content: space-between; font-size: var(--fs-small); color: var(--ink-soft); margin-top: var(--s2); gap: var(--s2); flex-wrap: wrap; }
.legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); align-items: center; font-size: var(--fs-small); color: var(--ink-soft); margin: var(--s3) 0 var(--s5); padding: 0; list-style: none; }
.legend li { display: inline-flex; gap: var(--s2); align-items: center; }
.legend .dotk { display: inline-block; border-radius: 50%; background: var(--dot); }
.legend .dotk--none { background: var(--edge); }

.toggle-row { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; justify-content: space-between; margin-bottom: var(--s4); }

/* Tabellen: auf schmalen Bildschirmen als gestapelte Zeilen, auf breiten bei Bedarf eigener Rollbereich */
.table-scroll { overflow-x: auto; max-width: 100%; }
.table-scroll:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.section-h { font-size: var(--fs-h3); font-family: var(--font-text); font-weight: 700; margin: 0 0 var(--s2); }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.table caption { text-align: left; font-weight: 700; margin-bottom: var(--s2); font-size: var(--fs-body); }
.table th, .table td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--rule); vertical-align: top; }
.table thead th { border-bottom: 2px solid var(--ink); }
@media (max-width: 40rem) {
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--stack tr { display: block; padding: var(--s3) 0; border-bottom: 1px solid var(--rule); }
  .table--stack td, .table--stack th[scope='row'] { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: var(--s3); border: 0; padding: var(--s1) 0; }
  .table--stack td::before { content: attr(data-label); color: var(--ink-soft); }
  .table--stack th[scope='row'] { display: block; font-size: var(--fs-body); }
}

/* ---------- Beobachtungen ---------- */
.finding { border-left: 4px solid var(--moss); padding: var(--s1) 0 var(--s1) var(--s4); margin: 0 0 var(--s5); }
.finding h3 { margin-bottom: var(--s2); }
.finding p { margin-bottom: var(--s2); }
.caveat { font-size: var(--fs-small); color: var(--ink-soft); }

/* ---------- Hinweise ---------- */
.note { background: var(--notice-tint); border-radius: var(--radius); padding: var(--s4); margin: 0 0 var(--s5); }
.note > :last-child { margin-bottom: 0; }
.note--privacy { background: var(--moss-tint); }
.note--danger { background: var(--danger-tint); }
.tag { display: inline-block; font-size: var(--fs-small); font-weight: 700; padding: 0 var(--s2); border-radius: 3px; border: 1px solid currentColor; line-height: 1.6; }
.tag--open { color: var(--clay); background: var(--sheet); }
.tag--ok { color: var(--moss-deep); background: var(--sheet); }

/* ---------- Listen ---------- */
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.list > li { border-bottom: 1px solid var(--rule); }
.list a.row, .list .row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 3.5rem; padding: var(--s3) 0; color: var(--ink); text-decoration: none; }
.list a.row:hover strong { text-decoration: underline; }
.row-text { display: grid; gap: 2px; min-width: 0; }
.row-text small { color: var(--ink-soft); }
.chev { flex: none; color: var(--moss-deep); }

/* ---------- Selbsttest ---------- */
.progress { height: 0.5rem; background: var(--paper-sunk); border-radius: 999px; overflow: hidden; margin: var(--s2) 0 var(--s5); border: 1px solid var(--edge); }
.progress span { display: block; height: 100%; background: var(--moss); transition: width var(--t-fast); }
.scale--mrs { --n: 5; }
@media (max-width: 26rem) { .scale--mrs { grid-template-columns: minmax(0, 1fr); } .scale--mrs label { flex-direction: row; justify-content: flex-start; gap: var(--s3); min-height: var(--target); padding: var(--s2) var(--s3); font-size: var(--fs-body); } .scale--mrs .slot { order: -1; } }
.result-total { display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.result-total b { font-family: var(--font-display); font-size: 3.5rem; line-height: 1; }
.meter { position: relative; height: 0.75rem; background: var(--paper-sunk); border: 1px solid var(--edge); border-radius: 999px; margin: var(--s2) 0 var(--s1); }
.meter span { position: absolute; inset: 0 auto 0 0; background: var(--dot); border-radius: 999px; }

/* ---------- Bericht ---------- */
.report { background: #fff; color: #111; border: 1px solid var(--rule); box-shadow: var(--shadow-sheet); padding: var(--s6) var(--s5); max-width: 46rem; }
.report h2 { font-size: 1.5rem; border-bottom: 2px solid #111; padding-bottom: var(--s2); }
.report h3 { margin-top: var(--s5); }
.report .meta { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1) var(--s5); font-size: var(--fs-small); margin-bottom: var(--s4); }
@media (min-width: 40rem) { .report .meta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.report footer { margin-top: var(--s6); padding-top: var(--s3); border-top: 1px solid #999; font-size: var(--fs-small); color: #333; }

/* Metadaten eines Artikels */
.meta-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2) var(--s5); margin: 0 0 var(--s5); font-size: var(--fs-small); }
@media (min-width: 40rem) { .meta-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.meta-list dd { margin: 0; color: var(--ink-soft); }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: min(34rem, calc(100vw - 2rem)); width: 100%; box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.45); color: var(--ink); background: var(--sheet); }
dialog::backdrop { background: rgba(30, 36, 34, 0.55); }
dialog .dlg { padding: var(--s5); }

/* ---------- Startseite ---------- */
.hero { display: grid; gap: var(--s5); grid-template-columns: minmax(0, 1fr); align-items: end; padding: var(--s5) 0 var(--s6); margin-bottom: var(--s4); }
.hero h1 { font-size: clamp(2.25rem, 1.6rem + 3vw, 3.75rem); max-width: 14ch; }
@media (min-width: 52rem) { .hero { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
.paths { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 48rem) { .paths { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.path { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s5) 0 0; border-top: 4px solid var(--ink); }
.path h2 { font-size: 1.375rem; margin: 0; }
.path p { margin: 0; }
.path .btn { margin-top: auto; align-self: flex-start; }
.path--hr { border-top-color: var(--clay); }
.sample { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; align-items: center; height: 5.5rem; }

/* ---------- Arbeitgeber-Bereich ---------- */
body.hr { background: #f3f1ee; }
.hr-top { border-bottom: 3px solid var(--clay); }
.kpis { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); margin: 0 0 var(--s6); }
@media (min-width: 40rem) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { border-top: 2px solid var(--ink); padding-top: var(--s3); }
.kpi dt { font-size: var(--fs-small); color: var(--ink-soft); }
.kpi dd { margin: 0; font-family: var(--font-display); font-size: 2.25rem; font-weight: 600; line-height: 1.1; }
.kpi dd small { font-family: var(--font-text); font-size: var(--fs-small); font-weight: 400; color: var(--ink-soft); display: block; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s1); padding: var(--s2) 0; }
.bars .bar { height: 0.75rem; background: var(--paper-sunk); border: 1px solid var(--edge); border-radius: 2px; }
.bars .bar span { display: block; height: 100%; background: var(--clay); }

/* ---------- Druck: nur der Bericht ---------- */
@media print {
  .table--stack thead { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .proto-note, .top, .nav, .no-print, .skip { display: none !important; }
  body { background: #fff; }
  .frame { display: block; padding: 0; }
  .report { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .page > header { display: none; }
}

/* Zugangscodes (Gegenprüfung R4): gut lesbar, Ziffern und Buchstaben eindeutig */
.code-text { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 600; letter-spacing: .04em; overflow-wrap: anywhere; }

/* Windows-Kontrastmodus (Gegenprüfung R7): Hintergrundfarben werden dort entfernt, Punkte und Balken verschwanden.
   Die Grafik behält ihre Form und nutzt die Systemfarben der Nutzerin. */
@media (forced-colors: active) {
  .strip i, .legend .dotk, .scale .dot, .meter span, .progress span, .bars .bar span { forced-color-adjust: none; }
  .strip i, .legend .dotk, .meter span, .progress span, .bars .bar span { background: CanvasText; }
  .strip i.l0, .strip i.bleed-keine, .legend .dotk--none { background: GrayText; }
  .strip i.gap { background: transparent; border-top-color: GrayText; }
  .strip i.sleep.short { background: Highlight; }
  .scale .dot { border-color: CanvasText; background: Canvas; }
  .scale label:has(input:checked) .dot { background: CanvasText; }
  .strip, .meter, .progress, .bars .bar { border: 1px solid CanvasText; }
}
