/* HeyMeister – Marke nach Brandbook V1 (11/2026): Koralle, Navy, Papier; Poppins für Überschriften, Inter für die Arbeit,
   JetBrains Mono für Zahlen und IDs. Flach: keine Verläufe, keine Schatten im Fluss. Schriften selbst gehostet. */

@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/static/fonts/poppins-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/static/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  /* Marke */
  --koralle: #E4572E;          /* Akzent: Buttons, Links, „Hey“ – knapp halten (≈ 5 %) */
  --koralle-dunkel: #C4461F;   /* kleiner Text in Akzentfarbe (4,6:1), Hover */
  --koralle-hell: #FCE5DD;
  --navy: #14213D;             /* Grund: Überschriften, Text, dunkle Flächen */
  --navy-hell: #2B3A5E;
  --papier: #FBFBF8;           /* Seitenhintergrund, kein reines Weiß */
  --flaeche-2: #F1F1EC;
  --fokus: #1F4FD8;            /* Fokusring, getrennt von Koralle und Kritisch */

  /* Arbeitsfarben (bestehende Namen, auf die Marke gelegt) */
  --bg: var(--papier);
  --surface: #FFFFFF;
  --surface-2: var(--flaeche-2);
  --line: #E3E3DC;
  --line-strong: #CFCFC6;
  --text: var(--navy);
  --text-2: #3A4560;
  --muted: #5E6679;
  --faint: #8A91A1;
  --accent: var(--koralle);
  --accent-dark: var(--koralle-dunkel);
  --accent-2: var(--navy-hell);
  --accent-soft: var(--koralle-hell);
  --accent-line: #F5C2B0;

  /* Zustände – getrennt von der Marke, immer mit Wort oder Haken */
  --good: #1E7B4A;
  --good-soft: #E2F3E9;
  --good-line: #B4DEC5;
  --warn: #9A5800;
  --warn-soft: #FDF0D6;
  --warn-line: #F1D39A;
  --danger: #B8232F;           /* Kritisch: ein anderes Rot als Koralle */
  --danger-soft: #FBE3E4;
  --danger-line: #F1B9BE;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: none;              /* Tiefe entsteht durch Weiß auf Papier */
  --shadow-lg: 0 12px 32px -12px rgba(20, 33, 61, .22);  /* nur für Schwebendes: Menüs, Tooltips */
  --display: "Poppins", "Segoe UI", Arial, sans-serif;
  --sans: "Inter", "Segoe UI", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-dark); text-decoration: none; }
a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); color: var(--navy); }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 1.25rem; }
h2 { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; margin: 2rem 0 .85rem; display: flex; align-items: center; gap: .55rem; }
h3 { font-size: 1rem; font-weight: 600; }
h2 .icon { color: var(--muted); }
code, .mono { font-family: var(--mono); font-size: .9em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: .84rem; }
::selection { background: var(--koralle-hell); color: var(--navy); }

/* Fokus: 2 px Blau, an allem Bedienbaren sichtbar */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--fokus); outline-offset: 2px; border-radius: 4px; }

/* Versal-Labels (Brandbook: label 12/16, 0,08 em) */
.label, .crumbs, .side-nav .label { font: 600 .72rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; }

/* ---------- App-Rahmen ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 1.25rem; padding: 1.4rem .9rem 1.25rem;
  background: var(--surface); border-right: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem; color: var(--text); }
.logo:hover { color: var(--text); text-decoration: none; }
.logo-wordmark { display: block; width: 150px; height: auto; }   /* Mindestbreite 120 px */
.logo-icon { display: none; width: 32px; height: 32px; }          /* unter 120 px: das Icon, nie beides */
.logo small { display: block; font: 500 .7rem/1.2 var(--sans); color: var(--faint); letter-spacing: .02em; margin-top: .35rem; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav .label { color: var(--faint); padding: .95rem .6rem .45rem; }
.side-nav a, .side-nav .soon {
  display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: .92rem; border: 1px solid transparent; transition: background .15s, color .15s;
}
.side-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.side-nav a.active { color: var(--navy); background: var(--surface-2); font-weight: 600; }
.side-nav a.active svg { color: var(--koralle); }
.side-nav .soon { opacity: .45; cursor: default; }
.side-nav a.planned:not(.active) { color: var(--muted); }
.side-nav a.planned:not(.active) svg { opacity: .6; }
.side-more { display: flex; flex-direction: column; gap: 2px; }
.side-more > summary { cursor: pointer; list-style: none; display: block; }
.side-more > summary::-webkit-details-marker { display: none; }
.side-more > summary::after { content: " ▸"; }
.side-more[open] > summary::after { content: " ▾"; }
.side-nav .soon::after { content: "bald"; margin-left: auto; font: 600 .62rem/1 var(--sans); text-transform: uppercase; letter-spacing: .08em; border: 1px solid var(--line-strong); border-radius: 99px; padding: .2rem .4rem; }
.side-nav svg, .icon { width: 18px; height: 18px; flex: none; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: .6rem; }
.status-line { display: flex; align-items: center; gap: .45rem; font: 500 .72rem/1 var(--sans); color: var(--faint); padding: 0 .6rem; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); flex: none; }
.dot.warn { background: var(--warn); }
@keyframes pulse { 50% { opacity: .45; } }
.user-chip { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font: 700 .78rem/1 var(--display); flex: none; }
.user-chip .who { min-width: 0; flex: 1; font-size: .82rem; line-height: 1.25; font-weight: 600; }
.user-chip .who span { display: block; color: var(--faint); font-size: .72rem; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { background: none; border: 0; color: var(--muted); cursor: pointer; padding: .3rem; border-radius: 6px; display: grid; place-items: center; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

main { padding: 2rem clamp(16px, 4vw, 3rem) 4rem; max-width: 1280px; width: 100%; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.crumbs { color: var(--faint); margin-bottom: .55rem; }
.crumbs a { color: var(--muted); }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; align-items: center; gap: .5rem; padding: .6rem 16px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .logo-wordmark, .logo small, .side-nav .label, .side-foot .status-line, .user-chip .who, .side-nav .soon { display: none; }
  .logo-icon { display: block; }
  .side-nav { flex-direction: row; gap: 2px; }
  .side-nav a { padding: .45rem .55rem; font-size: .85rem; white-space: nowrap; }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; }
  .user-chip { padding: .3rem; border: 0; background: none; }
  main { padding-top: 1.25rem; }
}

/* ---------- Bausteine ---------- */
/* Karten: Weiß auf Papier, 1 px Rahmen, Radius 16 px, kein Schatten */
.card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.5rem; box-shadow: none; }
a.card { color: inherit; display: block; transition: border-color .15s; }
a.card:hover { border-color: var(--navy); color: inherit; text-decoration: none; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: .85rem; }

/* Buttons: primär Koralle (nie zwei nebeneinander), sekundär Navy-Rahmen, Radius 10 px */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .55rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--navy);
  background: var(--surface); color: var(--navy); font: 600 .9rem/1.2 var(--sans); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { color: var(--navy); background: var(--surface-2); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.primary { border-color: var(--koralle); color: #fff; background: var(--koralle); }
.btn.primary:hover { color: #fff; background: var(--koralle-dunkel); border-color: var(--koralle-dunkel); }
.btn.danger { color: var(--danger); border-color: var(--danger-line); }
.btn.danger:hover { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.ghost:hover { color: var(--navy); background: var(--surface-2); }
.btn.sm { padding: .35rem .7rem; font-size: .8rem; border-radius: 8px; }
.btn .icon { width: 16px; height: 16px; }

/* Zustands-Pills: immer mit Wort */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .55rem; border-radius: 99px;
  font: 600 .72rem/1.35 var(--sans); background: var(--good-soft); color: var(--good); border: 1px solid var(--good-line); vertical-align: middle;
}
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge.bad { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.badge.neutral { background: var(--surface-2); color: var(--muted); border-color: var(--line); }

/* Hinweise: Erfolg mit Haken, Fehler in Kritisch mit Warnzeichen (statt Emojis) */
.notice {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--good-soft); color: var(--good); border: 1px solid var(--good-line);
  margin-bottom: 1rem; font-size: .9rem;
}
.notice::before {
  content: ""; flex: none; width: 18px; height: 18px; margin-top: .05rem; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.notice.error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.notice.error::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E");
          mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.01'/%3E%3C/svg%3E");
}
.notice > * { min-width: 0; }
.notice.row { align-items: center; }

/* Kennzahlen: Zahlen in Mono, tabellarisch */
.stats { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.stat { padding: 1rem 1.25rem; }
.stat .k { font: 600 .72rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); display: flex; align-items: center; gap: .45rem; }
.stat .k .icon { width: 14px; height: 14px; color: var(--muted); }
.stat .v { font: 600 1.9rem/1.1 var(--mono); letter-spacing: -.03em; margin-top: .7rem; color: var(--navy); }
.stat .s { font-size: .78rem; color: var(--muted); margin-top: .3rem; }
.stat.warn .v { color: var(--warn); }
@media (max-width: 640px) { .stats { gap: .6rem; } .stat .v { font-size: 1.6rem; } }

/* Formulare: Fokusring 2 px Blau, Fehler in Kritisch */
form.stack label, .field label, label.lbl { display: block; font: 600 .72rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .45rem; }
input, select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fokus); box-shadow: 0 0 0 1px var(--fokus); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; }
input[type="file"] { padding: .5rem; background: var(--surface-2); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--navy); }
textarea { min-height: 5.5rem; resize: vertical; }
.two { display: grid; gap: .85rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .two { grid-template-columns: 1fr; } }

/* Ablage */
.layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 1rem; align-items: start; }
.layout > * { min-width: 0; }
@media (max-width: 960px) { .layout { grid-template-columns: 1fr !important; } }
.folders { list-style: none; margin: 0; padding: .35rem; }
.folders a { display: flex; justify-content: space-between; gap: .5rem; padding: .48rem .65rem; border-radius: 8px; color: var(--text-2); font-size: .9rem; }
.folders a span:last-child { font: 500 .75rem/1.6 var(--mono); color: var(--faint); }
.folders a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.folders a.active { color: var(--navy); background: var(--surface-2); font-weight: 600; }
.folders a.active span:last-child { color: var(--accent-dark); }

/* Tabellen: Kopf in Fläche-2 mit Label, Zahlen rechtsbündig in Mono */
.docs { width: 100%; border-collapse: collapse; }
.docs th { text-align: left; font: 600 .72rem/1.3 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--navy); background: var(--surface-2); padding: .6rem .6rem; border-bottom: 1px solid var(--line-strong); }
.docs td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs tr:last-child td { border-bottom: 0; }
.docs tr:hover td { background: var(--papier); }
.docs td a { color: var(--text); font-weight: 600; }
.docs td a:hover { color: var(--accent-dark); }
.docs .date { font: 400 .8rem/1.5 var(--mono); color: var(--muted); white-space: nowrap; text-align: right; }
.docs .acct { font-size: .78rem; color: var(--faint); white-space: nowrap; }
@media (max-width: 640px) { .docs .hide-sm { display: none; } }

.preview { width: 100%; height: 75vh; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
img.preview { height: auto; max-height: 75vh; object-fit: contain; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; color: var(--text-2); }

.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon { width: 28px; height: 28px; color: var(--faint); margin-bottom: .6rem; }

/* ---------- Projekte & Mail-Kacheln ---------- */
.p-emerald { --p: #10b981; --p-soft: #ecfdf5; --p-ink: #047857; }
.p-blue    { --p: #3b82f6; --p-soft: #eff6ff; --p-ink: #1d4ed8; }
.p-violet  { --p: #8b5cf6; --p-soft: #f5f3ff; --p-ink: #6d28d9; }
.p-amber   { --p: #f59e0b; --p-soft: #fffbeb; --p-ink: #b45309; }
.p-rose    { --p: #f43f5e; --p-soft: #fff1f2; --p-ink: #be123c; }
.p-cyan    { --p: #06b6d4; --p-soft: #ecfeff; --p-ink: #0e7490; }
.p-slate   { --p: #64748b; --p-soft: #f1f5f9; --p-ink: #334155; }
.p-none    { --p: #98a2b3; --p-soft: #f2f4f7; --p-ink: #475467; }

.pdot { width: 10px; height: 10px; border-radius: 3px; background: var(--p); flex: none; }
.ptag { display: inline-flex; align-items: center; gap: .35rem; padding: .16rem .55rem; border-radius: 99px; background: var(--p-soft); color: var(--p-ink); font: 600 .72rem/1.35 var(--sans); }
.ptag::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--p); }

.group { margin-top: 1.6rem; }
.group-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; }
.group-head .name { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; color: var(--text); }
.group-head .count { white-space: nowrap; font: 600 .7rem/1 var(--mono); color: var(--p-ink); background: var(--p-soft); padding: .25rem .5rem; border-radius: 99px; }
.group-head a.more { margin-left: auto; font-size: .82rem; white-space: nowrap; }

.tiles { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: .55rem; min-height: 210px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1rem .85rem;
  transition: border-color .15s; overflow: hidden;
}
.tile::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: var(--p); }
.tile:hover { border-color: var(--navy); }
.tile .who { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.tile .who .avatar { width: 28px; height: 28px; font-size: .72rem; background: var(--p-soft); color: var(--p-ink); }
.tile .who .n { font-weight: 600; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.tile .who .t { font: 500 .7rem/1 var(--mono); color: var(--faint); white-space: nowrap; }
.tile .subj { font-weight: 650; font-size: .95rem; line-height: 1.35; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .subj:hover { color: var(--accent-dark); }
.tile .snip { font-size: .83rem; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile .foot { margin-top: auto; display: flex; align-items: center; gap: .5rem; padding-top: .6rem; border-top: 1px dashed var(--line); }
.tile .foot form { flex: 1; display: flex; gap: .4rem; min-width: 0; }
.tile .foot select { padding: .35rem .5rem; font-size: .8rem; border-radius: 8px; background: var(--surface-2); border-color: var(--line); }
.tile .foot input { padding: .35rem .5rem; font-size: .8rem; border-radius: 8px; }
.tile .meta { display: flex; gap: .35rem; flex-wrap: wrap; }

/* ---------- Login ---------- */
.gate { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr auto; padding: 1.5rem clamp(16px, 4vw, 2.5rem); }
.gate-top { display: flex; justify-content: space-between; align-items: center; font: 600 .72rem/1 var(--sans); color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.gate-top .logo { padding: 0; }
.gate-top .logo-wordmark { width: 168px; }
.gate-top .row { gap: .5rem; }
.gate-center { display: grid; grid-template-columns: minmax(0, 460px); justify-content: center; align-content: center; padding: 3rem 0; }
.gate-kicker { font: 600 .74rem/1 var(--sans); color: var(--koralle-dunkel); letter-spacing: .08em; text-transform: uppercase; }
.hello { font: 700 clamp(2.4rem, 8vw, 4rem)/1.06 var(--display); letter-spacing: -.03em; color: var(--navy); margin: 1rem 0 1rem; }
.hello .cursor { display: none; }
@keyframes blink { 50% { opacity: 0; } }
.gate-sub { color: var(--muted); font-size: 1.05rem; margin: 0 0 2rem; max-width: 40ch; }
.gate-panel { padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.btn.google { width: 100%; padding: .8rem 1rem; font-size: .98rem; }
.btn.google svg { width: 18px; height: 18px; }
.gate-meta { display: flex; justify-content: space-between; font: 400 .72rem/1.4 var(--sans); color: var(--faint); }
.gate-foot { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font: 400 .72rem/1 var(--sans); color: var(--faint); }
.term { font: 400 .84rem/1.8 var(--sans); color: var(--muted); margin-top: 1.5rem; }
.term .ok { color: var(--good); font-weight: 700; }

/* Mail-Aktionen (Archivieren / Löschen) */
.mail-actions { display: inline-flex; gap: .15rem; flex: none; }
.mail-actions form { margin: 0; }
.mail-actions .icon-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem; color: var(--muted); }
.mail-actions .icon-btn svg { width: 17px; height: 17px; }
.mail-actions .icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); }
.mail-actions.labels .icon-btn { padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 9px; font-size: .85rem; }

/* Softphone (Twilio) */
.softphone-state { font: inherit; font-size: .75rem; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 999px; padding: .1rem .55rem; cursor: pointer; }
.softphone-state.ok { color: var(--good); border-color: var(--good-line); background: var(--good-soft); }
.softphone-state.bad { color: var(--danger); background: var(--danger-soft); }
.softphone { position: fixed; right: 16px; bottom: 16px; z-index: 50; width: min(320px, calc(100vw - 32px)); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .9rem 1rem; display: grid; gap: .5rem; }
.softphone[hidden] { display: none; }
.sp-number { font-weight: 600; font-size: 1.05rem; }
.sp-contact { font-size: .85rem; color: var(--text-2); }
.sp-timer { font: 500 .8rem var(--mono); color: var(--muted); }
.sp-row { display: flex; gap: .4rem; flex-wrap: wrap; }
.softphone[data-mode="ringing"] .sp-live, .softphone:not([data-mode="ringing"]) .sp-ring { display: none; }
/* Wählfeld (Leitung, Nummer, Tastenfeld) und Tonwahl im Gespräch */
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 1.2rem; }
.sp-line-badge { font: 600 .72rem/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sp-close { font-size: 1.2rem; line-height: 1; }
.sp-dial { display: grid; gap: .45rem; }
.sp-input { font: 600 1.1rem/1.2 var(--mono); text-align: center; }
.sp-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.sp-key { height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); font: 600 1.05rem/1 var(--sans); color: var(--navy); cursor: pointer; }
.sp-key:hover { background: var(--surface-2); }
.sp-key:active { background: var(--koralle-hell); }
.sp-dtmf { font: 500 .85rem/1.2 var(--mono); letter-spacing: .15em; color: var(--muted); min-height: 0; }
.sp-padbtn[aria-pressed="true"] { background: var(--surface-2); }
.softphone:not([data-mode="dial"]) .sp-dial, .softphone:not([data-mode="dial"]) .sp-go-row, .softphone:not([data-mode="dial"]) .sp-close { display: none; }
.softphone[data-mode="dial"] .sp-number, .softphone[data-mode="dial"] .sp-contact, .softphone[data-mode="dial"] .sp-timer,
.softphone[data-mode="dial"] .sp-live, .softphone[data-mode="dial"] .sp-dtmf { display: none; }
.softphone:not([data-mode="dial"]):not([data-pad="on"]) .sp-pad, .softphone[data-mode="ringing"] .sp-pad { display: none; }
.sp-mute[aria-pressed="true"] { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }

/* Projekt-Tool, überall einbindbar: Deal → Projekt (Dialog) und Projekte am Account */
.ueb-dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.3rem; width: min(560px, calc(100vw - 2rem)); box-shadow: var(--shadow-lg); }
.ueb-dialog::backdrop { background: rgba(20, 33, 61, .35); }
.ueb-dialog h2 { margin: 0 0 .8rem; font: 700 1.05rem/1.3 var(--display); text-transform: none; letter-spacing: 0; color: var(--text); }
.ueb-dialog:not(.ueb-direct) .ueb-form { display: none; }
.ueb-dialog.ueb-direct .ueb-step { display: none; }
.ueb-form { display: flex; flex-direction: column; gap: .7rem; }
.ueb-form input, .ueb-form select { width: 100%; }
.ueb-two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
@media (max-width: 480px) { .ueb-two { grid-template-columns: 1fr; } }
.ueb-warn { padding: .6rem .8rem; border-radius: 10px; background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); font-size: .9rem; }
.acc-pj { display: flex; flex-direction: column; }
.acc-pj-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .8rem; align-items: center; padding: .55rem 0; border-top: 1px solid var(--line); color: var(--text); }
.acc-pj-row:first-child { border-top: 0; }
.acc-pj-row:hover { color: var(--text); background: var(--surface-2); }
.acc-pj-main { display: flex; flex-direction: column; min-width: 0; }
.acc-pj-st { font-size: .75rem; font-weight: 650; padding: .2rem .55rem; border-radius: 99px; background: var(--surface-2); color: var(--text-2); }
.acc-pj-prog { display: inline-flex; align-items: center; gap: .4rem; font-variant-numeric: tabular-nums; }
.acc-pj-bar { width: 70px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.acc-pj-bar span { display: block; height: 100%; background: var(--navy); }
.local-copy { margin: -.4rem 0 1rem; padding: .55rem .9rem; border-radius: 10px; background: var(--warn-soft); border: 1px solid var(--warn); color: var(--warn); font-size: .85rem; font-weight: 600; }
.local-copy a { color: var(--warn); text-decoration: underline; }

/* Nur für Screenreader sichtbar */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
