/* Postschleuse: ruhige Arbeitsfläche, Türkis/Lila/Bordeaux auf Blaugrau (Svens nornix-Farben). */
:root {
  --bg: #F4F6F8; --flaeche: #FFFFFF; --tief: #E9EDF1; --linie: #D6DDE4;
  --text: #141A20; --weich: #4A5866; --blass: #7C8B99;
  --akzent: #0E7C7B; --akzent-f: #DDF0EF; --lila: #5B4B8A; --lila-f: #EAE6F4;
  --rot: #B03A2E; --rot-f: #FBE6E3; --gruen: #2E7D4F; --gruen-f: #E2F1E8; --gelb: #A8710A; --gelb-f: #F8EDD3;
  --schrift: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1317; --flaeche: #161D23; --tief: #0A0E12; --linie: #242E36;
    --text: #E4EAEF; --weich: #A2B0BC; --blass: #75838F;
    --akzent: #4FC3C1; --akzent-f: #0F2B2B; --lila: #A392D9; --lila-f: #1E1A2E;
    --rot: #E0705F; --rot-f: #2B1714; --gruen: #5FBE85; --gruen-f: #12261B; --gelb: #E0A93E; --gelb-f: #2A2110;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--schrift); }
a { color: var(--akzent); }
h1 { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 1.1rem; margin: 0 0 6px; }
.unter { color: var(--weich); margin: 0; max-width: 70ch; }
.klein { color: var(--blass); font-size: 0.85rem; }
kbd { font: 500 0.78rem var(--mono); background: var(--tief); border: 1px solid var(--linie); border-radius: 4px; padding: 1px 5px; }
:focus-visible { outline: 3px solid var(--akzent); outline-offset: 2px; }

/* Kopf */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--flaeche); border-bottom: 1px solid var(--linie); }
.top-inner { max-width: 1100px; margin: 0 auto; padding-inline: 16px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; min-height: 56px; }
.marke { font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 10px; letter-spacing: 0.01em; }
.marke.gross { font-size: 1.6rem; }
.marke-zeichen { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(180deg, var(--akzent) 0 45%, transparent 45% 55%, var(--lila) 55%); display: inline-block; }
.marke.gross .marke-zeichen { width: 32px; height: 32px; border-radius: 8px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { text-decoration: none; color: var(--weich); padding: 8px 12px; border-radius: 8px; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; }
.tabs a:hover { background: var(--tief); color: var(--text); }
.tabs a.aktiv { background: var(--akzent-f); color: var(--akzent); }
.zahl { font: 600 0.78rem var(--mono); font-variant-numeric: tabular-nums; background: var(--tief); color: var(--weich); border-radius: 999px; padding: 1px 8px; }
.tabs a.aktiv .zahl { background: var(--akzent); color: var(--flaeche); }

.wrap { max-width: 1100px; margin: 0 auto; padding-inline: 16px; padding-block: 20px 80px; display: flex; flex-direction: column; gap: 18px; }
.lage { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.modus { display: inline-flex; align-items: center; gap: 8px; font-size: 0.88rem; padding: 6px 12px; border-radius: 999px; }
.modus .punkt { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.modus.probe { background: var(--gelb-f); color: var(--gelb); } .modus.probe .punkt { background: var(--gelb); }
.modus.an { background: var(--gruen-f); color: var(--gruen); } .modus.an .punkt { background: var(--gruen); }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { text-decoration: none; font-size: 0.85rem; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--linie); color: var(--weich); background: var(--flaeche); }
.chip.aktiv { border-color: var(--akzent); color: var(--akzent); background: var(--akzent-f); font-weight: 600; }

.rueckblick { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--lila-f); border: 1px solid var(--lila); color: var(--text); border-radius: var(--radius); padding: 12px 16px; }
.rueckblick strong { color: var(--lila); }
.rb-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }

.kopfzeile { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.tasten { color: var(--blass); font-size: 0.82rem; margin: -6px 0 0; }

/* Knöpfe */
.knopf { font: 600 0.92rem var(--schrift); background: var(--akzent); color: var(--flaeche); border: 0; border-radius: 8px; padding: 9px 16px; cursor: pointer; text-decoration: none; display: inline-block; }
.knopf.leise { background: transparent; color: var(--text); border: 1px solid var(--linie); }
.knopf.breit { width: 100%; padding: 12px; font-size: 1rem; }
.ak { font: 500 0.85rem var(--schrift); border-radius: 7px; padding: 6px 11px; cursor: pointer; border: 1px solid var(--linie); background: var(--flaeche); color: var(--text); }
.ak:hover { border-color: currentColor; }
.ak.werbung { color: var(--gelb); } .ak.spam { color: var(--rot); } .ak.wichtig { color: var(--lila); } .ak.ok { color: var(--gruen); }
.ak.leise { color: var(--weich); }
.ak:disabled { opacity: 0.5; cursor: wait; }

/* Mailliste */
.liste { display: flex; flex-direction: column; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.mail { padding: 14px 16px; border-bottom: 1px solid var(--linie); display: flex; flex-direction: column; gap: 4px; min-width: 0; transition: opacity .25s, transform .25s; }
.mail:last-child { border-bottom: 0; }
.mail:focus { outline: none; background: var(--akzent-f); }
.mail.prio1 { box-shadow: inset 4px 0 0 var(--lila); }
.mail.weg { opacity: 0; transform: translateX(24px); }
.mail-kopf { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.wer { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adr { color: var(--blass); font-size: 0.85rem; font-family: var(--mono); }
time { color: var(--blass); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.betreff { font-weight: 600; overflow-wrap: anywhere; }
.auszug { color: var(--weich); font-size: 0.9rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-fuss { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.aktionen { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.ki { font-size: 0.78rem; color: var(--blass); }
.pf { font: 600 0.72rem/1 var(--schrift); letter-spacing: 0.03em; text-transform: uppercase; padding: 4px 7px; border-radius: 5px; white-space: nowrap; background: var(--tief); color: var(--weich); }
.pf-miet1camper { background: var(--akzent-f); color: var(--akzent); }
.pf-europa { background: var(--lila-f); color: var(--lila); }
.pf-schrittmedia { background: var(--gelb-f); color: var(--gelb); }
.pf-gmail { background: var(--rot-f); color: var(--rot); }

/* Gruppen */
.gruppen { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.gruppe { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; transition: opacity .25s; }
.gruppe.weg { opacity: 0.35; }
.g-haupt { display: flex; justify-content: space-between; gap: 12px; }
.g-wer { display: flex; flex-direction: column; min-width: 0; }
.g-wer .adr { overflow-wrap: anywhere; }
.g-zahl { text-align: right; color: var(--blass); font-size: 0.78rem; display: flex; flex-direction: column; }
.g-zahl .n { font-size: 1.5rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1; }
.g-betreffe { margin: 0; padding-left: 18px; color: var(--weich); font-size: 0.88rem; }
.g-betreffe li { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.g-meta time { margin-left: auto; }
.g-aktionen { display: flex; gap: 6px; flex-wrap: wrap; }
.g-mails { margin: 0; padding-left: 18px; font-size: 0.86rem; color: var(--weich); display: flex; flex-direction: column; gap: 4px; }
.tag { font: 600 0.72rem/1 var(--schrift); padding: 4px 7px; border-radius: 5px; }
.tag.werbung { background: var(--gelb-f); color: var(--gelb); }
.tag.spam { background: var(--rot-f); color: var(--rot); }
.tag.wichtig { background: var(--lila-f); color: var(--lila); }
.tag.ok { background: var(--gruen-f); color: var(--gruen); }
.tag.regel { background: var(--akzent-f); color: var(--akzent); }
.tag.aus { background: var(--tief); color: var(--weich); }

/* Regeln, Einstellungen */
.regel-neu { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; }
.regel-neu label { font-size: 0.82rem; color: var(--weich); width: 100%; margin-bottom: -6px; }
.regel-neu label:nth-of-type(2) { width: auto; }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--linie); border-radius: 7px; padding: 8px 10px; }
#muster { flex: 1 1 260px; min-width: 0; }
.tabelle-wrap { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--linie); font-size: 0.9rem; }
.tabelle th { color: var(--blass); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.adr-zelle { font-family: var(--mono); overflow-wrap: anywhere; }
.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.karte p { margin: 0; color: var(--weich); }
.schalter { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; user-select: none; }
.schalter input { appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--linie); position: relative; cursor: pointer; padding: 0; border: 0; transition: background .2s; }
.schalter input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--flaeche); transition: transform .2s; }
.schalter input:checked { background: var(--akzent); }
.schalter input:checked::after { transform: translateX(18px); }
.zahl-feld input { width: 70px; margin-inline: 6px; }

.leer { background: var(--flaeche); border: 1px dashed var(--linie); border-radius: var(--radius); padding: 28px; text-align: center; color: var(--weich); }

/* Hinweis unten */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 12px 10px 16px; border-radius: 10px; display: flex; gap: 14px; align-items: center; max-width: calc(100% - 32px); box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 20; }
.toast button { background: transparent; color: var(--akzent); border: 1px solid currentColor; border-radius: 7px; padding: 5px 10px; font: 600 0.85rem var(--schrift); cursor: pointer; }
.toast[hidden] { display: none; }

/* Anmeldung */
.login-body { min-height: 100vh; display: grid; place-items: center; padding-inline: 16px; }
.login { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; padding-block: 40px; }
.login-form { display: flex; flex-direction: column; gap: 8px; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 20px; }
.login-form label { font-size: 0.85rem; color: var(--weich); margin-top: 6px; }
.login-form input { padding: 11px 12px; font-size: 1rem; }
.login-form .knopf { margin-top: 12px; }
.fehler { color: var(--rot); margin: 6px 0 0; font-size: 0.9rem; }

@media (max-width: 640px) {
  .mail-kopf { flex-wrap: wrap; }
  .wer { white-space: normal; flex-basis: 100%; order: 3; }
  .aktionen { margin-left: 0; }
  .tasten { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Ordner */
.ak.ordner { color: var(--akzent); }
.ordner-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; }
.ordner-karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ok-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ok-kopf h2 { overflow-wrap: anywhere; }
.ok-mails { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.ok-mails li { padding: 8px 0; border-top: 1px solid var(--linie); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ok-zeile { display: flex; justify-content: space-between; gap: 10px; }
.ok-zeile strong { font-weight: 600; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ok-mails .auszug { -webkit-line-clamp: 1; font-size: 0.84rem; }
.tag.ordner { background: var(--akzent-f); color: var(--akzent); }

/* Dialog */
.dialog { border: 1px solid var(--linie); border-radius: 14px; padding: 0; width: min(460px, calc(100% - 32px)); background: var(--flaeche); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dialog::backdrop { background: rgba(10, 14, 18, .55); }
.dialog form { display: flex; flex-direction: column; gap: 10px; padding: 20px; }
.dialog label[for="od-name"] { font-size: 0.85rem; color: var(--weich); margin-top: 4px; }
.dialog input[type="text"], .dialog #od-name { width: 100%; padding: 10px 12px; font-size: 1rem; }
.od-liste { display: flex; gap: 6px; flex-wrap: wrap; }
.od-wahl { cursor: pointer; font: inherit; font-size: 0.85rem; }
.od-wahl.aktiv { border-color: var(--akzent); color: var(--akzent); background: var(--akzent-f); }
.od-knoepfe { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.schalter span { font-weight: 500; }
