/* AIVA-Portal – Der Aussichtspunkt. Farbwelt: Nachtblau/Petrol, feines Gold. WCAG 2.1 AA. */
:root {
  --nacht: #0a1620;
  --nacht-hell: #10222d;
  --petrol: #123c47;
  --petrol-hell: #1c5563;
  --gold: #d9b45a;
  --gold-hell: #e9cd7e;
  --gold-dunkel: #b8923b;
  --text: #eaeff2;
  --text-leise: #b9c6cc;
  --text-dunkel: #0f1f28;
  --karte: rgba(14, 34, 44, 0.9);
  --rand: rgba(217, 180, 90, 0.28);
  --fehler: #ffb4a8;
  --fehler-grund: rgba(140, 40, 30, 0.35);
  --ok: #b9f0c8;
  --ok-grund: rgba(30, 110, 60, 0.35);
  --fokus: #ffe08a;
  --radius: 14px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0; min-height: 100vh; font-family: var(--schrift); font-size: 1rem; line-height: 1.55;
  color: var(--text); background: var(--nacht);
  background-image: radial-gradient(1200px 600px at 20% -10%, rgba(28, 85, 99, 0.45), transparent 60%),
                    radial-gradient(900px 500px at 100% 100%, rgba(217, 180, 90, 0.08), transparent 60%);
  display: flex; flex-direction: column;
}
a { color: var(--gold-hell); }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--fokus); outline-offset: 2px; border-radius: 4px; }
.unsichtbar { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprung { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--text-dunkel); padding: .5rem 1rem; border-radius: 8px; z-index: 100; }
.sprung:focus { left: 8px; }
.klein { font-size: .875rem; color: var(--text-leise); }
.klein-titel { font-size: 1rem; margin: 0 0 .5rem; color: var(--gold-hell); letter-spacing: .02em; }
.abstand-oben { margin-top: 1.5rem; }
.inline { display: inline; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; color: var(--gold-hell); }
h1 { font-size: 1.6rem; margin: 0 0 .75rem; font-weight: 600; }
h2 { font-size: 1.2rem; }

/* Kopf und Fuß */
.kopf { position: sticky; top: 0; z-index: 10; background: rgba(10, 22, 32, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rand); }
.kopf-innen { max-width: 1200px; margin: 0 auto; padding: .6rem 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.marke { color: var(--gold-hell); text-decoration: none; font-weight: 600; letter-spacing: .04em; }
.kopf nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; flex-wrap: wrap; align-items: center; }
.kopf nav a { display: inline-block; padding: .4rem .7rem; border-radius: 8px; text-decoration: none; color: var(--text); }
.kopf nav a[aria-current="page"] { background: var(--petrol); color: #fff; }
.kopf nav a:hover { background: var(--petrol-hell); }
.haupt { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 1rem; }
.fuss { text-align: center; padding: .75rem; color: var(--text-leise); font-size: .8rem; border-top: 1px solid rgba(255,255,255,.06); }

/* Karten, Formulare, Knöpfe */
.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
.feld { margin: 0 0 1rem; display: flex; flex-direction: column; gap: .3rem; }
.feld-zeile { flex-direction: row; align-items: center; gap: .6rem; }
label { font-weight: 500; }
input[type="email"], input[type="password"], input[type="text"], textarea, select {
  font: inherit; color: var(--text); background: var(--nacht-hell); border: 1px solid rgba(255,255,255,.18); border-radius: 10px; padding: .6rem .75rem; width: 100%;
}
input[type="checkbox"] { width: 1.15rem; height: 1.15rem; accent-color: var(--gold); }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--rand); border-radius: 10px; padding: .75rem 1rem 0; margin: 0 0 1rem; }
legend { padding: 0 .4rem; color: var(--gold-hell); }
.knopf {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: 10px; padding: .6rem 1.1rem;
  background: linear-gradient(180deg, var(--gold-hell), var(--gold)); color: var(--text-dunkel); text-decoration: none; display: inline-block;
}
.knopf:hover { background: linear-gradient(180deg, #fff0b8, var(--gold-hell)); }
.knopf:active { transform: translateY(1px); }
.knopf[disabled], .knopf[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.knopf-leise { background: transparent; color: var(--gold-hell); border: 1px solid var(--rand); font-weight: 500; }
.knopf-leise:hover { background: rgba(217, 180, 90, 0.12); }
.meldung { padding: .6rem .9rem; border-radius: 10px; margin: 0 0 1rem; }
.meldung-fehler { background: var(--fehler-grund); color: var(--fehler); border: 1px solid rgba(255,140,120,.35); }
.meldung-ok { background: var(--ok-grund); color: var(--ok); border: 1px solid rgba(120,220,150,.35); }

/* Anmeldung mit Bühne */
.seite-anmeldung .haupt { display: grid; place-items: center; min-height: calc(100vh - 3rem); position: relative; }
.buehne { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--nacht); }
.buehne-video, .buehne-bild { width: 100%; height: 100%; object-fit: cover; display: block; }
.buehne-schleier { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,22,32,.35), rgba(10,22,32,.75)); }
.karte-anmeldung { width: min(420px, 100%); text-align: left; }
.karte-anmeldung h1 { text-align: center; color: var(--gold-hell); letter-spacing: .06em; }
.unterzeile { text-align: center; color: var(--text-leise); margin-top: -0.4rem; }
.karte-anmeldung .knopf[type="submit"] { width: 100%; margin-top: .25rem; }
.buehne-video.angehalten { display: none; }

/* Gespräch */
.gespraech { display: grid; grid-template-columns: 300px 1fr; gap: 1.25rem; align-items: start; }
.seite-aiva { position: sticky; top: 4.2rem; }
.portrait img { width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--rand); box-shadow: 0 0 40px rgba(217,180,90,.15); display: block; }
.zustand { margin-top: .75rem; background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); padding: .75rem 1rem; }
.zustand p { margin: 0; color: var(--text-leise); }
.nur-mobil { display: none; }
.verlauf-bereich { display: flex; flex-direction: column; min-height: calc(100vh - 6rem); }
.verlauf { flex: 1; overflow-y: auto; max-height: calc(100vh - 14rem); padding: .5rem .25rem; display: flex; flex-direction: column; gap: .75rem; scroll-behavior: smooth; }
.leer { color: var(--text-leise); text-align: center; margin: auto; }
.trenner { display: flex; align-items: center; gap: .75rem; color: var(--text-leise); font-size: .8rem; margin: .5rem 0; }
.trenner::before, .trenner::after { content: ""; flex: 1; height: 1px; background: var(--rand); }
.nachricht { max-width: 80%; padding: .7rem .95rem; border-radius: var(--radius); background: var(--nacht-hell); border: 1px solid rgba(255,255,255,.08); }
.nachricht.von-nutzer { align-self: flex-end; background: var(--petrol); border-color: rgba(255,255,255,.12); }
.nachricht.von-aiva { align-self: flex-start; border-color: var(--rand); box-shadow: 0 0 24px rgba(217,180,90,.08); }
.nachricht.von-system { align-self: center; max-width: 92%; font-size: .875rem; color: var(--text-leise); background: transparent; border-style: dashed; }
.nachricht.art-tagebuch { border-left: 3px solid var(--gold); }
.nachricht.fehler { border-color: rgba(255,140,120,.5); }
.nachricht-kopf { display: flex; justify-content: space-between; gap: 1rem; font-size: .78rem; color: var(--text-leise); margin-bottom: .25rem; }
.nachricht .wer { color: var(--gold-hell); font-weight: 600; }
.nachricht .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bildidee { font-size: .875rem; color: var(--text-leise); margin: .5rem 0 0; }
.zustand-zeile { font-size: .8rem; color: var(--text-leise); margin: .5rem 0 0; font-style: italic; }
.nachricht-aktionen { margin-top: .4rem; }
.nachricht-aktionen .knopf { padding: .25rem .6rem; font-size: .8rem; }
.denkt { color: var(--gold-hell); margin: .25rem 0; }
.eingabe { margin-top: .75rem; background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); padding: .75rem; }
.eingabe textarea { min-height: 3.2rem; }
.eingabe-leiste { display: flex; gap: .5rem; align-items: center; margin-top: .5rem; flex-wrap: wrap; }
.eingabe-leiste select { width: auto; }
.eingabe-leiste #senden { margin-left: auto; }

/* Innenleben */
.reiter ul { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; gap: .3rem; flex-wrap: wrap; }
.reiter a { display: inline-block; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--rand); text-decoration: none; color: var(--text); }
.reiter a[aria-current="page"] { background: var(--gold); color: var(--text-dunkel); border-color: var(--gold); }
.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th, .tabelle td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: top; }
.tabelle th { color: var(--gold-hell); font-weight: 600; }
.tabelle-scroll { overflow-x: auto; }
.tabellenliste { columns: 3; list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.balken { position: relative; height: 10px; width: 160px; background: rgba(255,255,255,.1); border-radius: 999px; display: inline-block; vertical-align: middle; margin-right: .5rem; }
.balken-fuellung { position: absolute; left: 0; top: 0; height: 100%; background: linear-gradient(90deg, var(--petrol-hell), var(--gold)); border-radius: 999px; width: 0; }
.balken-marke { position: absolute; top: -3px; width: 2px; height: 16px; background: #fff; opacity: .7; }
.pruefliste { list-style: none; padding: 0; }
.pruefliste li { padding: .3rem 0; }
.pruefliste .ok { color: var(--ok); }
.pruefliste .nein { color: var(--fehler); }
.pruefliste .warnung { color: var(--gold-hell); }

/* Handy */
.vorschau { white-space: pre-wrap; word-break: break-word; background: var(--nacht-hell); border: 1px solid var(--rand); border-radius: 8px; padding: .75rem; font-size: .95rem; line-height: 1.5; max-height: 24rem; overflow-y: auto; }

/* Schlafender Zustand. Solange kein eigenes Schlafbild vorliegt, wird das Portraet abgedunkelt;
   liegt eines vor, spricht das Bild fuer sich und der Hinweis tritt zurueck. */
.portrait { position: relative; }
.portrait.schlaeft img { filter: brightness(.35) saturate(.5) blur(1px); }
.schlaf-hinweis { position: absolute; left: 0; right: 0; bottom: 12%; margin: 0; text-align: center;
  font-size: 1.15rem; letter-spacing: .04em; color: var(--gold); text-shadow: 0 2px 8px rgba(0,0,0,.8); }
.schlaf-hinweis.auf-bild { bottom: 6%; font-size: 1rem; opacity: .85; }
.schlaf-sperre { background: var(--nacht-hell); border: 1px solid var(--rand); border-radius: 10px;
  padding: .75rem 1rem; margin: .5rem 0; font-size: .95rem; }

.zeile-fehler td { color: #ffb4a2; }
.nichts-umbrechen { white-space: nowrap; }
.warnung { background: rgba(200, 70, 50, .18); border: 1px solid rgba(255, 140, 120, .45);
  border-radius: 8px; padding: .6rem .9rem; }

@media (max-width: 800px) {
  .gespraech { grid-template-columns: 1fr; }
  .seite-aiva { position: static; }
  .nur-mobil { display: inline-block; margin-bottom: .5rem; }
  .portrait img { max-height: 40vh; width: auto; margin: 0 auto; }
  .portrait[hidden] { display: none; }
  .nachricht { max-width: 94%; }
  .verlauf { max-height: none; }
  /* Die Eingabe bleibt am unteren Rand stehen: Zum Schreiben muss man nie erst ans Ende scrollen. */
  .eingabe { position: sticky; bottom: 0; z-index: 5; background: var(--nacht); padding-top: .5rem;
             box-shadow: 0 -8px 12px -8px rgba(0, 0, 0, .45); }
  .tabellenliste { columns: 2; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Innenleben – KI-Anbindung und Testfälle */
input.kurz { width: 16rem; } input.sehr-kurz { width: 5rem; }
.eingabe-leiste input[type="text"] { width: auto; }
details { margin: .5rem 0; } summary { cursor: pointer; color: var(--gold-hell); }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--nacht-hell); border: 1px solid rgba(255,255,255,.08); border-radius: 10px; padding: .6rem .8rem; font-size: .8rem; max-height: 24rem; overflow: auto; }
.ergebnis { background: var(--nacht-hell); border: 1px solid var(--rand); border-radius: var(--radius); padding: .75rem 1rem; }

/* Stimme */
.stimme-leiste { margin: .5rem 0 0; }
[data-mikro][aria-pressed="true"] { background: rgba(255, 140, 120, .25); color: #fff; }

/* ---------- App-Hülle (v0.6.0): Logo, Geräte, Sprungziel ---------- */
.logo-klein { width: 24px; height: 24px; vertical-align: -6px; margin-right: .45rem; border-radius: 50%; }
.logo-gross { width: 64px; height: 64px; vertical-align: middle; border-radius: 50%; box-shadow: 0 0 30px rgba(217,180,90,.25); }
.karte-anmeldung h1 { display: flex; align-items: center; gap: .75rem; }
.geraete-liste { list-style: none; margin: 0; padding: 0; }
.geraete-liste li { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .5rem 0; border-top: 1px solid var(--rand); flex-wrap: wrap; }
.nachricht.hervorgehoben { outline: 2px solid var(--gold); outline-offset: 2px; transition: outline-color 1s; }

/* Werkzeugkasten: Album und Bildabnahme (CSP erlaubt keine Inline-Styles) */
.vorschau-bild { max-width: 320px; height: auto; border-radius: 8px; }
.album-bild { max-width: 96px; max-height: 96px; height: auto; border-radius: 6px; }

/* Innenleben neu (konzept-innenleben.md): zwei Reiterzeilen, Zähler, Statuszeile, Gefahr-Kasten, Startseite */
.reiter-bereiche ul { margin-bottom: .4rem; }
.reiter-bereiche a { font-weight: 600; }
.reiter-seiten ul { margin-bottom: 1rem; }
.reiter-seiten a { padding: .25rem .65rem; font-size: .92rem; border-color: transparent; color: var(--text-leise, #9fb0c3); }
.reiter-seiten a[aria-current="page"] { background: transparent; color: var(--gold-hell); border-color: var(--gold); }
.zaehler { display: inline-block; min-width: 1.25rem; padding: 0 .35rem; margin-left: .25rem; border-radius: 999px; background: var(--gold); color: var(--text-dunkel); font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.25rem; vertical-align: middle; }
.reiter a[aria-current="page"] .zaehler { background: var(--text-dunkel); color: var(--gold); }
.statuszeile { color: var(--text-leise, #9fb0c3); font-size: .92rem; margin: -.25rem 0 1rem; }
.ruhig { color: var(--ok); font-size: 1.05rem; }
.zutun { list-style: none; padding: 0; margin: 0; }
.zutun li { padding: .45rem .6rem; border-left: 3px solid var(--gold); margin-bottom: .35rem; background: var(--nacht-hell); border-radius: 0 8px 8px 0; }
.zutun li.zutun-fehler { border-left-color: var(--fehler); }
.zutun a { text-decoration: none; color: var(--text); font-weight: 600; }
.zutun a:hover, .zutun a:focus { text-decoration: underline; }
.heute-raster { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1rem; }
.gefahr { margin-top: 1.5rem; padding: .9rem 1rem; border: 1px solid rgba(255,140,120,.45); background: rgba(200,70,50,.12); border-radius: var(--radius); }
.gefahr h2 { color: var(--fehler); }
.knopf-gefahr { background: transparent; border-color: rgba(255,140,120,.6); color: var(--fehler); }
.knopf-gefahr:hover, .knopf-gefahr:focus { background: rgba(200,70,50,.25); }
.abschnitt { margin-top: 1.25rem; }
details.pflege > summary { cursor: pointer; color: var(--gold-hell); font-weight: 600; padding: .35rem 0; }
@media (max-width: 800px) {
  .reiter ul { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .25rem; scrollbar-width: thin; }
  .reiter li { flex: 0 0 auto; }
  .heute-raster { grid-template-columns: 1fr; }
}

