/* Schanzplan – Look „Dienstbuch“: Papier, Tinte, Linien. Regeln und Verbotsliste in CLAUDE.md.
   Farben, Schriften, Größen, Abstände und Radien kommen ausschließlich aus den Variablen unten. */

:root {
  color-scheme: light;
  /* Papier und Tinte */
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #efebe3;
  --surface-3: #e6e0d4;
  --line: #ddd6c9;
  --line-strong: #8f8778;
  --ink: #1f2020;
  --ink-2: #484644;
  --muted: #625e57;
  /* Marke: Anthrazit, Gold, Terrakotta (Quelle siehe CLAUDE.md, offene Prüfpunkte) */
  --bar: #252626;
  --bar-ink: #f5f3ee;
  --bar-muted: #c4beb3;
  --gold: #bda16b;
  --gold-ink: #6f5a2c;
  --accent: #96594a;
  --accent-hover: #7f4a3d;
  --on-accent: #ffffff;
  --link: #8a5143;
  /* Bereiche und Status */
  --theke-bg: #f4eddd;
  --theke-line: #b39a62;
  --theke-ink: #6a5526;
  --open: #b3261e;
  --open-bg: #fbeae8;
  --warn: #8a4a0c;
  --warn-bg: #fbf0e1;
  --warn-line: #c98a45;
  --ok: #276a42;
  --ok-bg: #e4f1e8;
  --part: #4f6b1a;
  --part-bg: #eef4e2;
  --mine-bg: #1f2020;
  --mine-ink: #ffffff;
  --today-bg: #f6efdf;
  --hatch: #e9e4da;
  --scrim: rgb(20 20 20 / .5);
  --focus: #96594a;

  /* Schrift */
  --font-head: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Heading", Cambria, "Noto Serif", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
  --fs-xs: .8125rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.75rem;
  --fs-2xl: 2.25rem;
  --lh: 1.45;

  /* Abstände, Radien, Maße */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --r-1: 3px;
  --r-2: 5px;
  --tap: 44px;
  --bar-h: 56px;
  --page-w: 1320px;
  --dur: 120ms;
}

/* Nachtschicht: Werte doppelt, damit System-Einstellung und Umschalter dasselbe ergeben */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #161616;
  --surface: #1e1e1d;
  --surface-2: #262624;
  --surface-3: #2f2e2b;
  --line: #363531;
  --line-strong: #6f6a61;
  --ink: #ece8e1;
  --ink-2: #cfc9be;
  --muted: #a7a196;
  --bar: #101010;
  --bar-ink: #ece8e1;
  --bar-muted: #a7a196;
  --gold: #bda16b;
  --gold-ink: #d6bf8f;
  --accent: #d7967f;
  --accent-hover: #e3a994;
  --on-accent: #1a1210;
  --link: #e0a690;
  --theke-bg: #2b261b;
  --theke-line: #8c7646;
  --theke-ink: #dcc590;
  --open: #f39488;
  --open-bg: #3b1f1c;
  --warn: #eeb175;
  --warn-bg: #33271a;
  --warn-line: #a8743f;
  --ok: #86cc9f;
  --ok-bg: #1b2d22;
  --part: #b7d07e;
  --part-bg: #252c18;
  --mine-bg: #ece8e1;
  --mine-ink: #161616;
  --today-bg: #2a2619;
  --hatch: #222120;
  --scrim: rgb(0 0 0 / .65);
  --focus: #e0a690;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #161616;
    --surface: #1e1e1d;
    --surface-2: #262624;
    --surface-3: #2f2e2b;
    --line: #363531;
    --line-strong: #6f6a61;
    --ink: #ece8e1;
    --ink-2: #cfc9be;
    --muted: #a7a196;
    --bar: #101010;
    --bar-ink: #ece8e1;
    --bar-muted: #a7a196;
    --gold: #bda16b;
    --gold-ink: #d6bf8f;
    --accent: #d7967f;
    --accent-hover: #e3a994;
    --on-accent: #1a1210;
    --link: #e0a690;
    --theke-bg: #2b261b;
    --theke-line: #8c7646;
    --theke-ink: #dcc590;
    --open: #f39488;
    --open-bg: #3b1f1c;
    --warn: #eeb175;
    --warn-bg: #33271a;
    --warn-line: #a8743f;
    --ok: #86cc9f;
    --ok-bg: #1b2d22;
    --part: #b7d07e;
    --part-bg: #252c18;
    --mine-bg: #ece8e1;
    --mine-ink: #161616;
    --today-bg: #2a2619;
    --hatch: #222120;
    --scrim: rgb(0 0 0 / .65);
    --focus: #e0a690;
  }
}

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: var(--fs-md)/var(--lh) var(--font-body); -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { touch-action: manipulation; }
a { color: var(--link); }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.2; }
p { margin: var(--s-2) 0; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.17em; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Kopfleiste ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s-5);
  padding: 0 var(--s-5); min-height: var(--bar-h);
  background: var(--bar); color: var(--bar-ink);
  border-bottom: 2px solid var(--gold);
}
.brand { text-decoration: none; color: var(--bar-ink); line-height: 1.15; }
.brand > div { display: flex; flex-direction: column; }
.brand img { display: none; }
.brand b { font-family: var(--font-head); font-size: var(--fs-lg); font-weight: 600; }
.brand span { font-size: var(--fs-xs); color: var(--bar-muted); }
.nav { display: flex; gap: var(--s-1); flex: 1; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.nav a {
  display: flex; align-items: center; gap: var(--s-2); padding: 0 var(--s-3);
  color: var(--bar-muted); text-decoration: none; font-size: var(--fs-sm); white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.nav a:hover { color: var(--bar-ink); }
.nav a.active { color: var(--bar-ink); border-bottom-color: var(--bar-ink); font-weight: 600; }
.nav a:focus-visible { outline-color: var(--gold); outline-offset: -2px; }
.user { display: flex; align-items: center; gap: var(--s-2); font-size: var(--fs-sm); }
.user button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 36px; min-width: 36px; padding: 0 var(--s-3); border: 1px solid var(--bar-muted); border-radius: var(--r-1);
  background: transparent; color: var(--bar-ink); cursor: pointer; font-size: var(--fs-sm);
}
.user button:hover { background: var(--surface-3); color: var(--ink); }
.user button:focus-visible { outline-color: var(--gold); }
.user .who { color: var(--bar-muted); }

main { max-width: var(--page-w); margin: 0 auto; padding: var(--s-5) var(--s-5) var(--s-7); }

/* ---------- Knöpfe und Formulare ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 40px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-1);
  background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none;
  font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
  transition: background-color var(--dur), border-color var(--dur);
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--open); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 32px; padding: 0 var(--s-3); font-size: var(--fs-xs); }
.btn:disabled { opacity: .5; cursor: default; }
label.field, div.field { display: grid; gap: var(--s-1); font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; }
input[type=text], input[type=password], input[type=number], input[type=time], input[type=date], select, textarea {
  width: 100%; min-height: 40px; padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-1);
  background: var(--surface); color: var(--ink); font-size: var(--fs-md); font-weight: 400;
}
input[readonly] { background: var(--surface-2); }
input:disabled, select:disabled { opacity: .55; }
textarea { min-height: 120px; resize: vertical; font-family: var(--font-mono); font-size: var(--fs-sm); }
.check { display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer; font-weight: 400; color: var(--ink); min-height: 32px; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.stack { display: grid; gap: var(--s-4); align-content: start; }
details summary { cursor: pointer; }

/* ---------- Seitenkopf und Karten ---------- */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  padding-bottom: var(--s-4); margin-bottom: var(--s-5); border-bottom: 1px solid var(--line-strong);
}
.page-head h1 { font-family: var(--font-head); font-size: var(--fs-2xl); }
.page-head .sub { margin-top: var(--s-1); color: var(--muted); font-size: var(--fs-sm); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); padding: var(--s-5); }
.card h2 { font-family: var(--font-head); font-size: var(--fs-lg); margin-bottom: var(--s-1); }
.card + .card { margin-top: var(--s-4); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: var(--s-4); align-items: start; }
.cards > .card + .card { margin-top: 0; }

/* ---------- Wochen-Navigation ---------- */
.weeknav { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface); }
.weeknav button {
  min-width: var(--tap); min-height: var(--tap); border: 0; background: none; cursor: pointer; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; padding: 0 var(--s-2);
}
.weeknav button:hover { background: var(--surface-2); }
.weeknav button + .label, .weeknav .label + button { border-left: 1px solid var(--line); }
.weeknav button:last-child:not(:nth-child(3)) { border-left: 1px solid var(--line); font-size: var(--fs-sm); font-weight: 600; padding: 0 var(--s-3); }
.weeknav .label { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 var(--s-4); min-width: 168px; font-weight: 600; border-right: 1px solid var(--line); }
.weeknav .label small { color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }

/* ---------- Werkzeugleiste, Status, Hinweise ---------- */
.toolbar { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; margin-bottom: var(--s-4); }
.toolbar .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: var(--s-1); padding: var(--s-1) var(--s-2);
  border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface);
  font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2);
}
.pill.red { color: var(--open); background: var(--open-bg); border-color: transparent; }
.pill.orange { color: var(--warn); background: var(--warn-bg); border-color: transparent; }
.pill.green { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.banner {
  display: flex; gap: var(--s-2) var(--s-3); align-items: center; flex-wrap: wrap;
  padding: var(--s-3) var(--s-4); margin-bottom: var(--s-3); border-left: 3px solid var(--line-strong);
  background: var(--surface); font-size: var(--fs-sm);
}
.banner.info { border-left-color: var(--gold); }
.banner.warn { background: var(--warn-bg); border-left-color: var(--warn-line); color: var(--ink); }
.banner .btn { margin-left: auto; }

/* ---------- Wochenplan (Tabelle) ---------- */
.plan-wrap, .matrix-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); overflow-x: auto; }
table.plan { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 880px; }
table.plan th, table.plan td { border-bottom: 1px solid var(--line); padding: var(--s-1) var(--s-2); text-align: center; vertical-align: middle; }
table.plan td + td, table.plan th + th { border-left: 1px solid var(--line); }
table.plan thead .dates th { padding-top: var(--s-3); font-size: var(--fs-xs); font-weight: 400; color: var(--muted); border-bottom: 0; }
table.plan thead .days th { padding: 0 var(--s-2) var(--s-3); font-family: var(--font-head); font-size: var(--fs-md); font-weight: 600; border-bottom: 1px solid var(--line-strong); }
table.plan thead th.today, table.plan td.today { background: var(--today-bg); }
table.plan thead .days th.today { box-shadow: inset 0 -3px 0 var(--gold); }
table.plan thead .load td { padding: var(--s-2) var(--s-1); font-size: var(--fs-xs); background: var(--surface-2); }
table.plan thead .load td.today { background: var(--today-bg); }
table.plan th.time {
  position: sticky; left: 0; z-index: 1; width: 72px; padding-left: var(--s-4); text-align: left;
  background: var(--surface); font-size: var(--fs-sm); font-weight: 600;
  border-right: 2px solid var(--gold);
}
table.plan thead .load th.time { background: var(--surface-2); color: var(--ink-2); font-weight: 600; }
table.plan td.cell { height: 44px; min-width: 112px; }
table.plan td.closed { background: repeating-linear-gradient(-45deg, var(--surface-2) 0 6px, var(--hatch) 6px 12px); }
table.plan td.cell.admin { cursor: copy; }
table.plan td.cell.admin:hover { background: var(--surface-2); }
table.plan tfoot td { font-size: var(--fs-xs); color: var(--ink-2); border-bottom: 0; padding: var(--s-2); }
table.plan tr:last-child td, table.plan tr:last-child th { border-bottom: 0; }
.closed-label { color: var(--muted); font-size: var(--fs-xs); }

.chip {
  display: inline-flex; align-items: center; gap: var(--s-1); margin: 2px; padding: 3px var(--s-2);
  min-height: 28px; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--surface); color: var(--ink); font-size: var(--fs-sm); line-height: 1.2; cursor: default;
}
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--line-strong); background: var(--surface-2); }
.chip.theke { background: var(--theke-bg); border-color: var(--theke-line); border-left-width: 3px; }
.chip.theke::after { content: "Theke"; font-size: var(--fs-xs); color: var(--theke-ink); }
.chip.open { background: var(--open-bg); border-color: var(--open); color: var(--open); font-weight: 700; }
.chip.open.theke::after { color: var(--open); }
.chip.spare { background: transparent; border-style: dashed; color: var(--muted); }
.chip.conflict { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); font-weight: 600; }
.chip.mine { background: var(--mine-bg); border-color: var(--mine-bg); color: var(--mine-ink); font-weight: 700; }
.chip.mine.theke { border-left-color: var(--gold); }
.chip.mine.theke::after { color: var(--mine-ink); }
.chip .lock { display: inline-flex; opacity: .75; }
.chip .f {
  padding: 0 var(--s-1); border-radius: var(--r-1); background: var(--accent); color: var(--on-accent);
  font-size: var(--fs-xs); font-weight: 700; line-height: 1.4;
}
.chip.mine .f { background: var(--mine-ink); color: var(--mine-bg); }
.chip.changed { box-shadow: inset 3px 0 0 var(--accent); }
.chip .lvl { font-size: var(--fs-xs); opacity: .85; }
.addslot { opacity: 0; color: var(--muted); }
td.cell.admin:hover .addslot { opacity: 1; }

.load-badge {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px; padding: var(--s-1) var(--s-2);
  border: 1px solid transparent; border-radius: var(--r-1); background: none; cursor: pointer; color: var(--ink);
}
.load-badge:hover { border-color: var(--line-strong); background: var(--surface); }
.load-badge b { font-size: var(--fs-sm); }
.lvl-ruhig { color: var(--ok); }
.lvl-normal { color: var(--ink-2); }
.lvl-voll { color: var(--warn); }
.lvl-sehr-voll { color: var(--open); }
.day-warn { display: block; margin-top: 2px; color: var(--warn); font-size: var(--fs-xs); }

.legend { display: flex; gap: var(--s-2) var(--s-4); flex-wrap: wrap; align-items: center; margin-top: var(--s-3); font-size: var(--fs-xs); color: var(--ink-2); }
.legend > span { display: inline-flex; align-items: center; gap: var(--s-1); }

/* ---------- Tagesliste (Handy) ---------- */
.daylist { display: none; gap: var(--s-3); }
.daycard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.daycard header {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2);
  padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--line);
  font-family: var(--font-head); font-size: var(--fs-md); font-weight: 600;
}
.daycard header small { font-family: var(--font-body); font-weight: 400; font-size: var(--fs-xs); color: var(--muted); }
.daycard header .load-line { margin-left: auto; font-family: var(--font-body); font-weight: 400; font-size: var(--fs-xs); }
button.dayhead { width: 100%; border: 0; background: none; color: inherit; cursor: pointer; text-align: left; }
.daycard.today header { background: var(--today-bg); box-shadow: inset 3px 0 0 var(--gold); }
.daycard ul { list-style: none; margin: 0; padding: var(--s-1) var(--s-3) var(--s-2); }
.daycard li { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.daycard li:last-child { border-bottom: 0; }
.daycard li .t { width: 48px; flex: none; font-weight: 700; font-size: var(--fs-sm); }
.daycard .note { padding: var(--s-2) var(--s-4); font-size: var(--fs-xs); color: var(--ink-2); }

/* ---------- Verfügbarkeits-Matrix ---------- */
table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 900px; font-size: var(--fs-xs); }
table.matrix th, table.matrix td { border-bottom: 1px solid var(--line); padding: var(--s-1); text-align: center; }
table.matrix thead th { padding: var(--s-2) var(--s-1); background: var(--surface-2); font-weight: 600; border-bottom-color: var(--line-strong); }
table.matrix thead th.weekstart, table.matrix td.weekstart { border-left: 2px solid var(--gold); }
table.matrix thead th.closed { color: var(--muted); font-weight: 400; }
table.matrix th.name { position: sticky; left: 0; z-index: 1; min-width: 150px; padding-left: var(--s-4); text-align: left; background: var(--surface); font-size: var(--fs-sm); border-right: 1px solid var(--line); }
table.matrix thead th.name { background: var(--surface-2); }
table.matrix tfoot td { font-weight: 600; color: var(--ink-2); background: var(--surface-2); }
.av {
  position: relative; width: 100%; min-width: 52px; height: 32px; border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--surface); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; cursor: pointer;
}
.av:hover { border-color: var(--line-strong); }
.av.yes { background: var(--ok-bg); border-color: transparent; color: var(--ok); }
.av.part { background: var(--part-bg); border-color: transparent; color: var(--part); }
.av.no { background: var(--open-bg); border-color: transparent; color: var(--open); }
.av.closed { border: 1px dashed var(--line-strong); } /* Ruhetag: gestrichelt statt blass, damit der Text lesbar bleibt */
.av.assigned { box-shadow: inset 0 -3px 0 var(--ink); }
.av.assigned.theke { box-shadow: inset 0 -3px 0 var(--gold); }
.skill { color: var(--gold-ink); letter-spacing: -1px; font-size: var(--fs-xs); }
.tag {
  display: inline-block; padding: 0 var(--s-1); border: 1px solid var(--theke-line); border-radius: var(--r-1);
  background: var(--theke-bg); color: var(--theke-ink); font-size: var(--fs-xs); font-weight: 600; vertical-align: 1px;
}
.tag.admin { background: var(--surface-2); border-color: var(--line-strong); color: var(--ink-2); }
.tag.off { background: transparent; border-color: var(--line); color: var(--muted); }

/* ---------- Meine Schichten ---------- */
.myshifts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s-3); }
.shift { padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-left: 3px solid var(--ink); border-radius: var(--r-2); background: var(--surface); }
.shift.theke { border-left-color: var(--gold); background: var(--theke-bg); }
.shift .d { font-size: var(--fs-xs); color: var(--muted); }
.shift .t { margin: 2px 0; font-family: var(--font-head); font-size: var(--fs-xl); font-weight: 600; }
.avlist { display: grid; }
.avrow { display: grid; grid-template-columns: 112px 1fr; gap: var(--s-3); align-items: center; padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.avrow:last-child { border-bottom: 0; }
.avrow.closed .date { color: var(--muted); }
.avrow.past { display: none; }
.avrow .date b { display: block; font-size: var(--fs-sm); }
.avrow .date small { color: var(--muted); font-size: var(--fs-xs); }
.seg { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.seg button {
  display: inline-flex; align-items: center; gap: var(--s-1); min-height: 40px; padding: 0 var(--s-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface); cursor: pointer; font-size: var(--fs-sm);
}
.seg button:hover { background: var(--surface-2); }
.seg button.on.yes { background: var(--ok); border-color: var(--ok); color: var(--surface); font-weight: 600; }
.seg button.on.no { background: var(--open); border-color: var(--open); color: var(--surface); font-weight: 600; }
.seg input[type=time] { width: 116px; }
.planned { padding: 2px var(--s-2); border-radius: var(--r-1); background: var(--surface-2); font-size: var(--fs-xs); font-weight: 600; }

/* ---------- Import ---------- */
.steps { margin: var(--s-2) 0 var(--s-4); padding-left: var(--s-5); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
.drop {
  padding: var(--s-5) var(--s-4); border: 1px dashed var(--line-strong); border-radius: var(--r-2);
  background: var(--surface-2); color: var(--ink-2); text-align: center; cursor: pointer;
}
.drop:hover, .drop.over { border-color: var(--accent); border-style: solid; }
.drop b { color: var(--ink); }
table.list, table.team { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.list th, table.team th {
  padding: var(--s-2); text-align: left; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2);
  border-bottom: 1px solid var(--line-strong);
}
table.list td { padding: var(--s-2); border-bottom: 1px solid var(--line); vertical-align: top; }
table.list tr.dim td { color: var(--muted); }
.quote { font-style: italic; color: var(--ink-2); font-size: var(--fs-xs); }
.flag {
  display: inline-block; margin: 1px 2px 1px 0; padding: 0 var(--s-1); border-radius: var(--r-1);
  background: var(--warn-bg); color: var(--warn); font-size: var(--fs-xs); font-weight: 600;
}
.outcome { padding: 2px var(--s-2); border-radius: var(--r-1); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; }
.outcome.neu { background: var(--ok-bg); color: var(--ok); }
.sticky-actions { position: sticky; bottom: 0; display: flex; gap: var(--s-2); justify-content: flex-end; padding: var(--s-3) 0 var(--s-1); background: var(--surface); border-top: 1px solid var(--line); }

/* ---------- Team ---------- */
table.team td { padding: var(--s-3) var(--s-2); border-bottom: 1px solid var(--line); }
table.team tr:last-child td { border-bottom: 0; }
table.team tr.inactive td { color: var(--muted); }
table.team tbody tr:hover td { background: var(--surface-2); }
.scroll { overflow-x: auto; }

/* ---------- Einstellungen ---------- */
.level { padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: var(--s-3); align-items: start; margin-top: var(--s-3); }
.cards > .wide { grid-column: 1 / -1; }
.slotrow { display: grid; grid-template-columns: 116px 72px 1fr auto; gap: var(--s-2); align-items: center; margin-top: var(--s-2); }
.days-pick { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.days-pick label {
  display: inline-flex; align-items: center; justify-content: center; min-width: var(--tap); min-height: 40px;
  border: 1px solid var(--line-strong); border-radius: var(--r-1); background: var(--surface); color: var(--ink);
  font-weight: 400; cursor: pointer;
}
.days-pick input { position: absolute; opacity: 0; pointer-events: none; }
.days-pick label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: var(--surface); font-weight: 600; }
.days-pick label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.weekgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-2); }
.weekgrid input, .weekgrid select { padding: var(--s-2) var(--s-1); text-align: center; font-size: var(--fs-sm); }
.weekgrid input { -moz-appearance: textfield; appearance: textfield; }
.weekgrid input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* ---------- Dialog ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: var(--s-4); background: var(--scrim); }
.modal {
  display: flex; flex-direction: column; width: min(560px, 100%); max-height: calc(100vh - 2 * var(--s-4));
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-2);
}
.modal header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); padding: var(--s-4) var(--s-5) var(--s-3); border-bottom: 1px solid var(--line); }
.modal header h3 { font-family: var(--font-head); font-size: var(--fs-lg); }
.modal header small { display: block; margin-top: 2px; color: var(--muted); font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 400; }
.modal .x {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -6px -10px 0 0;
  border: 0; border-radius: var(--r-1); background: none; color: var(--ink-2); cursor: pointer;
}
.modal .x:hover { background: var(--surface-2); }
.modal .body { display: grid; gap: var(--s-4); padding: var(--s-4) var(--s-5); overflow-y: auto; }
.modal footer { display: flex; flex-wrap: wrap; gap: var(--s-2); justify-content: flex-end; padding: var(--s-3) var(--s-5) var(--s-4); border-top: 1px solid var(--line); }
.modal footer .left { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-right: auto; }

.cands { display: grid; gap: var(--s-1); max-height: 320px; overflow-y: auto; }
.cand {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s-2); align-items: center; padding: var(--s-2) var(--s-3);
  border: 1px solid var(--line); border-radius: var(--r-1); background: var(--surface); color: var(--ink); text-align: left; cursor: pointer;
}
.cand:hover { border-color: var(--accent); }
.cand.current { border-color: var(--ink); box-shadow: inset 3px 0 0 var(--ink); }
.cand.blocked { background: var(--surface-2); }
.cand.blocked b { color: var(--ink-2); }
.cand .meta { font-size: var(--fs-xs); color: var(--muted); }
.cand .count { font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }

/* ---------- Anmeldung ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--s-5) var(--s-4); background: var(--bg); }
.login .card { width: min(400px, 100%); padding: var(--s-6); border-top: 3px solid var(--gold); }
.login .logo { margin-bottom: var(--s-5); }
.login .logo img { display: none; }
.login .logo > div { display: flex; flex-direction: column; gap: 2px; }
.login .logo b { font-family: var(--font-head); font-size: var(--fs-2xl); font-weight: 600; line-height: 1.1; }
.login .logo span { color: var(--muted); font-size: var(--fs-sm); }
.login form { display: grid; gap: var(--s-4); }
.login .btn { min-height: var(--tap); }
.login .error { min-height: 1.2em; color: var(--open); font-size: var(--fs-sm); }
.login .choice { display: grid; gap: var(--s-3); }
.login .welcome { margin: 0 0 var(--s-5); text-align: center; font-family: var(--font-head); font-size: var(--fs-lg); color: var(--ink-2); }
.login .login-mode { margin: 0; font-family: var(--font-head); font-size: var(--fs-lg); font-weight: 600; }
/* Strichzeichnung auf der Startseite (Bewegung in motion.js: greet) */
.cheers { display: block; width: min(220px, 70%); height: auto; margin: 0 auto var(--s-3); }
.cheers [data-draw], .cheers [data-spark] { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cheers .tray.thin { stroke-width: 1; stroke: var(--line-strong); }
.cheers .spark [data-spark] { stroke: var(--gold); transform-box: fill-box; transform-origin: center; }
.cheers .wine { fill: var(--accent); }
.cheers .beer { fill: var(--gold); }
.cheers [data-fill] { transform-box: fill-box; transform-origin: bottom; }
.cheers .glass { transform-box: fill-box; transform-origin: 50% 100%; }

/* ---------- Hinweise (Toasts) ---------- */
#toasts { position: fixed; bottom: var(--s-4); left: 50%; z-index: 60; display: grid; gap: var(--s-2); width: min(520px, calc(100% - 2 * var(--s-4))); transform: translateX(-50%); }
.toast { padding: var(--s-3) var(--s-4); border-radius: var(--r-1); background: var(--ink); color: var(--bg); font-size: var(--fs-sm); }
.toast.error { background: var(--open); color: var(--surface); }
.toast.warn { background: var(--warn); color: var(--surface); }

.empty { padding: var(--s-7) var(--s-5); text-align: center; color: var(--muted); }
.empty b { display: block; margin-bottom: var(--s-2); color: var(--ink); font-family: var(--font-head); font-size: var(--fs-lg); }

/* ---------- Schichtbörse, Wochenregeln, Auswertung ---------- */
.badge {
  display: inline-block; min-width: 20px; padding: 0 var(--s-1); border-radius: var(--r-1);
  background: var(--gold); color: var(--bar); font-size: var(--fs-xs); font-weight: 700; text-align: center;
}
.pool { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.poolitem {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-3);
  border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--r-1); background: var(--surface);
}
.avmore { flex-basis: 100%; }
.avmore summary { font-size: var(--fs-xs); color: var(--muted); min-height: 28px; display: flex; align-items: center; gap: var(--s-1); }
.rec { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.recrow { display: grid; grid-template-columns: 34px 140px auto 116px auto 116px; gap: var(--s-2); align-items: center; }
.bar { display: flex; align-items: center; gap: var(--s-2); min-width: 140px; }
.bar span { display: block; height: 8px; background: var(--gold); border-radius: 1px; transform-origin: left; }

/* ---------- Handy ---------- */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 0 var(--s-3); padding: var(--s-2) var(--s-4) 0; min-height: 0; }
  .user { margin-left: auto; }
  .user .who, .user .label-text { display: none; }
  .nav { order: 3; flex-basis: 100%; margin: var(--s-1) calc(-1 * var(--s-4)) 0; padding: 0 var(--s-1); }
  .nav a { min-height: var(--tap); }
  main { padding: var(--s-4) var(--s-4) var(--s-7); }
  .page-head h1 { font-size: var(--fs-xl); }
  .page-head .weeknav { width: 100%; }
  .weeknav .label { flex: 1; min-width: 0; }
  .plan-wrap.has-list { display: none; }
  .daylist { display: grid; }
  .grid2 { grid-template-columns: 1fr; }
  .card { padding: var(--s-4); }
  .avrow { grid-template-columns: 1fr; gap: var(--s-2); }
  .slotrow { grid-template-columns: 1fr auto; }
  .slotrow .small { display: none; }
  .recrow { grid-template-columns: 34px 1fr 1fr; }
  .recrow > b { grid-row: span 2; align-self: start; padding-top: var(--s-2); }
  .recrow select { grid-column: span 2; }
  .recrow span.small { display: none; }
  .toolbar .btn { flex: 1 1 auto; }
  .toolbar .spacer { display: none; }
  .print-only-desktop { display: none; }
  table.list.stacked, table.list.stacked tbody, table.list.stacked tr, table.list.stacked td { display: block; }
  table.list.stacked tr { padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
  table.list.stacked td { padding: var(--s-1) 0; border: 0; white-space: normal; }
  .poolitem { flex-wrap: wrap; }
  .modal-bg { place-items: end stretch; padding: 0; }
  .modal { width: 100%; max-height: 92vh; border-radius: var(--r-2) var(--r-2) 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); }
  input[type=text], input[type=password], input[type=number], input[type=time], input[type=date], select, textarea { min-height: var(--tap); }
  .btn { min-height: var(--tap); }
  .btn.sm { min-height: 36px; }
}

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

/* ---------- Druck (wie der bisherige Aushang) ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  :root, :root[data-theme="dark"] { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #fff; --ink: #000; --ink-2: #222; --line: #999; --line-strong: #333; --today-bg: #fff; }
  body { background: #fff; }
  .topbar, .toolbar, .weeknav, .legend, .banner, #toasts, .no-print, .addslot, .day-warn { display: none !important; }
  main { padding: 0; max-width: none; }
  .page-head { margin-bottom: 4mm; }
  .plan-wrap { border: 1px solid #999; display: block !important; }
  .daylist { display: none !important; }
  table.plan { min-width: 0; }
  .chip { padding: 1px 4px; background: none !important; border: 0 !important; color: #000 !important; font-size: 10pt; box-shadow: none !important; }
  .chip.open { color: #b3261e !important; }
  .chip.theke::after { content: " (T)"; color: #000; }
  .chip .f { background: none; color: #000; padding: 0; font-weight: 400; }
  .chip .f::before { content: "("; }
  .chip .f::after { content: ")"; }
}
