/* ==========================================================================
   Aufgaben Bockler – Stylesheet
   Hell, ruhig, große Tippflächen — gleiche Familie wie die Zeiterfassung.
   Agenturrot ist Aktion, nie Dekoration; „überfällig" hat sein eigenes Rot.
   Erkennungsmerkmal: die Wiedervorlage-Mappe — Datums-Reiter an jeder Karte
   und die Wochenleiste über der eigenen Liste.
   Die Akzentfarbe kommt als --accent aus den Einstellungen (siehe layout.php).
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --accent: #e2001a;
  --accent-weich: #fdeef0;
  --accent-tief: #b8001a;

  --bg: #f6f9fd;
  --card: #ffffff;
  --card-2: #f4f7fb;
  --text: #0d1b30;
  --muted: #51607a;
  --line: #e4e9f1;
  --line-stark: #cfd7e3;
  --navy-deep: #081831;

  --good: #15803d;   --good-weich: #e8f6ed;
  --warn: #b45309;   --warn-weich: #fdf3e2;
  --bad: #b91c1c;    --bad-weich: #fdecec;
  --info: #1d4ed8;   --info-weich: #eaf1fe;

  --radius: 16px;
  --radius-klein: 10px;
  --schatten: 0 1px 2px rgba(13, 27, 48, .04), 0 8px 24px -14px rgba(13, 27, 48, .14);
  --schatten-hoch: 0 2px 4px rgba(13, 27, 48, .05), 0 18px 40px -16px rgba(13, 27, 48, .22);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent-weich: #3a1519;
    --accent-tief: #ff4d5e;
    --bg: #0c1220;
    --card: #131b2c;
    --card-2: #182236;
    --text: #eaf0f8;
    --muted: #97a4b8;
    --line: #223050;
    --line-stark: #33446a;
    --good: #4ade80;   --good-weich: #0f2a1c;
    --warn: #fbbf24;   --warn-weich: #2e2210;
    --bad: #f87171;    --bad-weich: #331616;
    --info: #60a5fa;   --info-weich: #14233d;
    --schatten: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
    --schatten-hoch: 0 2px 4px rgba(0,0,0,.5), 0 18px 40px -16px rgba(0,0,0,.8);
  }
}

/* ---- Grundlagen -------------------------------------------------------- */

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: 0 0 .25rem; text-wrap: balance; overflow-wrap: anywhere; }
h2 { font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; margin: 0 0 .75rem; }
p  { margin: 0 0 .75rem; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code { font-family: var(--mono); font-size: .9em; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
[hidden] { display: none !important; }

.muted { color: var(--muted); }
.klein { font-size: .82rem; }
.rechts { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }
.inaktiv td { opacity: .5; }
.icon { width: 1.25em; height: 1.25em; flex-shrink: 0; vertical-align: -.25em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* ---- Kopfleiste (Wortmarke Weiß auf Navy-Deep) ------------------------- */

.topbar { position: sticky; top: 0; z-index: 30; background: var(--navy-deep); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: .7rem 1.25rem; display: flex; align-items: center; gap: 1.25rem; }
.brand { display: flex; align-items: center; gap: .65rem; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 142px; height: auto; display: block; }
.brand-tool {
  color: rgba(255, 255, 255, .65); font-size: .82rem; font-weight: 500;
  padding-left: .8rem; border-left: 1px solid rgba(255, 255, 255, .22);
}

.mainnav { display: flex; align-items: center; gap: .15rem; }
.mainnav a {
  padding: .5rem .85rem; border-radius: 999px; color: rgba(255, 255, 255, .72); font-weight: 500;
  font-size: .92rem; transition: background .15s, color .15s;
}
.mainnav a:hover { background: rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.mainnav a.active { background: rgba(255, 255, 255, .14); color: #fff; }

.badge {
  display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; padding: 0 .35rem;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 700;
  vertical-align: 1px; margin-left: .2rem; font-variant-numeric: tabular-nums;
}
.badge-ruhig { background: rgba(255, 255, 255, .2); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .9rem; }
.cockpit-link { color: rgba(255, 255, 255, .72); font-size: .88rem; border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; padding: .3rem .7rem; }
.cockpit-link:hover { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .1); }
.userbox { display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.topbar a.username { color: rgba(255, 255, 255, .72); font-weight: 500; }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.linklike:hover { text-decoration: underline; }
.topbar .linklike { color: rgba(255, 255, 255, .85); }

/* ---- Inhalt ------------------------------------------------------------ */

.container { max-width: 760px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.container-breit { max-width: 1040px; }
.container-bare { max-width: 480px; padding-top: 3rem; }

.seitenkopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.seitenkopf h1 { margin: 0; }
.seitenkopf .muted { margin: .15rem 0 0; }
.zurueck { margin: 0 0 .5rem; font-size: .9rem; }
.zurueck a { color: var(--muted); }
.aktionsleiste { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }

.unternav { display: flex; gap: .35rem; flex-wrap: wrap; margin: 0 0 1.25rem; }
.unternav a {
  padding: .45rem .95rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line);
  color: var(--muted); font-size: .88rem; font-weight: 500;
}
.unternav a:hover { text-decoration: none; color: var(--text); }
.unternav a.active { background: var(--text); border-color: var(--text); color: var(--card); }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 1.25rem 1.35rem; margin-bottom: 1rem;
}
.form-card { max-width: 720px; }
.card > h2:first-child { margin-top: 0; }
.card h2 + p.muted { margin-top: -.4rem; }
/* Trennlinie nur ZWISCHEN Abschnitten — nicht über dem ersten (davor steht oft nur das versteckte CSRF-Feld) */
.form-card h2 ~ h2 { margin-top: 1.75rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.karten-paar { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.leer {
  text-align: center; padding: 2.5rem 1.25rem; border: 1px dashed var(--line-stark);
  border-radius: var(--radius); background: var(--card);
}
.leer p { margin-bottom: .4rem; }
.leer .btn { margin-top: .75rem; }

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

.flash {
  padding: .8rem 1rem; border-radius: var(--radius-klein); margin-bottom: 1rem;
  font-size: .92rem; font-weight: 500; border: 1px solid; display: flex; gap: .6rem; align-items: flex-start;
}
.flash::before { font-weight: 700; flex-shrink: 0; }
.flash-ok     { background: var(--good-weich); border-color: color-mix(in srgb, var(--good) 35%, transparent); color: var(--good); }
.flash-ok::before { content: "✓"; }
.flash-fehler { background: var(--bad-weich);  border-color: color-mix(in srgb, var(--bad) 35%, transparent);  color: var(--bad); }
.flash-fehler::before { content: "!"; }
.flash-warn   { background: var(--warn-weich); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.flash-warn::before { content: "!"; }
.flash-aktion { align-items: center; }
.flash-aktion .linklike { margin-left: auto; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: .2rem .4rem; }

.hinweis {
  background: var(--info-weich); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
  color: var(--text); border-radius: var(--radius-klein); padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem;
}
.hinweis-warn { background: var(--warn-weich); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }

/* ---- Buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .65rem 1.1rem; min-height: 2.75rem; border-radius: 999px; border: 1px solid var(--line-stark);
  background: var(--card); color: var(--text); font: inherit; font-size: .94rem; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: transform .08s, box-shadow .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; background: var(--card-2); }
.btn:active { transform: translateY(1px); }
.btn-accent {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--accent) 70%, transparent);
}
.btn-accent:hover { background: var(--accent-tief); border-color: var(--accent-tief); }
.btn-gefahr { border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }
.btn-gefahr:hover { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-block { width: 100%; }
.btn-klein { padding: .4rem .85rem; min-height: 2.25rem; font-size: .86rem; }
.btn-gross { min-height: 3.25rem; font-size: 1.02rem; }
.wartet-auf-antwort { opacity: .6; pointer-events: none; cursor: progress; }

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

.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.field-hint { font-size: .8rem; color: var(--muted); font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"],
input[type="date"], input[type="time"], input[type="url"], select, textarea {
  font: inherit; font-size: 1rem; color: var(--text);
  background: var(--card); border: 1px solid var(--line-stark); border-radius: var(--radius-klein);
  padding: .7rem .8rem; width: 100%; min-height: 2.9rem; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}
::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input[type="color"] { padding: .25rem; height: 2.9rem; }
.feld-schmal { max-width: 14rem; }
.check { display: flex; align-items: flex-start; gap: .6rem; margin: .5rem 0 .9rem; font-size: .95rem; cursor: pointer; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .1rem; flex-shrink: 0; accent-color: var(--accent); }
.feldpaar { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.zeile-form { display: flex; gap: .5rem; align-items: center; }
.zeile-form input { flex: 1; min-width: 0; }
.code {
  display: block; padding: .6rem .8rem; background: var(--navy-deep); color: #fff;
  border-radius: var(--radius-klein); font-family: var(--mono); font-size: .8rem; word-break: break-all; margin-bottom: .75rem;
}

/* Auswahl-Chips (Wer? Bis wann? Worauf?) — echte Radio-Felder, als Tasten gezeichnet */
.wahl { margin-bottom: 1.15rem; }
.wahl-kopf { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .45rem; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip > span {
  display: inline-flex; flex-direction: column; justify-content: center; min-height: 2.9rem;
  padding: .4rem 1rem; border: 1px solid var(--line-stark); border-radius: 14px; background: var(--card);
  font-weight: 600; font-size: .95rem; line-height: 1.2; transition: background .12s, border-color .12s, color .12s;
}
.chip small { font-size: .68rem; font-weight: 500; color: var(--muted); }
.chip input:checked + span { background: var(--text); border-color: var(--text); color: var(--card); }
.chip input:checked + span small { color: color-mix(in srgb, var(--card) 70%, transparent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }
.chip-pool > span { border-style: dashed; }
.chip-abwesend small { color: var(--warn); }
.datum-feld { display: none; margin-top: .6rem; max-width: 16rem; }
.wahl-faellig:has(input[value="datum"]:checked) .datum-feld,
.wahl-faellig.zeigt-datum .datum-feld { display: block; }

/* ---- Login ------------------------------------------------------------- */

body.ist-bare { background: var(--navy-deep); }
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem; background: var(--navy-deep); }
.login-stage { width: 100%; max-width: 400px; }
.login-logo-oevo { width: 244px; height: auto; display: block; margin: 0 auto 2rem; }
.login-card {
  width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: 24px; box-shadow: var(--schatten-hoch); padding: 2rem 1.75rem 1.75rem;
}
.login-brand { text-align: center; margin-bottom: 1.5rem; }
.login-brand h1 { font-size: 1.35rem; margin: .25rem 0 0; }
.login-brand .muted { font-size: .88rem; margin: .4rem 0 0; }
.qr-wrap { display: flex; justify-content: center; margin: .75rem 0; }
.qr-wrap svg { width: 200px; height: 200px; border-radius: 12px; }
.setup-secret {
  font-family: var(--mono); font-size: .95rem; letter-spacing: .06em; background: var(--card-2);
  padding: .65rem .8rem; border-radius: var(--radius-klein); word-break: break-all;
}
.setup-steps { padding-left: 1.2rem; }
.setup-steps li { margin-bottom: .55rem; }
.code-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: .5rem; margin: 1rem 0; }
.code-raster code { display: block; text-align: center; }

/* ==========================================================================
   Signatur 1: die Wochenleiste
   Fünf Werktage als Reiter einer Wiedervorlage-Mappe, links „überfällig",
   rechts „später". Die Zahl sagt, was an dem Tag fällig wird; der heutige
   Reiter steht vor. Die Grundlinie ist die Kante der Mappe.
   ========================================================================== */

.woche {
  display: grid; grid-template-columns: 1.5fr repeat(5, 1fr) 1.15fr; gap: 3px; align-items: end;
  margin: 0 0 1.5rem; padding: 6px 0 0; border-bottom: 2px solid var(--text);
}
.woche-reiter {
  display: flex; flex-direction: column; align-items: center; gap: .05rem; min-width: 0;
  padding: .45rem .15rem .4rem; border: 1px solid var(--line-stark); border-bottom: 0;
  border-radius: 10px 10px 0 0; background: var(--card); color: var(--text);
}
.woche-reiter:hover { text-decoration: none; background: var(--card-2); }
.wr-kopf { font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.wr-tag { font-weight: 500; letter-spacing: 0; }
.wr-zahl { font-size: 1.3rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.woche-reiter.ist-leer .wr-zahl { color: var(--line-stark); font-weight: 500; }
.woche-reiter.ist-vorbei { background: var(--card-2); }
.woche-reiter.ist-vorbei .wr-kopf { opacity: .7; }
.woche-reiter.ist-heute {
  background: var(--text); border-color: var(--text); color: var(--card);
  padding-top: .7rem; margin-top: -6px;
}
.woche-reiter.ist-heute .wr-kopf { color: color-mix(in srgb, var(--card) 72%, transparent); }
.woche-reiter.ist-heute.ist-leer .wr-zahl { color: color-mix(in srgb, var(--card) 45%, transparent); }
.woche-reiter.ist-ueber:not(.ist-leer) { background: var(--bad-weich); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.woche-reiter.ist-ueber:not(.ist-leer) .wr-kopf,
.woche-reiter.ist-ueber:not(.ist-leer) .wr-zahl { color: var(--bad); }

/* ==========================================================================
   Signatur 2: die Aufgabenkarte mit Datums-Reiter
   ========================================================================== */

.abschnitt { margin-bottom: 1.5rem; scroll-margin-top: 4.5rem; }
.abschnitt-kopf {
  display: flex; align-items: baseline; gap: .5rem; margin: 0 0 .55rem;
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.anzahl { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--muted); opacity: .75; letter-spacing: 0; }
.abschnitt.ist-ueberfaellig .abschnitt-kopf { color: var(--bad); }

.karte {
  display: grid; grid-template-columns: 3.2rem minmax(0, 1fr) auto; align-items: stretch;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-klein);
  box-shadow: var(--schatten); margin-bottom: .5rem; overflow: hidden; scroll-margin-top: 4.5rem;
}
.reiter {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .05rem;
  padding: .55rem .15rem; background: var(--card-2); border-right: 1px solid var(--line); color: var(--muted);
}
.reiter:hover { text-decoration: none; }
.reiter-wt { font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.reiter-tag { font-size: 1.02rem; font-weight: 700; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.reiter-haken { color: var(--good); display: grid; place-items: center; font-weight: 700; }
.karte.ist-ueberfaellig .reiter { background: var(--bad-weich); border-right-color: color-mix(in srgb, var(--bad) 30%, transparent); color: var(--bad); }
.karte.ist-ueberfaellig .reiter-tag { color: var(--bad); }
.karte.ist-heute .reiter { background: var(--text); border-right-color: var(--text); color: color-mix(in srgb, var(--card) 72%, transparent); }
.karte.ist-heute .reiter-tag { color: var(--card); }
.karte.ist-wartet .reiter { background: repeating-linear-gradient(135deg, var(--card-2) 0 6px, var(--card) 6px 12px); }
.karte.ist-wartet .karte-titel,
.karte.ist-abgebrochen .karte-titel { color: var(--muted); }
.karte.ist-abgebrochen .karte-titel { text-decoration: line-through; }
.karte.ist-abgebrochen .reiter-haken { color: var(--muted); }

.karte-text { display: flex; flex-direction: column; justify-content: center; gap: .2rem; padding: .7rem .85rem; color: var(--text); min-width: 0; }
.karte-text:hover { text-decoration: none; }
.karte-titel { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.karte-meta { font-size: .8rem; color: var(--muted); line-height: 1.35; }
.punkt-trenner { opacity: .5; }
.meta-ueber { color: var(--bad); font-weight: 600; }
.meta-abnahme { color: var(--info); font-weight: 600; }
.wichtig-marke {
  display: inline-grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: .74rem; font-weight: 800; margin-right: .15rem; vertical-align: .08em;
}
.schloss { color: var(--muted); }
.schloss .icon { width: .95em; height: .95em; vertical-align: -.1em; }

.pille {
  display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line); color: var(--muted);
  font-size: .7rem; font-weight: 700; letter-spacing: .02em; white-space: nowrap; vertical-align: .1em;
}
.pille .icon { width: .95em; height: .95em; }
.pille-neu { background: var(--accent); border-color: var(--accent); color: #fff; margin-right: .2rem; }
.pille-wichtig { background: var(--accent-weich); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.pille-abwesend { background: var(--warn-weich); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }

.karte-aktion { display: flex; align-items: center; padding: 0 .65rem 0 .15rem; }
.haken {
  display: grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border-radius: 50%;
  border: 2px solid var(--line-stark); background: var(--card); color: transparent; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s, transform .08s; -webkit-tap-highlight-color: transparent;
}
.haken .icon { width: 1.4rem; height: 1.4rem; }
.haken:hover, .haken:focus-visible { border-color: var(--good); background: var(--good-weich); color: var(--good); text-decoration: none; }
.haken:active { transform: scale(.94); }
.karte-pfeil { color: var(--line-stark); padding-right: .5rem; }
.btn-nehmen { border-color: var(--text); white-space: nowrap; }
.btn-nehmen:hover { background: var(--text); color: var(--card); }
.btn-zuweisen { white-space: nowrap; color: var(--muted); }
.karte-aktion:has(.btn-nehmen) { gap: .4rem; }
.zuweisen-chips { margin-bottom: 1rem; }

/* ---- Neue Aufgabe ------------------------------------------------------ */

.neu-titel { display: block; margin-bottom: 1.15rem; }
.neu-titel input { font-size: 1.1rem; font-weight: 600; min-height: 3.4rem; }
.mehr-angaben { border-top: 1px solid var(--line); margin: .25rem 0 1rem; }
.mehr-angaben > summary, .aktion > summary {
  display: flex; align-items: baseline; gap: .6rem; flex-wrap: wrap; cursor: pointer; list-style: none;
  padding: .9rem 0; font-weight: 600; -webkit-tap-highlight-color: transparent;
}
.mehr-angaben > summary::-webkit-details-marker, .aktion > summary::-webkit-details-marker { display: none; }
.mehr-angaben > summary::before, .aktion > summary::before { content: "＋"; color: var(--muted); font-weight: 400; width: 1rem; }
.mehr-angaben[open] > summary::before, .aktion[open] > summary::before { content: "–"; }
.neu-fuss .check { justify-content: center; margin: .9rem 0 0; color: var(--muted); }
.vorlagen-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 1rem; }
.chip-link {
  padding: .3rem .75rem; border: 1px solid var(--line-stark); border-radius: 999px; background: var(--card);
  color: var(--text); font-size: .84rem; font-weight: 500;
}
.chip-link:hover { text-decoration: none; background: var(--card-2); }

/* ---- Eine Aufgabe ------------------------------------------------------ */

.aufgabe-kopf { margin-bottom: 1.1rem; }
.aufgabe-marken { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .6rem; }
.status-pille {
  display: inline-flex; align-items: center; padding: .2rem .7rem; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line-stark); font-size: .78rem; font-weight: 700;
}
.aufgabe.ist-ueberfaellig .status-pille { background: var(--bad-weich); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.aufgabe.ist-heute .status-pille { background: var(--text); border-color: var(--text); color: var(--card); }
.aufgabe.ist-erledigt .status-pille { background: var(--good-weich); border-color: color-mix(in srgb, var(--good) 40%, transparent); color: var(--good); }
.aufgabe.ist-zur_abnahme .status-pille { background: var(--info-weich); border-color: color-mix(in srgb, var(--info) 40%, transparent); color: var(--info); }

.aufgabe-fakten { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: .9rem 0 0; }
.aufgabe-fakten dt { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.aufgabe-fakten dd { margin: .1rem 0 0; font-weight: 600; font-size: .95rem; }
.aufgabe-text {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-klein);
  padding: .9rem 1rem; margin-bottom: 1rem; overflow-wrap: anywhere;
}
.ergebnis {
  background: var(--info-weich); border: 1px solid color-mix(in srgb, var(--info) 30%, transparent);
  border-radius: var(--radius-klein); padding: .9rem 1rem; margin-bottom: 1rem; overflow-wrap: anywhere;
}
.ergebnis-kopf { display: block; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--info); margin-bottom: .25rem; }

.hauptaktion { display: grid; gap: .6rem; margin-bottom: 1.5rem; scroll-margin-top: 5rem; }
.hauptaktion p { margin: 0; text-align: center; }

.block { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1rem; scroll-margin-top: 4.5rem; }
.block > h2 { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }

.aktionen { padding-bottom: .25rem; }
.aktion { border-top: 1px solid var(--line); }
.aktion:first-of-type { border-top: 0; }
.aktion > form { padding: 0 0 1rem; }
.aktion-zeile { padding: .25rem 0 .9rem; }
.aktion-gefahr > summary { color: var(--bad); }
.hauptaktion .aktion { border: 0; }
.hauptaktion .aktion > summary { justify-content: center; color: var(--muted); padding: .4rem 0; }

.checkliste { list-style: none; margin: 0 0 .75rem; padding: 0; }
.checkliste li { display: flex; align-items: center; gap: .25rem; border-bottom: 1px solid var(--line); }
.checkliste li:last-child { border-bottom: 0; }
.checkliste li > form:first-child { flex: 1; min-width: 0; }
.punkt-knopf {
  display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 2.9rem; padding: .4rem 0;
  background: none; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.punkt-knopf:disabled { cursor: default; }
.punkt-box {
  display: grid; place-items: center; width: 1.5rem; height: 1.5rem; flex-shrink: 0;
  border: 2px solid var(--line-stark); border-radius: 7px; color: #fff;
}
.punkt-box .icon { width: 1rem; height: 1rem; stroke-width: 2.6; }
.ist-erledigt .punkt-box { background: var(--good); border-color: var(--good); }
.ist-erledigt .punkt-text { color: var(--muted); text-decoration: line-through; }
.punkt-text { overflow-wrap: anywhere; }
.punkt-weg { background: none; border: 0; color: var(--muted); font-size: 1.25rem; line-height: 1; width: 2.5rem; height: 2.5rem; cursor: pointer; border-radius: 50%; }
.punkt-weg:hover { background: var(--bad-weich); color: var(--bad); }

.verlauf { list-style: none; margin: 0 0 1rem; padding: 0; }
.verlauf li { padding: .5rem 0 .5rem .9rem; border-left: 2px solid var(--line); font-size: .88rem; }
.verlauf-kopf { color: var(--muted); }
.verlauf-kopf strong { color: var(--text); }
.verlauf-kopf time { font-size: .78rem; white-space: nowrap; margin-left: .25rem; }
.verlauf-text { margin-top: .15rem; overflow-wrap: anywhere; }
.verlauf li.ist-kommentar { border-left-color: var(--text); }
.verlauf li.ist-kommentar .verlauf-text {
  background: var(--card-2); border-radius: 4px var(--radius-klein) var(--radius-klein) var(--radius-klein);
  padding: .55rem .75rem; margin-top: .3rem; font-size: .95rem;
}
.verlauf li.verlauf-verschoben, .verlauf li.verlauf-abnahme_zurueck { border-left-color: var(--warn); }
.verlauf li.verlauf-erledigt, .verlauf li.verlauf-abnahme_ok { border-left-color: var(--good); }
.kommentar-form .field { margin-bottom: .6rem; }

/* ---- Team -------------------------------------------------------------- */

.team { display: grid; gap: .6rem; }
.team-karte {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: .95rem 1.1rem; color: var(--text);
}
.team-karte:hover { text-decoration: none; border-color: var(--line-stark); }
.team-kopf { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .6rem; }
.team-kopf strong { font-size: 1.05rem; }
.team-gesamt { margin-left: auto; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }
.team-leiste { display: flex; flex-wrap: wrap; gap: .35rem; }
.tl {
  display: inline-flex; align-items: baseline; gap: .3rem; padding: .25rem .65rem; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line); font-size: .8rem; color: var(--muted);
}
.tl b { font-size: .95rem; color: var(--text); font-variant-numeric: tabular-nums; }
.tl.ist-leer { display: none; }
.team-leiste:not(:has(.tl:not(.ist-leer)))::after { content: "nichts offen"; font-size: .84rem; color: var(--muted); }
.tl.ist-ueber:not(.ist-leer) { background: var(--bad-weich); border-color: color-mix(in srgb, var(--bad) 40%, transparent); color: var(--bad); }
.tl.ist-ueber:not(.ist-leer) b { color: var(--bad); }
.tl.ist-heute:not(.ist-leer) { background: var(--text); border-color: var(--text); color: color-mix(in srgb, var(--card) 80%, transparent); }
.tl.ist-heute:not(.ist-leer) b { color: var(--card); }
.tl.ist-abnahme:not(.ist-leer) { background: var(--info-weich); border-color: color-mix(in srgb, var(--info) 35%, transparent); color: var(--info); }
.tl.ist-abnahme:not(.ist-leer) b { color: var(--info); }
.team-pool { border-style: dashed; box-shadow: none; }
.team-karte.ist-abwesend strong { color: var(--muted); }

/* ---- Mehr / Einweisung ------------------------------------------------- */

.menue {
  display: grid; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--schatten); margin-bottom: 1rem; overflow: hidden;
}
.menue a { display: grid; gap: .1rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--text); }
.menue a:last-child { border-bottom: 0; }
.menue a:hover { text-decoration: none; background: var(--card-2); }
.menue a span { font-size: .84rem; color: var(--muted); }
.menue-abmelden { margin-top: 1.5rem; }

.regeln { list-style: none; counter-reset: regel; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.regeln li {
  counter-increment: regel; position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1rem 1.1rem 1rem 3.6rem;
}
.regeln li::before {
  content: counter(regel); position: absolute; left: 1.05rem; top: 1rem; width: 1.8rem; height: 1.8rem;
  display: grid; place-items: center; border-radius: 50%; background: var(--text); color: var(--card); font-weight: 700; font-size: .9rem;
}
.regeln h2 { margin-bottom: .25rem; }
.regeln p { margin: 0; color: var(--muted); font-size: .94rem; }
.regeln p strong { color: var(--text); }
.liste { margin: 0; padding-left: 1.1rem; }
.liste li { margin-bottom: .45rem; }
.schritte { padding-left: 1.25rem; }
.schritte li { margin-bottom: .55rem; }
.suche-form { margin-bottom: .5rem; }

/* ---- Tabellen (Verwaltung) --------------------------------------------- */

.tabelle-wrap {
  overflow-x: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--schatten); margin-bottom: 1rem;
}
.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th, .tabelle td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--line); }
.tabelle thead th {
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); background: var(--card-2);
}
.tabelle tbody tr:last-child td { border-bottom: 0; }
.status { display: inline-block; padding: .15rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 700; }
.status-genehmigt { background: var(--good-weich); color: var(--good); }

/* ---- Untere Tab-Leiste (Handy) ---------------------------------------- */

.tabbar { display: none; }

@media (max-width: 1000px) { .brand-tool { display: none; } }

@media (max-width: 760px) {
  .topbar-inner { padding: .6rem 1rem; gap: .75rem; }
  .mainnav, .topbar-neu, .userbox form { display: none; }
  .cockpit-link span { display: none; }
  a.username { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .container { padding: 1rem 1rem calc(7.5rem + env(safe-area-inset-bottom)); }
  .feldpaar, .karten-paar { grid-template-columns: 1fr; }
  .card { padding: 1.05rem 1.1rem; }
  h1 { font-size: 1.4rem; }
  .aufgabe-fakten { grid-template-columns: 1fr 1fr; }
  .aufgabe-fakten > div:first-child { grid-column: 1 / -1; }
  /* Pool am Handy: „Nehme ich" unter den Text, damit der Titel die volle Breite hat */
  .karte:has(.btn-nehmen) { grid-template-columns: 3.2rem minmax(0, 1fr); }
  .karte:has(.btn-nehmen) .karte-text { padding-bottom: .45rem; }
  .karte:has(.btn-nehmen) .karte-aktion { grid-column: 2; padding: 0 .85rem .7rem; justify-content: flex-start; }
  .karte:has(.btn-nehmen) .reiter { grid-row: 1 / span 2; }
  .wr-kopf { font-size: .58rem; letter-spacing: .02em; }
  .woche-reiter.ist-ueber .wr-kopf, .woche-reiter.ist-spaeter .wr-kopf { letter-spacing: 0; text-transform: none; font-size: .68rem; }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: color-mix(in srgb, var(--card) 92%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--line);
    padding: .3rem .4rem calc(.3rem + env(safe-area-inset-bottom));
  }
  .tabbar a {
    display: flex; flex-direction: column; align-items: center; gap: .1rem;
    padding: .4rem .1rem .25rem; border-radius: 12px; color: var(--muted); font-size: .66rem; font-weight: 600;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar a:hover { text-decoration: none; }
  .tabbar a.active { color: var(--text); }
  .tabbar a.active .tab-icon { background: var(--card-2); }
  .tab-icon { position: relative; display: grid; place-items: center; width: 2.6rem; height: 1.75rem; border-radius: 999px; }
  .tab-icon .icon { width: 1.4rem; height: 1.4rem; }
  .tab-marke {
    position: absolute; top: -.3rem; right: .05rem; min-width: 1.05rem; height: 1.05rem; padding: 0 .25rem;
    display: grid; place-items: center; border-radius: 999px; background: var(--accent); color: #fff;
    font-size: .62rem; font-weight: 700; font-variant-numeric: tabular-nums;
  }
  .tab-marke-ruhig { background: var(--muted); }
  /* Die Mitte ist die Hauptsache: neue Aufgabe in einem Tipp */
  .tabbar a.tab-neu { color: var(--text); }
  .tabbar a.tab-neu .tab-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tabbar a.tab-neu .tab-icon {
    width: 3.4rem; height: 3.4rem; margin-top: -1.3rem; background: var(--accent); color: #fff;
    box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--accent) 75%, transparent), 0 0 0 4px var(--bg);
  }
  .tabbar a.tab-neu .tab-icon .icon { width: 1.7rem; height: 1.7rem; stroke-width: 2.2; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .topbar, .tabbar, .btn, .aktionsleiste, .haken, .hauptaktion, .aktionen, .kommentar-form, .unternav, .zurueck { display: none !important; }
  body { background: #fff; }
  .card, .karte, .block, .tabelle-wrap { box-shadow: none; break-inside: avoid; }
}

/* ---- Zeilenlisten (Routinen, Vorlagen) --------------------------------- */

.zeilenliste {
  display: grid; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--schatten); margin-bottom: 1rem; overflow: hidden;
}
.zeile { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--text); }
.zeile:last-child { border-bottom: 0; }
a.zeile:hover, .zeile a.zeile-text:hover { text-decoration: none; }
a.zeile:hover { background: var(--card-2); }
.zeile-text { display: grid; gap: .1rem; flex: 1; min-width: 0; color: var(--text); }
.zeile-text span { font-size: .84rem; color: var(--muted); }
.zeile.ist-aus strong { color: var(--muted); font-weight: 600; }
.pille-an { background: var(--good-weich); border-color: color-mix(in srgb, var(--good) 35%, transparent); color: var(--good); }

/* Routine-Formular: nur die Felder des gewählten Rhythmus zeigen */
.nur-woechentlich, .nur-monatlich { display: none; margin-top: 1rem; }
.wahl-rhythmus:has(input[value="woechentlich"]:checked) .nur-woechentlich,
.wahl-rhythmus:has(input[value="monatlich"]:checked) .nur-monatlich { display: block; }
.chips-eng .chip > span { padding: .3rem .7rem; min-height: 2.4rem; font-size: .88rem; }
.chip input[type="checkbox"]:checked + span { background: var(--text); border-color: var(--text); color: var(--card); }

/* ---- Besprechung ------------------------------------------------------- */

.besprechung { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; align-items: start; }
.besprechung-person { margin: 0; }
.besprechung-person h2 { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-size: 1.15rem; }
.bs-kopf { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 1rem 0 .3rem; }
.bs-ueber { color: var(--bad); }
.bs-gut { color: var(--good); }
.bs-liste { margin: 0; padding-left: 1.1rem; }
.bs-liste li { margin-bottom: .25rem; overflow-wrap: anywhere; }
.bs-liste a { color: var(--text); }

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

.kennzahlen { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1rem; }
.kennzahl { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-klein); padding: .85rem .95rem; box-shadow: var(--schatten); }
.kz-wert { display: block; font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kz-label { display: block; font-size: .8rem; font-weight: 600; margin-top: .15rem; }
.kz-label small { font-weight: 400; color: var(--muted); }
.balken-zelle { width: 28%; min-width: 4rem; }
.balken { display: block; height: .55rem; min-width: 2px; border-radius: 999px; background: var(--text); }
.zahl-ueber { color: var(--bad); font-weight: 700; }

@media (max-width: 760px) {
  .kennzahlen { grid-template-columns: repeat(2, 1fr); }
  .besprechung { grid-template-columns: 1fr; }
}
.anbindung-fehler { color: var(--bad); }

/* ---- Sprachnotizen ----------------------------------------------------- */

.aufnahme { display: grid; gap: .5rem; margin-bottom: 1rem; }
.wahl > .aufnahme { margin-bottom: 0; }
.aufnahme-start { justify-self: start; }
.aufnahme-mikro { width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent); }
.aufnahme-laeuft {
  display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: var(--radius-klein);
  background: var(--accent-weich); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}
.aufnahme-laeuft .btn { margin-left: auto; }
.aufnahme-punkt { width: .75rem; height: .75rem; border-radius: 50%; background: var(--accent); animation: aufnahme-puls 1.1s ease-in-out infinite; }
.aufnahme-zeit { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.6rem; }
@keyframes aufnahme-puls { 50% { opacity: .25; } }
.aufnahme-fertig { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.aufnahme-fertig audio, .sprachnotiz audio { width: 100%; max-width: 26rem; height: 2.75rem; }
.aufnahme-rueckfall { display: grid; gap: .3rem; }
.aufnahme-rueckfall input { font: inherit; font-size: .9rem; }
.aufnahme-fehler { color: var(--bad); margin: 0; }

.sprachnotizen { display: grid; gap: .6rem; margin-bottom: 1rem; scroll-margin-top: 4.5rem; }
.sprachnotiz {
  background: var(--card); border: 1px solid var(--line); border-left: 3px solid var(--text);
  border-radius: var(--radius-klein); padding: .75rem .9rem;
}
.sprachnotiz-kopf { display: flex; align-items: center; gap: .55rem; margin-bottom: .5rem; }
.sprachnotiz-kopf > span { display: grid; flex: 1; min-width: 0; line-height: 1.3; }
.sprachnotiz-kopf .icon { color: var(--muted); }
.meta-sprachnotiz .icon { width: 1em; height: 1em; vertical-align: -.15em; }
