/* fleekad Cockpit — Gestaltung.
   Dunkel als Grundton, passend zum Ad-Editor der App. Helle Variante wird
   mitgeliefert, weil nicht alle den ganzen Tag im Dunkeln arbeiten. */

:root {
  --grund: #0f1216;
  --flaeche: #161a20;
  --erhoeht: #1c212a;
  --linie: #262c36;
  --linie-stark: #333b47;

  --text: #e9ecf1;
  --text-leise: #98a1ae;
  --text-schwach: #6b7482;

  --akzent: #f0604a;
  --akzent-leise: rgba(240, 96, 74, 0.14);

  --gut: #5cc08d;
  --gut-leise: rgba(92, 192, 141, 0.14);
  --warn: #dfa445;
  --warn-leise: rgba(223, 164, 69, 0.14);
  --schlecht: #e4645f;
  --schlecht-leise: rgba(228, 100, 95, 0.14);

  --radius: 10px;
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --grund: #f6f7f9;
    --flaeche: #ffffff;
    --erhoeht: #ffffff;
    --linie: #e3e7ec;
    --linie-stark: #cfd6de;
    --text: #1a1f26;
    --text-leise: #5b6673;
    --text-schwach: #8a94a1;
    --akzent: #d8412a;
    --akzent-leise: rgba(216, 65, 42, 0.09);
    --gut: #2f8f5f;
    --gut-leise: rgba(47, 143, 95, 0.1);
    --warn: #a9761b;
    --warn-leise: rgba(169, 118, 27, 0.1);
    --schlecht: #c33b36;
    --schlecht-leise: rgba(195, 59, 54, 0.1);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--grund);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------- Anmeldung */

.anmelden {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}
.anmelden-karte {
  width: 100%;
  max-width: 380px;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 14px;
  padding: 2rem;
}
.marke {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: 1.75rem;
}
.marke-punkt {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--akzent);
}
.marke-text { font-weight: 650; letter-spacing: -0.01em; }
.marke-zusatz { color: var(--text-schwach); font-weight: 400; }

label {
  display: block;
  font-size: .8rem;
  color: var(--text-leise);
  margin-bottom: .4rem;
}
input {
  width: 100%;
  padding: .65rem .8rem;
  background: var(--grund);
  border: 1px solid var(--linie-stark);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  margin-bottom: 1rem;
}
input:focus {
  outline: 2px solid var(--akzent);
  outline-offset: 1px;
  border-color: transparent;
}
button.haupt {
  width: 100%;
  padding: .7rem;
  background: var(--akzent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
}
button.haupt:hover { filter: brightness(1.08); }
button.haupt:disabled { opacity: .6; cursor: default; }

.fehlerfeld {
  background: var(--schlecht-leise);
  border: 1px solid var(--schlecht);
  color: var(--schlecht);
  padding: .6rem .75rem;
  border-radius: 8px;
  font-size: .87rem;
  margin-bottom: 1rem;
}
.hinweis {
  margin-top: 1.25rem;
  font-size: .8rem;
  color: var(--text-schwach);
  text-align: center;
}

/* ------------------------------------------------------------------ Kopf */

header.kopf {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--grund) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linie);
  padding: .85rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.kopf-rechts {
  margin-left: auto;
  display: flex; align-items: center; gap: 1rem;
  font-size: .82rem; color: var(--text-leise);
}
button.leise {
  background: transparent;
  border: 1px solid var(--linie-stark);
  color: var(--text-leise);
  padding: .35rem .7rem;
  border-radius: 7px;
  font-family: inherit; font-size: .8rem;
  cursor: pointer;
}
button.leise:hover { color: var(--text); border-color: var(--text-schwach); }

main { padding: 1.5rem; max-width: 1400px; margin: 0 auto; }

/* --------------------------------------------------------------- Raster */

.raster {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.breit { grid-column: 1 / -1; }

.karte {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: var(--radius);
  overflow: hidden;
}
.karte-kopf {
  padding: .9rem 1.1rem;
  border-bottom: 1px solid var(--linie);
  display: flex; align-items: center; gap: .6rem;
}
.karte-titel { font-weight: 620; font-size: .95rem; }
.karte-zahl {
  margin-left: auto;
  font-size: .8rem; color: var(--text-schwach);
  font-variant-numeric: tabular-nums;
}
.karte-inhalt { padding: .5rem 0; }
.karte-inhalt.gepolstert { padding: 1.1rem; }

/* -------------------------------------------------------------- Zustände */

.punkt {
  width: 8px; height: 8px; border-radius: 50%;
  flex: none; display: inline-block;
}
.punkt.gut { background: var(--gut); }
.punkt.warn { background: var(--warn); }
.punkt.schlecht { background: var(--schlecht); }
.punkt.laeuft {
  background: var(--akzent);
  animation: pulsieren 1.6s ease-in-out infinite;
}
@keyframes pulsieren {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
@media (prefers-reduced-motion: reduce) {
  .punkt.laeuft { animation: none; }
}

.pille {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .15rem .5rem;
  border-radius: 20px;
  font-size: .74rem; font-weight: 550;
  white-space: nowrap;
}
.pille.gut { background: var(--gut-leise); color: var(--gut); }
.pille.warn { background: var(--warn-leise); color: var(--warn); }
.pille.schlecht { background: var(--schlecht-leise); color: var(--schlecht); }
.pille.laeuft { background: var(--akzent-leise); color: var(--akzent); }
.pille.neutral { background: var(--erhoeht); color: var(--text-leise); }

/* --------------------------------------------------------------- Zeilen */

.zeile {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1.1rem;
  border-bottom: 1px solid var(--linie);
}
.zeile:last-child { border-bottom: none; }
.zeile:hover { background: var(--erhoeht); }
.zeile-haupt { min-width: 0; flex: 1; }
.zeile-titel {
  font-size: .88rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zeile-neben {
  font-size: .76rem; color: var(--text-schwach);
  margin-top: .1rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.zeile-rechts {
  flex: none; text-align: right;
  font-size: .76rem; color: var(--text-schwach);
  font-variant-numeric: tabular-nums;
}
a.zeile { text-decoration: none; color: inherit; }

/* ------------------------------------------------------------ Kennzahlen */

.kennzahlen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--linie);
}
.kennzahl { background: var(--flaeche); padding: 1rem 1.1rem; }
.kennzahl-wert {
  font-size: 1.7rem; font-weight: 640;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.kennzahl-name {
  font-size: .78rem; color: var(--text-schwach);
  margin-top: .15rem;
}

/* -------------------------------------------------------------- Balken */

.balken-zeile {
  display: flex; align-items: center; gap: .75rem;
  padding: .4rem 1.1rem;
}
.balken-name { font-size: .84rem; width: 10.5rem; flex: none; }
.balken-bahn {
  flex: 1; height: 7px;
  background: var(--erhoeht);
  border-radius: 4px; overflow: hidden;
}
.balken-fuell { height: 100%; border-radius: 4px; background: var(--akzent); }
.balken-wert {
  font-size: .8rem; color: var(--text-leise);
  width: 2.5rem; text-align: right; flex: none;
  font-variant-numeric: tabular-nums;
}

textarea {
  width: 100%;
  padding: .65rem .8rem;
  background: var(--grund);
  border: 1px solid var(--linie-stark);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 1rem;
}
textarea:focus {
  outline: 2px solid var(--akzent);
  outline-offset: 1px;
  border-color: transparent;
}
.feld-hinweis {
  color: var(--text-schwach);
  font-weight: 400;
  font-size: .78rem;
}
.meldung-gut {
  background: var(--gut-leise);
  border: 1px solid var(--gut);
  color: var(--gut);
  padding: .6rem .75rem;
  border-radius: 8px;
  font-size: .87rem;
  margin-bottom: 1rem;
}

/* --- Verlauf eines Wunsches (aufklappbar unter der Zeile) --------------- */

.verlauf {
  border-bottom: 1px solid var(--linie);
  background: var(--grund);
  padding: 1rem 1.1rem 1.2rem;
}
.blasen { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.blase {
  max-width: 42em;
  padding: .6rem .8rem;
  border-radius: 10px;
  font-size: .87rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.blase-kopf {
  font-size: .72rem;
  color: var(--text-schwach);
  margin-bottom: .25rem;
  font-weight: 500;
}
.blase.von-mensch { background: var(--erhoeht); border: 1px solid var(--linie); }
.blase.von-agent  { background: var(--akzent-leise); border: 1px solid var(--akzent); align-self: flex-start; }
.blase.von-system {
  background: transparent; border: 1px dashed var(--linie-stark);
  color: var(--text-leise); font-size: .82rem;
}

.aktionen { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
button.aktion {
  padding: .45rem .9rem;
  border-radius: 8px;
  font-family: inherit; font-size: .84rem; font-weight: 550;
  cursor: pointer;
  border: 1px solid var(--linie-stark);
  background: var(--flaeche);
  color: var(--text);
}
button.aktion:hover { border-color: var(--text-schwach); }
button.aktion.gut { background: var(--gut); border-color: var(--gut); color: #fff; }
button.aktion.gut:hover { filter: brightness(1.08); }
button.aktion.test { background: var(--akzent); border-color: var(--akzent); color: #fff; }
button.aktion.test:hover { filter: brightness(1.08); }
button.aktion:disabled { opacity: .55; cursor: default; }

a.test-knopf {
  flex: none;
  padding: .35rem .8rem;
  border-radius: 8px;
  background: var(--akzent);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
a.test-knopf:hover { filter: brightness(1.08); }

.nachfassen { display: flex; gap: .5rem; margin-bottom: .8rem; }
.nachfassen textarea { margin: 0; }

.leer, .fehlermeldung {
  padding: 1.6rem 1.1rem;
  text-align: center;
  font-size: .85rem;
  color: var(--text-schwach);
}
.fehlermeldung { color: var(--schlecht); }

code {
  font-family: var(--mono);
  font-size: .82em;
  background: var(--erhoeht);
  padding: .1rem .3rem;
  border-radius: 4px;
}

.scroller { overflow-x: auto; }

@media (max-width: 640px) {
  main { padding: 1rem; }
  header.kopf { padding: .75rem 1rem; }
  .balken-name { width: 7.5rem; }
}
