/* ================= Grundlagen ================= */
:root {
  /* Akzentfarbe (Standard DLRG-Rot) – über „Darstellung“ änderbar; --red bleibt der Name im ganzen CSS */
  --accent: #e30613;
  --red: var(--accent);
  --red-dark: color-mix(in srgb, var(--accent) 78%, #000);
  --red-soft: color-mix(in srgb, var(--accent) 10%, var(--card));
  --yellow: #ffed00;
  --stripe: var(--yellow);
  --blue: #1565c0;
  --ok: #2e7d32;
  --ok-soft: #e7f4e8;
  --warn: #b26a00;
  --warn-soft: #fff4e0;
  --bad: #c62828;
  --bad-soft: #fdecea;
  --bg: #f3f5f8;
  --card: #ffffff;
  --text: #1d2430;
  --muted: #667085;
  --line: #e3e7ee;
  --radius: 14px;
  --radius-sm: 10px;
  /* Flächen und Rahmen (für Hell/Dunkel) */
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef1f5;
  --border-strong: #cfd5df;
  --hover-border: #b9c1cf;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-scale: 1;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: calc(100% * var(--font-scale)); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: .9375rem/1.45 var(--font);
}
body.modal-open { overflow: hidden; }
a { color: var(--blue); }
h1 { font-size: 1.6rem; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: 1.2rem; margin: 0 0 10px; }
h3 { font-size: 1.02rem; margin: 0; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hint { color: var(--muted); font-size: .85rem; display: block; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nowrap { white-space: nowrap; }
.ok-text { color: var(--ok); }
.warn-text { color: var(--warn); font-weight: 600; }
.pad { padding: 12px; }
[hidden] { display: none !important; }
.loading { padding: 40px; text-align: center; color: var(--muted); }

/* ================= Buttons & Formulare ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #256628; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-ghost { color: var(--bad); border-color: #f2c4c4; }
.btn-danger-ghost:hover { background: var(--bad-soft); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(0,0,0,.05); }
.btn-dashed { border-style: dashed; background: transparent; color: var(--muted); width: 100%; }
.btn-dashed:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: .88rem; }
.btn-big { min-height: 48px; font-size: 1.05rem; width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 1rem; padding: 6px; border-radius: 8px; color: var(--muted); line-height: 1; min-width: 32px; min-height: 32px; }
.icon-btn:hover { background: rgba(0,0,0,.06); color: var(--text); }

input, select, textarea {
  font: inherit; color: inherit; width: 100%; min-height: 42px; padding: 8px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
}
textarea { resize: vertical; min-height: 70px; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, [tabindex]:focus-visible { outline: 3px solid rgba(198, 40, 40, .25); outline-offset: 1px; border-color: var(--red); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--red); flex: none; }
input[type=color] { padding: 4px; height: 42px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label { font-weight: 600; font-size: .9rem; }
.full { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.sub { margin-top: 10px; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 42px; flex-wrap: wrap; }
.check .hint { flex-basis: 100%; }
.form-error { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; font-weight: 600; grid-column: 1 / -1; }
.search { margin: 8px 0; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
label.inline input { width: auto; }

/* Schalter */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; min-height: 42px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .slider { width: 46px; height: 26px; background: var(--border-strong); border-radius: 26px; position: relative; transition: background .2s; flex: none; }
.switch .slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::after { transform: translateX(20px); }
.switch input:focus-visible + .slider { outline: 3px solid rgba(198,40,40,.25); }

/* ================= Badges, Tags, Pills ================= */
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-neutral { background: var(--surface-3); color: var(--muted); }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: .02em; }
.tag-leader { background: var(--yellow); color: #1d2430; }
.tag-admin { background: var(--red-soft); color: var(--red); }
.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .85rem; font-weight: 600; margin: 4px 0; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-leader { background: var(--yellow); color: #1d2430; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: #3b4556; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: none; }
.avatar.sm { width: 30px; height: 30px; font-size: .75rem; }
.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px; font-weight: 600; }
.banner-warn { background: var(--warn-soft); color: var(--warn); }

/* ================= Layout ================= */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 0 20px; height: 60px; background: var(--surface); border-bottom: 4px solid var(--yellow);
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand.big { font-size: 1.6rem; margin-bottom: 6px; }
.topbar .brand > span:last-child { max-width: 240px; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1640px) { .topbar .brand > span:last-child { max-width: 220px; } }
@media (max-width: 720px) { .topbar .brand > span:last-child { max-width: none; } }
.brand-logo { width: 32px; height: 32px; flex: none; }
.brand.big .brand-logo { width: 44px; height: 44px; }
.live-brand .brand-logo { width: 40px; height: 40px; border-radius: 10px; box-shadow: 0 0 0 2px #fff; }
.topnav { display: flex; gap: 2px; flex: 1; min-width: 0; align-items: center; }
.topnav > .tnav-item { flex: none; }
.tnav-more-wrap { position: relative; flex: none; }
.tnav-more { border: 0; background: transparent; font: inherit; font-weight: 600; cursor: pointer; }
.tnav-more.has-active { background: var(--red-soft); color: var(--red); }
.tnav-more.has-badge::after { content: ''; position: absolute; top: 6px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.tnav-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 50; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; gap: 2px; }
.tnav-menu-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; white-space: nowrap; position: relative; }
.tnav-menu-item:hover { background: var(--surface-3); }
.tnav-menu-item.active { background: var(--red-soft); color: var(--red); }
.tnav-item { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; position: relative; }
.tnav-item:hover { background: var(--surface-3); color: var(--text); }
.tnav-item.active { background: var(--red-soft); color: var(--red); }
.nav-badge { background: var(--red); color: #fff; font-size: .7rem; font-weight: 800; border-radius: 999px; padding: 1px 6px; min-width: 18px; text-align: center; }
.userbox { display: flex; align-items: center; gap: 8px; }
.userchip { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 600; }
main { max-width: 1320px; margin: 0 auto; padding: 24px 20px 40px; }
.page.narrow { max-width: 760px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-title { margin: 26px 0 12px; font-size: 1.1rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 1px solid var(--line); }
.card + .card, section.card { margin-bottom: 14px; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.cards.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .search { flex: 1; min-width: 220px; margin: 0; }
.toolbar select { width: auto; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty-icon { font-size: 2.6rem; }
.empty h3 { color: var(--text); margin: 8px 0 4px; }
.stat-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; min-width: 110px; box-shadow: var(--shadow); }
.stat-value { font-size: 1.4rem; font-weight: 800; }
.stat-label { color: var(--muted); font-size: .8rem; }
.bottomnav, .more-sheet { display: none; }

/* ================= Login & Seiten ohne Menü ================= */
.center-page { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; background: linear-gradient(160deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 78%, #000) 55%, color-mix(in srgb, var(--accent) 53%, #000) 100%); }
.login-card { border-top: 6px solid var(--yellow); }
.login-org { font-weight: 700; color: var(--red); margin: 0 0 4px; }
.login-card { width: 100%; max-width: 400px; padding: 28px; text-align: left; }
.login-card .brand { color: var(--text); }
.login-form { display: grid; gap: 14px; margin-top: 16px; }
.login-card form { margin-top: 14px; }

.install-code { display: block; word-break: break-all; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; margin: 6px 0 2px; font-size: .8rem; }
/* ---- Installer ---- */
.install-page { min-height: 100vh; background: #9a0510 linear-gradient(160deg, #e30613 0%, #b0050f 45%, #7a040a 100%) no-repeat; padding: 28px 16px 48px; }
.install-wrap { max-width: 1040px; margin: 0 auto; display: grid; gap: 18px; }
.install-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: #fff; }
.install-head .brand { color: #fff; margin: 0; }
.install-head .brand-logo { box-shadow: 0 0 0 3px rgba(255,255,255,.35); border-radius: 10px; }
.install-steps { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; flex-wrap: wrap; }
.install-steps li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: rgba(255,255,255,.12); color: rgba(255,255,255,.75); font-weight: 600; font-size: .88rem; }
.install-steps li span { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.2); font-weight: 800; font-size: .8rem; }
.install-steps li.current { background: var(--surface); color: var(--red); }
.install-steps li.current span { background: var(--red); color: #fff; }
.install-steps li.done { color: #fff; }
.install-steps li.done span { background: var(--yellow); color: #1d2430; }
.install-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.install-side { position: sticky; top: 20px; border-top: 5px solid var(--yellow); }
.install-side h2 { font-size: 1.05rem; margin-bottom: 4px; }
.install-check-details summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .88rem; margin-top: 6px; }
@media (min-width: 861px) { .install-check-details summary { display: none; } }
.install-checks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; }
.install-checks li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 8px; font-size: .9rem; font-weight: 600; }
.install-checks li small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.install-checks .ic, .install-todo .ic { width: 22px; height: 22px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; color: #fff; background: #98a2b3; }
.install-checks .ok .ic, .install-todo .ok .ic { background: var(--ok); }
.install-checks .warn { background: var(--warn-soft); }
.install-checks .warn .ic, .install-todo .warn .ic { background: #f0a020; }
.install-checks .bad { background: var(--bad-soft); }
.install-checks .bad .ic { background: var(--bad); }
.install-form { padding: 24px 28px; display: grid; gap: 22px; border-top: 5px solid var(--yellow); }
.install-form section { display: grid; gap: 12px; }
.install-form section + section { border-top: 1px solid var(--line); padding-top: 20px; }
.install-form h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.1rem; }
.install-form h2 .num { width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .9rem; }
.install-form .center { text-align: center; margin: -10px 0 0; }
.db-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.db-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.db-card:hover { border-color: var(--border-strong); }
.db-card:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.db-card input { margin-top: 2px; }
.db-card small { display: block; color: var(--muted); margin-top: 4px; font-size: .85rem; }
.mysql-fields { padding: 14px; background: var(--surface-2); border-radius: 12px; display: grid; gap: 10px; }
.install-adv summary { cursor: pointer; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.install-done { max-width: 680px; width: 100%; margin: 0 auto; padding: 32px; text-align: left; border-top: 5px solid var(--yellow); display: grid; gap: 14px; }
.install-done h1 { font-size: 1.5rem; margin: 0; }
.install-hero { font-size: 3rem; line-height: 1; }
.install-todo { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 10px; }
.install-todo li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.install-todo li.ok { background: var(--ok-soft); }
.install-todo li.warn { background: var(--warn-soft); }
.install-todo .btn { margin-top: 8px; }
@media (max-width: 860px) {
  .install-grid { grid-template-columns: minmax(0, 1fr); }
  .install-side { position: static; }
  .install-form { padding: 18px; }
  .install-done { padding: 22px 18px; }
  .install-page { padding: 16px 10px 32px; }
}

/* ================= Mein Plan ================= */
.day-card { display: flex; gap: 14px; align-items: flex-start; }
.day-card.needs-help { border-left: 4px solid var(--bad); }
.day-card.is-pending { border-left: 4px solid var(--warn); }
.date-block { width: 58px; flex: none; text-align: center; border-radius: 12px; background: var(--red); color: #fff; padding: 6px 0; border-bottom: 4px solid var(--yellow); }
.db-wd { font-size: .75rem; font-weight: 700; text-transform: uppercase; }
.db-d { font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.db-m { font-size: .75rem; }
.day-body { flex: 1; min-width: 0; }
.day-title { font-weight: 700; font-size: 1.05rem; }
.assign-list { list-style: none; padding: 0; margin: 6px 0; }
.assign-list li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.note { background: var(--surface-2); border-radius: 8px; padding: 6px 10px; margin-top: 6px; font-size: .9rem; white-space: pre-wrap; }

.setup-card { border-top: 5px solid var(--yellow); margin-top: 8px; }
.setup-card .progress { margin-bottom: 8px; }
.setup-card .section-head .badge { margin-left: auto; }
.setup-hide { margin-left: 4px; }
.setup-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.setup-list li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.setup-list li:last-child { border-bottom: 0; }
.setup-list li.done a { color: var(--muted); text-decoration: line-through; }
.setup-check { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 2px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; }
.setup-list li.done .setup-check { background: var(--ok); border-color: var(--ok); }
.setup-main { display: grid; gap: 4px; justify-items: start; }
.setup-main a { font-weight: 700; }

/* ================= Kalender ================= */
.cal-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-toolbar h2 { margin: 0 8px; min-width: 170px; text-align: center; }
.cal-toolbar .btn-ghost:not(.btn-sm) { font-size: 1.2rem; }
.legend { margin-left: auto; display: flex; gap: 12px; color: var(--muted); font-size: .85rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head { text-align: center; font-weight: 700; color: var(--muted); font-size: .85rem; padding: 4px; }
.cal-cell { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 4px; cursor: default; position: relative; }
.cal-cell.other { background: var(--surface-2); opacity: .65; }
.cal-cell.today { border: 2px solid var(--red); }
.cal-cell.past .cal-pill { opacity: .7; }
.cal-num { font-weight: 700; font-size: .85rem; color: var(--muted); }
.cal-add { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--red); opacity: 0; pointer-events: none; transition: opacity .15s; }
.cal-cell:hover .cal-add { opacity: .5; }
.cal-cell[title] { cursor: pointer; }
.cal-pill { display: flex; flex-direction: column; gap: 3px; background: var(--ok-soft); border-left: 3px solid var(--ok); border-radius: 6px; padding: 4px 6px; text-decoration: none; color: var(--text); font-size: .8rem; }
.cal-pill.under { background: var(--bad-soft); border-left-color: var(--bad); }
.cal-pill:hover { filter: brightness(.96); }
.cal-pill-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-pill-meta { display: flex; gap: 3px; flex-wrap: wrap; }
.cal-pill .badge { min-width: 0; font-size: .7rem; padding: 0 6px; }
.cal-list { display: none; }
.list-day { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); margin-bottom: 8px; }
.list-day.past { opacity: .6; }
.ld-date { width: 64px; flex: none; }
.ld-main { flex: 1; min-width: 0; }
.ld-title { font-weight: 700; }
.ld-badges { display: flex; gap: 4px; flex-direction: column; align-items: flex-end; }
.station-checks, .chip-checks { display: flex; flex-direction: column; gap: 4px; }
.chip-checks { flex-direction: row; flex-wrap: wrap; }
.station-check { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.chip-check { display: inline-flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; }

/* ================= Tagesplaner ================= */
.planner-head { margin-bottom: 12px; }
.ph-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ph-date { flex: 1; min-width: 200px; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ph-date h1 { font-size: 1.4rem; margin: 0; }
.ph-details summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: .9rem; padding: 4px 0; }
.ph-details[open] summary { margin-bottom: 8px; }
.ph-fields { display: grid; grid-template-columns: 1.2fr 1.2fr .8fr auto; gap: 10px 14px; align-items: end; }
.ph-field { display: flex; flex-direction: column; gap: 3px; font-size: .85rem; font-weight: 600; color: var(--muted); }
.ph-field input, .ph-field select, .ph-field textarea { color: var(--text); font-weight: 400; }
.staffing { margin-bottom: 12px; display: grid; gap: 8px; }
.staffing-nums { display: flex; gap: 18px; flex-wrap: wrap; font-size: 1.02rem; }
.progress { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.progress-bar { height: 100%; background: var(--ok); border-radius: 8px; transition: width .3s; }
.staffing-warn .progress-bar { background: #f0a020; }
.staffing-bad .progress-bar { background: var(--bad); }
.staffing-alert { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--bad-soft); color: var(--bad); font-weight: 700; padding: 8px 12px; border-radius: 10px; }
.planner-grid { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 14px; align-items: start; }
.pool { position: sticky; top: 72px; max-height: calc(100vh - 86px); max-height: calc(var(--app-height, 100vh) - 86px); display: flex; flex-direction: column; padding: 12px; }
.pool-head .hint { margin: 2px 0 6px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: 100%; background: var(--surface-3); padding: 4px; border-radius: 10px; }
.tab { flex: 1; border: 0; background: transparent; padding: 7px 8px; border-radius: 8px; font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.big-tabs { margin-bottom: 14px; max-width: 560px; }
.big-tabs .tab { font-size: .95rem; padding: 9px; }
.pool-list { overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 2px; border-radius: 10px; min-height: 120px; }
.pool-list.drop-hover { background: var(--red-soft); outline: 2px dashed var(--red); }
.person, .assigned {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  cursor: grab; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.person:hover, .assigned:hover { border-color: var(--hover-border); box-shadow: var(--shadow); }
.person:active, .assigned:active { cursor: grabbing; }
.person.is-assigned { background: #f7faf7; }
.person.is-assigned .person-name { color: var(--muted); }
.person.is-pending, .assigned.is-pending { border-color: #f0c070; background: var(--warn-soft); }
.person-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-meta { font-size: .75rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.qual { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-count { font-size: .75rem; color: var(--muted); font-weight: 700; }
.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.station { border-top: 4px solid var(--st, var(--red)); padding: 12px; display: flex; flex-direction: column; gap: 8px; transition: box-shadow .15s, background .15s; }
.station.drop-hover { background: #fff8f8; box-shadow: 0 0 0 3px var(--st, var(--red)); }
body.dragging .station { box-shadow: 0 0 0 2px rgba(0,0,0,.05); }
body.dragging .station.is-open { background: #fffdfd; }
.st-head { display: flex; align-items: center; gap: 8px; }
.st-title { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.st-title h3 { overflow: hidden; overflow-wrap: break-word; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.25; }
.st-times { display: flex; align-items: center; gap: 6px; }
.st-times input { width: auto; flex: 1 1 0; min-width: 0; min-height: 34px; padding: 4px 8px; font-size: .9rem; }
.st-people { display: flex; flex-direction: column; gap: 6px; min-height: 44px; }
.slot-empty { border: 2px dashed #e0c4c4; color: #c9a0a0; border-radius: 10px; padding: 9px; text-align: center; font-size: .82rem; }
.station.is-full .slot-empty { display: none; }
.time-custom { color: var(--blue); font-weight: 600; }
.add-station { margin-top: 12px; min-height: 48px; }
.signups { margin-top: 14px; }
.signup-list { list-style: none; margin: 0; padding: 0; }
.signup-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.signup-list li:last-child { border-bottom: 0; }
.su-name { font-weight: 600; flex: 1; min-width: 140px; }
.su-status { font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.su-status.st-abmeldung_beantragt { background: var(--warn-soft); color: var(--warn); }
.su-status.st-abgemeldet { background: var(--surface-3); color: var(--muted); }
.su-abgemeldet .su-name { color: var(--muted); text-decoration: line-through; }
.su-reason { font-style: italic; color: var(--muted); font-size: .88rem; flex-basis: 100%; }
.su-actions { display: flex; gap: 6px; align-items: center; }
.inline-select { min-height: 42px; }
.print-only { display: none; }

.publish-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; padding: 12px 16px; }
.publish-bar.is-draft { background: var(--warn-soft); border-color: #f3d39a; }
.publish-bar.is-published { background: var(--ok-soft); border-color: #b9dcbb; }
.req-list { display: flex; flex-wrap: wrap; gap: 4px; }
.req { font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.req-ok { background: var(--ok-soft); color: var(--ok); }
.req-miss { background: var(--bad-soft); color: var(--bad); }
.auto-title { margin: 16px 0 8px; }
.auto-preview { display: grid; gap: 8px; }
.auto-sum { font-weight: 700; color: var(--blue); }
.auto-st { border: 1px solid var(--line); border-left: 5px solid var(--st); border-radius: 10px; padding: 8px 10px; }
.auto-st-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.auto-people { display: flex; flex-wrap: wrap; gap: 4px; }
.auto-p { background: var(--surface-3); border-radius: 999px; padding: 2px 10px; font-size: .85rem; }
.auto-p.is-new { background: var(--ok-soft); color: var(--ok); font-weight: 700; }
.auto-warn { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 8px 12px; font-weight: 600; font-size: .9rem; }
.cal-pill.draft { border-left-style: dashed; }
.auto-result { padding-left: 18px; display: grid; gap: 6px; }
.cal-pill.draft .cal-pill-title::before { content: "📝 "; }

/* Auswahllisten in Dialogen */
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow-y: auto; }
.pick-list.compact { max-height: 260px; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font: inherit; text-align: left; cursor: pointer; min-height: 52px; }
.pick:hover:not(:disabled) { border-color: var(--red); background: var(--red-soft); }
.pick:disabled { opacity: .55; cursor: default; }
.pick-name { flex: 1; font-weight: 600; }
.pick-check { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.pick-check:hover { background: var(--surface-2); }
.pick-check.disabled { opacity: .5; }
.pick-check span { flex: 1; }

/* ================= Personen / Stationen ================= */
.user-list { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.user-row { display: flex; align-items: center; gap: 12px; cursor: pointer; padding: 12px 14px; margin: 0 !important; }
.user-row:hover, .station-tpl:hover, .tpl-card:hover { border-color: var(--hover-border); }
.user-row.inactive, .station-tpl.inactive { opacity: .55; }
.ur-main { flex: 1; min-width: 0; }
.ur-name { font-weight: 700; }
.ur-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--muted); font-size: 1.4rem; }
.account-box { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface-2); }
.cred { background: var(--surface-2); border-radius: 10px; padding: 12px; margin: 10px 0; display: grid; gap: 4px; font-size: 1.05rem; }
.station-tpl { border-top: 4px solid var(--st); cursor: pointer; margin: 0 !important; display: grid; gap: 4px; }
.station-tpl h3 { display: flex; align-items: center; gap: 8px; }

/* ================= Abmeldungen ================= */
.withdraw-card { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0 !important; }
.wc-main { display: grid; gap: 4px; }

/* ================= E-Mail ================= */
.ph-bar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 6px; }
.ph-chip { border: 1px solid #c8d6ec; background: #eef4fc; color: var(--blue); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.ph-chip:hover { background: #dce8f8; }
.ph-chip.on { background: var(--red); border-color: var(--red); color: #fff; }
.qual-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: -6px; }
.recipient-count { font-weight: 700; color: var(--blue); }
.mail-preview .mp-subject { font-weight: 700; font-size: 1.1rem; margin: 8px 0; }
.mp-body { white-space: pre-wrap; font: inherit; background: var(--surface-2); padding: 12px; border-radius: 10px; margin: 0; }
.tpl-card { cursor: pointer; margin: 0 !important; display: grid; gap: 6px; }
.tpl-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* ================= Tabellen ================= */
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface-2); }
.table .num { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 700; background: var(--surface-2); border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.settings-form section { margin-bottom: 14px; }
.sticky-save { position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 30%); z-index: 5; }
.test-row { margin-top: 12px; }
.test-row input { flex: 1; min-width: 200px; }

/* ================= Dialoge & Meldungen ================= */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .5); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: pop .18s; }
.modal-wide { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px 8px; }
.modal-head h3 { font-size: 1.15rem; }
.modal-body { padding: 8px 18px 16px; overflow-y: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
#toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #1d2430; color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; transition: opacity .4s, transform .4s; }
.toast-err { background: var(--bad); }
.toast-warn { background: var(--warn); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ================= Tablet ================= */
@media (max-width: 1640px) {
  .tnav-item { font-size: .9rem; padding: 8px 8px; gap: 4px; }
  .user-name { display: none; }
}
@media (max-width: 1100px) {
  .ph-fields { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .planner-grid { grid-template-columns: minmax(0, 1fr); }
  .pool { position: static; max-height: none; }
  .pool-list { max-height: 300px; }
}

/* ================= Handy ================= */
/* auch Handys im Querformat (breit, aber wenig Höhe) bekommen die Handy-Bedienung */
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) and (max-width: 1100px) {
  body { font-size: 1rem; }
  main { padding: 14px 12px calc(84px + env(safe-area-inset-bottom)); }
  .topbar { padding: 0 12px; height: 54px; }
  .topnav, .logout-btn, .user-name { display: none; }
  .brand { flex: 1; }
  h1 { font-size: 1.35rem; }
  .form-grid { grid-template-columns: 1fr; }
  .cards, .cards.grid-3, .user-list { grid-template-columns: minmax(0, 1fr); }
  .page-head > .btn-row, .page-head > .btn { width: 100%; }
  .page-head > .btn-row .btn { flex: 1; }
  .bottomnav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface);
    border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 10px rgba(0,0,0,.05);
  }
  .bnav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 2px; color: var(--muted); text-decoration: none; font-size: .7rem; font-weight: 600; border: 0; background: transparent; font-family: inherit; border-radius: 10px; position: relative; }
  .bnav-item .nav-icon { font-size: 1.35rem; }
  .bnav-item.active { color: var(--red); background: var(--red-soft); }
  .bnav-item .nav-badge { position: absolute; top: 2px; right: 18%; }
  .more-sheet { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(16,24,40,.4); opacity: 0; pointer-events: none; transition: opacity .2s; }
  .more-sheet.open { opacity: 1; pointer-events: auto; }
  .more-inner { position: absolute; bottom: 0; left: 0; right: 0; background: var(--surface); border-radius: 18px 18px 0 0; padding: 12px 12px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 4px; transform: translateY(100%); transition: transform .2s; }
  .more-sheet.open .more-inner { transform: none; }
  .more-item { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; text-decoration: none; color: var(--text); font: inherit; font-weight: 600; border: 0; background: transparent; text-align: left; }
  .more-item.active, .more-item:hover { background: var(--red-soft); color: var(--red); }

  .cal-grid { display: none; }
  .cal-list { display: block; }
  .legend { display: none; }
  .cal-toolbar h2 { flex: 1; min-width: 0; font-size: 1.1rem; }

  .ph-top { gap: 8px; }
  .ph-actions { width: 100%; flex-wrap: nowrap; }
  .ph-actions .btn { flex: 1 1 0; padding: 8px 4px; font-size: 1.1rem; }
  .ph-actions .btn-label { display: none; }
  .ph-date h1 { font-size: 1.2rem; }
  .ph-top > .btn-ghost { padding: 4px 6px; }
  .ph-fields { grid-template-columns: 1fr; }
  .stations { grid-template-columns: minmax(0, 1fr); }
  .person, .assigned { padding: 10px; min-height: 52px; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; }
  .overlay { align-items: flex-end; padding: 0; }
  .modal-actions .btn { flex: 1; }
  .day-card { gap: 10px; }
  .table th, .table td { padding: 8px; }
  .stat { flex: 1; min-width: 90px; }
}

/* ================= Live-Ansicht ================= */
.live-body { background: var(--surface-3); }
.live-head { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--red); color: #fff; border-bottom: 5px solid var(--yellow); flex-wrap: wrap; position: sticky; top: 0; z-index: 10; }
.live-brand { display: flex; align-items: center; gap: 10px; font-size: 1.6rem; }
.live-org { font-weight: 800; font-size: 1.1rem; line-height: 1.1; }
.live-sub { font-size: .8rem; opacity: .9; text-transform: uppercase; letter-spacing: .08em; }
.live-date { display: flex; align-items: center; gap: 6px; flex: 1; justify-content: center; }
.live-date .btn-ghost { color: #fff; font-size: 1.4rem; }
.live-date .btn-ghost:hover { background: rgba(255,255,255,.15); }
.live-date-text { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; flex-wrap: wrap; justify-content: center; }
.live-badge { background: var(--yellow); color: #1d2430; font-weight: 800; font-size: .75rem; padding: 2px 8px; border-radius: 999px; animation: blink 2s infinite; }
@keyframes blink { 50% { opacity: .55; } }
.live-clock { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.live-fs { color: #fff; font-size: 1.3rem; }
.live-meta { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 20px; color: var(--muted); }
.live-wrap > .card, .live-wrap > section { margin: 0 16px 14px; }
.live-now h2 { margin-bottom: 8px; }
.live-now-list { display: flex; flex-wrap: wrap; gap: 8px; }
.live-chip { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--st); min-width: 150px; flex: 0 1 auto; }
@media (max-width: 720px) { .live-chip { flex: 1 1 140px; min-width: 0; } .live-chip span { white-space: normal; } }
.live-chip span { font-size: .8rem; color: var(--muted); }
.live-tl { padding: 8px 0; }
.tl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tl-inner { min-width: 1100px; padding: 0 12px; }
.tl-row { display: flex; border-bottom: 1px solid var(--line); }
.tl-row:last-child { border-bottom: 0; }
.tl-label { width: 190px; flex: none; padding: 8px 10px 8px 12px; display: flex; flex-direction: column; gap: 2px; align-items: flex-start; position: sticky; left: 0; background: var(--surface); z-index: 3; border-left: 5px solid var(--st, transparent); }
.tl-track { position: relative; flex: 1; min-height: 44px; }
.tl-axis .tl-track { height: 24px; min-height: 24px; }
.tl-axis { border-bottom: 2px solid var(--line); position: sticky; top: 0; }
.tl-hour { position: absolute; top: 4px; transform: translateX(-50%); font-size: .75rem; font-weight: 700; color: var(--muted); }
.tl-grid { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--surface-3); }
.tl-window { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--st) 7%, transparent); border-left: 2px solid color-mix(in srgb, var(--st) 40%, transparent); border-right: 2px solid color-mix(in srgb, var(--st) 40%, transparent); }
.tl-bar { position: absolute; height: 28px; border-radius: 8px; background: var(--st); color: #fff; display: flex; align-items: center; gap: 8px; padding: 0 8px; overflow: hidden; white-space: nowrap; font-size: .85rem; box-shadow: var(--shadow); z-index: 1; }
.tl-bar.done { opacity: .45; }
.tl-bar.active { box-shadow: 0 0 0 3px var(--yellow), var(--shadow); }
.tl-name { font-weight: 700; }
.tl-time { opacity: .9; font-size: .78rem; }
.tl-empty { position: absolute; top: 8px; height: 28px; border: 2px dashed #e0c4c4; color: #c9a0a0; border-radius: 8px; font-size: .8rem; display: flex; align-items: center; justify-content: center; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 3px; margin-left: -1px; background: var(--red); z-index: 2; }
.tl-nowrow { border-bottom: 0; }
.tl-nowrow .tl-track { height: 24px; min-height: 24px; }
.tl-now-label { position: absolute; transform: translateX(-50%); background: var(--red); color: #fff; font-weight: 700; font-size: .75rem; padding: 1px 6px; border-radius: 6px; top: 2px; }
.live-foot { text-align: center; padding: 8px 16px 20px; }
.live-link { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.live-link input { flex: 1; min-width: 220px; font-family: ui-monospace, monospace; font-size: .85rem; }
@media (max-width: 720px) {
  .live-head { padding: 8px 12px; gap: 8px; }
  .live-brand { font-size: 1.2rem; }
  .live-org { font-size: .95rem; }
  .live-clock { font-size: 1.4rem; margin-left: auto; }
  .live-date { order: 3; flex-basis: 100%; }
  .live-date-text { font-size: 1rem; }
  .live-fs { display: none; }
  .live-meta { padding: 8px 12px; font-size: .9rem; }
  .live-wrap > .card, .live-wrap > section { margin: 0 8px 10px; }
  .tl-inner { min-width: 1000px; }
  .tl-label { width: 120px; font-size: .85rem; }
}

/* Live-Ansicht: dunkler Modus (abends / nachts) */
.live-theme { color: #fff; font-size: .9rem; white-space: nowrap; }
.live-theme:hover { background: rgba(255,255,255,.15); }
body.theme-dark {
  --bg: #0f1216; --card: #1a1f26; --text: #e8ecf2; --muted: #9aa4b2; --line: #2a313b;
  --ok-soft: #12301a; --bad-soft: #3a1416; --warn-soft: #3a2a10;
  background: var(--bg); color: var(--text);
}
body.theme-dark .live-head { background: #1a1f26; border-bottom-color: var(--red); }
body.theme-dark .card, body.theme-dark .tl-label, body.theme-dark .live-chip { background: var(--card); border-color: var(--line); color: var(--text); }
body.theme-dark .tl-grid { border-left-color: #222831; }
body.theme-dark .tl-bar.done { opacity: .35; }
body.theme-dark .tl-empty { border-color: #5a3a3d; color: #b98a8e; }
body.theme-dark .badge-ok { color: #7bd88f; }
body.theme-dark .badge-bad { color: #ff8a8f; }
body.theme-dark .empty h3 { color: var(--text); }
body.theme-dark .btn { background: #232a33; color: var(--text); border-color: #323b47; }
body.theme-dark .live-head .btn-ghost { background: transparent; border-color: transparent; color: #fff; }

/* Rechtstexte & Datenschutz */
.legal h2 { font-size: 1.4rem; margin: 0 0 12px; }
.legal h3 { font-size: 1.05rem; margin: 18px 0 6px; }
.legal p, .legal li { line-height: 1.55; }
.legal ul { padding-left: 20px; margin: 4px 0 10px; }
.legal-missing { background: var(--warn-soft); color: var(--warn); font-weight: 700; padding: 0 4px; border-radius: 4px; }
.legal-card { padding: 22px 26px; }
.legal-footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 18px 0 4px; }
.legal-footer a { color: var(--muted); }
.login-card .legal-footer { padding-bottom: 0; }
.consent-page h1 { margin-bottom: 8px; }
.legal-box { border: 1px solid var(--line); border-radius: 12px; margin: 12px 0 18px; }
.legal-box summary { cursor: pointer; padding: 10px 14px; font-weight: 700; color: var(--blue); }
.legal-scroll { max-height: 45vh; overflow-y: auto; padding: 0 16px 12px; border-top: 1px solid var(--line); }
.consent-item { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; background: var(--surface-2); }
.consent-item p { margin: 4px 0; }
.ack-check { margin: 14px 0; font-weight: 600; flex-wrap: nowrap; align-items: flex-start; }
.center { text-align: center; }
.mt { margin-top: 18px; }
.checklist { padding-left: 20px; display: grid; gap: 8px; }
.table tr.inactive td { opacity: .55; }

/* ================= Druck ================= */
@media print {
  .topbar, .bottomnav, .more-sheet, .planner > :not(.print-only), #toasts, .legal-footer, .legal-card + .btn-row { display: none !important; }
  .print-only { display: block !important; }
  body { background: var(--surface); }
  main { padding: 0; }
  .print-table { width: 100%; border-collapse: collapse; margin-top: 12px; }
  .print-table th, .print-table td { border: 1px solid #999; padding: 8px; text-align: left; vertical-align: top; }
}

/* ---------- U18-Regel ---------- */
.tag-minor { background: #e3f0ff; color: #0b5cad; text-transform: none; }
.minor-banner ul { margin: 6px 0 0; padding-left: 20px; font-weight: 500; }
.station.has-minor-issue { box-shadow: 0 0 0 2px var(--warn) inset; }

/* ---------- Änderungsprotokoll ---------- */
.audit-list { list-style: none; margin: 0; padding: 0; }
.audit-item { display: flex; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.audit-item:last-child { border-bottom: 0; }
.audit-icon { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; font-size: .9rem; }
.audit-main { min-width: 0; flex: 1; }
.audit-details { overflow-wrap: anywhere; margin: 2px 0; }
.audit-publish .audit-icon { background: var(--ok-soft); }
.audit-day_delete .audit-icon, .audit-unassign .audit-icon, .audit-signup_remove .audit-icon { background: var(--bad-soft); }
.audit-toolbar .inline-field { display: inline-flex; align-items: center; gap: 6px; font-size: .9rem; color: var(--muted); }
.audit-toolbar .inline-field input { width: auto; margin: 0; }

/* ---------- Halbtags, Warteliste, Kalender ---------- */
.tag-part { background: #fff4d6; color: #8a5a00; text-transform: none; }
.su-part { width: auto; padding: 2px 6px; font-size: .85rem; }
.waitlist li { list-style: decimal inside; }
.plain-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.plain-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ics-btn.ics-ok { color: var(--ok); border-color: var(--ok); }
.ics-btn.ics-changed { color: var(--warn); border-color: var(--warn); background: var(--warn-soft); }
.geo-results { margin-top: 8px; }

/* ---------- Wachbuch ---------- */
.lb-tabs { margin-bottom: 14px; display: inline-flex; }
.lb-tabs .tab { text-decoration: none; }
.lb-head { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.lb-title { font-weight: 700; font-size: 1.15rem; }
.lb-when { display: flex; flex-wrap: wrap; gap: 10px; }
.lb-when .field { margin: 0; }
.lb-lab { font-size: .8rem; font-weight: 700; color: var(--muted); display: block; }
.lb-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; align-items: start; }
.lb-station { display: block; min-width: 0; }
.lb-station select, .lb-station input { width: 100%; }
.lb-row { display: grid; grid-template-columns: 1.5fr 1.5fr .8fr .8fr .55fr 36px; gap: 6px; align-items: center; padding: 4px 0; }
.lb-row input { margin: 0; min-width: 0; }
.lb-row-head { font-size: .8rem; font-weight: 700; color: var(--muted); border-bottom: 1px solid var(--line); }
.lb-h { font-size: .85rem; white-space: nowrap; }
.lb-total { margin: 10px 0; text-align: right; }
.lb-acc summary { cursor: pointer; font-weight: 700; padding: 2px 0; }
.lb-acc[open] summary { margin-bottom: 10px; }
.lb-side .card { margin-bottom: 10px; }
.lb-stat { display: grid; grid-template-columns: 1fr 90px 56px; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.lb-stat input { margin: 0; }
.lb-acts { white-space: nowrap; }
.icon-btn.danger { color: var(--bad); }
.banner-ok { background: var(--ok-soft); color: var(--ok); }
@media (max-width: 900px) {
  .lb-grid { grid-template-columns: 1fr; }
  .lb-row { grid-template-columns: 1fr 1fr; }
  .lb-row-head { display: none; }
  .lb-row { border-bottom: 1px dashed var(--line); padding: 8px 0; }
}

/* ---------- Registrierung ---------- */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.register-card { max-width: 560px; }
.register-link { text-align: center; margin-top: 12px; }
.reg-card { border-left: 4px solid var(--warn); }
.reg-item { padding: 12px 0; border-top: 1px solid var(--line); }
.reg-item.is-highlight { background: var(--warn-soft); margin: 0 -16px; padding: 12px 16px; }
.reg-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.reg-choices { display: grid; gap: 4px; margin: 8px 0; }
.reg-choice { align-items: flex-start; }

/* Bemerkung zur Anmeldung */
.su-note { display: block; font-size: .78rem; color: var(--blue); margin-top: 2px; overflow-wrap: anywhere; }
.my-note { display: grid; gap: 3px; margin: 6px 0 2px; }
.my-note input { min-height: 36px; padding: 6px 10px; font-size: .9rem; }

/* ================= Stationsmeldung ================= */
.banner-ok { background: var(--ok-soft); color: var(--ok); }
.sr-builder-title { margin: 18px 0 4px; }
.sr-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.sr-row { display: grid; grid-template-columns: 28px minmax(0, 2fr) minmax(0, 1fr) minmax(0, 2fr) auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.sr-row .sr-opts { grid-column: 2 / -2; }
.sr-num { width: 26px; height: 26px; border-radius: 50%; background: var(--red-soft); color: var(--red); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.sr-tools { display: inline-flex; gap: 2px; }
.sr-stats { display: grid; gap: 6px; margin-bottom: 14px; }
.sr-stat { display: grid; grid-template-columns: minmax(0, 1fr) 90px 80px; gap: 10px; align-items: center; }
.sr-stat-head { font-size: .78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.sr-stat-head span:not(:first-child), .sr-sum { text-align: center; }
.sr-sum { color: var(--muted); font-weight: 700; background: var(--surface-3); border-radius: 8px; padding: 8px 4px; }
.sr-yesno { display: flex; gap: 8px; }
.sr-panel h2 { display: flex; align-items: center; gap: 8px; }
.sr-toggle-row { margin: 4px 0 10px; }
.sr-in-logbook { box-shadow: none; background: var(--surface-2); margin-bottom: 12px; }
.sr-missing { margin-top: 12px; border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 6px; }
.sr-missing h3 { font-size: .9rem; color: var(--muted); margin: 0; }
.sr-missing-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; }
.sr-report { border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.sr-report.sr-uebernommen { border-left-color: var(--ok); }
.sr-report.sr-abgelehnt { border-left-color: #98a2b3; opacity: .8; }
.sr-report-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sr-items { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 3px; }
.sr-items li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.sr-items li b { min-width: 24px; }
@media (max-width: 720px) {
  .sr-row { grid-template-columns: 28px minmax(0, 1fr) auto; }
  .sr-row select, .sr-row .sr-opts { grid-column: 2 / -1; }
  .sr-row .sr-tools { grid-column: 3; grid-row: 1; }
  .sr-stat { grid-template-columns: minmax(0, 1fr) 76px 60px; }
}

/* E-Mail: Absender wählen */
.sender-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }
.sender-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; }
.sender-opt:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.sender-opt span { display: grid; gap: 2px; }
.sender-opt input { margin-top: 3px; }

/* ================= Gemeinsames Planen ================= */
.presence-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 12px; background: #e8f3ff; color: #0b4a8b; font-weight: 600; font-size: .92rem; border: 1px solid #c8def5; }
.presence-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 0 rgba(46,125,50,.5); animation: presence-pulse 1.8s infinite; }
@keyframes presence-pulse { 70% { box-shadow: 0 0 0 8px rgba(46,125,50,0); } 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); } }
.cal-editing { display: block; margin-top: 3px; font-size: .72rem; font-weight: 700; color: var(--blue); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flash { animation: flash-change 2.4s ease-out; }
@keyframes flash-change { 0%, 30% { background: #fff3b0; box-shadow: 0 0 0 3px #ffd84d; } 100% { background: inherit; box-shadow: none; } }

/* ================= Geräteanpassung =================
   device.js setzt an <html>: data-input (touch|hybrid|mouse), data-size (phone-s|phone|tablet|desktop),
   data-orient, data-os, data-standalone, data-keyboard und --app-height (sichtbare Höhe). */

/* Sichtbare Höhe statt 100vh – Browserleisten und Tastatur werden berücksichtigt */
.modal { max-height: calc(var(--app-height, 100dvh) - 32px); }

/* Notch und abgerundete Ecken (v. a. im Querformat) */
.topbar { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
main { padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.bottomnav { padding-left: max(4px, env(safe-area-inset-left)); padding-right: max(4px, env(safe-area-inset-right)); }
@media (max-width: 720px), (pointer: coarse) and (max-height: 500px) and (max-width: 1100px) {
  .topbar { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
  main { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); }
}
/* Als App gestartet: Statusleiste oben freihalten */
[data-standalone="1"] .topbar { padding-top: env(safe-area-inset-top); height: calc(60px + env(safe-area-inset-top)); }

/* Bedienung per Finger: größere Tippflächen, keine 300-ms-Verzögerung, kein Zoom beim Antippen von Feldern */
button, a, .btn, .pick, .person, .assigned, label, summary { touch-action: manipulation; }
[data-input="touch"] { -webkit-tap-highlight-color: rgba(227, 6, 19, .12); }
[data-input="touch"] .btn { min-height: 44px; }
[data-input="touch"] .btn-sm, [data-input="touch"] .btn.small { min-height: 38px; }
[data-input="touch"] .icon-btn { min-width: 44px; min-height: 44px; }
[data-input="touch"] input, [data-input="touch"] select, [data-input="touch"] textarea { min-height: 46px; font-size: max(16px, 1rem); }
[data-input="touch"] input[type=checkbox], [data-input="touch"] input[type=radio] { width: 24px; height: 24px; min-height: 0; }
[data-input="touch"] .check, [data-input="touch"] .switch { min-height: 46px; }
[data-input="touch"] .tab { padding: 11px 8px; }
[data-input="touch"] .chip-check, [data-input="touch"] .ph-chip { padding: 8px 12px; }
[data-input="touch"] .tnav-item { padding: 10px 10px; }
[data-input="touch"] .table tr.clickable td { padding-top: 12px; padding-bottom: 12px; }
[data-input="touch"] .btn:active, [data-input="touch"] .pick:active, [data-input="touch"] .bnav-item:active { transform: scale(.97); }
/* Hover-Effekte bleiben auf Touch-Geräten sonst nach dem Antippen „hängen“ */
@media (hover: none) {
  .cal-cell:hover .cal-add { opacity: 0; }
  .user-row:hover, .person:hover, .assigned:hover { border-color: var(--line); box-shadow: none; }
}
/* Touchscreen mit Maus (z. B. Convertible): etwas größere Flächen, Ziehen bleibt möglich */
[data-input="hybrid"] .icon-btn { min-width: 38px; min-height: 38px; }

/* Bildschirmtastatur offen: untere Leiste ausblenden, damit das Eingabefeld sichtbar bleibt */
[data-keyboard="1"] .bottomnav { display: none !important; }
[data-keyboard="1"] main { padding-bottom: 24px; }
[data-keyboard="1"] #toasts { bottom: 12px; }

/* Handy: lange Button-Texte umbrechen statt die Seite zu verbreitern; lange Wörter/Adressen umbrechen */
[data-size="phone"] .btn, [data-size="phone-s"] .btn { white-space: normal; max-width: 100%; text-align: center; }
[data-size="phone"] main, [data-size="phone-s"] main { overflow-wrap: anywhere; }
[data-size="phone"] .cards, [data-size="phone-s"] .cards { grid-template-columns: minmax(0, 1fr); }

/* Meldungen auf dem Handy über der unteren Leiste */
[data-size="phone"] #toasts, [data-size="phone-s"] #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }

/* Sehr kleine Handys (≤ 360 px, z. B. iPhone SE 1. Gen., kleine Android-Geräte) */
[data-size="phone-s"] body { font-size: .9375rem; }
[data-size="phone-s"] main { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
[data-size="phone-s"] .card { padding: 12px; }
[data-size="phone-s"] h1 { font-size: 1.2rem; }
[data-size="phone-s"] .bnav-item { font-size: .62rem; padding: 6px 0; }
[data-size="phone-s"] .bnav-item .nav-icon { font-size: 1.2rem; }
[data-size="phone-s"] .topbar { padding-left: 8px; padding-right: 8px; gap: 8px; }
[data-size="phone-s"] .stat { min-width: 0; padding: 8px 10px; }
[data-size="phone-s"] .modal-body { padding: 6px 12px 12px; }
[data-size="phone-s"] .modal-actions { padding: 10px 12px; flex-wrap: wrap; }

/* Handy quer: wenig Höhe → kompakte Leisten */
@media (pointer: coarse) and (max-height: 500px) and (max-width: 1100px) {
  .topbar { height: 46px; }
  [data-standalone="1"] .topbar { height: calc(46px + env(safe-area-inset-top)); }
  .bnav-item { flex-direction: row; justify-content: center; gap: 6px; padding: 4px 2px; }
  .bnav-item .nav-icon { font-size: 1.1rem; }
  main { padding-top: 10px; padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .overlay { align-items: center; padding: 8px; }
  .modal { border-radius: 14px; max-height: calc(var(--app-height, 100dvh) - 16px); max-width: 680px; }
  .center-page { align-items: flex-start; padding: 12px; }
}

/* Tablet: Platz nutzen, aber Finger-tauglich */
[data-size="tablet"][data-input="touch"] .modal { max-width: 640px; }
[data-size="tablet"][data-input="touch"] .modal-wide { max-width: 860px; }

/* Große Bildschirme: etwas mehr Breite */
/* ================= PC =================
   Große Bildschirme: Planer und Tabellen dürfen breiter werden, Lese-Seiten bleiben angenehm schmal. */
@media (min-width: 1500px) {
  main:has(.planner), main:has(.cal-grid), main:has(.table), main:has(.user-list) { max-width: 1600px; }
  .stations { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}
a.pick { text-decoration: none; color: var(--text); }
.btn-row input[type=date] { width: auto; }
/* Einstellungen: auf dem PC mit Inhaltsverzeichnis am Rand */
.settings-page { max-width: 760px; margin: 0 auto; }
.toc { display: none; }
@media (min-width: 1100px) {
  .settings-page { max-width: 1060px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
  .toc { display: grid; gap: 2px; position: sticky; top: 84px; padding-top: 58px; }
  .toc-title { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 12px 6px; }
  .toc-item { border: 0; background: transparent; text-align: left; font: inherit; font-size: .92rem; font-weight: 600; color: var(--muted); padding: 7px 12px; border-radius: 8px; cursor: pointer; border-left: 3px solid transparent; }
  .toc-item:hover { background: var(--surface); color: var(--text); }
  .toc-item.active { color: var(--red); background: var(--red-soft); border-left-color: var(--red); }
  .settings-main section.card { scroll-margin-top: 80px; }
}
.setup-main a { text-decoration: none; }
.setup-main a:hover { text-decoration: underline; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); max-height: none; }
/* Kopfzeile hebt sich beim Scrollen leicht ab */
.topbar { box-shadow: 0 1px 0 rgba(16, 24, 40, .04), 0 4px 14px rgba(16, 24, 40, .05); }
/* Mausbedienung: Karten und Listen reagieren sichtbar beim Darüberfahren */
@media (hover: hover) and (pointer: fine) {
  .day-card, .user-row, .pick, .station-tpl, .tpl-card { transition: box-shadow .15s, border-color .15s, transform .15s; }
  .day-card:hover, .user-row:hover, a.pick:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
  .table tbody tr:hover td { background: var(--surface-2); }
  ::-webkit-scrollbar { width: 10px; height: 10px; }
  ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid var(--bg); }
  ::-webkit-scrollbar-track { background: transparent; }
}

/* Weniger Bewegung, wenn im System eingestellt */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
/* Mehr Kontrast, wenn im System eingestellt */
@media (prefers-contrast: more) {
  :root { --muted: #3d4655; --line: #9aa4b2; }
  .btn, input, select, textarea { border-color: #6b7686; }
}

/* ================= Darstellung: Dunkelmodus und persönliche Anpassung =================
   theme.js setzt an <html>: data-theme (light|dark), data-font, data-density, data-radius, data-contrast, data-motion
   sowie --accent (Akzentfarbe) und --font-scale (Schriftgröße). */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1217; --card: #161b22; --surface: #161b22; --surface-2: #1c222a; --surface-3: #232a33;
  --text: #e6e9ee; --muted: #9aa4b2; --line: #2a313b; --border-strong: #3a4350; --hover-border: #4a5462;
  --ok: #5cc46f; --ok-soft: #12301a; --warn: #e0a040; --warn-soft: #3a2a10; --bad: #ff6b6b; --bad-soft: #3a1416; --blue: #6ea8ff;
  --red-soft: color-mix(in srgb, var(--accent) 22%, var(--card));
  --shadow: 0 1px 2px rgba(0, 0, 0, .45); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .6);
}
html[data-theme="dark"] .presence-bar { background: #10263f; color: #9cc8ff; border-color: #1f3d60; }
html[data-theme="dark"] .flash { animation-name: flash-change-dark; }
@keyframes flash-change-dark { 0%, 30% { background: #4a3d00; box-shadow: 0 0 0 3px #8a7100; } 100% { background: inherit; box-shadow: none; } }
html[data-theme="dark"] .slot-empty { border-color: #5a3a3d; color: #b98a8e; }
html[data-theme="dark"] .toast { background: #2a313b; }
html[data-theme="dark"] .overlay { background: rgba(0, 0, 0, .65); }
html[data-theme="dark"] .tnav-item.active, html[data-theme="dark"] .bnav-item.active { color: color-mix(in srgb, var(--accent) 55%, #fff); }
html[data-theme="dark"] .brand, html[data-theme="dark"] .userchip { color: var(--text); }
html[data-theme="dark"] .badge-ok { color: #7bd88f; }
html[data-theme="dark"] .badge-bad { color: #ff8a8f; }
html[data-theme="dark"] input[type=date], html[data-theme="dark"] input[type=time] { color-scheme: dark; }
html[data-theme="dark"] img.brand-logo { filter: brightness(.95); }
html[data-theme="dark"] .avatar { background: #2a3340; color: #c9d1dc; }

/* Schriftart */
html[data-font="serif"] { --font: Georgia, Cambria, "Times New Roman", serif; }
html[data-font="rounded"] { --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Arial Rounded MT Bold", system-ui, sans-serif; }
html[data-font="readable"] { --font: "Atkinson Hyperlegible", Verdana, Tahoma, "DejaVu Sans", sans-serif; letter-spacing: .01em; }
html[data-font="condensed"] { --font: "Roboto Condensed", "Arial Narrow", "Liberation Sans Narrow", system-ui, sans-serif; }
html[data-font="mono"] { --font: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace; }

/* Abstände */
html[data-density="compact"] body { line-height: 1.35; }
html[data-density="compact"] main { padding-top: 14px; }
html[data-density="compact"] .card { padding: 11px 12px; }
html[data-density="compact"] .form-grid { gap: 9px; }
html[data-density="compact"] .btn:not(.btn-sm) { min-height: 34px; padding: 6px 12px; }
html[data-density="compact"] input, html[data-density="compact"] select { min-height: 36px; padding: 6px 10px; }
html[data-density="compact"] .page-head { margin-bottom: 10px; }
html[data-density="comfy"] body { line-height: 1.6; }
html[data-density="comfy"] .card { padding: 22px; }
html[data-density="comfy"] .form-grid { gap: 18px; }
html[data-density="comfy"] .cards, html[data-density="comfy"] .user-list { gap: 16px; }

/* Ecken */
html[data-radius="square"] { --radius: 4px; --radius-sm: 3px; }
html[data-radius="round"] { --radius: 22px; --radius-sm: 16px; }
html[data-radius] .btn, html[data-radius] input, html[data-radius] select, html[data-radius] textarea, html[data-radius] .pick,
html[data-radius] .tab, html[data-radius] .tabs, html[data-radius] .tnav-item, html[data-radius] .person, html[data-radius] .assigned { border-radius: var(--radius-sm); }
html[data-radius] .modal { border-radius: var(--radius); }

/* Kontrast */
html[data-contrast="high"] { --muted: #3d4655; --line: #8f99a8; --border-strong: #5f6a7a; }
html[data-contrast="high"][data-theme="dark"] { --muted: #c3cad4; --line: #5b6573; --border-strong: #7c8796; --text: #ffffff; }
html[data-contrast="high"] .btn, html[data-contrast="high"] input, html[data-contrast="high"] select, html[data-contrast="high"] textarea { border-width: 2px; }
html[data-contrast="high"] a { text-decoration: underline; }

/* Bewegung */
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }

/* Profil: Darstellung einstellen */
.theme-section .theme-grid { display: grid; gap: 14px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--surface-3); padding: 4px; border-radius: 12px; }
.seg button { border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--muted); padding: 8px 12px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 3px var(--text); }
.swatch-custom { width: 44px; height: 36px; padding: 2px; border-radius: 10px; cursor: pointer; }
.theme-row { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 12px; align-items: center; }
.theme-preview { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--bg); display: grid; gap: 10px; }
@media (max-width: 720px) { .theme-row { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
