/* TiPOS Installations-Checkliste – Gestaltung wie TiPOS DevBoard (devboard.tiweb.at), angelehnt an Teamwork 2.0.
   Standard ist „Dunkel“; „Hell“ und „System“ sind über die Kopfleiste wählbar. */

/* ---------- Farben: Hell ---------- */
:root {
  --app-bg: #f4f7fb;
  --nav-bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7faff;
  --surface-3: #eef4fb;
  --line: rgba(15, 23, 42, .14);
  --line-strong: rgba(15, 23, 42, .22);
  --text: #0b1726;
  --muted: #526579;
  --muted-2: #7c8da0;
  --nav-link: #006ee6;
  --link: #006ee6;
  --accent-blue: #0078d7;
  --accent-lime: #7ead12;
  --accent-cyan: #0093c5;
  --accent-orange: #ff9f1c;
  --danger: #d71920;
  --success: #1f9d55;
  --table-stripe: rgba(15, 23, 42, .045);
  --table-hover: rgba(0, 147, 197, .09);
  --input-bg: #ffffff;
  --focus-ring: rgba(0, 147, 197, .22);
  --eyebrow-accent: #2563eb;
  --hero-tint: linear-gradient(120deg, rgba(0, 120, 215, .07), rgba(126, 173, 18, .10));
  --danger-tint: rgba(215, 25, 32, .08);
  --success-tint: rgba(31, 157, 85, .10);
  --orange-tint: rgba(255, 159, 28, .14);
  --shadow-sm: 0 8px 20px rgba(15, 23, 42, .08);

  --radius-sm: 10px;
  --radius: 12px;
  --radius-lg: 16px;
  --tap: 40px;
  --font: "Segoe UI Variable", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

/* ---------- Farben: Dunkel ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --app-bg: #3f4040;
    --nav-bg: #494a4a;
    --surface: #494a4a;
    --surface-2: #545555;
    --surface-3: #3f4040;
    --line: rgba(255, 255, 255, .18);
    --line-strong: rgba(255, 255, 255, .3);
    --text: #ffffff;
    --muted: rgba(255, 255, 255, .72);
    --muted-2: rgba(255, 255, 255, .52);
    --nav-link: #ffffff;
    --link: #8fd0f0;
    --accent-blue: #166f9a;
    --accent-lime: #a1c116;
    --accent-cyan: #278bb5;
    --accent-orange: #f59d16;
    --danger: #d84040;
    --success: #a1c116;
    --table-stripe: rgba(0, 0, 0, .13);
    --table-hover: rgba(161, 193, 22, .16);
    --input-bg: #3f4040;
    --focus-ring: rgba(161, 193, 22, .22);
    --eyebrow-accent: #2563eb;
    --hero-tint: linear-gradient(120deg, rgba(37, 99, 235, .06), rgba(161, 193, 22, .12));
    --danger-tint: rgba(216, 64, 64, .28);
    --success-tint: rgba(161, 193, 22, .18);
    --orange-tint: rgba(245, 157, 22, .2);
    --shadow-sm: 0 10px 30px rgba(15, 23, 42, .06);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --app-bg: #3f4040;
  --nav-bg: #494a4a;
  --surface: #494a4a;
  --surface-2: #545555;
  --surface-3: #3f4040;
  --line: rgba(255, 255, 255, .18);
  --line-strong: rgba(255, 255, 255, .3);
  --text: #ffffff;
  --muted: rgba(255, 255, 255, .72);
  --muted-2: rgba(255, 255, 255, .52);
  --nav-link: #ffffff;
  --link: #8fd0f0;
  --accent-blue: #166f9a;
  --accent-lime: #a1c116;
  --accent-cyan: #278bb5;
  --accent-orange: #f59d16;
  --danger: #d84040;
  --success: #a1c116;
  --table-stripe: rgba(0, 0, 0, .13);
  --table-hover: rgba(161, 193, 22, .16);
  --input-bg: #3f4040;
  --focus-ring: rgba(161, 193, 22, .22);
  --eyebrow-accent: #2563eb;
  --hero-tint: linear-gradient(120deg, rgba(37, 99, 235, .06), rgba(161, 193, 22, .12));
  --danger-tint: rgba(216, 64, 64, .28);
  --success-tint: rgba(161, 193, 22, .18);
  --orange-tint: rgba(245, 157, 22, .2);
  --shadow-sm: 0 10px 30px rgba(15, 23, 42, .06);
  color-scheme: dark;
}

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
/* Platz für die Bildlaufleiste immer freihalten – sonst springt das Layout zwischen kurzen und langen Seiten */
html { scrollbar-gutter: stable; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--app-bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
}
a { color: var(--link); }
h1, h2, h3 { margin: 0; }
h2 { font-size: 1.25rem; font-weight: 850; line-height: 1.2; }
h3 { font-size: 1rem; font-weight: 800; }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }
.muted { color: var(--muted); }
code { background: var(--surface-2); border: 1px solid var(--line); padding: 0 .3rem; border-radius: 6px; font-size: .88em; }

.eyebrow {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow.accent { color: var(--eyebrow-accent); letter-spacing: .12em; }

/* ---------- Kopfleiste ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 48px;
  padding: 0 14px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.logo {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  background: #ffffff;
  color: #1e2a3a;
  border: 1px solid rgba(15, 23, 42, .14);
  font-weight: 900;
  font-size: .8rem;
  letter-spacing: .02em;
}
.brand-name {
  font-weight: 800;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.nav-links { display: flex; gap: 2px; margin-left: 8px; }
.nav-links a {
  font-weight: 700;
  font-size: .9rem;
  color: var(--muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
}
.nav-links a:hover { color: var(--text); background: var(--table-hover); }
.nav-links a.active { color: var(--nav-link); background: var(--surface-2); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 18px; }
.who { font-weight: 700; color: var(--nav-link); font-size: .95rem; }
.nav-right a { font-size: .85rem; font-weight: 700; color: var(--muted); text-decoration: none; }
.nav-right a:hover { color: var(--text); text-decoration: underline; }
.theme-pick {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.theme-pick select {
  font: inherit;
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 4px 10px;
  width: auto;
  min-height: 0;
  height: auto;
}

/* Inhalt nutzt immer die volle Fensterbreite; der Rand wächst mit dem Fenster mit */
main {
  width: 100%;
  margin: 0;
  padding: 26px clamp(14px, 2.5vw, 36px) 96px;
  display: grid;
  gap: 16px;
  align-content: start;
}
main > section, main > div, main > form, main > table, main > p { margin: 0; }

/* ---------- Kopfbereich ---------- */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 22px 18px 20px;
  background: var(--hero-tint), var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.hero h1 { font-size: 2.3rem; font-weight: 850; line-height: 1.15; margin: 4px 0 6px; }
.hero .sub { margin: 0; color: var(--muted); }
.hero-side { color: var(--muted); font-size: .9rem; text-align: right; }

/* ---------- Reiter (Segment) – Verwaltung ---------- */
.seg, .admin-nav {
  justify-self: start;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 7px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.seg a, .admin-nav a {
  font-weight: 850;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius);
  padding: 9px 14px;
}
.seg a:hover, .admin-nav a:hover { background: var(--table-hover); }
.seg a.active, .admin-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}

/* ---------- Karten ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
}
.card > h1 { font-size: 1.5rem; font-weight: 850; margin-bottom: 6px; }
.card > h2 { margin-bottom: 10px; }
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin: -16px -18px 14px;
  padding: 15px 18px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-head h2 { font-size: 1.35rem; }
.card-meta {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  padding-bottom: 4px;
}

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: .8rem; font-weight: 700; color: var(--text); }
.field.full { grid-column: 1 / -1; }
input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 6px 12px;
  min-height: 38px;
  width: 100%;
}
textarea { padding: 8px 12px; }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:disabled { color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-cyan); box-shadow: 0 0 0 3px var(--focus-ring); }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--accent-cyan); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

/* ---------- Schaltflächen ---------- */
button, .button {
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 14px;
}
button:hover, .button:hover { background: var(--table-hover); }
button.primary, .button.primary {
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #166f9a, #278bb5);
  border: 1px solid transparent;
}
button.primary:hover, .button.primary:hover { filter: brightness(1.08); background: linear-gradient(135deg, #166f9a, #278bb5); }
button.outline, .button.outline {
  font-weight: 800;
  color: var(--accent-cyan);
  background: transparent;
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
}
button.danger { color: var(--danger); background: transparent; border-color: var(--danger); }
button.danger:hover { background: var(--danger-tint); }
button.link {
  min-height: 0;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--link);
  font-weight: 700;
}
button.link:hover { background: none; text-decoration: underline; }
button.chip, .chip {
  min-height: 0;
  font-size: .85rem;
  border-radius: 999px;
  padding: 6px 12px;
}
button:disabled { opacity: .55; cursor: default; filter: none; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Meldungen ---------- */
.error, .ok {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  white-space: pre-line;
  margin: 0;
}
.error { background: var(--danger-tint); border: 1px solid var(--danger); font-weight: 600; }
.ok { background: var(--success-tint); border: 1px solid var(--success); font-weight: 600; }

/* ---------- Installationsart (Auswahl) ---------- */
.segmented { border: 0; padding: 0; margin: 0 0 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.segmented legend { font-size: .8rem; font-weight: 700; margin-bottom: 6px; padding: 0; }
.segmented label { flex: 1 1 180px; }
.segmented input { position: absolute; opacity: 0; }
.segmented span {
  display: flex; align-items: center; justify-content: center;
  min-height: 56px; cursor: pointer; font-weight: 850;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
}
.segmented span:hover { background: var(--table-hover); }
.segmented input:checked + span {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}
.segmented input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus-ring); }

/* ---------- Checkliste ---------- */
#app { display: grid; gap: 16px; }
#step-list { display: grid; gap: 16px; }
.list-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; }
.list-head h1 { font-size: 1.5rem; font-weight: 850; }
.list-head .filters { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.progress-box { text-align: right; font-size: .85rem; color: var(--muted); min-width: 200px; }
.progress { height: 8px; border-radius: 999px; background: var(--table-stripe); overflow: hidden; margin-bottom: 4px; }
.progress > div { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--accent-blue), var(--accent-lime)); transition: width .2s; }

.category { padding-top: 0; }
.category h2 {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 16px;
  margin: 0 -18px 4px;
  padding: 15px 18px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--line);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.cat-count { font-size: .78rem; font-weight: 800; letter-spacing: .06em; color: var(--muted); }

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 8px 18px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.category h2 + .item { border-top: 0; }
.item.missing { background: var(--danger-tint); box-shadow: inset 4px 0 0 var(--danger); margin: 0 -18px; padding: 12px 18px; }
.item h3 { line-height: 1.3; }
.item .desc { margin: 4px 0 0; color: var(--muted); font-size: .92rem; }
.item .hint {
  margin: 6px 0 0; font-size: .85rem;
  background: var(--surface-2); border: 1px solid var(--line); border-left: 4px solid var(--accent-cyan);
  border-radius: 8px; padding: 6px 10px;
}
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.badge {
  font-size: .72rem; font-weight: 800; padding: 1px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-3); color: var(--muted); border: 1px solid var(--line);
}
.badge.mandatory { background: var(--danger); color: #fff; border-color: transparent; }
.badge.paid { background: var(--accent-orange); color: #2b1a00; border-color: transparent; }
.badge.version { background: transparent; }

.item-actions { display: flex; flex-direction: column; gap: 6px; }
.status-group { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.status-btn { font-size: .85rem; padding: 6px 4px; }
.status-btn.selected.status-besprochen { background: var(--success); color: #172000; border-color: transparent; font-weight: 850; }
.status-btn.selected.status-nicht_relevant { background: var(--muted-2); color: #fff; border-color: transparent; font-weight: 850; }
.status-btn.selected.status-offen { background: var(--accent-orange); color: #2b1a00; border-color: transparent; font-weight: 850; }
:root[data-theme="light"] .status-btn.selected.status-besprochen { color: #fff; }
.note { resize: none; overflow: hidden; font-size: .9rem; min-height: 36px; padding: 6px 10px; }

.sticky-actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  display: flex; justify-content: flex-end; align-items: center; gap: 16px;
  padding: 10px 36px;
  background: var(--nav-bg);
  border-top: 1px solid var(--line);
}

/* ---------- Unterschrift ---------- */
.confirm { font-weight: 700; }
.signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sigpad {
  /* bewusst hell wie Papier: dunkle Unterschrift, wie sie auch im PDF erscheint */
  width: 100%; height: 180px; display: block; touch-action: none; cursor: crosshair;
  border: 2px dashed var(--line-strong); border-radius: var(--radius); background: #fff;
}
.sig-foot { display: flex; justify-content: space-between; align-items: center; font-size: .85rem; color: var(--muted); margin-top: 4px; }

/* ---------- Verwaltung ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.stat {
  position: relative; overflow: hidden;
  padding: 14px 16px 14px 18px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-size: .85rem; color: var(--muted);
}
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(#2563eb, #14b8a6); }
.stat:nth-child(2)::before { background: var(--accent-orange); }
.stat:nth-child(3)::before { background: linear-gradient(var(--accent-lime), #14b8a6); }
.stat b { display: block; font-size: 1.4rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.filterbar {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card .filterbar { padding: 0; border: 0; box-shadow: none; background: none; margin-bottom: 12px; }
.filterbar .field { margin: 0; min-width: 170px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 0 14px; }

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .9rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
table.data th {
  text-align: left; font-weight: 800; white-space: nowrap;
  padding: 10px 12px;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  border-bottom: 1px solid var(--line-strong);
}
table.data td { vertical-align: top; padding: 7px 12px; border-bottom: 1px solid var(--line); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:nth-child(even) td { background: var(--table-stripe); }
table.data tbody tr:hover td { background: var(--table-hover); }
table.data tr.inactive td { color: var(--muted-2); }
table.data td.num, table.data th.num { text-align: right; width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data input, table.data select { min-height: 32px; padding: 3px 8px; }
table.data a { font-weight: 700; text-decoration: none; color: var(--text); }
table.data a:hover { text-decoration: underline; }

/* ---------- Anordnen (Sortieren / Verschieben) ---------- */
.arr-bar {
  position: sticky; top: 48px; z-index: 12;
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  background: var(--nav-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.arr-bar .dirty { font-weight: 800; color: var(--accent-orange); }
.arr-cats { display: grid; gap: 16px; }
.arr-cat { padding: 0; overflow: hidden; }
.arr-cat > summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 13px 18px; cursor: pointer; list-style: none;
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
}
.arr-cat > summary::-webkit-details-marker { display: none; }
.arr-cat > summary::before { content: "+"; width: 1ch; color: var(--muted); font-weight: 800; }
.arr-cat[open] > summary::before { content: "–"; }
.arr-cat > summary h2 { flex: 1; font-size: 1.15rem; }
.cat-handle { cursor: grab; color: var(--muted); font-size: 1.15rem; user-select: none; }
.arr-cat.dragging-cat { opacity: .45; }
table.data tr.dragging td { opacity: .45; }
table.data td.cat-handle { width: 1%; text-align: center; }
.kassencheck {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px;
  padding: 10px 12px; border: 1px dashed var(--accent-cyan); border-radius: var(--radius); font-size: .9rem;
}
.kassencheck .kc-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.kassencheck .kc-actions .button { cursor: pointer; text-decoration: none; }
.kassencheck p { flex-basis: 100%; margin: 0; }
.kc-code { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.kc-code b { font-size: 1.9rem; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--accent-cyan); }
.badge.script { background: var(--surface-3); color: var(--accent-cyan); border-color: var(--accent-cyan); }
.arr-cat.unassigned { border-style: dashed; }
.arr-cat.unassigned > summary { background: var(--surface); cursor: default; }
.arr-cat.unassigned > summary h2 { flex: 0 1 auto; color: var(--accent-orange); }
.arr-unassigned-note { flex: 1; font-size: .85rem; }
.arr-cat.moved-cat > summary { box-shadow: inset 4px 0 0 var(--accent-orange); }
.arr-cat > summary .arr-move button { min-height: 28px; padding: 1px 8px; }
.arr-cat[open] > summary { border-bottom: 1px solid var(--line); }
.arr-list { list-style: none; margin: 0; padding: 6px 0; min-height: 46px; }
.arr-list.drop-target { background: var(--table-hover); }
.arr-empty { padding: 10px 18px; color: var(--muted); font-style: italic; }
.arr-item {
  display: grid;
  grid-template-columns: 28px 34px minmax(0, 1fr) auto auto auto;
  gap: 10px; align-items: center;
  padding: 6px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.arr-item:first-child { border-top: 0; }
.arr-item:hover { background: var(--table-hover); }
.arr-item.dragging { opacity: .45; }
.arr-item.moved, .arr-item.areas-changed { box-shadow: inset 4px 0 0 var(--accent-orange); }
.arr-item.inactive .arr-title { color: var(--muted-2); }
.arr-handle { cursor: grab; color: var(--muted); font-size: 1.1rem; text-align: center; user-select: none; }
.arr-pos {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  font-size: .8rem; font-weight: 900; background: var(--surface-3); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.arr-title { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.arr-title a { color: var(--text); text-decoration: none; }
.arr-title a:hover { text-decoration: underline; }
.arr-title .badge { margin-left: 6px; }
.arr-move { display: flex; gap: 4px; }
.areas { display: inline-flex; gap: 2px; margin-left: 8px; vertical-align: 1px; }
.area {
  display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 6px;
  font-size: .68rem; font-weight: 900; color: var(--muted-2); border: 1px solid var(--line);
}
.area.on { color: #fff; background: var(--accent-blue); border-color: transparent; }
.arr-move button { min-height: 30px; padding: 2px 9px; }
.arr-filters { margin-bottom: 12px; }
.arr-filters .arr-search { flex: 1; min-width: 220px; }
.arr-filters .arr-new { margin-left: auto; }
.arr-cat > summary .arr-add { min-height: 28px; padding: 2px 10px; font-size: .8rem; text-decoration: none; }
.arr-cat { scroll-margin-top: 120px; }
.arr-item { scroll-margin-top: 140px; }
.arr-item.flash { animation: arr-flash 2.4s ease-out; }
@keyframes arr-flash { 0%, 40% { background: var(--focus-ring); } 100% { background: var(--surface); } }
/* Bereiche je Punkt: vier gleich breite, getrennte Felder, damit sie über alle Zeilen als Spalten fluchten */
.area-toggles { display: grid; grid-template-columns: 80px repeat(4, 64px); gap: 6px; padding: 0 10px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.area-toggle {
  display: flex; align-items: center; justify-content: center; gap: 5px; height: 30px; margin: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-3);
  font-size: .76rem; font-weight: 800; color: var(--muted); cursor: pointer; user-select: none;
}
.area-toggle input { width: 15px; height: 15px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent-blue); cursor: pointer; }
.area-toggle:has(input:checked) { color: #fff; background: var(--accent-blue); border-color: transparent; }
.area-toggle:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--focus-ring); }
/* Pflicht: rot und durch Abstand von den vier Bereichen abgesetzt */
.mandatory-toggle { margin-right: 8px; }
.mandatory-toggle input { accent-color: var(--danger); }
.mandatory-toggle:has(input:checked) { background: var(--danger); }
.arr-item select { min-height: 30px; padding: 2px 8px; width: 220px; font-size: .85rem; }

/* ---------- Schmal ---------- */
@media (max-width: 1100px) {
  /* Punktzeile zweizeilig: oben Titel + Pfeile, darunter Bereiche und „Verschieben nach …“ */
  .arr-item {
    grid-template-columns: 24px 30px minmax(0, 1fr) auto;
    grid-template-areas: "h p t m" ". . a s";
    row-gap: 6px;
  }
  .arr-handle { grid-area: h; }
  .arr-pos { grid-area: p; }
  .arr-title { grid-area: t; }
  .arr-item > .arr-move { grid-area: m; }
  .area-toggles { grid-area: a; justify-self: start; padding: 0; border: 0; }
  .arr-item select { grid-area: s; width: 100%; min-width: 0; }
}
@media (max-width: 980px) {
  main { padding-top: 18px; }
  .arr-filters .arr-new { margin-left: 0; }
}
@media (max-width: 700px) {
  .arr-item { grid-template-areas: "h p t m" ". . a a" ". . s s"; }
  .area-toggles { justify-self: stretch; grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .mandatory-toggle { margin-right: 0; }
  .arr-cat > summary { flex-wrap: wrap; row-gap: 6px; }
  .arr-cat > summary h2 { flex-basis: calc(100% - 60px); }
  .filterbar .field { min-width: 0; flex: 1 1 100%; }
  /* breite Tabellen (Kategorien, Jira-Import) waagrecht scrollbar statt abgeschnitten */
  table.data { display: block; overflow-x: auto; }
}
@media (max-width: 760px) {
  .nav { padding: 0 10px; gap: 10px; }
  .who, .brand-name, .theme-pick span { display: none; }
  .hero { flex-direction: column; align-items: flex-start; }
  .hero h1 { font-size: 1.8rem; }
  .grid2, .signatures { grid-template-columns: 1fr; }
  .item { grid-template-columns: 1fr; }
  .list-head { grid-template-columns: minmax(0, 1fr); }
  .progress-box { min-width: 0; text-align: left; }
  .sticky-actions { padding: 10px 16px; }
}
@media (max-width: 520px) {
  /* Handy: Kopfleiste darf zweizeilig werden und scrollt mit; die Speichern-Leiste bleibt oben stehen */
  .nav { position: static; height: auto; min-height: 48px; flex-wrap: wrap; row-gap: 4px; padding: 6px 10px; }
  .nav-links { margin-left: 0; }
  .nav-right { gap: 10px; }
  .arr-bar { top: 0; }
  .hero h1 { font-size: 1.6rem; }
  .admin-nav a { padding: 6px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
