/* ============================================================
   Kolbe LEADS PWA - Mobile-First Styles
   Farben angelehnt an die Desktop-App (grün/rot Bearbeitungs-
   Marker).
   ============================================================ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  background: #F8FAFC;
  color: #1F2937;
  -webkit-font-smoothing: antialiased;
  /* Safe-Area auf iPhones mit Notch */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.hidden { display: none !important; }
.muted { color: #6B7280; font-size: 14px; }
.error { color: #B91C1C; font-size: 14px; font-weight: 600; }

/* ----------------- Screens */
.screen {
  min-height: 100vh;
  padding-bottom: 24px;
}

/* ----------------- Top-Bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  /* Wie .chat-header der Haupt-App: das Haus-Gelb ueber die ganze
     Flaeche. Beide Bereiche laufen in derselben installierten PWA -
     sie duerfen sich nicht unterscheiden. */
  background: #FFC107;
  border-bottom: 1px solid rgba(0,0,0,0.10);
  color: #1F2937;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.topbar-title {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
}
.topbar .ghost {
  background: transparent;
  border: none;
  color: #1F2937;
  font-size: 22px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}
.topbar .ghost:active { background: rgba(0,0,0,0.08); }

/* ----------------- Login */
.login-box {
  max-width: 380px;
  margin: 40px auto;
  padding: 28px 24px;
  background: white;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.login-box .logo {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  color: #F59E0B;
  margin-bottom: 8px;
}
.login-box label {
  display: block;
  margin-top: 14px;
  font-size: 14px;
  color: #374151;
  font-weight: 600;
}
.login-box input {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  font-size: 16px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #F8FAFC;
}
.login-box input:focus {
  outline: none;
  border-color: #FFC107;
  background: white;
}

/* ----------------- Buttons */
.primary {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  color: #1F2937;
  background: #FFC107;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.primary:active { background: #F59E0B; }
.primary:disabled {
  background: #FCD34D; cursor: not-allowed;
}

.btn-secondary {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  color: #1F2937;
  /* Weiss mit feinem Umriss statt grauer Fuellung - so unterscheidet
     sich der Zweitknopf vom Hauptknopf durch die FORM und nicht durch
     einen zweiten Farbklecks. Beide Systeme machen das so. */
  background: #FFFFFF;
  border: 1px solid #CAC4D0;
  border-radius: 12px;
  cursor: pointer;
}
.btn-secondary:active { background: #F1F5F9; }

/* --- Knoepfe je System ---------------------------------------------
   iOS rundet Knoepfe zurueckhaltend, Material deutlich staerker
   (voll gerundete "Pille"). Dasselbe gilt in der Haupt-App. */
.os-ios .primary,
.os-ios .btn-secondary { border-radius: 12px; }
.os-android .primary,
.os-android .btn-secondary { border-radius: 100px; }

/* ----------------- Postfach-Tabs (Pillen-Leiste) */
/* ====================================================================
   Postfach-Reiter - dieselbe Handschrift wie die Reiterleisten der
   Haupt-PWA, aber in der scrollenden Bauform.

   Warum eine eigene Bauform: Diese Leiste ist die EINZIGE der PWA, die
   quer scrollt. Zu den fuenf festen Faechern kommen die abonnierten
   IMAP-Ordner, und deren Zahl ist nach oben offen (kein LIMIT in
   list_aktiv_for_user). Gleich grosse Anteile ueber die Bildschirm-
   breite - wie beim Segmentschalter der Haupt-App - ergaeben bei
   20 Ordnern Reiter von rund 15 px. Aufgeteilt wird hier deshalb nach
   Inhalt; angeglichen werden Form, Farben und Verhalten.

   Zwei Ebenen: .mailbox-tabs-zeile ist die weisse Zeile mit Luft und
   Trennlinie, .mailbox-tabs die scrollende Leiste darin - und auf iOS
   zugleich die Schiene. Der Hintergrund einer scrollenden Flaeche
   bleibt stehen, waehrend ihr Inhalt wandert; die Schiene liegt
   deshalb bewusst DORT und nicht als ::before, das nur die sichtbare
   Breite abdecken wuerde.
   ==================================================================== */
.mailbox-tabs-zeile {
  padding: 10px 16px 12px;
  background: #FFFFFF;
  border-bottom: 1px solid #ECEFF1;
  flex: 0 0 auto;
}
.mailbox-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Die Schiene: systemgrau wie beim Schalter der Haupt-App. */
  background: rgba(120,120,128,0.16);
  border-radius: 10px;
}
.mailbox-tabs::-webkit-scrollbar { display: none; }

.mailbox-tab {
  /* Inhaltsbreite - die Leiste scrollt, sie teilt nicht auf. */
  flex: 0 0 auto;
  /* ACHTUNG, haeufiger Irrtum: Die globale button-Regel der Haupt-App
     (width:100%, margin:14px 0) gilt HIER NICHT - /leads/index.html
     laedt ausschliesslich diese Datei, und eine button-Regel gibt es
     darin nicht. Wer beide Stylesheets in eine Testseite legt, sieht
     den Fehler trotzdem; er kommt dann aus dem fremden Stylesheet. */
  /* 44 px ist Apples Richtwert. Der echte iOS-Schalter ist 32 px hoch -
     der muss aber auch nicht unterwegs mit Handschuh getroffen werden;
     die Zielgruppe ist ueberwiegend ueber 50. */
  min-height: 44px;
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  /* KONSTANT, auch im gewaehlten Zustand. Ein fetterer aktiver Reiter
     macht seinen Text breiter - bei inhaltsbreiten Reitern ruecken
     dann beim Umschalten ALLE nachfolgenden zur Seite. */
  font-weight: 590;
  line-height: 1.2;
  color: #1F2937;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* Haarfeine Teiler zwischen den nicht gewaehlten Stellungen - und wie
   im System verschwinden die beiden, die am Regler liegen. */
.mailbox-tab + .mailbox-tab::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: rgba(60,60,67,0.26);
}
.mailbox-tab.active::before,
.mailbox-tab.active + .mailbox-tab::before { background: transparent; }
/* Der Regler: weisse Flaeche mit 2 px Abstand in der Schiene. Als
   eigenes ::after, damit der Schlagschatten am Regler sitzt und nicht
   am Rand des ganzen Reiters. z-index: -1 wirkt, weil der Reiter
   selbst (position + z-index) einen eigenen Stapel aufmacht. */
.mailbox-tab.active::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 3px 1px rgba(0,0,0,0.04);
  z-index: -1;
}
/* Der Haken ist nur bei Material im Spiel. */
.mailbox-tab > .hk { display: none; }
/* Druckrueckmeldung: kurz abdunkeln. Kein scale() - das zoege einen
   breiten Reiter sichtbar zusammen. Kein opacity - das senkte die
   Beschriftung eines durchsichtigen Reiters auf 2,46:1. */
.mailbox-tab:active {
  transform: none;
  box-shadow: inset 0 0 0 999px rgba(0,0,0,0.18);
}
.mailbox-tab:focus-visible {
  outline: 2px solid #1F2937;
  outline-offset: 1px;
}

/* --- iOS -------------------------------------------------------------
   Die Grundfassung oben IST bereits der iOS-Schalter: systemgraue
   Schiene, weisser Regler, haarfeine Teiler. Hier stehen nur die
   Feinheiten, die wirklich vom System kommen. */
.os-ios .mailbox-tabs { border-radius: 9px; }
.os-ios .mailbox-tab,
.os-ios .mailbox-tab.active::after { border-radius: 7px; }
.os-ios .mailbox-tab {
  font-family: -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
  letter-spacing: -0.01em;
}
.os-ios .mailbox-tab:active {
  box-shadow: inset 0 0 0 999px rgba(0,0,0,0.14);
}

/* --- Android: Material-3-Filterchips ---------------------------------
   Material loest dieselbe Aufgabe anders - und fuer eine SCROLLENDE
   Auswahl sieht es ausdruecklich keinen Segmentknopf vor (der ist auf
   die Bildschirmbreite festgelegt), sondern Filterchips: einzeln
   stehende Pillen mit Umriss, die gewaehlte gefuellt und mit einem
   HAKEN davor. Genau dieser Fall liegt hier vor.

   Der Haken ist zugleich das zweite, von der Farbe unabhaengige
   Merkmal der Auswahl - noetig, weil Gelb gegen eine helle Flaeche
   die geforderten 3:1 rechnerisch nie erreicht. */
.os-android .mailbox-tabs-zeile { border-bottom-color: #CAC4D0; }
.os-android .mailbox-tabs {
  background: transparent;   /* keine Schiene - die kennt Material hier nicht */
  border-radius: 0;
  gap: 8px;
  /* Damit die Umrisse der ersten und letzten Pille nicht am Rand der
     scrollenden Flaeche kleben. */
  padding: 1px;
}
.os-android .mailbox-tab {
  min-height: 44px;
  background: #FFFFFF;
  /* #CAC4D0 ist bei Material die dekorative Linie; fuer die Begrenzung
     eines Bedienelements ist "outline" #79747E zustaendig. */
  border: 1px solid #79747E;
  /* Material-3-Chips sind mit 8 dp nur leicht gerundet - NICHT
     vollrund. Vollrund ist dort die Form der Knoepfe. */
  border-radius: 8px;
  font-family: Roboto, "Segoe UI", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.008em;
  color: #49454F;
}
/* Material trennt Chips durch Luft, nicht durch Striche. */
.os-android .mailbox-tab + .mailbox-tab::before { background: transparent; }
/* Kein Regler - die Fuellung sitzt direkt am Chip. */
.os-android .mailbox-tab.active::after { display: none; }
.os-android .mailbox-tab.active {
  /* "secondaryContainer": ein weiches Bernstein aus der Hausfarbe.
     Eine kraeftige Markenfarbe als Fuellung ist die Handschrift der
     frueheren 2010er - und der Kopfbereich darueber ist bereits gelb. */
  background: #FDF0C9;
  /* Der gewaehlte Filterchip verliert bei Material seinen Umriss. */
  border-color: transparent;
  color: #3F2E00;
}
/* Der Haken - mit zwei Raendern gezeichnet statt als Schriftzeichen:
   so hat er auf jedem Geraet dieselbe Form und Staerke. Sein Platz
   wird IMMER freigehalten (auch unbemalt), sonst wuerde die
   Beschriftung beim Umschalten schmaler und die Leiste ruckte. */
.os-android .mailbox-tab > .hk {
  display: block;
  flex: 0 0 auto;
  width: 11px;
  height: 6px;
  border: 0 solid currentColor;
  transform: rotate(-45deg) translate(1px, -1px);
}
.os-android .mailbox-tab.active > .hk {
  border-left-width: 2px;
  border-bottom-width: 2px;
}
.os-android .mailbox-tab:active {
  box-shadow: inset 0 0 0 999px rgba(0,0,0,0.18);
}

/* Rote Badge mit Anzahl neuer Mails pro Tab */
.tab-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  background: #D92D20;
  color: #FFFFFF;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
  vertical-align: text-top;
}
.tab-badge.hidden { display: none; }

/* Pull-to-Refresh-Indikator */
.ptr-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 13px;
  font-weight: 600;
  color: #92400E;
  height: 0;
  overflow: hidden;
  transition: height 0.15s ease-out;
}
.ptr-indicator.visible {
  height: 38px;
}
.ptr-spinner {
  display: inline-block;
  font-size: 20px;
  transition: transform 0.15s ease-out;
}
.ptr-indicator.refreshing .ptr-spinner {
  animation: ptr-spin 0.8s linear infinite;
}
@keyframes ptr-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ----------------- LEAD-Liste */
/* Flache Liste statt Kartenstapel. Beide Systeme zeigen Postfaecher
   als durchgehende Liste mit Trennlinie; schwebende Kaesten mit
   Schlagschatten und Aussenabstand sind das Muster von 2015 - und sie
   kosten auf einem Handy bei jeder Zeile Platz, den die Betreffzeile
   besser gebrauchen kann. */
#lead-list {
  padding: 0;
  background: #FFFFFF;
}
/* Swipe-to-Delete Wrapper: position relative, der Papierkorb sitzt
   absolut rechts, die Karte liegt darueber und kann nach links
   geschoben werden. */
.lead-row {
  position: relative;
  margin-bottom: 0;
  overflow: hidden;
  border-radius: 0;
}
.lead-row .lead-trash {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  /* 96 px wie die Wisch-Aktion der Haupt-App - beide Bereiche laufen
     in derselben installierten PWA. */
  width: 96px;
  background: #DC2626;
  color: #FFFFFF;
  border: none;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  z-index: 1;
}
.lead-row .lead-trash:active { background: #991B1B; }
.lead-card {
  position: relative;
  z-index: 2;
  background: #FFFFFF;
  padding: 12px 14px;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  /* Der schmale Streifen links bleibt - er traegt den
     Bearbeitungsstand und ist ohne ihn nicht mehr abzulesen. Nur
     dass er jetzt an einer flachen Zeile sitzt und nicht an einer
     schwebenden Karte. */
  border-left: 4px solid transparent;
  transition: transform 0.18s ease-out;
  will-change: transform;
}
/* Trennlinie wie in der Chatliste - eingerueckt bis unter den
   Textanfang. */
.lead-card::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: rgba(60,60,67,0.14);
}
.lead-card:active { background: #F1F5F9; }

/* --- Mailliste je System ---------------------------------------------
   Dieselben drei Merkmale wie in der Haupt-App: iOS rueckt die
   Trennlinie ein und setzt am Zeilenende einen Winkel, Material
   zieht sie durch, verzichtet auf den Winkel und gibt der Zeile
   mehr Hoehe. */
.os-ios .lead-card::after { left: 14px; background: rgba(60,60,67,0.20); }
.os-ios .lead-card { padding-right: 28px; }
/* Der Winkel am Zeilenende. ::before ist hier frei - der Punkt fuer
   ungelesene Mails haengt an .lead-von, nicht an der Zeile. */
.os-ios .lead-card::before {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px; height: 8px;
  margin-top: -5px;
  border-right: 2px solid rgba(60,60,67,0.3);
  border-bottom: 2px solid rgba(60,60,67,0.3);
  transform: rotate(-45deg);
  pointer-events: none;
}
.os-android .lead-card {
  min-height: 76px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.os-android .lead-card::after { left: 0; background: #E7E0EC; }
.os-android .lead-card:active { background: rgba(0,0,0,0.06); }
/* Die Kennzeichnungen in der Zeile: Material rundet sie voll. */
.os-android .lead-card .lead-meta .meta-tag { border-radius: 100px; }
.lead-card.swiped {
  transform: translateX(-96px);
}
/* Der Bearbeitungsstand steht im Streifen links, nicht mehr in der
   ganzen Flaeche: eine Liste, in der jede zweite Zeile rot oder gelb
   hinterlegt ist, hat keinen ruhigen Grund mehr, gegen den sich
   etwas abheben koennte. */
.lead-card.bearbeitet-andere { border-left-color: #DC2626; }
.lead-card.bearbeitet-eigen { border-left-color: #F59E0B; }
/* Ungelesene Mail: gruener Rand rundum + leichter gruener
   Hintergrund. Greift auch wenn die Mail gleichzeitig
   'bearbeitet-eigen' oder 'bearbeitet-andere' ist - der gruene
   Rand zeigt 'neu', der linke farbige Streifen zeigt den
   Bearbeitungs-Status. */
/* Ungelesen: frueher ein 2 px starker gruener Rahmen rundum, gruene
   Flaeche UND gruener Schatten - drei Signale fuer dieselbe Aussage,
   und die Zeile schrie lauter als ihr Inhalt. Beide Systeme loesen
   das mit einem Punkt und fetter Schrift; die Flaeche bleibt ruhig. */
.lead-card.mail-unread {
  border-left-color: #16A34A;
  background: #FFFFFF;
  box-shadow: none;
}
.lead-card.mail-unread.bearbeitet-andere {
  /* Bei doppelter Klasse gewinnt der Bearbeitungsstand am Streifen -
     dass die Mail ungelesen ist, sagt weiterhin der Punkt. */
  border-left-color: #DC2626;
}
.lead-card.mail-unread.bearbeitet-eigen {
  border-left-color: #F59E0B;
}
.lead-card.mail-unread .lead-von {
  font-weight: 800;
}
.lead-card.mail-unread .lead-von::before {
  content: '● ';
  color: #16A34A;
  font-size: 16px;
}
.lead-card .lead-von {
  font-size: 15px;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 4px;
}
.lead-card .lead-betreff {
  font-size: 14px;
  color: #4B5563;
  margin-bottom: 6px;
  /* nur eine Zeile */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-card .lead-meta {
  font-size: 12px;
  color: #6B7280;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.lead-card .lead-meta .meta-tag {
  background: #F1F5F9;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.lead-card .lead-meta .meta-tag.tag-rot {
  background: #FEE2E2;
  color: #991B1B;
}
.lead-card .lead-meta .meta-tag.tag-gruen {
  background: #DCFCE7;
  color: #166534;
}

/* ----------------- Detail */
.banner {
  margin: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}
.banner-green {
  background: #DCFCE7;
  color: #166534;
  border: 1px solid #FCD34D;
}
.banner-red {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FCA5A5;
}

.detail-block {
  margin: 0 12px 12px;
  padding: 14px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.detail-row {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
}
.detail-label {
  flex: 0 0 70px;
  font-weight: 700;
  color: #6B7280;
}
.detail-value {
  flex: 1;
  color: #1F2937;
  word-break: break-word;
}
.detail-betreff { font-weight: 600; }

.detail-actions {
  margin: 0 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-title {
  margin: 16px 16px 6px;
  font-size: 13px;
  font-weight: 700;
  color: #6B7280;
  /* Kein text-transform: uppercase mehr. Durchgehende
     Grossbuchstaben sind schwerer zu lesen und ein Muster, das
     beide Systeme laengst abgelegt haben. */
  letter-spacing: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .badge {
  background: #FFC107;
  color: #1F2937;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: none;
  letter-spacing: 0;
}

.body-box {
  margin: 0 12px 12px;
  padding: 14px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  font-size: 14.5px;
  line-height: 1.5;
  word-break: break-word;
  /* HTML-Mails dürfen breit werden - dann scrollen */
  overflow-x: auto;
  max-height: 50vh;
  overflow-y: auto;
}
.body-box img { max-width: 100%; height: auto; }

.notizen-box {
  margin: 0 12px 12px;
}
.notiz-card {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  font-size: 14px;
}
.notiz-card .notiz-kopf {
  font-size: 12px;
  font-weight: 600;
  color: #92400E;
  margin-bottom: 4px;
}
.notiz-card .notiz-text {
  color: #1F2937;
  white-space: pre-wrap;
  word-break: break-word;
}

.notiz-input-block {
  margin: 12px;
  padding: 12px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.notiz-input-block textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px;
  font-size: 15px;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  background: #F8FAFC;
  resize: vertical;
  font-family: inherit;
}
.notiz-input-block textarea:focus {
  outline: none;
  border-color: #F59E0B;
  background: white;
}
.notiz-input-block .primary { background: #F59E0B; }
.notiz-input-block .primary:active { background: #D97706; }

/* ----------------- Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1F2937;
  color: white;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  max-width: 90%;
}


/* ===================================================================
   Gemeinsame Formwerte (wie in der Haupt-App)
   ===================================================================
   Beide Bereiche laufen in DERSELBEN installierten PWA. Die Werte
   stehen hier noch einmal, weil /leads/ ausschliesslich dieses
   Stylesheet laedt - wer sie drueben aendert, muss sie hier
   mitziehen. */
:root {
  --r-chip: 8px;
  --r-knopf: 12px;
  --r-karte: 14px;
}
.os-android { --r-chip: 100px; --r-knopf: 100px; --r-karte: 16px; }
.os-ios { --r-chip: 8px; --r-knopf: 12px; --r-karte: 12px; }

.primary,
.btn-secondary,
.topbar .ghost { border-radius: var(--r-knopf); }
.meta-tag,
.section-title .badge { border-radius: var(--r-chip); }
.detail-block,
.body-box { border-radius: var(--r-karte); }
/* Mindest-Trefferflaeche - im Postfach wird viel getippt. */
.topbar .ghost { min-height: 40px; }


/* ===================================================================
   Knoepfe: dieselben drei Formen wie in der Haupt-App
   =================================================================== */
.primary,
.btn-secondary {
  min-height: 48px;
  font-weight: 600;
}
.btn-secondary {
  background: #FFFFFF;
  border: 1px solid #CAC4D0;
  color: #1F2937;
}
.btn-secondary:active { background: #F1F5F9; }
.topbar .ghost {
  background: transparent;
  border: none;
  min-height: 40px;
  padding: 4px 12px;
}
.topbar .ghost:active { background: rgba(0,0,0,0.08); }


/* ===== HIG-Ueberarbeitung (16.11.2026): Dunkelmodus nach Handy-Vorgabe =====
   Wie am Ende von /style.css: kein eigener Schalter (dark-mode.md › Best
   practices), <meta name="color-scheme" content="light dark"> in
   leads/index.html. Der Block wiederholt jede Regel mit heller Flaeche /
   dunkler Schrift / heller Kante mit dem dunklen Gegenstueck (nur Farb-
   Langformen). Gelb bleibt Gelb mit dunkler Schrift. Hauspalette dunkel:
   Grund #181613, Karte #24211D, Karte-alt #2D2924, Kante #3B362F, starke
   Kante #7A7164, Schrift #EEE9E0, gedaempft #B3AB9C. Mail-Inhalte
   (.body-box) werden nicht invertiert. */
:root { color-scheme: light dark; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}
/* === DUNKELMODUS-BLOCK (generiert) ANFANG === */
@media (prefers-color-scheme: dark) {
  html,
  body { background-color: #2D2924; color: #EEE9E0; }
  .muted { color: #B3AB9C; }
  .error { color: #FCA5A5; }
  .topbar { background-color: #FFC107; color: #1F2937; }
  .login-box { background-color: #24211D; }
  .login-box label { color: #EEE9E0; }
  .login-box input { border-color: #7A7164; background-color: #2D2924; }
  .login-box input:focus { background-color: #24211D; }
  .primary { color: #1F2937; background-color: #FFC107; }
  .primary:active { background-color: #F59E0B; color: #2A2113; }
  .primary:disabled { background-color: #4F410B; }
  .btn-secondary { color: #EEE9E0; background-color: #24211D; border-color: #7A7164; }
  .btn-secondary:active { background-color: #2D2924; }
  .mailbox-tabs-zeile { background-color: #24211D; border-bottom-color: #3B362F; }
  .mailbox-tab { color: #EEE9E0; }
  .mailbox-tab + .mailbox-tab::before { background-color: rgba(238, 233, 224, 0.26); }
  .mailbox-tab.active::before,
  .mailbox-tab.active + .mailbox-tab::before { background-color: transparent; }
  .mailbox-tab.active::after { background-color: #24211D; }
  .os-android .mailbox-tabs-zeile { border-bottom-color: #7A7164; }
  .os-android .mailbox-tab { background-color: #24211D; color: #B3AB9C; }
  .os-android .mailbox-tab + .mailbox-tab::before { background-color: transparent; }
  .os-android .mailbox-tab.active { background-color: #2F2812; color: #F2D36B; }
  .ptr-indicator { color: #FCD34D; }
  #lead-list { background-color: #24211D; }
  .lead-card { background-color: #24211D; }
  .lead-card::after { background-color: rgba(238, 233, 224, 0.14); }
  .lead-card:active { background-color: #2D2924; }
  .os-ios .lead-card::after { background-color: rgba(238, 233, 224, 0.20); }
  .os-ios .lead-card::before { border-right-color: rgba(238, 233, 224, 0.3); border-bottom-color: rgba(238, 233, 224, 0.3); }
  .os-android .lead-card::after { background-color: #3B362F; }
  .os-android .lead-card:active { background-color: rgba(0,0,0,0.06); }
  .lead-card.mail-unread { background-color: #24211D; }
  .lead-card.mail-unread .lead-von::before { color: #6EE7A0; }
  .lead-card .lead-von { color: #EEE9E0; }
  .lead-card .lead-betreff { color: #B3AB9C; }
  .lead-card .lead-meta { color: #B3AB9C; }
  .lead-card .lead-meta .meta-tag { background-color: #2D2924; }
  .lead-card .lead-meta .meta-tag.tag-rot { background-color: #4A211E; color: #FCA5A5; }
  .lead-card .lead-meta .meta-tag.tag-gruen { background-color: #1F3A2A; color: #6EE7A0; }
  .banner-green { background-color: #1F3A2A; color: #6EE7A0; border-color: #6B5A12; }
  .banner-red { background-color: #4A211E; color: #FCA5A5; border-color: #7F2D2A; }
  .detail-block { background-color: #24211D; }
  .detail-label { color: #B3AB9C; }
  .detail-value { color: #EEE9E0; }
  .section-title { color: #B3AB9C; }
  .section-title .badge { background-color: #FFC107; color: #1F2937; }
  .body-box { background-color: #24211D; }
  .notiz-card { background-color: #2F2812; border-color: #6B5A12; }
  .notiz-card .notiz-kopf { color: #FCD34D; }
  .notiz-card .notiz-text { color: #EEE9E0; }
  .notiz-input-block { background-color: #24211D; }
  .notiz-input-block textarea { border-color: #7A7164; background-color: #2D2924; }
  .notiz-input-block textarea:focus { background-color: #24211D; }
  .notiz-input-block .primary { background-color: #F59E0B; color: #2A2113; }
  .notiz-input-block .primary:active { background-color: #D97706; }
  .btn-secondary { background-color: #24211D; border-color: #7A7164; color: #EEE9E0; }
  .btn-secondary:active { background-color: #2D2924; }
}
/* === DUNKELMODUS-BLOCK (generiert) ENDE === */
@media (prefers-color-scheme: dark) {
  html, body { background-color: #181613; color: #EEE9E0; }
  :where(input:not([type=checkbox]):not([type=radio]), select, textarea) {
    background-color: #24211D; color: #EEE9E0; border-color: #7A7164;
  }
  ::placeholder { color: #A8A091; opacity: 1; }
  :where(a:link, a:visited) { color: #93C5FD; }
  .primary:disabled { color: #B3AB9C; }
}
/* ===== Ende HIG-Ueberarbeitung ===== */
