/* Design tokens taken from the council prototype approved in #19 (variant A),
   so the app looks like one thing from the first screen onwards. */
:root {
  --bg: #f6f6f4;
  --flaeche: #fff;
  --rand: #e2e1dc;
  --rand-stark: #cfcec7;
  --text: #23221e;
  --gedaempft: #6f6d64;
  --akzent: #3d5a45;
  --akzent-hell: #eaf0eb;
  --warn: #8a4b2a;
  --warn-hell: #f7eee8;
  --stern: #b8860b;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a17;
    --flaeche: #232220;
    --rand: #35332e;
    --rand-stark: #47443d;
    --text: #eceae4;
    --gedaempft: #a3a096;
    --akzent: #8fb89b;
    --akzent-hell: #23302a;
    --warn: #d59a75;
    --warn-hell: #33261f;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
}

.marke {
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}

.inhalt {
  max-width: 62rem;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

h1 { font-size: 1.6rem; margin: 0 0 0.4rem; font-weight: 620; }
.gedaempft { color: var(--gedaempft); margin-top: 0; }

/* The login page: a single card, centred, nothing else on screen. */
.schloss {
  max-width: 22rem;
  margin: 12vh auto 0;
  padding: 1.75rem;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
}

.schloss h1 { margin-bottom: 0.15rem; }
.schloss form { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 1.25rem; }

label { font-size: 0.85rem; color: var(--gedaempft); }

input[type="password"], input[type="text"], textarea {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rand-stark);
  border-radius: calc(var(--radius) - 4px);
}

input:focus-visible, button:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 1px;
}

button {
  padding: 0.6rem 0.9rem;
  font: inherit;
  font-weight: 550;
  color: var(--flaeche);
  background: var(--akzent);
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 4px);
  cursor: pointer;
}

button.leise {
  color: var(--gedaempft);
  background: transparent;
  border-color: var(--rand-stark);
  font-weight: 450;
}

.hinweis {
  margin: 1rem 0 0;
  padding: 0.6rem 0.75rem;
  font-size: 0.9rem;
  border-radius: calc(var(--radius) - 4px);
}

.hinweis.warnung {
  color: var(--warn);
  background: var(--warn-hell);
  border: 1px solid color-mix(in srgb, var(--warn) 25%, transparent);
}

code {
  padding: 0.1em 0.35em;
  font-size: 0.9em;
  background: var(--akzent-hell);
  border-radius: 4px;
}

/* ---- Navigation ---- */
.kopf nav { display: flex; align-items: center; gap: 1rem; }
.kopf nav a { color: var(--gedaempft); text-decoration: none; font-size: 0.92rem; }
.kopf nav a:hover { color: var(--text); }

/* ---- Page header with an action on the right ---- */
.kopfzeile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

a.knopf {
  display: inline-block;
  padding: 0.6rem 0.9rem;
  font-weight: 550;
  font-size: 0.95rem;
  color: var(--flaeche);
  background: var(--akzent);
  border-radius: calc(var(--radius) - 4px);
  text-decoration: none;
  white-space: nowrap;
}

a.knopf.leise { color: var(--gedaempft); background: transparent; border: 1px solid var(--rand-stark); }
button.klein, .klein { font-size: 0.85rem; padding: 0.35rem 0.6rem; }

/* ---- Profile cards: wrapping columns, same idea as the council answers ---- */
.karten {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1rem;
}

.karte {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
}

.karte form { margin-top: auto; }
.karte-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.karte-name { font-weight: 600; color: var(--text); text-decoration: none; }
a.karte-name:hover { color: var(--akzent); }
.karte-weg { margin: 0; font-size: 0.85rem; color: var(--gedaempft); }
.trenner { opacity: 0.5; padding: 0 0.15rem; }

.karte-persona {
  margin: 0;
  font-size: 0.9rem;
  color: var(--gedaempft);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.karten.gedimmt .karte { opacity: 0.62; }

.marke {
  font-size: 0.72rem;
  padding: 0.1rem 0.42rem;
  color: var(--akzent);
  background: var(--akzent-hell);
  border-radius: 999px;
  white-space: nowrap;
}

.abschnitt { font-size: 1.05rem; margin: 2.5rem 0 0.25rem; font-weight: 600; }
.leer { margin-top: 2rem; color: var(--gedaempft); }

/* ---- Forms ---- */
.formular { display: flex; flex-direction: column; gap: 0.3rem; max-width: 42rem; margin-top: 1.5rem; }
.formular label { margin-top: 0.9rem; }
.formular label.haken { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; color: var(--text); }
.formular label.haken input { width: auto; }

select {
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--rand-stark);
  border-radius: calc(var(--radius) - 4px);
}

textarea { resize: vertical; min-height: 6rem; font-family: inherit; }
.feldhilfe { margin: 0.3rem 0 0; font-size: 0.82rem; color: var(--gedaempft); }
.knopfreihe { display: flex; gap: 0.6rem; align-items: center; margin-top: 1.6rem; }
ul.blank { list-style: none; margin: 0; padding: 0; }
ul.blank li + li { margin-top: 0.3rem; }

/* ---- Quick ask ---- */
.frageform { display: flex; flex-direction: column; gap: 0.35rem; margin-top: 1.5rem; }

.chips { border: 0; padding: 0; margin: 1.2rem 0 0; }
.chips legend { padding: 0; font-size: 0.85rem; color: var(--gedaempft); }

.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0.5rem 0.5rem 0 0;
  padding: 0.45rem 0.75rem;
  background: var(--flaeche);
  border: 1px solid var(--rand-stark);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.92rem;
}

.chip:has(input:checked) {
  border-color: var(--akzent);
  background: var(--akzent-hell);
}

.chip input { margin: 0; }
.chip-name { font-weight: 550; }
.chip-modell { font-size: 0.78rem; color: var(--gedaempft); }

/* Answers side by side, wrapping to a second row when the space runs out —
   the same gesture as the council page: comparing, not reading. */
.antworten {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  align-items: start;
}

.antwort {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem;
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
}

.antwort.fehlgeschlagen { border-color: color-mix(in srgb, var(--warn) 35%, var(--rand)); }
.antwort-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.antwort-name { font-weight: 600; }
.antwort-modell { font-size: 0.75rem; color: var(--gedaempft); font-family: ui-monospace, monospace; }
.antwort-text { white-space: pre-wrap; line-height: 1.6; }
.antwort-ausfall { margin: 0; color: var(--warn); font-size: 0.92rem; }

.verbrauch { margin-top: auto; font-size: 0.82rem; color: var(--gedaempft); }
.verbrauch summary { cursor: pointer; padding: 0.3rem 0; }
.verbrauch dl { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.8rem; margin: 0.4rem 0 0; }
.verbrauch dt { color: var(--gedaempft); }
.verbrauch dd { margin: 0; }
.verbrauch pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 0.75rem; }
