/* Gefechtsstand — Design-Token aus Gefechtsstand.dc.html.
   Werte nie schaetzen, immer aus dieser Datei nehmen. */

:root {
  --grund-verlauf: radial-gradient(120% 90% at 50% 0%, #202942 0%, #1B2236 55%, #161C2C 100%);
  --kopfzeile: #1B2236;
  --sidebar: #161C2C;
  --karte: #222B40;
  --karte-hoch: #2A3450;
  --detailzeile: #1E263A;
  --protokoll: #161C2C;
  --rahmen: #2E3852;
  --text: #FFFFFF;
  --text-zweit: #8B94AC;
  --text-gedaempft: #5D6883;
  --akzent: #2196F3;
  --akzent-hell: #56CCF2;
  --erfolg: #27AE60;
  --warnung: #F2C94C;
  --gefahr: #EB5757;
  --neutral: #6B7690;
  --balken: #404B68;

  --schrift: Inter, system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --logo: UnifrakturCook, serif;

  /* Masse des Geruests — aus Chrome.dc.html */
  --kopf-hoehe: 64px;
  --sidebar-breite: 64px;

  /* Handy: die Sidebar wird zur unteren Leiste. Hoehe aus Aufgabe 19. */
  --leiste-hoehe: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: #161C2C;
  color: var(--text);
  font-family: var(--schrift);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--akzent); text-decoration: none; }
a:hover { color: var(--akzent-hell); }

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.86); }
}
@keyframes skel {
  0%, 100% { opacity: .35; }
  50% { opacity: .7; }
}

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

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

.anmeldung {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(90% 70% at 50% 42%, #232C46 0%, #1B2236 52%, #141A29 100%);
}

.anmeldung form {
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.marke-zeichen {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
}
.marke-zeichen span {
  font-family: var(--logo);
  font-weight: 700;
  font-size: 40px;
  line-height: 1;
}
.marke-zeichen i {
  width: 3px;
  height: 58px;
  background: var(--text);
  margin: 0 3px;
}

.wortmarke {
  font-family: var(--logo);
  font-weight: 700;
  font-size: 26px;
  margin-bottom: 8px;
}

.feld {
  width: 100%;
  height: 40px;
  border-radius: 4px;
  background: var(--karte);
  border: 1px solid var(--rahmen);
  padding: 0 14px;
  font-size: 13px;
  font-family: var(--schrift);
  color: var(--text);
}
.feld::placeholder { color: var(--text-gedaempft); }
.feld:focus { outline: none; border-color: var(--akzent); }

.pille {
  width: 100%;
  height: 40px;
  border-radius: 20px;
  border: none;
  background: var(--akzent);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.pille:hover { background: var(--akzent-hell); }
.pille:disabled { background: var(--karte-hoch); color: var(--text-gedaempft); cursor: not-allowed; }

.fehler {
  width: 100%;
  padding: 10px 12px;
  border-radius: 4px;
  background: rgba(235, 87, 87, .12);
  border-left: 3px solid var(--gefahr);
  font-size: 12px;
  line-height: 1.5;
}

.ohne-skript {
  padding: 24px;
  font-family: var(--schrift);
  font-size: 13px;
  color: var(--text-zweit);
}

/* --- Geruest: Kopfzeile, Sidebar, Buehne -------------------------------- */

.geruest {
  min-height: 100vh;
  background: var(--grund-verlauf);
}

/* Kopfzeile */

.kopfzeile {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: var(--kopf-hoehe);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: var(--kopfzeile);
  border-bottom: 1px solid var(--rahmen);
}

.kopf-wortmarke {
  font-family: var(--logo);
  font-weight: 700;
  font-size: 22px;
  line-height: 20px;
  color: var(--text);
}

.kopf-rechts {
  display: flex;
  align-items: center;
  gap: 16px;
}

.knopf-pille {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 18px;
  background: var(--akzent);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.knopf-pille:hover { background: var(--akzent-hell); }

.kopf-symbol {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-zweit);
  cursor: pointer;
}
.kopf-symbol:hover svg { stroke: var(--akzent-hell); }

.glocken-zaehler {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 14px;
  height: 14px;
  padding: 0 4px;
  border-radius: 7px;
  background: var(--akzent);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 9px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
}

.kopf-nutzer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.kuerzel-kreis {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--karte-hoch);
  border: 1px solid var(--rahmen);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-zweit);
}

/* Sidebar */

.sidebar {
  position: fixed;
  left: 0;
  top: var(--kopf-hoehe);
  bottom: 0;
  z-index: 15;
  width: var(--sidebar-breite);
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  background: var(--sidebar);
}

.sidebar-punkt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--sidebar-breite);
  height: 22px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

/* Balken am linken Rand beim aktiven Punkt */
.sidebar-punkt.aktiv::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  margin-top: -13px;
  width: 3px;
  height: 26px;
  border-radius: 0 2px 2px 0;
  background: var(--akzent);
}

.sidebar-punkt svg { stroke: var(--text-gedaempft); }
.sidebar-punkt:hover svg { stroke: var(--akzent-hell); }
.sidebar-punkt.aktiv svg { stroke: var(--akzent); }

/* Textschild rechts neben dem Symbol */
.sidebar-schild {
  position: absolute;
  left: calc(var(--sidebar-breite) - 8px);
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--karte-hoch);
  border: 1px solid var(--rahmen);
  color: var(--text);
  font-family: var(--schrift);
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.sidebar-punkt:hover .sidebar-schild,
.sidebar-punkt:focus-visible .sidebar-schild {
  opacity: 1;
  visibility: visible;
}

/* Buehne */

.buehne {
  margin-left: var(--sidebar-breite);
  padding-top: var(--kopf-hoehe);
  min-height: 100vh;
}

.stoerungsbalken {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  padding: 0 24px;
  background: rgba(235, 87, 87, .12);
  border-left: 3px solid var(--gefahr);
}
.stoerungsbalken[hidden] { display: none; }

.stoerung-punkt {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--gefahr);
  flex-shrink: 0;
}
.stoerung-text { font-size: 13px; color: var(--text); }
.stoerung-ansehen {
  margin-left: auto;
  padding: 0;
  border: none;
  background: none;
  font-family: var(--schrift);
  font-size: 13px;
  font-weight: 600;
  color: var(--gefahr);
  cursor: pointer;
}

.inhalt {
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

/* Platzhalter je Ansicht — bis die Bildschirme gebaut sind. */

.platzhalter {
  grid-column: span 12;
  background: var(--karte);
  border-radius: 6px;
  padding: 20px;
}
.platzhalter-marke {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-gedaempft);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.platzhalter-titel {
  margin: 8px 0 4px;
  font-size: 20px;
  font-weight: 600;
}
.platzhalter-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-zweit);
}

/* =========================================================================
   Handy-Ansicht — Umbruchpunkt 720 px
   =========================================================================
   Gleichwertig zur Rechner-Ansicht, keine Notloesung. Die Regeln:
   · Schriftgroessen bleiben, nur Abstaende schrumpfen (24 -> 16, 16 -> 12).
   · Tippflaechen mindestens 44 px hoch.
   · Nichts scrollt waagerecht.
   Die Ansichten bringen ihre eigenen Handy-Regeln in ihrer eigenen
   Stildatei mit; hier steht nur, was allen gemeinsam ist. */

@media (max-width: 720px) {

  /* --- Kopfzeile: schlanker, aber vollstaendig -------------------------- */

  .kopfzeile {
    padding: 0 12px;
    gap: 8px;
  }

  /* Die Wortmarke darf schrumpfen und notfalls kuerzen — sie darf nie die
     Seite breiter machen als das Fenster. */
  .kopf-wortmarke {
    min-width: 0;
    font-size: 18px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .kopf-rechts {
    flex-shrink: 0;
    gap: 4px;
  }

  /* „Auftrag +" wird zum runden Knopf mit einem Plus. */
  .kopfzeile .knopf-pille {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 22px;
    font-size: 0;
  }
  .kopfzeile .knopf-pille::after {
    content: '+';
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
  }

  /* Lupe, Glocke und Kuerzel-Kreis bleiben — nur die Tippflaeche waechst.
     Ueber den Kuerzel-Kreis laeuft das Passwort-Aendern; er darf nie weg. */
  .kopf-symbol,
  .kopf-nutzer {
    width: 44px;
    height: 44px;
    justify-content: center;
  }
  /* Der Zaehler sitzt an der Ecke des Glockensymbols, nicht an der Ecke der
     vergroesserten Tippflaeche — sonst schwebt er frei daneben. */
  .glocken-zaehler { top: 8px; right: 5px; }

  /* Der kleine Pfeil neben dem Kuerzel-Kreis kostet nur Platz. */
  .kopf-nutzer > svg { display: none; }

  /* --- Sidebar wird zur unteren Leiste ---------------------------------- */

  .sidebar {
    top: auto;
    right: 0;
    bottom: 0;
    width: auto;
    height: var(--leiste-hoehe);
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    gap: 0;
    border-top: 1px solid var(--rahmen);
  }

  /* Nur vier Symbole. Routine-Detail, Meldungen und Anleitung bleiben ueber
     Verweise und die Adresszeile (#/routine, #/meldungen, #/anleitung)
     erreichbar — sie stehen nur nicht in der Leiste. */
  .sidebar-punkt[data-schluessel="routine"],
  .sidebar-punkt[data-schluessel="meldungen"],
  .sidebar-punkt[data-schluessel="anleitung"] { display: none; }

  .sidebar-punkt {
    flex: 1;
    width: auto;
    height: auto;
    min-width: 0;
  }

  /* Der Balken wandert von links nach oben ueber das Symbol. */
  .sidebar-punkt.aktiv::before {
    left: 50%;
    top: 0;
    margin-top: 0;
    width: 26px;
    height: 3px;
    transform: translateX(-50%);
    border-radius: 0 0 2px 2px;
  }

  /* Das Schild haengt am Zeigen mit der Maus — am Handy gibt es das nicht. */
  .sidebar-schild { display: none; }

  /* --- Buehne ----------------------------------------------------------- */

  .buehne {
    margin-left: 0;
    padding-bottom: var(--leiste-hoehe);
  }

  .stoerungsbalken {
    height: auto;
    min-height: 44px;
    padding: 8px 16px;
    flex-wrap: wrap;
  }

  .inhalt {
    padding: 16px;
    gap: 12px;
  }

  /* --- Eingabefelder ---------------------------------------------------- */

  /* Unter 16px zoomt Safari beim Antippen von selbst in die Seite hinein und
     kommt nicht wieder heraus. Deshalb hier ausnahmsweise mit Nachdruck:
     die Ansichten setzen ihre Feldgroessen ueber Klassen, die sonst gewinnen. */
  input,
  select,
  textarea {
    font-size: 16px !important;
  }

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

  .anmeldung form { width: 100%; padding: 0 24px; }
  .feld { height: 48px; }
  .pille { height: 48px; border-radius: 24px; }
}
