/* ==========================================================================
   Tamos Intern · Aussehen
   Im Qonto-Stil (siehe .claude/skills/qonto-stil): Schwarz, Weiß und Grau,
   Pastell nur als Akzent, runde Karten ohne Schatten, schwarze Knöpfe,
   eine Schrift (Geist, lokal im Ordner fonts/), kurze Bewegungen.
   Hell- und Dunkelmodus: folgt dem Gerät, lässt sich im Menü umschalten.
   ========================================================================== */

/* ---------- Schrift (lokal, nie von einem fremden Server) ---------- */
@font-face { font-family: "Geist"; src: url("fonts/geist-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Geist"; src: url("fonts/geist-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* ---------- Farben und Maße ---------- */
:root {
  color-scheme: light;
  /* Feste Töne */
  --black: #050505; --white: #ffffff;
  --grey-25: #f9f9f9; --grey-50: #f5f5f5; --grey-100: #e8e8e8; --grey-200: #e0e0e0; --grey-300: #cccccc; --grey-400: #b8b8b8;
  --grey-500: #8f8f8f; --grey-600: #616161; --grey-700: #3d3d3d; --grey-800: #262626; --grey-850: #2c2c2c; --grey-900: #1a1a1a;
  --blueberry-50: #cfdeff; --blueberry-100: #99b9ff; --blueberry-900: #2450b0; --blueberry-1000: #0c2351;
  --plum-50: #d5c8ff; --plum-1000: #461068;
  --mint-50: #c8ffec; --mint-1000: #0d5563;
  --peach-50: #ffc9a6; --peach-1000: #7a250c;
  --mustard-50: #faffa4; --mustard-1000: #705208;
  --sakura-50: #ffdfea; --sakura-1000: #7e0f4c;
  --success: #0a7037; --promo: #0247f6;

  /* Rollen (hell). Der Dunkelmodus setzt sie weiter unten neu. */
  --bg: var(--grey-25);        /* Grund der Seite */
  --panel: var(--white);       /* Kästen, Leiste links, Fenster */
  --surface: var(--grey-50);   /* Fläche in Kästen, Hover auf Zeilen */
  --ink: var(--black);         /* Text */
  --muted: var(--grey-600);    /* Nebentext */
  --line: var(--grey-100);     /* Linien und Ränder */
  --line-strong: var(--grey-400); /* Rand von Eingabefeldern */
  --btn-bg: var(--black); --btn-fg: var(--white);
  --btn-hover: rgba(29, 29, 27, 0.92); --btn-active: #373737;
  --ghost-hover: rgba(29, 29, 27, 0.08); --ghost-active: rgba(29, 29, 27, 0.12);
  --nav-active: var(--grey-100);
  --focus: var(--blueberry-900); --focus-soft: var(--blueberry-50);
  --late: #ba2c22;             /* überfällig, Fehler */
  --error-bg: #ffe9e7;
  --notice-bg: var(--blueberry-50); --notice-fg: var(--black); --notice-tag-bg: var(--blueberry-1000); --notice-tag-fg: var(--white);
  --intern-bg: var(--plum-50); --intern-fg: var(--black);
  --event-bg: var(--blueberry-50); --event-fg: var(--black);
  --bar: rgba(255, 255, 255, 0.86);

  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --r-xs: 4px; --r-sm: 8px; --r-md: 16px; --r-lg: 24px; --r-full: 999px;
  --side: 0px;                 /* Breite der Leiste links (nur am Rechner) */
  --head: 60px;                /* Höhe der Zeile oben (Handy und Tablet) */
  --band: 0px;                 /* Höhe des Demo-Bands, wird gemessen */
  --tabbar: calc(64px + env(safe-area-inset-bottom));
  --pad: 16px;                 /* Seitenrand des Inhalts */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-arrow: cubic-bezier(0.4, 0, 0.6, 1);
  --ease-spring: cubic-bezier(0.25, 0.89, 0.35, 1.15);
}
@media (min-width: 761px) { :root { --pad: 24px; } }
@media (min-width: 1024px) { :root { --side: 248px; --head: 0px; --tabbar: 0px; --pad: 40px; } }

/* Dunkel */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: var(--black); --panel: var(--grey-900); --surface: var(--grey-800); --ink: var(--white); --muted: var(--grey-400);
    --line: var(--grey-850); --line-strong: var(--grey-600);
    --btn-bg: var(--white); --btn-fg: var(--black); --btn-hover: rgba(255, 255, 255, 0.92); --btn-active: var(--grey-200);
    --ghost-hover: rgba(245, 245, 245, 0.08); --ghost-active: rgba(245, 245, 245, 0.14);
    --nav-active: var(--grey-800);
    --focus: var(--blueberry-100); --focus-soft: rgba(153, 185, 255, 0.3);
    --late: #ff9991; --error-bg: #3a1512;
    --notice-bg: var(--blueberry-1000); --notice-fg: var(--white); --notice-tag-bg: var(--blueberry-50); --notice-tag-fg: var(--black);
    --intern-bg: var(--plum-1000); --intern-fg: var(--white);
    --event-bg: var(--blueberry-1000); --event-fg: var(--white);
    --success: #77e5a4;
    --bar: rgba(26, 26, 26, 0.86);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--black); --panel: var(--grey-900); --surface: var(--grey-800); --ink: var(--white); --muted: var(--grey-400);
  --line: var(--grey-850); --line-strong: var(--grey-600);
  --btn-bg: var(--white); --btn-fg: var(--black); --btn-hover: rgba(255, 255, 255, 0.92); --btn-active: var(--grey-200);
  --ghost-hover: rgba(245, 245, 245, 0.08); --ghost-active: rgba(245, 245, 245, 0.14);
  --nav-active: var(--grey-800);
  --focus: var(--blueberry-100); --focus-soft: rgba(153, 185, 255, 0.3);
  --late: #ff9991; --error-bg: #3a1512;
  --notice-bg: var(--blueberry-1000); --notice-fg: var(--white); --notice-tag-bg: var(--blueberry-50); --notice-tag-fg: var(--black);
  --intern-bg: var(--plum-1000); --intern-fg: var(--white);
  --event-bg: var(--blueberry-1000); --event-fg: var(--white);
  --success: #77e5a4;
  --bar: rgba(26, 26, 26, 0.86);
}
:root:has(body.is-demo) { --band: 40px; }
@media (max-width: 760px) { :root:has(body.is-demo) { --band: 52px; } }

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 400 16px/24px var(--font); }
:where(h1, h2, h3, p, ul, ol, dl, dd, figure) { margin: 0; }
:where(h1, h2, h3) { font-weight: 600; }
:where(ul, ol) { list-style: none; padding: 0; }
:where(a) { color: inherit; text-decoration: none; }
:where(button, input, textarea, select) { font: inherit; color: inherit; }
:where(b, strong) { font-weight: 600; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-xs); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(100% - 2 * var(--pad), 1200px); margin-inline: auto; }
.icon { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 22px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Schrift-Bausteine ---------- */
.eyebrow { color: var(--muted); font-size: 12px; line-height: 16px; }
.title { font-size: 28px; line-height: 36px; font-weight: 600; letter-spacing: 0; overflow-wrap: anywhere; }
.h3 { font-size: 18px; line-height: 24px; font-weight: 600; }

/* ---------- Knöpfe ---------- */
/* Gefüllt: schwarz (im Dunkeln weiß). Beim Überfahren ändert sich nur die Farbe. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 11px 16px;
  border: 1px solid transparent; border-radius: var(--r-sm); background: var(--btn-bg); color: var(--btn-fg);
  font-size: 16px; line-height: 24px; font-weight: 400; white-space: nowrap; }
.btn:hover { background: var(--btn-hover); }
.btn:active { background: var(--btn-active); }
.btn--line { border-color: var(--ink); background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--ghost-hover); }
.btn--line:active { background: var(--ghost-active); }
.btn--tonal { background: var(--ghost-hover); color: var(--ink); }
.btn--tonal:hover { background: var(--ghost-active); }
.btn--tonal:active { background: var(--ghost-active); }
.btn--full { width: 100%; justify-content: space-between; }
.btn[disabled] { opacity: 0.45; cursor: progress; }
.btn .icon { width: 16px; height: 16px; }

/* Textlink: unterstrichen. Mit Pfeil ohne Strich. */
.text-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--ink);
  font-size: 14px; line-height: 22px; text-align: left; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; text-decoration-color: var(--line-strong); }
.text-btn:hover { text-decoration-color: currentColor; }
.text-btn:has(.arrow), .text-btn:has(.icon) { text-decoration: none; }
.text-btn .icon { width: 16px; height: 16px; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-full); background: none; color: var(--ink); }
.icon-btn:hover { background: var(--ghost-hover); }

/* Pfeil ↗: zwei gleiche Pfeile. Beim Überfahren fliegt der erste nach oben rechts hinaus,
   der zweite kommt von unten links herein. */
.arrow { position: relative; display: inline-block; width: 18px; height: 18px; overflow: hidden; flex: none; }
.arrow::before, .arrow::after { content: ""; position: absolute; inset: 0; background: currentColor;
  --pfeil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='black' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13 13 5M6.5 5H13v6.5'/%3E%3C/svg%3E");
  -webkit-mask: var(--pfeil) center / contain no-repeat; mask: var(--pfeil) center / contain no-repeat; }
.arrow::after { transform: translate(-18px, 18px); }
.text-btn .arrow { width: 14px; height: 14px; }
.text-btn .arrow::after { transform: translate(-14px, 14px); }

/* ---------- Demo-Hinweis (das eine blaue Band ganz oben) ---------- */
.demo-band { position: fixed; inset: 0 0 auto; z-index: 60; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 0 16px;
  min-height: var(--band); padding: 6px 16px; background: var(--promo); color: var(--white); font-size: 14px; line-height: 22px; text-align: center; }
.demo-band strong { font-weight: 600; }
@media (max-width: 760px) { .demo-band__mehr { display: none; } }
.demo-band button { min-height: 28px; padding: 0 10px; border: 1px solid currentColor; border-radius: var(--r-sm); background: none; color: inherit; font-size: 12px; line-height: 18px; }
.demo-band button:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- Logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 20px; line-height: 1; white-space: nowrap; }
.logo svg { width: 22px; height: 18px; flex: none; }
.logo b { font-weight: 700; }
.logo span { font-weight: 400; color: var(--muted); }

/* ---------- Leiste links (Rechner) ---------- */
.side { display: none; }
@media (min-width: 1024px) {
  .side { position: fixed; inset: var(--band) auto 0 0; z-index: 40; display: flex; flex-direction: column; width: var(--side);
    padding: 20px 12px 16px; background: var(--panel); border-right: 1px solid var(--line); overflow-y: auto; }
}
.side__logo { display: inline-flex; align-self: flex-start; margin: 0 12px 20px; }
.side__nav { display: grid; gap: 4px; }
.side__nav a, .side__btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 8px 12px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--muted); font-size: 16px; line-height: 24px; text-align: left; }
.side__nav a:hover, .side__btn:hover { background: var(--surface); color: var(--ink); }
.side__nav a[aria-current="page"] { background: var(--nav-active); color: var(--ink); font-weight: 600; }
.side__nav a .tag { margin-left: auto; }
.side__foot { display: grid; gap: 2px; margin-top: auto; padding-top: 16px; border-top: 1px solid var(--line); }
.side__user { display: flex; align-items: center; gap: 12px; padding: 4px 12px 12px; font-weight: 600; }
.side__btn { min-height: 36px; padding-block: 6px; font-size: 14px; line-height: 22px; }

/* ---------- Zeile oben und Leiste unten (Handy und Tablet) ---------- */
.header { position: fixed; inset: var(--band) 0 auto; z-index: 50; background: var(--bar); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: calc(var(--head) - 1px); }
.header__user { display: flex; align-items: center; margin-right: -10px; }
.tabbar { position: fixed; inset: auto 0 0; z-index: 50; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--tabbar);
  padding: 0 4px env(safe-area-inset-bottom); background: var(--bar); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-top: 1px solid var(--line); }
.tabbar a { display: grid; place-items: center; align-content: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--muted); }
.tabbar a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabbar .icon { width: 20px; height: 20px; }
@media (min-width: 1024px) { .header, .tabbar { display: none; } }

/* ---------- Seite ---------- */
.main { margin-left: var(--side); padding: calc(var(--band) + var(--head) + 24px) 0 calc(var(--tabbar) + 32px); }
@media (min-width: 1024px) { .main { padding-top: calc(var(--band) + 32px); padding-bottom: 64px; } }
.view { display: grid; gap: 24px; align-content: start; }
.view > * { min-width: 0; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; }
.page-head__sub { margin-top: 2px; color: var(--muted); }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Kasten: weiß, feine Linie, 16 px Ecken, kein Schatten */
.block, .view > .rows, .note-box, .cal-panel {
  padding: 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
@media (min-width: 761px) { .block, .note-box { padding: 24px; } }
.view > .rows { padding-block: 8px; }
@media (min-width: 761px) { .view > .rows { padding: 8px 24px; } }
.block__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 32px; margin-bottom: 8px; }
.block__head .text-btn { min-height: 32px; flex: none; }
.empty { padding-block: 8px; color: var(--muted); }
.view > .empty { padding: 24px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); text-align: center; }

/* „Braucht Aufmerksamkeit“: der eine Pastell-Block der Übersicht. Höchstens drei Zeilen, der Rest auf Klick. */
.note-band { padding: 12px 20px 4px; border-radius: var(--r-md); background: var(--notice-bg); color: var(--notice-fg); }
.note-band .block__head { margin-bottom: 0; }
.note-band li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 24px; min-height: 44px; padding-block: 8px; }
.note-band li + li { border-top: 1px solid color-mix(in srgb, var(--notice-fg) 14%, transparent); }
.note-band .eyebrow { display: inline-flex; justify-content: center; min-width: 60px; margin-right: 8px; padding: 2px 8px; border-radius: var(--r-full); background: var(--notice-tag-bg); color: var(--notice-tag-fg); }
.note-band .muted { color: inherit; opacity: 0.75; }
.note-band .text-btn { color: inherit; text-decoration-color: currentColor; }

/* Zahlen: eine schmale Zeile in einem Kasten. Beschriftung oben, Zahl unten. Jede Zahl ist ein Link. */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--line); overflow: hidden; }
.stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; min-width: 0; padding: 14px 20px; background: var(--panel); }
a.stat:hover { background: var(--surface); }
.stat:focus-visible { outline-offset: -2px; }
.stat__n { display: block; font-size: 24px; line-height: 32px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat__label { display: block; color: var(--muted); font-size: 14px; line-height: 22px; }

.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* ---------- Listenzeilen ---------- */
.rows { display: grid; }
.rows > li { min-width: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; width: calc(100% + 24px); margin-inline: -12px; padding: 10px 12px;
  border: 0; border-radius: var(--r-sm); background: none; color: inherit; text-align: left; }
button.row:hover, a.row:hover { background: var(--surface); }
.row--plain { grid-template-columns: minmax(0, 1fr) auto; }
.row--avatar { grid-template-columns: 40px minmax(0, 1fr) auto; }
.row__lead { min-width: 64px; color: var(--muted); font-size: 14px; line-height: 22px; font-variant-numeric: tabular-nums; }
.row__title { display: block; font-size: 16px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.row__meta { display: flex; flex-wrap: wrap; gap: 0 12px; color: var(--muted); font-size: 14px; line-height: 22px; }
.row__side { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; line-height: 22px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row__side .num { color: var(--ink); font-weight: 600; }
.row__side.num { color: var(--ink); font-weight: 600; }
/* Nebenzeile, die nie umbricht: was nicht passt, endet mit „…“ */
.row__meta--eins { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row__meta--eins > * { margin-right: 12px; }
/* Langer Text als Hauptzeile (Verlauf): normale Stärke, höchstens zwei Zeilen */
.row__title--lang { font-weight: 400; }
.row__title--kurz { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.is-done .row__title { color: var(--muted); font-weight: 400; text-decoration: line-through; text-decoration-thickness: 1px; }
.is-late { color: var(--late); font-weight: 600; }
/* In der Nebenzeile wird ein Hinweis („überfällig“, „Unterlage fehlt“) zur Pfirsich-Marke statt zu rotem Text */
.row__meta .is-late { display: inline-flex; align-items: center; align-self: center; padding: 1px 8px; border-radius: var(--r-full); background: var(--peach-50); color: var(--peach-1000); font-size: 12px; line-height: 16px; font-weight: 400; }

/* Runder Kreis mit zwei Buchstaben */
.avatar { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--grey-100); color: var(--black);
  font-size: 14px; line-height: 1; font-weight: 600; }
.avatar--blueberry { background: var(--blueberry-50); }
.avatar--plum { background: var(--plum-50); }
.avatar--mint { background: var(--mint-50); }
.avatar--peach { background: var(--peach-50); }
.avatar--mustard { background: var(--mustard-50); }
.avatar--sakura { background: var(--sakura-50); }
.side__user .avatar { width: 32px; height: 32px; font-size: 12px; }

/* Aufgaben-Zeile: Kästchen links, daneben eine Hauptzeile (Titel links, Etiketten, Fälligkeit und zuständig rechts)
   und höchstens eine graue Nebenzeile (Kunde, Wiederholung). Notiz und Status-Wort stehen nur noch im Fenster. */
.task { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 0 12px; }
.row--task { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "titel seite" "meta seite"; gap: 0 16px; }
.row--task .row__title { grid-area: titel; }
.row--task .row__meta { grid-area: meta; }
.row--task .row__side { grid-area: seite; gap: 12px; }
.row__tags { display: flex; gap: 4px; }
.task__due { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 4.75rem; }
.task__due.is-heute { color: var(--ink); }
.task__who { min-width: 3.25rem; }
.is-urgent .row__title { font-weight: 700; }
.is-done .task__due { text-decoration: line-through; text-decoration-thickness: 1px; }
/* Schmale Spalten (Übersicht, Überblick des Kunden): Titel über die ganze Breite,
   darunter eine graue Zeile mit Fälligkeit, zuständig und Kunde. Am Handy gilt dasselbe für alle Aufgaben (siehe unten). */
.cols .row--task { grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: none; gap: 0 10px; }
.cols .row--task .row__title { grid-area: auto; grid-column: 1 / -1; }
.cols .row--task :is(.row__meta, .row__side) { display: contents; }
.cols .row--task :is(.row__tags, .task__wdh) { display: none; }
.cols .row--task :is(.task__due, .task__who) { min-width: 0; color: var(--muted); font-size: 14px; line-height: 22px; }
.cols .row--task .task__due.is-heute { color: var(--ink); }
.cols .row--task .task__kunde { overflow: hidden; color: var(--muted); font-size: 14px; line-height: 22px; white-space: nowrap; text-overflow: ellipsis; }
.check { position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin-left: -12px; padding: 0; border: 0; border-radius: var(--r-full); background: none; }
.check:hover { background: var(--ghost-hover); }
.check::before { content: ""; width: 20px; height: 20px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--panel); }
.check:hover::before { border-color: var(--ink); }
/* In Arbeit: Punkt im Kästchen. Erledigt: gefüllt mit Haken. */
.check[data-status="in_arbeit"]::before { border-color: var(--ink); }
.check[data-status="in_arbeit"]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 8px; height: 8px; border-radius: 2px; background: var(--ink); }
.check[data-status="erledigt"]::before { background: var(--ink); border-color: var(--ink); }
.check[data-status="erledigt"]::after { content: ""; position: absolute; inset: 0; margin: auto; width: 11px; height: 11px; background: var(--panel);
  clip-path: polygon(13% 50%, 0 64%, 38% 100%, 100% 22%, 86% 9%, 37% 70%); }

/* Kleine Marken (Pillen). Farbe nur als Pastell. */
.tag { display: inline-flex; align-items: center; min-height: 20px; padding: 2px 8px; border: 0; border-radius: var(--r-full); background: var(--ghost-hover); color: var(--ink);
  font-size: 12px; line-height: 16px; font-weight: 400; white-space: nowrap; }
.tag--tonal, .tag--grey { background: var(--ghost-active); }
.tag--solid { background: var(--blueberry-1000); color: var(--white); }
.tag--blueberry { background: var(--blueberry-50); color: var(--blueberry-1000); }
.tag--plum { background: var(--plum-50); color: var(--plum-1000); }
.tag--mint { background: var(--mint-50); color: var(--mint-1000); }
.tag--peach, .tag--open { background: var(--peach-50); color: var(--peach-1000); }
.tag--mustard { background: var(--mustard-50); color: var(--mustard-1000); }
.tag--sakura { background: var(--sakura-50); color: var(--sakura-1000); }
:root[data-theme="dark"] .tag--solid { background: var(--blueberry-50); color: var(--black); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag--solid { background: var(--blueberry-50); color: var(--black); } }

/* ---------- Filter und Umschalter ---------- */
/* Filterzeile: links die Suche, daneben die Filter, rechts die Anzahl. Keine Beschriftungen darüber.
   Am Handy stehen die Filter hinter dem Knopf „Filter“ (siehe unten bei „Tablet und Handy“). */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.toolbar__filter { display: contents; }
.toolbar__knopf { display: none; min-height: 44px; padding: 9px 14px; font-size: 14px; line-height: 22px; }
.toolbar .text-btn { min-height: 38px; margin-left: 4px; }
/* Zwei schmale Zeilen (Aufgaben): oben Suche, Status und Anzahl, darunter die Auswahlfelder */
.toolbar--zwei .count { order: 1; }
.toolbar--zwei::after { content: ""; order: 1; flex-basis: 100%; height: 0; margin-top: -8px; }
.toolbar--zwei .toolbar__filter > :not(.seg) { order: 2; }
.toolbar--zwei .toolbar__filter > .text-btn { margin-left: 4px; }
/* Auswahl-Pillen: die gewählte ist schwarz */
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-full); background: var(--panel); font-size: 14px; line-height: 22px; white-space: nowrap; }
.seg button:hover { border-color: var(--line-strong); }
.seg button[aria-pressed="true"] { border-color: var(--btn-bg); background: var(--btn-bg); color: var(--btn-fg); }
.search, .select { min-height: 38px; padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--panel); font-size: 16px; line-height: 22px; }
.search { width: min(100%, 14rem); }
.select { max-width: 12rem; font-size: 14px; text-overflow: ellipsis; }
/* Gesetzter Filter: kräftiger Rand und kräftige Schrift */
.select.is-aktiv { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
:is(.search, .select):hover { border-color: var(--muted); }
:is(.search, .select):focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-soft); }
.count { margin-left: auto; color: var(--muted); font-size: 14px; line-height: 22px; align-self: center; }

/* ---------- Formulare ---------- */
.field { display: grid; gap: 4px; margin-bottom: 16px; }
.field label, .field legend { padding: 0; font-size: 14px; line-height: 22px; }
.field .hint { color: var(--muted); }
.field :is(input, textarea, select) { width: 100%; min-height: 48px; padding: 11px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--panel); font-size: 16px; line-height: 24px; }
.field :is(input, textarea, select):hover { border-color: var(--muted); }
.field :is(input, textarea, select):focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-soft); }
.field textarea { min-height: 6.5rem; resize: vertical; }
.field input[type="file"] { padding: 10px; }
fieldset.field { min-width: 0; margin-inline: 0; border: 0; padding: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.inline-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; line-height: 22px; cursor: pointer; }
.inline-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--btn-bg); }
.form-error { margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--late); border-radius: var(--r-sm); background: var(--error-bg); color: var(--late); font-size: 14px; line-height: 22px; }
.form-error:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.form-actions .spacer { flex: 1; }

/* „Mehr Angaben“: Felder, die selten gebraucht werden, klappen erst auf Klick auf */
.mehr { margin-bottom: 8px; border-top: 1px solid var(--line); }
.mehr summary { display: flex; align-items: center; gap: 8px; min-height: 48px; font-size: 14px; line-height: 22px; cursor: pointer; list-style: none; }
.mehr summary::-webkit-details-marker { display: none; }
.mehr summary:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.mehr summary .icon { width: 16px; height: 16px; }
.mehr[open] summary .icon { transform: rotate(90deg); }
.mehr__inhalt { padding-top: 8px; }
/* Dasselbe als Kasten auf der Seite (Eckdaten des Kunden): die Überschrift klappt auf und zu */
.mehr--block { margin-bottom: 0; }
.mehr--block summary { min-height: 32px; }
.mehr--block summary:hover { text-decoration: none; }
.mehr--block .mehr__inhalt { padding-top: 12px; }

/* Auswahl-Kästchen in Fenstern (Zuständig, Status, Ordner): das gewählte ist schwarz */
.tabs { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 6px; }
.tabs label { position: relative; }
.tabs input { position: absolute; opacity: 0; }
.tabs span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding-inline: 6px; border-radius: var(--r-sm); background: var(--ghost-hover); color: var(--muted);
  font-size: 14px; line-height: 20px; text-align: center; cursor: pointer; }
.tabs span:hover { background: var(--ghost-active); color: var(--ink); }
.tabs input:checked + span { background: var(--btn-bg); color: var(--btn-fg); }
.tabs input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Fenster zum Anlegen und Ändern ---------- */
dialog { width: min(100% - 32px, 36rem); max-height: calc(100dvh - 32px); padding: 0; border: 0; border-radius: var(--r-md); background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(5, 5, 5, 0.5); }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 12px 12px 24px; border-bottom: 1px solid var(--line); }
.dialog__head .h3 { font-size: 20px; line-height: 28px; }
.dialog__body { padding: 24px; }
.dialog__body form > p.muted { margin-bottom: 20px; font-size: 14px; line-height: 22px; }
@media (max-width: 760px) {
  dialog { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; }
  .dialog__body { padding: 20px 16px calc(24px + env(safe-area-inset-bottom)); }
  .dialog__head { padding-left: 16px; }
}

/* ---------- Anmeldung: dunkle Karte links, Formular rechts ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 26rem); align-items: stretch; gap: clamp(24px, 5vw, 72px);
  min-height: 100dvh; padding-block: calc(var(--band) + 24px) 24px; }
.auth__intro { display: flex; flex-direction: column; gap: 16px; padding: clamp(24px, 4vw, 48px); border-radius: var(--r-lg); color: var(--white);
  background: #1a1a1a radial-gradient(60% 60% at 60% 70%, #3d3d3d 0%, #2c2c2c 50%, #1a1a1a 100%); }
.auth__intro .logo span { color: var(--grey-300); }
.auth__intro .title { margin-top: auto; font-size: clamp(36px, 22px + 3.6vw, 56px); line-height: 1.04; font-weight: 700; }
.auth__intro .title > span { display: block; color: var(--grey-400); font-weight: 600; }
.auth__intro p { max-width: 36ch; color: var(--grey-300); font-size: 18px; line-height: 28px; }
/* Schwebende Kärtchen: zeigen die vier Bereiche */
.auth__floats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.float { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border-radius: var(--r-sm); background: rgba(255, 255, 255, 0.92); color: var(--black);
  font-size: 14px; line-height: 22px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); }
.float .icon { box-sizing: content-box; width: 16px; height: 16px; padding: 6px; border-radius: var(--r-xs); background: var(--grey-100); }
.auth__card { align-self: center; padding: clamp(24px, 3vw, 32px); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); }
.auth__card h2 { margin-bottom: 20px; font-size: 24px; line-height: 32px; font-weight: 600; }
.auth__card p.muted { margin-bottom: 20px; font-size: 14px; line-height: 22px; }
.auth__card form > .btn + p, .auth__card form > p:last-child { margin: 12px 0 0; }
.auth__steps { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.auth__steps span { padding: 4px 12px; border-radius: var(--r-full); background: var(--ghost-hover); color: var(--muted); font-size: 12px; line-height: 18px; }
.auth__steps span[aria-current="step"] { background: var(--btn-bg); color: var(--btn-fg); }
@media (max-width: 760px) {
  .auth { grid-template-columns: 1fr; align-content: start; gap: 16px; padding-top: calc(var(--band) + 16px); }
  .auth__intro .title { margin-top: 24px; }
  .auth__floats { display: none; }
}

/* ---------- Kalender ---------- */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.cal-bar__title { margin-right: auto; font-size: 20px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-nav .btn { min-height: 38px; padding-block: 6px; font-size: 14px; }
.cal-panel { padding: 0; overflow: hidden; }
.cal-week-head, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-week-head { border-bottom: 1px solid var(--line); }
.cal-week-head span { padding: 10px 12px; color: var(--muted); font-size: 12px; line-height: 16px; }
.cal-day { position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; min-height: 6.5rem; padding: 6px 6px 8px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:nth-last-child(-n + 7) { border-bottom: 0; }
.cal-day.is-other { background: var(--surface); }
.cal-day.is-other .cal-day__n { color: var(--muted); }
.cal-day.is-selected { box-shadow: inset 0 0 0 2px var(--ink); z-index: 1; }
.cal-day__n { align-self: flex-start; display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 4px; border: 0; border-radius: var(--r-full); background: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.cal-day__n:hover { background: var(--ghost-hover); }
.cal-day.is-today .cal-day__n { background: var(--btn-bg); color: var(--btn-fg); font-weight: 600; }
/* Termin: Pastell-Pille. Ganztägig: schwarz. */
.ev { display: block; width: 100%; min-height: 24px; padding: 3px 8px; border: 0; border-radius: 6px; background: var(--event-bg); color: var(--event-fg); font-size: 12px; line-height: 18px; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev:hover { filter: brightness(0.95); }
.ev--allday { background: var(--btn-bg); color: var(--btn-fg); }
.ev__time { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: 4px; }
.ev__who { margin-left: 4px; opacity: 0.7; }
.cal-more { padding: 0 8px; border: 0; background: none; color: var(--muted); font-size: 12px; line-height: 18px; text-align: left; }
.cal-dots { display: none; }

/* Wochenansicht: sieben Kästen, Termine nach Uhrzeit */
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week__day { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: 22rem; padding: 12px 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
.week__head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.week__head b { font-size: 24px; line-height: 32px; font-weight: 600; font-variant-numeric: tabular-nums; }
.week__day.is-today { border-color: var(--ink); }
.week .ev { white-space: normal; padding: 6px 8px; font-size: 14px; line-height: 20px; }
.week .ev__time { display: block; margin: 0 0 2px; font-size: 12px; line-height: 16px; }
.week__add { margin-top: auto; align-self: flex-start; min-height: 32px; padding: 0 10px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: none; color: var(--muted); font-size: 12px; }
.week__add:hover { border-color: var(--ink); color: var(--ink); }

@media (max-width: 900px) {
  .cal-day { min-height: 4.75rem; padding: 4px 3px; cursor: pointer; }
  .cal-day .ev, .cal-more { display: none; }
  .cal-dots { display: flex; flex-wrap: wrap; gap: 3px; padding-inline: 6px; }
  .cal-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--focus); }
  .cal-week-head span { padding-inline: 6px; }
  .week { grid-template-columns: 1fr; }
  .week__day { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 6px 8px; padding: 12px; }
  .week__head { flex: 0 0 4.5rem; flex-direction: column; gap: 0; padding: 0; margin: 0; border: 0; }
  .week__events { flex: 1 1 0; min-width: 0; display: grid; gap: 6px; }
  .week__add { margin-top: 0; }
}
@media (min-width: 901px) { .week__events { display: grid; gap: 6px; } }

/* ---------- Dateien ---------- */
.table { width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); border-collapse: separate; border-spacing: 0; background: var(--panel); font-size: 16px; overflow: hidden; }
.table th { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 400; text-align: left; white-space: nowrap; }
.table td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.table tr:last-child td { border-bottom: 0; }
.table :is(th, td):first-child { padding-left: 24px; }
.table td:last-child, .table th:last-child { padding-right: 16px; text-align: right; white-space: nowrap; }
.table td.col-folder, .table td.col-size, .table td.col-meta { color: var(--muted); font-size: 14px; }
.table .file-name { overflow-wrap: anywhere; }
.table .file-name .text-btn { min-height: 32px; font-size: 16px; font-weight: 600; text-decoration: none; }
.table .file-name .text-btn:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.25em; }
.table .file-name small { display: block; color: var(--muted); font-size: 14px; line-height: 22px; }
.table .file-name small .is-late { display: inline-flex; margin-left: 8px; padding: 1px 8px; border-radius: var(--r-full); background: var(--peach-50); color: var(--peach-1000); font-size: 12px; line-height: 16px; font-weight: 400; }
@media (max-width: 760px) {
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; }
  .table { padding: 4px 16px; }
  /* Datei am Handy: links Name und Datum, rechts daneben die beiden Knöpfe */
  .table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding-block: 10px; border-bottom: 1px solid var(--line); }
  .table tr:last-child { border-bottom: 0; }
  .table td, .table :is(th, td):first-child { padding: 0; border: 0; }
  .table td.col-name { grid-column: 1; }
  .table td.col-folder, .table td.col-size { display: none; }
  .table td:last-child { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-right: -10px; padding: 0; }
}

/* ---------- Kunden ---------- */
.link { text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 1px; text-decoration-color: var(--line-strong); }
.link:hover { text-decoration-color: currentColor; }
button.link { padding: 0; border: 0; background: none; text-align: left; }
.note-band .link { text-decoration-color: currentColor; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.back { margin-bottom: -16px; }
.back .text-btn { color: var(--muted); }
.back .text-btn:hover { color: var(--ink); }
.tag-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag-line .tag { white-space: normal; }

/* Kopf der Kundenseite: Name und Stand, darunter das Wichtigste zum Anklicken */
.kunde-titel { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.kontakt { display: flex; flex-wrap: wrap; gap: 0 16px; font-size: 14px; line-height: 22px; }
.kontakt .link { color: var(--ink); }

/* Reiter der Kundenseite: eine Zeile, der gewählte hat einen schwarzen Strich. Am Handy seitlich zu schieben. */
.reiter { position: relative; display: flex; gap: 4px; margin-top: -8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.reiter::-webkit-scrollbar { display: none; }
.reiter a { position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 44px; padding: 10px 12px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  color: var(--muted); white-space: nowrap; }
.reiter a:hover { background: var(--surface); color: var(--ink); }
.reiter a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.reiter a[aria-current="page"]::after { content: ""; position: absolute; inset: auto 12px 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--ink); }
.reiter a:focus-visible { outline-offset: -2px; }
.reiter-inhalt { display: grid; gap: 16px; align-content: start; }
.reiter-inhalt > * { min-width: 0; }
.tag--inline { margin-left: 8px; vertical-align: 2px; }
.tag--x { gap: 2px; min-height: 30px; padding-inline: 10px; background: var(--ghost-hover); cursor: pointer; }
.tag--x:hover { background: var(--ghost-active); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }

/* Eckdaten und Zahlen: Begriff klein, Wert darunter */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px clamp(24px, 3.5vw, 48px); margin: 0; padding-block: 4px 8px; }
.fact dt { color: var(--muted); font-size: 14px; line-height: 22px; }
.fact dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.fact__gross { font-size: 28px; line-height: 36px; font-weight: 600; }
.facts--zwei { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.facts + .rows { margin-top: 8px; border-top: 1px solid var(--line); }
.plan-line, .more-line { padding-top: 12px; }
.note-line { margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--notice-bg); color: var(--notice-fg); }
.note-box p + p { margin-top: 8px; max-width: 70ch; }
.note-text { padding-block: 4px 0; max-width: 75ch; }
/* „Geplant (intern)“: eigener Pastell-Kasten, damit klar ist, dass der Kunde das nicht weiß */
.intern-box { border-color: transparent; background: var(--intern-bg); color: var(--intern-fg); }
.intern-box .muted { color: inherit; opacity: 0.75; }
.intern-box .text-btn { color: inherit; text-decoration-color: currentColor; }
.is-faded { opacity: 0.55; }
.file-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.time-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; }
.field textarea.low { min-height: 4.25rem; }
.row__side--keep { flex-wrap: wrap; justify-content: flex-end; gap: 6px 12px; }

/* Aufgaben markieren: Priorität als Punkt, Etiketten als Pillen */
.prio { display: inline-block; width: 8px; height: 8px; margin-right: 8px; border: 1.5px solid var(--late); border-radius: 50%; vertical-align: 2px; }
.prio--voll { background: var(--late); }
.tabs--2 { --n: 2; }
.tabs--4 { --n: 4; }
.tabs--5 { --n: 5; }

/* ---------- Kundenportal: Fenster zu einem Beleg oder einer Nachricht ---------- */
.eingang-filter { margin-bottom: 4px; }
.einspiel-titel { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.beleg { display: grid; gap: 20px; }
.beleg > * { min-width: 0; }
.beleg .field, .beleg .form-error { margin-bottom: 0; }
.beleg__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; color: var(--muted); font-size: 14px; line-height: 22px; }
.beleg__label { margin-bottom: 6px; color: var(--muted); font-size: 14px; line-height: 22px; font-weight: 400; }
/* Seiten eines Belegs: kleine Vorschau, darunter Name und zwei Knöpfe */
.seiten { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 16px 12px; }
.seite { display: grid; align-content: start; gap: 4px; min-width: 0; }
.seite__bild { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--muted); font-size: 14px; line-height: 22px; }
.seite__bild:hover { border-color: var(--line-strong); }
.seite__bild img { width: 100%; height: 100%; object-fit: cover; }
.seite__name { font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.seite__knoepfe { display: flex; flex-wrap: wrap; gap: 0 12px; }
.seite__knoepfe .text-btn { min-height: 32px; font-size: 14px; line-height: 22px; }
/* Gespräch: Kunde links, wir rechts */
.gespraech { display: grid; gap: 8px; }
.gespraech li { justify-self: start; max-width: min(100%, 32rem); padding: 8px 12px; border-radius: var(--r-sm); background: var(--surface); }
.gespraech li.von-team { justify-self: end; background: var(--notice-bg); color: var(--notice-fg); }
.gespraech small { display: block; color: var(--muted); font-size: 12px; line-height: 18px; }
.gespraech .von-team small { color: inherit; opacity: 0.75; }

/* ---------- Kurze Meldung unten ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar) + 24px); z-index: 80; max-width: min(100% - 32px, 30rem); padding: 12px 16px; border-radius: var(--r-sm);
  background: var(--btn-bg); color: var(--btn-fg); font-size: 14px; line-height: 22px; transform: translateX(-50%); }
@media (min-width: 1024px) { .toast { left: calc(50% + var(--side) / 2); } }

/* ---------- Tablet und Handy ---------- */
@media (max-width: 1200px) {
  .cols { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
  /* Reiter bis an den Rand, damit das Schieben natürlich aussieht */
  .reiter { margin-inline: calc(-1 * var(--pad)); padding-inline: calc(var(--pad) - 12px); }
}
@media (max-width: 760px) {
  .stats, .stats--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 12px 16px; }
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .title { font-size: 24px; line-height: 32px; }
  .field-row { grid-template-columns: 1fr; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

  /* Filter: Suche und der Knopf „Filter“. Die Auswahl klappt darunter auf. */
  .toolbar .search { flex: 1 1 8rem; width: auto; min-height: 44px; }
  .toolbar__knopf { display: inline-flex; }
  .toolbar__filter { display: none; flex-basis: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); }
  .toolbar.is-offen .toolbar__filter { display: grid; }
  .toolbar__filter > :is(.seg, .text-btn) { grid-column: 1 / -1; }
  .toolbar__filter .select { width: 100%; max-width: none; min-height: 44px; }
  .toolbar--zwei::after { display: none; }
  .count { flex-basis: 100%; margin-left: 0; }

  /* Aufgabe am Handy: Titel, darunter eine Zeile mit Fälligkeit, zuständig und Kunde */
  .row--task { grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: none; gap: 0 10px; }
  .row--task .row__title { grid-area: auto; grid-column: 1 / -1; }
  .row--task :is(.row__meta, .row__side) { display: contents; }
  .row--task :is(.row__tags, .task__wdh) { display: none; }
  .row--task :is(.task__due, .task__who) { min-width: 0; color: var(--muted); font-size: 14px; line-height: 22px; }
  .row--task .task__due.is-heute { color: var(--ink); }
  .row--task .task__kunde { overflow: hidden; color: var(--muted); font-size: 14px; line-height: 22px; white-space: nowrap; text-overflow: ellipsis; }
  .row--stack { grid-template-columns: minmax(0, 1fr); }
  .row--stack.row--avatar { grid-template-columns: 40px minmax(0, 1fr); }
  .row--stack.row--avatar .row__side { grid-column: 2; }
  .row--stack .row__side { justify-content: flex-start; }
  .tabs--4 { --n: 2; }
  .page-head__actions .btn { min-height: 44px; padding: 9px 14px; }
}

/* ---------- Bewegung (nur wenn erwünscht): kurz, leise, immer mit Auslöser ---------- */
@media (prefers-reduced-motion: no-preference) {
  .btn, .icon-btn, .seg button, .tabs span, .ev, .check, .check::before, .side__nav a, .side__btn, .row, .stat, .reiter a, .tag--x, .search, .select, .field :is(input, textarea, select), .cal-day__n, .week__add
    { transition: background-color 150ms var(--ease), color 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease), transform 250ms var(--ease-out); }
  .text-btn, .link { transition: text-decoration-color 150ms var(--ease), color 150ms var(--ease); }

  .mehr summary .icon { transition: transform 150ms var(--ease); }

  /* Pfeil-Wechsel */
  :is(a, button):hover > .arrow::before { animation: arrow-exit 300ms var(--ease-arrow) forwards; }
  :is(a, button):hover > .arrow::after { animation: arrow-enter 300ms var(--ease-arrow) 150ms forwards; }
  /* Klick-Puls auf Textlinks und runden Knöpfen */
  .text-btn:active, .icon-btn:active { animation: click-pulse 300ms var(--ease-arrow); }

  /* Einblenden: nur beim Wechsel der Seite (Klasse view--neu setzt app.js), nacheinander */
  .view--neu > * { animation: fade-up 500ms ease-out backwards; }
  .view--neu > :nth-child(2) { animation-delay: 80ms; }
  .view--neu > :nth-child(3) { animation-delay: 160ms; }
  .view--neu > :nth-child(4) { animation-delay: 240ms; }
  .view--neu > :nth-child(5) { animation-delay: 320ms; }
  .view--neu > :nth-child(n + 6) { animation-delay: 400ms; }
  /* Wechsel des Reiters auf der Kundenseite: nur der Inhalt darunter blendet ein */
  .reiter-inhalt--neu > * { animation: fade-up 500ms ease-out backwards; }
  .reiter-inhalt--neu > :nth-child(2) { animation-delay: 80ms; }
  .reiter-inhalt--neu > :nth-child(n + 3) { animation-delay: 160ms; }
  .auth__intro, .auth__card { animation: fade-up 500ms ease-out backwards; }
  .auth__card { animation-delay: 100ms; }
  .auth__floats .float { animation: fade-up 500ms ease-out backwards; animation-delay: 300ms; }
  .auth__floats .float:nth-child(2) { animation-delay: 400ms; }
  .auth__floats .float:nth-child(3) { animation-delay: 500ms; }
  .auth__floats .float:nth-child(4) { animation-delay: 600ms; }

  /* Haken ploppt auf, wenn eine Aufgabe gerade erledigt wurde */
  .is-fresh .check[data-status="erledigt"]::before { animation: check-pop 500ms backwards; }
  .is-fresh .check[data-status="erledigt"]::after { animation: fade 200ms ease-out 200ms backwards; }

  /* Fenster erscheint, Hintergrund blendet ein */
  dialog[open] { animation: card-appear 300ms var(--ease-out) both; }
  dialog::backdrop { animation: fade 300ms ease-out; }
  /* Meldung fällt von unten herein und federt leicht */
  .toast { animation: toast 400ms var(--ease-spring) both; }
}
@keyframes fade { from { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(20px); } }
@keyframes card-appear { from { opacity: 0; transform: translateY(30px); } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 200%); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes arrow-exit { to { transform: translate(18px, -18px); } }
@keyframes arrow-enter { to { transform: translate(0, 0); } }
@keyframes click-pulse { 50% { transform: scale(0.9); } }
@keyframes check-pop {
  0% { transform: scale(0); animation-timing-function: cubic-bezier(0.3, 0.9, 0.4, 1); }
  50% { transform: scale(1.2); animation-timing-function: cubic-bezier(0.36, 0.13, 0.36, 1); }
  100% { transform: scale(1); }
}

@media print { .side, .header, .tabbar, .demo-band { display: none !important; } .main { margin-left: 0; padding-top: 0; } }
