/* Contivana Seiten, Modul 1. Setzt auf dem Designsystem (designsystem-v0.1.css, Tannengrün auf Leinen) auf und lädt danach. Eigene Regeln und selbst gehostete Schriften. */
@font-face { font-family: "Bricolage Grotesque"; src: url("../fonts/BricolageGrotesque.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible Next"; src: url("../fonts/AtkinsonHyperlegibleNext.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }

@media (prefers-reduced-motion: reduce) { :root { --dur-1: 0ms; --dur-2: 0ms; } * { transition-duration: 0ms !important; animation-duration: 0ms !important; } }

/* Basis */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.cv { font-family: var(--font-text); font-size: var(--fs-md); line-height: 1.55; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.01em; font-weight: 700; margin: 0; text-wrap: balance; }
h1 { font-size: 2rem; } h2 { font-size: var(--fs-2xl); } h3 { font-size: var(--fs-xl); }
p { margin: 0; }
a { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
code { font-family: var(--font-data); }
[data-modus] { display: grid; gap: var(--sp-3); }

/* Kunden, Kunde, Log, API-Doku (Block 12, Aufgabe 3): Ergänzungen zum Designsystem, anstelle der style-Attribute der Entwürfe */
.stack--kopf { gap: var(--sp-1); }
.stack--abschnitt { gap: var(--sp-6); scroll-margin-top: var(--sp-6); }
.stack--aktion { gap: var(--sp-4); scroll-margin-top: var(--sp-6); min-width: 0; padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.row--mitte { justify-content: center; }
.row--ende { justify-content: flex-end; }
.mask--start { align-self: flex-start; }
.cell-name { display: flex; flex-direction: column; min-width: 0; }
.cell-name b { display: block; }
.cell-end { text-align: right; white-space: nowrap; }
.table--log { min-width: 820px; }
.table th[scope="col"] { white-space: nowrap; }
.empty-text { max-width: 44ch; }
.select--kunde { min-height: 40px; max-width: 220px; }
.mitem-knopf { align-self: flex-start; }
.mitem > .kv { padding-top: var(--sp-2); }
.row-open td { padding: var(--sp-4) var(--sp-5); }

/* Suchfeld mit Lupe */
.input-wrap--search { width: 280px; max-width: 100%; }
.input-wrap--search .input { min-height: 40px; padding-left: 40px; padding-right: 12px; }
.input-wrap--search > .ic { position: absolute; left: 12px; top: 10px; color: var(--text-muted); pointer-events: none; }

/* Zeitraum als Segment aus Links (das Designsystem stylt nur .seg button) */
.seg a { min-height: 38px; padding: 0 var(--sp-4); border-radius: 6px; background: transparent; color: var(--text-muted); font: 600 var(--fs-sm)/1 var(--font-text); display: inline-flex; align-items: center; text-decoration: none; }
.seg a:hover { color: var(--text); }
.seg a[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.chip .tag { margin-left: 2px; }
.chip[aria-pressed="true"] .tag { background: rgba(255, 255, 255, .18); color: inherit; }

/* Dialoge: native dialog-Elemente mit showModal. Das Designsystem setzt .dialog auf display:flex und würde ein geschlossenes Element zeigen. */
dialog.dialog:not([open]) { display: none; }
dialog.dialog { border: 0; color: var(--text); width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; }
dialog.dialog::backdrop { background: var(--overlay); }
.dialog > form { display: contents; }
.dialog .code-row { margin-block: var(--sp-1); }
.dialog .secret { word-break: break-all; }
@container page (max-width: 760px) {
  dialog.dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .dialog .dlg-actions { flex-direction: column-reverse; }
  .dialog .dlg-actions .btn { width: 100%; }
}

/* API-Doku: nur Navigation und Inhalt nebeneinander; das Codebeispiel steht unter den Feldern der Aktion.
   Block 12b.3: Am Rechner fällt die zentrierte Inhaltsbreite weg, das Dienste-Menü liegt direkt am Hauptmenü; das Handy bleibt unverändert. */
@container page (min-width: 761px) {
  .api { grid-template-columns: 264px minmax(0, 1fr); }
  .content--voll { max-width: none; margin: 0; padding: 0; }
}
.api-nav { position: sticky; top: 0; max-height: 100dvh; overflow-y: auto; }
.api-nav a { text-decoration: none; }
.api-nav .ep--grund { padding-left: 10px; font-family: var(--font-text); font-weight: 600; font-size: 14px; }
.api-main { max-width: 1040px; }
.api-main article { min-width: 0; }
.code-label { margin-top: var(--sp-2); }
.code + .code-label { margin-top: var(--sp-3); }
.code pre code { font: inherit; }

/* Rahmen und Anmeldeseiten (Block 12, Aufgabe 2): Ergänzungen zum Designsystem, anstelle der style-Attribute der Entwürfe */
.auth-brand .stack { gap: 20px; }
.auth-col h1 { font-size: 32px; }
.auth-links { align-self: flex-start; }
.auth-col .row .muted { align-items: flex-start; }
.empty-ic--info { background: var(--info-bg); color: var(--info); }
.empty-ic--danger { background: var(--danger-bg); color: var(--danger); }
.wz--3 { --n: 3; }
.code-liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2) var(--sp-6); }
.side-abstand { height: var(--sp-3); }
.side-fuss { padding: 0 var(--sp-2); }
.stack--eng { gap: 0; }
.profile--still { cursor: default; }
.profile-text { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.ctxbar .why { opacity: .8; }
.topbar .ctx { min-width: 0; }
.tabbar > .tab { flex: 1 1 0; min-width: 0; }
.note[hidden], .note > .ic[hidden] { display: none; }
.auth-col .btn--ghost:not(.btn--sm) { white-space: normal; height: auto; min-height: 44px; padding-block: 8px; text-align: center; }
.auth-col > .stack > .btn--sm { align-self: flex-start; }
.auth-col, .auth-main { min-width: 0; }

/* Gerät merken auf /code (Block 12, Aufgabe 4): Häkchen wie Entwurf 03 bis 05, Haken nur sichtbar, wenn an */
.geraet { display: flex; flex-direction: column; gap: 2px; }
.geraet-hinweis { padding-left: 34px; }
.check .ic { stroke-width: 2.5; }
.check:not(.is-on) .ic { visibility: hidden; }

/* Zugangsseiten (Block 12, Aufgabe 5): Passwort vergessen, Passwort setzen, Registrierung, Antrag. Ergänzungen anstelle der style-Attribute der Entwürfe */
.auth-zurueck { align-self: flex-start; margin-left: -12px; }
.stack--form { gap: var(--sp-4); }
.stack--antwort { gap: var(--sp-4); }
.lead { font-size: var(--fs-lg); }
.empty-ic--warning { background: var(--warning-bg); color: var(--warning); }
.empty-ic--success { background: var(--success-bg); color: var(--success); }
.empty-ic--review { background: var(--st-review-bg); color: var(--st-review); }
.staerke-wort { color: var(--text); }
.field .field-error[hidden] { display: none; }
.steps--antrag { gap: var(--sp-3); }
.steps--antrag .dot > .ic { stroke-width: 2.5; }
.steps--antrag .is-now .dot { border-color: var(--st-review); animation: none; }
.btn.is-loading .spin[hidden] { display: none; }
/* Köderfeld der Registrierung: für Menschen unsichtbar, Bots füllen es aus */
.fang { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Kunde anlegen und Anträge (Block 12, Aufgabe 6a): Ergänzungen anstelle der style-Attribute der Entwürfe betreiber-01, 05 bis 10 */
.tabbar { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; }
.fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.fieldset .label { margin-bottom: 6px; padding: 0; }
.fieldset .seg { align-self: flex-start; }
.toast--seite { flex-wrap: wrap; }
.toast--seite .toast-text { flex: 1 1 260px; }
.toast--seite .toast-haken { color: var(--accent-soft); }
.toast--seite .toast-knopf { background: var(--bg); color: var(--text); }
.antrag { gap: var(--sp-3); }
.antrag-kopf { gap: var(--sp-2); }
.btn--gefahr { color: var(--danger); }

/* Einstellungen Kunde und Profile (Block 12, Aufgabe 6b): Ergänzungen anstelle der style-Attribute der Entwürfe kunden-01 bis 06 */
.stack--einstellungen { gap: var(--sp-5); max-width: 640px; }
.field--grenzen { border-top: 1px solid var(--line); padding-top: var(--sp-4); }
.num-schmal { max-width: 140px; }
.meter .bar { width: 160px; }
.op-chip--klein { height: 24px; font-size: 11px; }
.stack--note { gap: var(--sp-2); }
.toast--einstellungen { align-self: flex-start; }
.toast--einstellungen .toast-haken { color: var(--accent-soft); }
.row--titel { gap: var(--sp-3); }
.row--eng { gap: var(--sp-2); }
.row--dialog { gap: var(--sp-3); }
.grenz-hinweis { gap: var(--sp-2); min-height: 44px; }
.input--kurzname { font-family: var(--font-data); }
.empty-ic--klein { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.dialog[role="alertdialog"] .row--dialog + .small { margin-top: var(--sp-2); }

/* Nutzer einladen und Schlüssel anlegen (Block 12, Aufgabe 6c): Ergänzungen anstelle der style-Attribute der Entwürfe kunden-07 bis 12 */
.stack--dialog { gap: var(--sp-4); min-width: 0; }
dialog.dialog--breit { width: min(560px, calc(100vw - 32px)); }
.schritt-zahl { white-space: nowrap; flex: none; }
.stack--rollen { gap: var(--sp-2); }
.stack--rollen .version { padding: 12px 14px; gap: 2px; cursor: pointer; }
.version:not(.is-picked) .rolle-haken { visibility: hidden; }
.rolle-haken { color: var(--accent-text); }
.row--hinweis { gap: var(--sp-2); align-items: flex-start; }
.row--hinweis > .ic { flex: none; margin-top: 2px; }
.stack--wahlliste { gap: var(--sp-1); }
.stack--wahlliste .check-btn { align-items: flex-start; padding-block: var(--sp-2); }
.stack--wahlliste .check { margin-top: 2px; }
.stack--wahl { gap: 2px; min-width: 0; }
.fieldset.is-error .check { border-color: var(--danger); }
.stack--datum { gap: var(--sp-1); margin-top: 6px; }
.input--datum { max-width: 240px; }
.ic-erfolg { color: var(--success); flex: none; }
.pill--start { align-self: flex-start; }
.text-stark { color: var(--text); }
.secret .btn { flex: none; }
#schluessel-klartext { font-size: 15px; }
@container page (max-width: 760px) {
  dialog.dialog--breit { width: 100%; }
}

/* Contivana QR (Carl): QR-Code auf /einrichten. Am Rechner links neben Knopf und Schlüssel, am Handy darunter; immer weißer Grund, damit Kameras ihn auch im dunklen Modus lesen */
.qr-verbinden { display: flex; gap: var(--sp-5); align-items: flex-start; }
.qr-verbinden .qr-daneben { flex: 1; min-width: 0; }
.qr { display: block; flex: none; box-sizing: border-box; width: 200px; height: 200px; padding: var(--sp-2); background: #fff; border-radius: var(--r-sm); image-rendering: pixelated; }
.qr[hidden] { display: none; }
@media (max-width: 640px) {
  .qr-verbinden { flex-direction: column; align-items: stretch; }
  .qr { order: 2; align-self: center; }
}
/* Schlüssel-Seite, Chat-Schlüssel (Bild 28.10.): Aufrufe zum Aufklappen, feste Darf-Liste, Schritte in Claude.
   Nötig, weil das Designsystem weder <details> noch Listen ohne Aufzählungszeichen kennt. */
.aufrufe-zeile { background: var(--surface-2); }
.aufrufe summary { cursor: pointer; padding: var(--sp-1) 0; }
.aufrufe .table, .aufrufe-liste { margin-top: var(--sp-2); }
.aufrufe-liste, .stack--darf { list-style: none; margin: 0; padding: 0; }
.stack--darf { gap: var(--sp-1); }
.stack--schritte { margin: 0; padding-left: 1.4em; gap: var(--sp-2); }
