/* Glowbal Mail — Oberfläche
   Markenfarbe Orange #FF7E06, Anthrazit #2B2622. Akzent bewusst sparsam.
   Systemschriften, damit nichts nachgeladen werden muss (offline-tauglich). */

:root {
  --orange: #ff7e06;
  --orange-hell: #ff9838;
  --orange-blass: #ffe5cd;
  --anthrazit: #2b2622;
  --grund: #fbfaf9;
  --flaeche: #ffffff;
  --rand: #e7e2dd;
  --text: #2b2622;
  --text-leise: #6f665e;
  --ok: #1f7a4d;
  --ok-grund: #e7f4ed;
  --fehler: #a32020;
  --fehler-grund: #fbeaea;
  --hinweis-grund: #fff4e8;
  --radius: 14px;
  --schatten: 0 1px 2px rgba(43, 38, 34, 0.06), 0 8px 24px rgba(43, 38, 34, 0.05);
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --grund: #16130f;
    --flaeche: #201c18;
    --rand: #362f28;
    --text: #f3efeb;
    --text-leise: #a99e93;
    --ok: #6ed39d;
    --ok-grund: #14301f;
    --fehler: #ff8f8f;
    --fehler-grund: #35191a;
    --hinweis-grund: #33240f;
    --orange-blass: #3a2712;
    --schatten: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--schrift);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--grund);
  padding-bottom: env(safe-area-inset-bottom);
  overflow-wrap: break-word;
}

/* Nur dort hart umbrechen, wo lange Adressen und Kennungen stehen —
   sonst zerreißt es auch normale deutsche Wörter. */
.postfach__adresse,
.punkt__meta,
.entwurf header .hilfetext,
code {
  overflow-wrap: anywhere;
}

.sprung {
  position: absolute;
  left: -9999px;
}
.sprung:focus {
  left: 12px;
  top: 12px;
  z-index: 20;
  background: var(--flaeche);
  padding: 10px 16px;
  border-radius: 8px;
}

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

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px clamp(16px, 4vw, 32px);
  padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--flaeche);
  border-bottom: 1px solid var(--rand);
  position: sticky;
  top: 0;
  z-index: 10;
}

.kopf__marke {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.kopf__marke img { border-radius: 7px; display: block; }
.kopf__marke strong { color: var(--orange); font-weight: 700; }

.kopf__nav { display: flex; gap: 4px; }
.kopf__nav a {
  color: var(--text-leise);
  text-decoration: none;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.94rem;
}
.kopf__nav a:hover { background: var(--grund); color: var(--text); }
.kopf__nav a[aria-current="page"] { background: var(--anthrazit); color: #fff; }
@media (prefers-color-scheme: dark) {
  .kopf__nav a[aria-current="page"] { background: var(--orange); color: #1a1512; }
}

/* -------- Hülle -------- */

.huelle {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 28px) clamp(14px, 4vw, 28px) 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* -------- Karten -------- */

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: var(--radius);
  padding: clamp(16px, 3.5vw, 24px);
  box-shadow: var(--schatten);
}
.karte--schmal { max-width: 420px; margin: 8vh auto 0; }
.karte--leise { background: transparent; box-shadow: none; }
.karte--fehler { border-color: color-mix(in srgb, var(--fehler) 40%, var(--rand)); }
.karte--aktion { text-align: center; padding: clamp(22px, 5vw, 36px); }

h1 { font-size: clamp(1.35rem, 4vw, 1.7rem); margin: 0 0 12px; line-height: 1.25; }
h2 {
  font-size: 1.05rem;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.01em;
}
h3 { font-size: 1rem; margin: 0 0 2px; }

.anzahl {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-leise);
  background: var(--grund);
  border: 1px solid var(--rand);
  border-radius: 999px;
  padding: 1px 9px;
}

.gross { font-size: 1.3rem; font-weight: 600; margin: 0 0 10px; }
.leer { color: var(--text-leise); margin: 0; }
.hilfetext { color: var(--text-leise); font-size: 0.9rem; margin: 10px 0 0; }
.hinweis-fett { color: var(--text); font-weight: 600; }
code { font-size: 0.87em; background: var(--grund); padding: 1px 6px; border-radius: 5px; }

/* -------- Knöpfe -------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font: inherit;
  font-weight: 600;
  border-radius: 11px;
  border: 1px solid transparent;
  padding: 12px 20px;
  min-height: 46px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.06s ease, background-color 0.15s ease;
}
.knopf:active { transform: translateY(1px); }
.knopf:focus-visible { outline: 3px solid var(--orange-hell); outline-offset: 2px; }
.knopf[disabled] { opacity: 0.55; cursor: not-allowed; }

.knopf--haupt { background: var(--orange); color: #1a1512; }
.knopf--haupt:hover:not([disabled]) { background: var(--orange-hell); }

.knopf--zweit {
  background: var(--flaeche);
  color: var(--text);
  border-color: var(--rand);
}
.knopf--zweit:hover:not([disabled]) { border-color: var(--orange); color: var(--orange); }

.knopf--warn { background: transparent; color: var(--fehler); border-color: currentColor; }

.knopf--klein {
  background: var(--flaeche);
  color: var(--text-leise);
  border-color: var(--rand);
  padding: 6px 12px;
  min-height: 34px;
  font-size: 0.84rem;
  font-weight: 600;
}
.knopf--klein:hover { color: var(--ok); border-color: var(--ok); }

.punkt__aktion { margin-top: 8px; }

/* Der große, leicht verständliche Bedienknopf */
.knopf--riesig {
  width: 100%;
  max-width: 460px;
  min-height: 92px;
  font-size: clamp(1.15rem, 4.5vw, 1.45rem);
  border-radius: 18px;
  background: var(--orange);
  color: #1a1512;
  box-shadow: 0 6px 20px rgba(255, 126, 6, 0.28);
}
.knopf--riesig:hover:not([disabled]) { background: var(--orange-hell); }
.knopf--riesig[disabled] { box-shadow: none; }

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(26, 21, 18, 0.25);
  border-top-color: #1a1512;
  border-radius: 50%;
  animation: dreh 0.9s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 3s; }
  .knopf { transition: none; }
}

/* -------- Formulare -------- */

.formular { display: flex; flex-direction: column; gap: 6px; }
.formular label { font-size: 0.88rem; color: var(--text-leise); margin-top: 8px; }
.formular input {
  font: inherit;
  padding: 12px 13px;
  border: 1px solid var(--rand);
  border-radius: 10px;
  background: var(--grund);
  color: var(--text);
  min-height: 46px;
}
.formular input:focus-visible { outline: 3px solid var(--orange-hell); outline-offset: 1px; }
.formular .knopf { margin-top: 18px; }
form.inline { display: inline; }

/* -------- Meldungen -------- */

.meldung {
  margin: 0;
  padding: 13px 16px;
  border-radius: 11px;
  border: 1px solid var(--rand);
  font-size: 0.94rem;
}
.meldung--ok { background: var(--ok-grund); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.meldung--fehler { background: var(--fehler-grund); border-color: color-mix(in srgb, var(--fehler) 35%, transparent); }
.meldung--hinweis { background: var(--hinweis-grund); border-color: color-mix(in srgb, var(--orange) 30%, transparent); }
.meldung a { color: inherit; }

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

.kennzahlen {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.kennzahlen li {
  background: var(--grund);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 0.85rem;
  color: var(--text-leise);
  overflow-wrap: normal;
  hyphens: auto;
}
.kennzahlen span { display: block; font-size: 1.35rem; font-weight: 700; color: var(--text); }

.fakten { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; font-size: 0.94rem; }
.fakten dt { color: var(--text-leise); }
.fakten dd { margin: 0; }

/* -------- Postfächer -------- */

.postfachliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.postfach {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 13px;
  border: 1px solid var(--rand);
  border-radius: 10px;
  background: var(--grund);
  font-size: 0.94rem;
}
.postfach__punkt { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: var(--text-leise); }
.postfach--ok .postfach__punkt { background: var(--ok); }
.postfach--fehler .postfach__punkt { background: var(--fehler); }
.postfach__adresse { flex: 1 1 auto; min-width: 0; }
.postfach__zustand { color: var(--text-leise); font-size: 0.86rem; }
.postfachliste--knapp { margin-top: 14px; }

/* -------- Berichtspunkte -------- */

.punkte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.punkt {
  border-left: 3px solid var(--rand);
  padding: 2px 0 2px 14px;
}
.punkt__kopf { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.punkt__meta { margin: 2px 0 0; font-size: 0.82rem; color: var(--text-leise); }
.punkt__text { margin: 6px 0 0; }
.punkt__handlung { margin: 6px 0 0; font-weight: 600; }

.marke {
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--rand);
  color: var(--text-leise);
  white-space: nowrap;
}
.marke--dringend { color: var(--orange); border-color: var(--orange); }
.marke--frist { background: var(--orange-blass); border-color: transparent; color: var(--text); }

/* -------- Entwürfe -------- */

.entwurf {
  border: 1px solid var(--rand);
  border-radius: 11px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--grund);
}
.entwurf:last-of-type { margin-bottom: 0; }
.entwurf__text {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  margin-top: 10px;
  padding: 11px;
  border: 1px solid var(--rand);
  border-radius: 9px;
  background: var(--flaeche);
  color: var(--text);
  resize: vertical;
}
.entwurf__aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }

.grenzen { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: 0.94rem; }

/* -------- Fuß -------- */

.fuss {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 28px) 32px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-leise);
}
.fuss__grenze { font-weight: 600; }
