/* ===========================================================================
   Furmica-Aufgaben — Farbschema (Token-basiert, hell & dunkel)
   Reihenfolge: Standard = hell -> System-Dunkelmodus -> manuelle Wahl (data-theme)
   =========================================================================== */
:root {
  color-scheme: light;
  --brand: #d4a800;        /* Gold (Logo/Akzent) */
  --brand-dark: #b28c00;   /* Dunkelgold */
  --brand-hover: #c49b00;  /* Button-Hover */
  --brand-tint: #f7edcc;   /* Gold hell (aktive Flächen) */
  --brand-ink: #8a6d00;    /* Text auf Gold-Tint */
  --on-brand: #2b2b2b;     /* Text auf Gold-Buttons */

  --bg: #f5f3ee;
  --surface: #ffffff;
  --border: #e7e3d9;
  --text: #2b2b2b;
  --muted: #6b6862;

  --teal: #15779b;
  --green: #1f9159;
  --red: #cf4646;

  --row-line: #f2efe7;
  --pill-bg: #f0ede4;
  --due-bg: #f0ede4;
  --overdue-bg: #fbe7e7;
  --cat-bg: #e6eef2;
  --recur-bg: #e6f2ea;
  --dept-bg: #efe9f7;
  --dept-fg: #6a4fce;
  --check-border: #cbc6b8;
  --stripe-neutral: #d8d2c4;
  --danger-border: #eccaca;
  --danger-bg: #fbe7e7;
  --focus-ring: #ecd98f;
  --toast-bg: #2b2b2b;
  --toast-text: #ffffff;
  --overlay: rgba(43,43,43,.42);

  --shadow: 0 1px 3px rgba(60,50,20,.07), 0 6px 22px rgba(60,50,20,.06);
  --radius: 12px;
}

/* Dunkle Palette (als wiederverwendbarer Block) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand: #e6bd1f; --brand-dark: #f0cf4d; --brand-hover: #f0cf4d;
    --brand-tint: #3a3216; --brand-ink: #f0cf4d; --on-brand: #241f0a;
    --bg: #1c1b18; --surface: #26241f; --border: #37342c;
    --text: #ece9e1; --muted: #a39f95;
    --teal: #6fb6d4; --green: #57c98a; --red: #e88a8a;
    --row-line: #302d26; --pill-bg: #333027; --due-bg: #333027; --overdue-bg: #3d2626;
    --cat-bg: #24333a; --recur-bg: #223429; --dept-bg: #2c2740; --dept-fg: #b3a0ee; --check-border: #4a4638; --stripe-neutral: #4a4638;
    --danger-border: #5a3a3a; --danger-bg: #3d2626; --focus-ring: #9c8636;
    --toast-bg: #3a3730; --toast-text: #ece9e1; --overlay: rgba(0,0,0,.55);
    --shadow: 0 1px 3px rgba(0,0,0,.3), 0 6px 22px rgba(0,0,0,.28);
  }
}

/* Manuelle Wahl gewinnt in beide Richtungen */
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #e6bd1f; --brand-dark: #f0cf4d; --brand-hover: #f0cf4d;
  --brand-tint: #3a3216; --brand-ink: #f0cf4d; --on-brand: #241f0a;
  --bg: #1c1b18; --surface: #26241f; --border: #37342c;
  --text: #ece9e1; --muted: #a39f95;
  --teal: #6fb6d4; --green: #57c98a; --red: #e88a8a;
  --row-line: #302d26; --pill-bg: #333027; --due-bg: #333027; --overdue-bg: #3d2626;
  --cat-bg: #24333a; --recur-bg: #223429; --dept-bg: #2c2740; --dept-fg: #b3a0ee; --check-border: #4a4638; --stripe-neutral: #4a4638;
  --danger-border: #5a3a3a; --danger-bg: #3d2626; --focus-ring: #9c8636;
  --toast-bg: #3a3730; --toast-text: #ece9e1; --overlay: rgba(0,0,0,.55);
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 6px 22px rgba(0,0,0,.28);
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.45;
}

/* Topbar */
.topbar {
  display: flex; align-items: center; gap: 20px; padding: 0 24px; height: 62px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
/* Die Wortmarke führt zur Übersicht — als Link gestaltet, aber ohne Link-Optik */
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; border-radius: 10px; padding: 4px 6px; margin-left: -6px; transition: background .12s; }
.brand:hover { background: var(--bg); }
.brand:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.logo { height: 32px; width: auto; display: block; }
.wordmark { display: flex; flex-direction: column; line-height: 1.05; font-weight: 800; font-size: 18px; letter-spacing: .2px; color: var(--text); }
.wordmark .sub { font-weight: 600; font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--brand-dark); }
.tabs { display: flex; gap: 4px; }
.tab { border: none; background: transparent; color: var(--muted); padding: 8px 16px; border-radius: 8px; font-size: 15px; cursor: pointer; font-weight: 600; }
.tab:hover { background: var(--bg); color: var(--text); }
.tab.active { background: var(--brand-tint); color: var(--brand-ink); }

.theme-toggle {
  margin-left: auto; border: 1px solid var(--border); background: var(--surface);
  width: 38px; height: 38px; border-radius: 9px; cursor: pointer; font-size: 17px;
  display: grid; place-items: center; line-height: 1; color: var(--text);
}
.theme-toggle:hover { background: var(--bg); }

.user-area { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.avatar { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-tint); color: var(--brand-ink); font-weight: 700; font-size: 13px; }
.user-chip .uname { font-weight: 600; color: var(--text); }
.logout { color: var(--muted); text-decoration: none; font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.logout:hover { background: var(--bg); color: var(--red); }

main { max-width: 1100px; margin: 0 auto; padding: 24px; }

/* Kennzahlen */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.kpi .num { font-size: 32px; font-weight: 700; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.kpi .label { color: var(--muted); font-size: 13px; margin-top: 8px; font-weight: 600; }
.kpi.red .num { color: var(--red); }
.kpi.amber .num { color: var(--brand-dark); }
.kpi.green .num { color: var(--green); }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card h3 { margin: 0; padding: 16px 20px; font-size: 15px; border-bottom: 1px solid var(--border); }
.card .body { padding: 8px 20px 16px; }
.breakdown-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--row-line); }
.breakdown-row:last-child { border-bottom: none; }
.breakdown-row .name { font-weight: 600; }
.breakdown-row .meta { color: var(--muted); font-size: 13px; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill.count { background: var(--pill-bg); color: var(--text); }
.pill.overdue { background: var(--overdue-bg); color: var(--red); margin-left: 6px; }

/* Toolbar / Filter */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.search-wrap { position: relative; }
.search-input { min-width: 220px; padding-right: 26px; }
.search-clear {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  border: none; background: transparent; color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 4px 6px;
}
.search-clear:hover { color: var(--text); }
select, input[type="text"], input[type="date"], input[type="number"], textarea {
  font-family: inherit; font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
}
select:focus, input:focus, textarea:focus { outline: 2px solid var(--focus-ring); border-color: var(--brand); }

.btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.danger { color: var(--red); border-color: var(--danger-border); }
.btn.danger:hover { background: var(--danger-bg); }

/* Aufgabenliste */
.task-list { display: flex; flex-direction: column; gap: 8px; }
.task { position: relative; display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.task.done { opacity: .6; }
.task.done .title { text-decoration: line-through; }
.check { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--check-border); cursor: pointer; display: grid; place-items: center; margin-top: 2px; background: var(--surface); color: #fff; font-size: 14px; transition: all .12s; }
.check.checked { background: var(--green); border-color: var(--green); }
.task-main { flex: 1; min-width: 0; }
.task .title { font-weight: 600; }
.task .sub { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; font-size: 12.5px; color: var(--muted); align-items: center; }
/* pre-wrap: Zeilenumbrüche aus dem Beschreibungsfeld bleiben erhalten */
.task .desc { color: var(--muted); font-size: 13px; margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-weight: 600; font-size: 12px; }
.badge.due { background: var(--due-bg); }
.badge.due.overdue { background: var(--overdue-bg); color: var(--red); }
.badge.due.today { background: var(--brand-tint); color: var(--brand-ink); }
.badge.assignee { background: var(--brand-tint); color: var(--brand-ink); }
.badge.cat { background: var(--cat-bg); color: var(--teal); }
.badge.dept { background: var(--dept-bg); color: var(--dept-fg); }
.badge.recur { background: var(--recur-bg); color: var(--green); }
.prio { flex: none; width: 8px; align-self: stretch; border-radius: 4px; background: var(--stripe-neutral); }
.prio.hoch { background: var(--red); }
.prio.mittel { background: var(--brand); }
.prio.tief { background: var(--teal); }
.task-actions { display: flex; gap: 4px; align-items: center; }

/* Handsortierung: Griff erscheint nur bei Aufgaben gleicher Gewichtung */
.drag-handle {
  flex: none; width: 20px; height: 24px; margin-top: 1px; padding: 0;
  border: 0; background: none; color: var(--muted); font-size: 15px; line-height: 1;
  border-radius: 6px; cursor: grab; opacity: .35; transition: opacity .12s;
  touch-action: none;
}
.task:hover .drag-handle, .drag-handle:focus-visible { opacity: 1; }
.drag-handle:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.drag-handle:active { cursor: grabbing; }
.task.dragging { opacity: .35; }
/* Ziele anderer Gewichtung sind gesperrt — sichtbar zurückgenommen */
.task.no-drop { opacity: .4; }
/* Einfügemarke im Abstand zwischen den Zeilen (task-list gap: 8px) */
.task.drop-before::after, .task.drop-after::after {
  content: ''; position: absolute; left: 0; right: 0; height: 3px;
  background: var(--brand); border-radius: 2px; pointer-events: none;
}
.task.drop-before::after { top: -6px; }
.task.drop-after::after { bottom: -6px; }

/* Teilaufgaben (Checkliste) */
.subtasks { margin-top: 10px; display: flex; flex-direction: column; gap: 1px; }
.subprogress { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.subbar { flex: 1; max-width: 200px; height: 5px; background: var(--pill-bg); border-radius: 3px; overflow: hidden; }
.subbar-fill { height: 100%; background: var(--brand); border-radius: 3px; transition: width .2s; }
.subcount { font-size: 11.5px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.subrows { display: flex; flex-direction: column; gap: 1px; }
.subtask { display: flex; align-items: center; gap: 8px; padding: 2px 0; position: relative; }
/* Griff zum Umsortieren einer Checkliste — schmaler als der Griff einer Aufgabe */
.sub-handle {
  flex: none; width: 14px; height: 17px; padding: 0; border: 0; background: none;
  color: var(--muted); font-size: 12px; line-height: 17px; text-align: center;
  border-radius: 4px; cursor: grab; opacity: 0; transition: opacity .12s; touch-action: none;
}
/* Schon beim Überfahren der Aufgabe angedeutet, damit die Griffe auffindbar sind */
.task:hover .sub-handle { opacity: .3; }
.subtask:hover .sub-handle, .sub-handle:focus-visible { opacity: .7; }
.sub-handle:focus-visible { opacity: 1; outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.sub-handle:active { cursor: grabbing; }
.sub-handle.empty { cursor: default; }        /* Platzhalter, solange nichts zu sortieren ist */
.subtask.dragging { opacity: .35; }
/* Einfügemarke an der Ober- bzw. Unterkante der Zielzeile */
.subtask.drop-before::after, .subtask.drop-after::after {
  content: ''; position: absolute; left: 0; right: 0; height: 2px;
  background: var(--brand); border-radius: 1px; pointer-events: none;
}
.subtask.drop-before::after { top: 0; }
.subtask.drop-after::after { bottom: 0; }
.subcheck {
  flex: none; width: 17px; height: 17px; border-radius: 4px; border: 1.5px solid var(--check-border);
  display: grid; place-items: center; cursor: pointer; font-size: 11px; color: #fff; background: var(--surface);
}
.subcheck.checked { background: var(--green); border-color: var(--green); }
.subtitle { font-size: 13px; }
.subtask.done .subtitle { text-decoration: line-through; color: var(--muted); }
.subdel { margin-left: auto; border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; opacity: 0; }
.subtask:hover .subdel { opacity: 1; }
.subdel:hover { color: var(--red); }
.subadd { width: 100%; max-width: 280px; font-size: 13px; padding: 4px 8px; border: 1px dashed var(--border); border-radius: 6px; background: transparent; color: var(--text); }
.subadd:focus { outline: none; border-color: var(--brand); border-style: solid; }
.subtask.add { padding-top: 5px; }

/* Teilaufgaben-Editor im Dialog */
.subedit { display: flex; flex-direction: column; gap: 1px; }
.subedit .subcheck { cursor: default; }
.subedit .subdel { opacity: 1; }
/* Im Dialog sind die Schaltflächen dauerhaft sichtbar — der Griff ebenso */
.subedit .sub-handle { opacity: .7; }

.empty { text-align: center; color: var(--muted); padding: 48px 20px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

/* Vorlagen und Zeitpläne */
.tpl-list { display: flex; flex-direction: column; gap: 10px; }
/* Kategorie-Überschrift in der Vorlagenliste */
.group-head { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 12px 2px 0; }
.tpl-list > .group-head:first-child { margin-top: 0; }
/* Aufklappbare Schrittliste einer Vorlage */
.bp-steps { margin-top: 8px; font-size: 13px; }
.bp-steps > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-weight: 600; width: fit-content; }
.bp-steps > summary:hover { color: var(--brand); }
.bp-steps ol { margin: 8px 0 2px; padding-left: 22px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.bp-steps li { overflow-wrap: anywhere; }
.tpl { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; }
.tpl.inactive { opacity: .55; }
/* Vorlagen können eine aufgeklappte Schrittliste zeigen — dann gehören die Schaltflächen
   nach oben statt in die Mitte der gewachsenen Karte. */
.tpl.bp { align-items: flex-start; }
.tpl.bp .task-actions { padding-top: 2px; }
.tpl-main { flex: 1; min-width: 0; }
.tpl .title { font-weight: 700; }
.tpl .sub { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 5px; font-size: 12.5px; color: var(--muted); align-items: center; }
.tpl .desc { color: var(--muted); font-size: 13px; margin-top: 3px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Dialog */
dialog { border: none; border-radius: 16px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.28); width: min(520px, 92vw); background: var(--surface); color: var(--text); }
dialog::backdrop { background: var(--overlay); }
#modal-form { padding: 24px; }
#modal-form h2 { margin: 0 0 18px; font-size: 19px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; }
/* Kontrollkästchen mit nebenstehendem Text — nicht über die volle Breite ziehen */
.field label.checkline { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; color: var(--text); margin-bottom: 0; cursor: pointer; }
.field label.checkline input[type="checkbox"] { width: auto; flex: none; margin: 0; accent-color: var(--brand); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--toast-bg); color: var(--toast-text); padding: 12px 20px; border-radius: 10px; opacity: 0; pointer-events: none; transition: all .25s; font-weight: 600; z-index: 100; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.topbar .spacer { flex: 1; }

/* Anhänge an einer Aufgabe */
.attachments { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.attach-head { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.attach { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.attach-icon { width: 26px; text-align: center; font-size: 15px; flex: none; }
.attach-thumb {
  width: 34px; height: 34px; flex: none; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); background: var(--pill-bg); display: block;
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-main { min-width: 0; }
.attach-name { font-size: 13px; color: var(--text); text-decoration: none; word-break: break-word; }
a.attach-name:hover { color: var(--brand-dark); text-decoration: underline; }
.attach-meta { font-size: 11.5px; color: var(--muted); }
.attach .subdel { opacity: 0; }
.attach:hover .subdel { opacity: 1; }

/* Knopf und Ablagefläche zum Hinzufügen */
.attach-add {
  position: relative;                 /* hält das unsichtbare Dateifeld an seinem Platz */
  display: inline-flex; align-items: center; gap: 8px; margin-top: 5px;
  font-size: 13px; color: var(--muted); cursor: pointer;
  padding: 4px 10px; border: 1px dashed var(--border); border-radius: 6px;
}
.attach-add:hover { border-color: var(--brand); color: var(--text); }
.attach-add.over { border-color: var(--brand); border-style: solid; background: var(--brand-tint); color: var(--brand-ink); }
.attach-add.busy { opacity: .6; pointer-events: none; }
.attach-add.busy > span:first-of-type::after { content: ' — lädt …'; }
.attach-hint { font-size: 11.5px; opacity: .8; }
.attach-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* Anhänge im Dialog "Neue Aufgabe" — dort ist noch nichts hochgeladen */
.attach-editor { display: flex; flex-direction: column; gap: 1px; }
.attach-editor .subdel { opacity: 1; }
.attach.picked .attach-name { word-break: break-word; }

/* Kommentare an einer Aufgabe */
.comments { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border); }
.comment-head { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.comment { margin: 0 0 7px; }
.comment-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.comment-meta .who { font-weight: 700; color: var(--text); }
.comment-meta .subdel { margin-left: 0; opacity: 0; }
.comment:hover .comment-meta .subdel { opacity: 1; }
.comment-text { font-size: 13.5px; white-space: pre-wrap; margin-top: 1px; }
.comment-add { max-width: 100%; }

/* Gruppen-Überschriften der Aufgabenliste */
.group-head {
  display: flex; align-items: center; gap: 10px;
  margin: 22px 2px 8px; font-size: 13px; font-weight: 700;
  color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
}
.group-head:first-child { margin-top: 4px; }
.group-head.overdue { color: var(--red); }
.group-head .count {
  background: var(--pill-bg); color: var(--muted); font-weight: 700;
  padding: 1px 8px; border-radius: 10px; font-size: 12px; letter-spacing: 0;
}
.group-head.overdue .count { background: var(--overdue-bg); color: var(--red); }

/* Fusszeile (dezent) */
.appfoot { max-width: 1100px; margin: 0 auto; padding: 4px 24px 28px; text-align: right; display: flex; align-items: baseline; justify-content: flex-end; gap: 18px; flex-wrap: wrap; }
.appfoot .spacer { flex: 1; }
.appfoot a { color: var(--muted); font-size: 12.5px; text-decoration: none; border-bottom: 1px solid transparent; }
.appfoot a:hover { color: var(--text); border-bottom-color: var(--border); }
/* Betriebszustand (Sicherung, Neustart) — bewusst zurückhaltend, links im Fuss */
.footstat { color: var(--muted); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; }
.footstat b { font-weight: 600; color: var(--text); }
.footstat .stale b { color: var(--red); }

/* Anleitung */
.help h1 { font-size: 24px; margin: 4px 0 6px; }
.help .lead { color: var(--muted); margin: 0 0 22px; max-width: 62ch; }
.help .card { margin-bottom: 16px; }
.help .body p { margin: 12px 0; max-width: 68ch; }
.help .body ul { margin: 12px 0; padding-left: 20px; max-width: 68ch; }
.help .body li { margin-bottom: 7px; }
.help .body dl { margin: 12px 0; }
.help .body dt { font-weight: 700; margin-top: 12px; }
.help .body dd { margin: 3px 0 0; color: var(--muted); max-width: 68ch; }
.help .note { color: var(--muted); font-size: 13.5px; border-left: 3px solid var(--border); padding-left: 12px; }
.help .body a { color: var(--teal); }
.help code { background: var(--pill-bg); padding: 1px 6px; border-radius: 5px; font-size: 12.5px; font-family: Consolas, 'SF Mono', Menlo, monospace; }
.help pre { background: var(--pill-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; font-family: Consolas, 'SF Mono', Menlo, monospace; }
.help pre code { background: none; padding: 0; }
.help table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13.5px; }
.help th { text-align: left; font-weight: 700; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--border); white-space: nowrap; }
.help td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--row-line); vertical-align: top; }
.help td:first-child { white-space: nowrap; }
.help .scroll { overflow-x: auto; }
.help .diagram { margin: 14px 0; overflow-x: auto; }
.help .diagram svg { display: block; width: 100%; height: auto; min-width: 560px; }
.help .diagram .note { margin-top: 10px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

@media (max-width: 780px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .cols, .cols-3 { grid-template-columns: 1fr; }
  .tabs .tab { padding: 8px 10px; }
  .wordmark .sub { display: none; }
  main { padding: 16px; }
}
