/* ───────────────────────── Filmset – Produktion ─────────────────────────
   Ruhig und sachlich wie eine Dispo: Graphit, Weiss, feine Linien.
   Ein einziger Akzent (Stahlblau) für Links und Fokus.
   Geist für die Oberfläche, Courier nur für Szenenköpfe wie im Drehbuch. */

@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; src: url("fonts/geist-ext.woff2") format("woff2"); font-weight: 100 900; font-display: swap; unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courierprime-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Courier Prime"; src: url("fonts/courierprime-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --graphite: #1a2230;
  --graphite-2: #242e3d;
  --graphite-line: rgba(255,255,255,.08);
  --bg: #f5f6f8;
  --surface: #ffffff;
  --line: #e3e6eb;
  --line-strong: #cfd4dc;
  --text: #161b24;
  --text-2: #3b4452;
  --muted: #6a7381;
  --accent: #2b5c8a;
  --accent-soft: #eaf0f6;
  --danger: #b3261e;
  --ok: #1e7a52;
  --warn: #a15c07;

  --ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --script: "Courier Prime", "Courier New", Courier, monospace;

  --r: 6px;
  --r-l: 8px;
  --side: 240px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--ui); font-size: 15px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; font-feature-settings: "ss01";
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; letter-spacing: -.025em; }
.h3, h2.h3 { font-size: .95rem; font-weight: 600; letter-spacing: -.005em; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--text); padding: 8px 12px; z-index: 100; border-radius: var(--r); }
.skip:focus { left: 8px; }
.late { color: var(--danger); font-weight: 500; }
.top-gap { margin-top: 14px; }
.top-space { margin-top: 28px; }

/* ───────── Gerüst ───────── */
.app { display: flex; min-height: 100vh; }
.side {
  position: fixed; inset: 0 auto 0 0; width: var(--side); z-index: 40;
  background: var(--graphite); color: #c9d0da; display: flex; flex-direction: column;
  overflow-y: auto; overscroll-behavior: contain;
}
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 14px 12px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.brand:hover { text-decoration: none; }
.mark {
  flex: none; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center;
  background: #fff; color: var(--graphite); font-weight: 700; font-size: .95rem;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: .95rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-text small { color: #8893a3; font-size: .75rem; }
.side-close { display: none; }
.side-search { padding: 4px 12px 8px; }
.side-search input {
  width: 100%; background: var(--graphite-2); border: 1px solid transparent; color: #fff; border-radius: var(--r);
  padding: 7px 10px; font: inherit; font-size: .85rem;
}
.side-search input::placeholder { color: #7c8797; }
.side-search input:focus { border-color: #4b5a70; outline: none; box-shadow: none; background: var(--graphite-2); }
.nav { padding: 2px 8px 16px; flex: 1; }
.nav a, .side-foot a, .side-foot .link {
  display: block; padding: 6px 10px; border-radius: var(--r); color: #b9c1cc; font-size: .9rem;
}
.nav a:hover, .side-foot a:hover, .side-foot .link:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav a.on, .side-foot a.on { background: rgba(255,255,255,.1); color: #fff; font-weight: 500; }
.nav-group { margin-top: 16px; }
.nav-title { display: block; padding: 0 10px 4px; font-size: .75rem; color: #737e8e; }
.side-foot { border-top: 1px solid var(--graphite-line); padding: 10px 8px 16px; }
.side-foot form { margin: 0; }
.link { background: none; border: 0; font: inherit; cursor: pointer; text-align: left; width: 100%; }

.main-wrap { flex: 1; margin-left: var(--side); min-width: 0; }
.topbar { display: none; }
.main { max-width: 1200px; padding: 30px clamp(16px, 3vw, 40px) 80px; margin: 0 auto; }
.scrim { display: none; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.page-head h1 { margin: 0; }
.intro { color: var(--muted); max-width: 70ch; margin: 4px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { margin: 0 0 6px; font-size: .85rem; }
.crumbs a { color: var(--muted); }
.crumbs a::before { content: "‹ "; }

/* ───────── Buttons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: .875rem; font-weight: 500; line-height: 1.2;
  padding: 8px 14px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--text); cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: #f3f4f6; text-decoration: none; color: var(--text); }
.btn-primary { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.btn-primary:hover { background: #2c3749; border-color: #2c3749; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: #eceef1; }
.btn-danger { color: var(--danger); border-color: #e9c5c2; background: var(--surface); }
.btn-danger:hover { background: #fcf1f0; color: var(--danger); }
.btn-small { padding: 5px 10px; font-size: .8rem; }
.btn-block { width: 100%; padding: 10px; }
.icon-btn { background: none; border: 0; color: inherit; padding: 8px; cursor: pointer; border-radius: var(--r); font-size: 1rem; line-height: 1; }

/* ───────── Flächen ───────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.card-head a { font-size: .85rem; }
.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px; border: 1px solid #bfe0cf; background: #f0f8f4; color: #134e35; font-size: .9rem; }
.flash-err { border-color: #efc7c3; background: #fdf3f2; color: #7d1a14; }

/* ───────── Formulare ───────── */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field .label, .label { font-size: .8rem; font-weight: 500; color: var(--text-2); }
.req { color: var(--danger); }
input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r); padding: 8px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(43,92,138,.12); }
input[type="color"] { padding: 3px; height: 38px; width: 70px; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--graphite); flex: none; margin: 2px 0 0; }
.help { color: var(--muted); font-size: .78rem; }
.affix { display: flex; }
.affix span { padding: 8px 10px; background: #f3f4f6; border: 1px solid var(--line-strong); border-right: 0; border-radius: var(--r) 0 0 var(--r); font-size: .85rem; color: var(--muted); }
.affix input { border-radius: 0 var(--r) var(--r) 0; }
.check { display: flex; gap: 9px; align-items: flex-start; cursor: pointer; font-size: .9rem; }
.check.disabled { opacity: .5; cursor: not-allowed; }
.check.strong { font-weight: 500; margin-bottom: 12px; }
.field-check { justify-content: flex-end; padding-bottom: 9px; }
.grid-form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px 18px; }
.w-s { grid-column: span 2; } .w-m { grid-column: span 3; } .w-l { grid-column: span 6; }
.form-card { padding: 24px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-l { display: flex; flex-direction: column; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; padding: 0; margin-bottom: 10px; font-size: .95rem; }
.files-edit { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }

.multi { border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); }
.multi-filter { border: 0; border-bottom: 1px solid var(--line); border-radius: var(--r) var(--r) 0 0; }
.multi-filter:focus { box-shadow: none; }
.multi-list { max-height: 240px; overflow-y: auto; padding: 8px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }
.multi-list.tall { max-height: 360px; grid-template-columns: 1fr; }
.multi-list p { grid-column: 1 / -1; margin: 4px 0; }
.team-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; border-radius: var(--r) var(--r) 0 0; }
.team-toggle { display: inline-flex; align-items: center; font: inherit; font-size: .85rem; padding: 5px 10px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.team-toggle small { color: var(--muted); margin-left: 6px; }
.team-toggle:hover { border-color: #aab3bf; }
.team-toggle.partial { border-color: var(--graphite); box-shadow: inset 0 -2px 0 var(--graphite); }
.team-toggle[aria-pressed="true"] { background: var(--graphite); border-color: var(--graphite); color: #fff; }
.team-toggle[aria-pressed="true"] small { color: #aeb6c2; }
.team-toggle[aria-pressed="true"] .dot { box-shadow: 0 0 0 1.5px #fff; }
.team-quick-sep { flex: 1; }
[data-picked] { width: 100%; }
[data-team-picker] .multi-list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); max-height: 320px; }

.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-l); padding: 24px 16px; text-align: center; cursor: pointer;
  background: #fafbfc; transition: border-color .12s, background .12s; margin-bottom: 6px; font-size: .9rem; color: var(--text-2);
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-compact { padding: 14px; }
.dz-list { font-size: .8rem; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; }
.thumb-edit { display: flex; flex-direction: column; gap: 6px; font-size: .78rem; border: 1px solid var(--line); border-radius: var(--r); padding: 6px; }
.thumb-edit img { aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; width: 100%; }
.thumb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.thumb-edit .doc-badge { aspect-ratio: 4/3; width: 100%; height: auto; }

/* ───────── Toolbar, Filter, Tabs ───────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin-bottom: 16px; }
.tb-search { flex: 1 1 240px; max-width: 340px; margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 4px; }
.pill { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: var(--r); color: var(--text-2); font-size: .85rem; border: 1px solid transparent; }
.pill:hover { background: #eceef1; text-decoration: none; }
.pill span { color: var(--muted); font-size: .78rem; font-variant-numeric: tabular-nums; }
.pill.on { background: var(--surface); border-color: var(--line-strong); color: var(--text); font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; margin-left: auto; background: var(--surface); }
.seg a { padding: 5px 11px; font-size: .8rem; color: var(--muted); }
.seg a:hover { text-decoration: none; color: var(--text); }
.seg a.on { background: #eef0f3; color: var(--text); font-weight: 500; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--muted); font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--graphite); font-weight: 500; }

/* ───────── Tabellen ───────── */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: .9rem; }
.list th { text-align: left; font-weight: 500; font-size: .78rem; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.list td { padding: 10px 14px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.list tbody tr:last-child td { border-bottom: 0; }
.list tbody tr:hover { background: #fafbfc; }
.row-link { font-weight: 500; color: var(--text); }
.list tbody tr[data-href] { cursor: pointer; }
.td-files { text-align: right; font-size: .78rem; white-space: nowrap; }
.th-files { width: 1%; }

/* ───────── Status ───────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px 1px 7px; border-radius: 4px; font-size: .78rem; font-weight: 500; white-space: nowrap; background: #f1f2f4; color: var(--text-2); border: 1px solid #e6e8ec; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #9aa3af); }
.tone-1 { --c: #9aa3af; } .tone-2 { --c: #2b5c8a; } .tone-3 { --c: #1e7a52; }
.tone-4 { --c: #c28a12; } .tone-5 { --c: #6d4c9f; } .tone-6 { --c: #b3261e; }
.tone-bg-1 { background: #c3c9d1; } .tone-bg-2 { background: #2b5c8a; } .tone-bg-3 { background: #1e7a52; }
.tone-bg-4 { background: #c28a12; } .tone-bg-5 { background: #6d4c9f; } .tone-bg-6 { background: #b3261e; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 4px; background: #f1f2f4; border: 1px solid #e6e8ec; color: var(--text); font-size: .85rem; }
a.chip:hover { border-color: var(--line-strong); text-decoration: none; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; background: #f1f2f4; color: var(--text-2); font-size: .78rem; font-variant-numeric: tabular-nums; }
.tag-warn { background: #fdf4e7; color: var(--warn); }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; vertical-align: middle; border: 1px solid rgba(0,0,0,.1); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

/* Drehbuch-Konvention */
.slug { font-family: var(--script); font-weight: 700; font-size: 1rem; margin: -12px 0 20px; color: var(--text-2); }
.slug-sm { font-family: var(--script); font-weight: 700; font-size: .88rem; }

/* ───────── Kacheln ───────── */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.cards-group { grid-column: 1 / -1; font-size: .9rem; font-weight: 600; margin: 14px 0 -4px; color: var(--text-2); }
.cards-group:first-child { margin-top: 0; }
.tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; color: var(--text); }
.tile:hover { border-color: var(--line-strong); text-decoration: none; box-shadow: 0 4px 14px -8px rgba(22,27,36,.25); }
.tile-img { aspect-ratio: 16/9; background: #eef0f3; display: block; overflow: hidden; border-bottom: 1px solid var(--line); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-ph { display: flex; height: 100%; align-items: center; justify-content: center; color: #9aa3af; font-size: .8rem; }
.tile-body { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 6px; }
.tile-body strong { font-weight: 500; }
.tile-sub { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .8rem; color: var(--muted); }

/* ───────── Detailansicht ───────── */
.view-grid { display: grid; gap: 18px; }
.view-grid.has-media { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
.view-grid > .card { margin: 0; }
.details { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; }
.d-row { min-width: 0; }
.d-wide { grid-column: 1 / -1; }
.details dt { font-size: .78rem; color: var(--muted); margin-bottom: 2px; }
.details dd { margin: 0; overflow-wrap: anywhere; }
.prose { line-height: 1.6; }
.meta { margin: 18px 0 0; font-size: .78rem; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery a { display: block; border-radius: var(--r); overflow: hidden; background: #eef0f3; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.gallery a:hover img { opacity: .92; }
.gallery .g-first { grid-column: 1 / -1; }
.gallery .g-first img { aspect-ratio: 16/10; }
#dateien { margin-top: 18px; }
.doc-list { list-style: none; padding: 0; margin: 0 0 14px; }
.doc-list li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #eef0f3; flex-wrap: wrap; }
.doc-list li a:first-of-type { flex: 1; min-width: 150px; font-weight: 500; }
.doc-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 26px; padding: 0 6px; border-radius: 4px; background: #eef0f3; color: var(--text-2); font-size: .68rem; font-weight: 600; border: 1px solid var(--line); }
.upload-inline { margin: 0; }
.share-box { margin-top: 20px; padding: 12px 14px; border-radius: var(--r); background: #f7f8fa; border: 1px solid var(--line); }
.copy-row { display: flex; gap: 8px; margin-top: 6px; }
.copy-row input { font-size: .82rem; }
.related { margin: 26px 0 0; }
.rel-list { display: flex; flex-wrap: wrap; gap: 8px; }
.rel-item { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); font-size: .88rem; }
.rel-item img { width: 40px; height: 30px; object-fit: cover; border-radius: 3px; margin-left: -6px; }
.rel-item:hover { border-color: var(--line-strong); text-decoration: none; }
.danger-zone { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); }
.empty { text-align: center; padding: 52px 20px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-l); color: var(--muted); }

/* ───────── Übersicht ───────── */
.next-day { display: grid; grid-template-columns: minmax(0, 1fr) auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); margin-bottom: 18px; overflow: hidden; }
.nd-main { padding: 22px 24px; border-left: 3px solid var(--graphite); }
.nd-label { color: var(--muted); font-size: .85rem; margin: 0 0 4px; }
.nd-date { font-size: 1.55rem; font-weight: 600; letter-spacing: -.025em; margin: 0 0 4px; }
.nd-place { color: var(--text-2); margin: 0 0 16px; }
.nd-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.nd-facts { display: grid; grid-template-columns: repeat(3, auto); margin: 0; border-left: 1px solid var(--line); background: #fafbfc; }
.nd-facts > div { padding: 16px 22px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 92px; }
.nd-facts > div:nth-child(3n) { border-right: 0; }
.nd-facts > div:nth-last-child(-n+3) { border-bottom: 0; }
.nd-facts dt { font-size: .78rem; color: var(--muted); }
.nd-facts dd { margin: 0; font-size: 1.45rem; font-weight: 600; letter-spacing: -.02em; }
.nd-facts dd small { font-size: .78rem; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.nd-call dd { color: var(--accent); }
.dash-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.day-list { list-style: none; margin: 4px 0 10px; padding: 0; }
.day-list a { display: grid; grid-template-columns: 8.5em 1fr auto auto; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef0f3; color: var(--text); }
.day-list a:hover { text-decoration: none; }
.day-list a:hover span:nth-child(2) { color: var(--accent); }
.day-date { font-weight: 500; font-variant-numeric: tabular-nums; }
.big-stat { color: var(--muted); margin-bottom: 10px; }
.big-stat strong { font-size: 1.6rem; color: var(--text); margin-right: 4px; font-weight: 600; letter-spacing: -.02em; }
.stack-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: #eef0f3; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 10px 0 0; color: var(--muted); font-size: .8rem; }
.meter { height: 8px; border-radius: 4px; background: #eef0f3; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--graphite); }
.meter span.over { background: var(--danger); }
.task-list { list-style: none; padding: 0; margin: 0; }
.task-list li { display: flex; flex-direction: column; padding: 7px 0; border-bottom: 1px solid #eef0f3; }
.task-list li:last-child { border-bottom: 0; }
.task-list a { color: var(--text); font-weight: 500; }
.quick { margin-top: 6px; }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.quick-grid a { display: flex; flex-direction: column; padding: 14px 16px; color: var(--muted); font-size: .8rem; border-right: 1px solid #eef0f3; border-bottom: 1px solid #eef0f3; margin: 0 -1px -1px 0; }
.quick-grid a:hover { background: #fafbfc; text-decoration: none; }
.quick-grid strong { font-size: 1.3rem; color: var(--text); font-weight: 600; }

/* ───────── Budget ───────── */
.budget-setup { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid #c6d6e6; border-radius: var(--r); padding: 12px 14px; margin-bottom: 18px; }
.budget-setup > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.budget-total-form { display: flex; gap: 8px; align-items: center; }
.budget-total-form .affix input { width: 140px; }
.budget-edit summary { cursor: pointer; color: var(--accent); width: max-content; margin-top: 2px; }
.budget-edit form { margin-top: 6px; }
.kpi-main strong { font-size: 1.5rem; }
.budget-meter { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: #e3f1ea; }
.budget-meter .bm-paid { background: var(--graphite); }
.budget-meter .bm-open { background: #c28a12; }
.budget-meter .bm-open.over { background: var(--danger); }
.lg.bm-paid { background: var(--graphite); } .lg.bm-open { background: #c28a12; } .lg.bm-free { background: #e3f1ea; border: 1px solid #b9dcc9; }
.legend .lg { margin-right: 5px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 16px; }
.kpis > div { display: flex; flex-direction: column; gap: 2px; }
.kpis strong { font-size: 1.25rem; font-weight: 600; letter-spacing: -.02em; }
.kpis .neg strong { color: var(--danger); }
.kpis .pos strong { color: var(--ok); }
.cat-bars { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.cat-row { display: grid; grid-template-columns: minmax(120px, 13em) 1fr auto; gap: 12px; align-items: center; font-size: .85rem; }
.cat-track { position: relative; height: 14px; }
.bar-plan, .bar-real { position: absolute; left: 0; border-radius: 2px; }
.bar-plan { top: 0; height: 14px; background: #e6e9ee; }
.bar-real { top: 4px; height: 6px; background: var(--graphite); }
.bar-real.over { background: var(--danger); }
.cat-val { color: var(--muted); white-space: nowrap; }
.lg { display: inline-block; width: 14px; height: 8px; border-radius: 2px; margin-right: -8px; }
.lg-plan { background: #e6e9ee; } .lg-real { background: var(--graphite); }

/* ───────── Team informieren ───────── */
.day-pick { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.day-pick select { width: auto; min-width: 280px; }
.send-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.send-panel { position: sticky; top: 20px; margin: 0; }
.send-panel .field { margin-bottom: 12px; }
.recips { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.recips-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; border-radius: var(--r-l) var(--r-l) 0 0; font-size: .9rem; flex-wrap: wrap; }
.recip { padding: 14px 16px; border-bottom: 1px solid #eef0f3; display: grid; gap: 8px; }
.recip:last-child { border-bottom: 0; }
.recip.no-mail .recip-name strong { color: var(--text-2); }
.recip-main { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.recip-name { display: flex; flex-direction: column; }
.recip-name .muted { font-size: .82rem; }
.recip-call strong { font-size: 1.05rem; }
.recip-meta { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 25px; }
.recip-preview, .recip-actions, .recip-tasks { margin-left: 25px; }
.recip-preview summary { cursor: pointer; font-size: .85rem; color: var(--accent); width: max-content; }
.mail-preview { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; max-height: 560px; overflow-y: auto; }
.recip-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-left: 17px; align-items: center; }
.recip-tasks { margin-top: 0; margin-bottom: 0; padding-left: 16px; font-size: .9rem; }
.msg-grid { margin-bottom: 20px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 18px; align-items: start; }
.msg-grid .card { margin: 0; }
.msg-grid .card .field { margin-bottom: 14px; }
.team-picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pill-check { position: relative; cursor: pointer; }
.pill-check input { position: absolute; opacity: 0; }
.pill-check span { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: var(--r); border: 1px solid var(--line-strong); font-size: .85rem; background: var(--surface); }
.pill-check small { color: var(--muted); margin-left: 6px; }
.pill-check input:checked + span { background: var(--graphite); color: #fff; border-color: var(--graphite); }
.pill-check input:checked + span small { color: #aeb6c2; }
.pill-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.msg-history { list-style: none; padding: 0; margin: 0; }
.msg-history li { border-bottom: 1px solid #eef0f3; padding: 9px 0; }
.msg-history li:last-child { border-bottom: 0; }
.msg-history summary { cursor: pointer; }

/* ───────── Einstellungen ───────── */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.user-list { list-style: none; padding: 0; margin: 0 0 14px; }
.user-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #eef0f3; }
.user-list form { margin: 0; }
details > summary.btn { list-style: none; }
details > summary.btn::-webkit-details-marker { display: none; }

/* ───────── Login & Einrichtung ───────── */
.login-body { min-height: 100vh; background: var(--bg); display: flex; }
.login { margin: auto; width: 100%; max-width: 400px; padding: 24px 16px; }
.login.install { max-width: 540px; }
.login-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: 0 12px 32px -18px rgba(22,27,36,.25); }
.login-inner { padding: 30px 30px 32px; }
.login-kicker { color: var(--muted); margin: 0 0 4px; font-size: .85rem; }
.login h1 { font-size: 1.5rem; margin-bottom: 22px; }
.checks { list-style: none; padding: 12px 14px; margin: 0 0 20px; background: #f7f8fa; border: 1px solid var(--line); border-radius: var(--r); font-size: .82rem; columns: 2; column-gap: 20px; }
.checks li { break-inside: avoid; padding: 2px 0; }
.checks .ok { color: var(--ok); } .checks .bad { color: var(--danger); font-weight: 600; } .checks .warn { color: var(--muted); }

.restore { border: 1px solid #bcd0e4; background: var(--accent-soft); border-radius: var(--r-l); padding: 16px; margin-bottom: 24px; }
.restore-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 12px; margin: 10px 0; flex-wrap: wrap; }
.restore-item > div { display: flex; flex-direction: column; gap: 2px; }

/* ───────── Rechte ───────── */
.rights { border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.rights-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; background: #fafbfc; border-bottom: 1px solid var(--line); }
.rights-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.rights-table th, .rights-table td { padding: 6px 10px; text-align: center; border-bottom: 1px solid #eef0f3; }
.rights-table th:first-child, .rights-table td:first-child { text-align: left; }
.rights-table thead th { font-size: .75rem; font-weight: 500; color: var(--muted); }
.rights-group th { text-align: left !important; font-size: .75rem; color: var(--muted); font-weight: 500; background: #fafbfc; padding-top: 8px; }
.rights-table td.na { color: #c3c9d1; }
.radio-cell { display: inline-flex; padding: 4px; cursor: pointer; }
.rights .help { padding: 10px 12px; margin: 0; background: #fafbfc; }
.rights-view td { padding: 3px 14px 3px 0; }
.access-card { margin-top: 18px; }
.access-rights { margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; }
.center { text-align: center; margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ───────── Mein Drehplan ───────── */
.my-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); margin-bottom: 14px; overflow: hidden; }
.my-day.is-next { border-left: 3px solid var(--graphite); }
.my-day-head { display: flex; justify-content: space-between; gap: 16px; padding: 18px 20px 10px; align-items: flex-start; }
.my-day-head .nd-place { margin-bottom: 0; }
.my-call { text-align: right; flex: none; }
.my-call span { display: block; font-size: .78rem; color: var(--muted); }
.my-call strong { font-size: 1.8rem; font-weight: 600; letter-spacing: -.02em; color: var(--accent); }
.my-day-body { padding: 4px 20px 6px; }
.my-day-more { padding: 0 20px 6px; }
.my-day-more summary { cursor: pointer; color: var(--accent); font-size: .88rem; padding: 4px 0 8px; }
.my-day-more .my-day-body { padding: 0; }
.my-day-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 20px 16px; }
.bf-sec { padding: 12px 0; border-top: 1px solid #eef0f3; }
.bf-sec:first-child { border-top: 0; }
.bf-title { font-size: .78rem; font-weight: 500; color: var(--muted); margin: 0 0 8px; letter-spacing: 0; }
.bf-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 20px; margin: 0; }
.bf-rows dt { font-size: .75rem; color: var(--muted); }
.bf-rows dd { margin: 0; }
.bf-items { list-style: none; margin: 0; padding: 0; }
.bf-items li { display: flex; flex-direction: column; padding: 5px 0; }
.bf-item { font-weight: 500; }
@media (max-width: 640px) {
  .my-day-head { padding: 14px 14px 6px; }
  .my-day-body, .my-day-more, .my-day-actions { padding-left: 14px; padding-right: 14px; }
  .my-call strong { font-size: 1.5rem; }
  .bf-rows { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .nd-date { font-size: 1.3rem; }
  .rights-table th, .rights-table td { padding: 6px 4px; }
  .rights-table thead th { font-size: .68rem; }
}

/* ───────── Verfügbarkeit ───────── */
.av { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 4px; font-size: .78rem; font-weight: 600; line-height: 1; vertical-align: middle; }
.av-ja { background: #dff1e8; color: #1e7a52; }
.av-nein { background: #fbe4e2; color: #b3261e; }
.av-open { background: #eef0f3; color: #9aa3af; }
.av-yes-n::before { content: "✓ "; } .av-yes-n { color: #1e7a52; }
.av-no-n::before { content: "✕ "; } .av-no-n { color: #b3261e; }
.av-ok-text { color: #1e7a52; font-size: .8rem; font-weight: 600; }
.av-row-no span:first-of-type { }
.check.av-row-no { color: var(--muted); }
.avail-hint { width: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.login.login-wide { max-width: 620px; }
.avail-calm { background: var(--accent-soft); border: 1px solid #c6d6e6; border-radius: var(--r); padding: 10px 14px; font-size: .9rem; color: var(--text-2); margin: 0 0 12px; }
.avail-form { display: flex; flex-direction: column; gap: 10px; }
.avail-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.avail-head p { margin: 0; }
.avail-day { border: 1px solid var(--line); border-radius: var(--r-l); padding: 14px; background: var(--surface); display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; align-items: center; transition: border-color .12s, background .12s; }
.avail-day.is-ja { border-color: #a8d9c1; background: #f5fbf8; }
.avail-day.is-nein { border-color: #efc7c3; background: #fdf6f5; }
.avail-date { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.avail-date strong { font-weight: 600; }
.avail-time { font-weight: 500; color: var(--accent); }
.avail-choice { display: flex; gap: 6px; }
.avail-opt { position: relative; cursor: pointer; }
.avail-opt input { position: absolute; opacity: 0; inset: 0; }
.avail-opt span { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--surface); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.avail-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.opt-ja input:checked + span { background: #1e7a52; border-color: #1e7a52; color: #fff; }
.opt-nein input:checked + span { background: #b3261e; border-color: #b3261e; color: #fff; }
.avail-note { grid-column: 1 / -1; }
.avail-note summary { cursor: pointer; font-size: .82rem; color: var(--muted); width: max-content; }
.avail-note input { margin-top: 6px; }
.avail-save { position: sticky; bottom: 0; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--surface) 30%); }
.main .avail-save { background: linear-gradient(transparent, var(--bg) 30%); }
.matrix-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); }
.matrix { border-collapse: collapse; font-size: .85rem; min-width: 100%; }
.matrix th, .matrix td { padding: 7px 8px; border-bottom: 1px solid #eef0f3; text-align: center; white-space: nowrap; }
.matrix tbody tr:last-child th, .matrix tbody tr:last-child td { border-bottom: 0; }
.matrix .m-name { text-align: left; position: sticky; left: 0; background: var(--surface); z-index: 1; font-weight: 500; min-width: 150px; border-right: 1px solid var(--line); }
.matrix .m-name span { display: block; font-weight: 400; }
.matrix thead th { font-weight: 500; vertical-align: bottom; background: #fafbfc; }
.matrix thead .m-name { background: #fafbfc; }
.m-day a { color: inherit; }
.m-wd { display: block; font-size: .72rem; color: var(--muted); }
.m-dt { display: block; font-weight: 600; }
.m-sum { display: block; font-size: .72rem; font-weight: 400; margin-top: 2px; color: var(--muted); }
.m-na { color: #c3c9d1; }
.tm { display: inline-flex; min-width: 40px; justify-content: center; padding: 4px 7px; border-radius: 4px; font-weight: 600; font-size: .82rem; font-variant-numeric: tabular-nums; cursor: default; }
.tm-all { background: #dff1e8; color: #17603f; }
.tm-some { background: #fbefd2; color: #7a5200; }
.tm-open { background: #eef0f3; color: #6a7381; }
.tm-none { background: #fbe4e2; color: #b3261e; }
.tm-na { color: #c3c9d1; font-weight: 400; min-width: 0; }
.team-matrix tfoot th, .team-matrix tfoot td { border-top: 2px solid var(--line); background: #fafbfc; }
.team-matrix .m-name a { color: inherit; }
.view-switch { margin-left: 0; }
.tm-pop { position: absolute; z-index: 50; background: var(--graphite); color: #fff; font-size: .82rem; line-height: 1.45; padding: 8px 10px; border-radius: 6px; white-space: pre-line; max-width: 260px; box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); pointer-events: none; }
.m-copy { display: block; font-size: .7rem; font-weight: 400; color: var(--accent); margin-top: 2px; }
.extra-dates { gap: 8px; }
.mass-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.mass-grid > div { display: flex; flex-direction: column; gap: 6px; }
.mass-more summary { cursor: pointer; color: var(--accent); margin-top: 10px; width: max-content; }
.day-checks { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); max-height: 300px; }
.pill-remove input:checked + span { background: #b3261e; border-color: #b3261e; }
.danger-check { color: var(--danger); margin-left: auto; }
@media (max-width: 640px) { .mass-grid { grid-template-columns: 1fr; } .danger-check { margin-left: 0; } }
.extra-list { display: flex; flex-wrap: wrap; gap: 8px; }
.extra-list input { width: auto; min-width: 170px; }
.m-note { color: var(--accent); font-weight: 700; }
.matrix tr.m-good th, .matrix tr.m-good td { background: #f5fbf8; }
.seg-link { margin-left: auto; color: var(--muted); }
.bulk summary { cursor: pointer; }
.bulk[open] summary { margin-bottom: 4px; }
.wd-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.avail-card { margin-top: 18px; }
.avail-group { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.install-box { background: #f7f8fa; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.install-box p { margin: 0 0 6px; }
.push-actions { margin-top: 0; }
@media (max-width: 640px) {
  .avail-day { grid-template-columns: 1fr; }
  .avail-choice { display: grid; grid-template-columns: 1fr 1fr; }
  .avail-opt span { width: 100%; }
  .matrix .m-name { min-width: 120px; }
}

/* ───────── Push-Schalter ───────── */
.push-bell { margin-left: auto; position: relative; background: none; border: 0; color: #c9d0da; padding: 8px; border-radius: var(--r); cursor: pointer; display: inline-flex; }
.push-bell:hover { background: rgba(255,255,255,.08); color: #fff; }
.push-bell .push-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: #e5534b; box-shadow: 0 0 0 2px var(--graphite); }
.push-bell.is-on { color: #fff; }
.push-bell.is-on .push-dot { background: #3fb67e; }
.push-switch { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; font: inherit; font-size: .9rem; color: #b9c1cc; padding: 7px 10px; border-radius: var(--r); cursor: pointer; text-align: left; margin-bottom: 4px; }
.push-switch:hover { background: rgba(255,255,255,.05); color: #fff; }
.push-switch > span:nth-of-type(1) { flex: 1; }
.switch { width: 32px; height: 18px; border-radius: 9px; background: #4b5668; position: relative; flex: none; transition: background .15s; }
.switch span { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.push-switch.is-on { color: #fff; }
.push-switch.is-on .switch { background: #3fb67e; }
.push-switch.is-on .switch span { transform: translateX(14px); }
.push-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; background: var(--accent-soft); border: 1px solid #c6d6e6; border-radius: var(--r-l); padding: 14px 16px; margin-bottom: 18px; }
.push-banner > div:first-child { display: flex; flex-direction: column; gap: 2px; max-width: 60ch; }
.push-banner span { color: var(--text-2); font-size: .9rem; }
.push-banner-actions { display: flex; gap: 6px; }
.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90; background: var(--graphite); color: #fff; padding: 12px 16px; border-radius: var(--r-l); font-size: .9rem; max-width: min(92vw, 460px); box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); }
.toast.bad { background: #7d1a14; }

/* ───────── Fragen & Antworten ───────── */
.nav-badge { display: inline-flex; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5534b; color: #fff; font-size: .7rem; font-weight: 700; align-items: center; justify-content: center; margin-left: 4px; vertical-align: 1px; }
.inbox-alert { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fdf4e7; border: 1px solid #f0d49c; border-radius: var(--r-l); padding: 12px 16px; margin-bottom: 18px; color: var(--text); }
.inbox-alert:hover { text-decoration: none; border-color: #c28a12; }
.inbox-alert span { color: var(--accent); font-size: .9rem; }
.inbox { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.inbox .card { margin: 0; }
.inbox-list { padding: 0; overflow: hidden; }
.inbox-new { display: flex; gap: 6px; padding: 12px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.inbox-empty { padding: 14px; margin: 0; }
.conv-list { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.conv { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px; border-bottom: 1px solid #eef0f3; color: var(--text); position: relative; }
.conv:hover { background: #fafbfc; text-decoration: none; }
.conv.on { background: var(--accent-soft); }
.conv.unread strong { font-weight: 700; }
.conv-top { display: flex; justify-content: space-between; gap: 8px; }
.conv-snip { color: var(--muted); font-size: .85rem; padding-right: 26px; }
.conv-badge { position: absolute; right: 12px; bottom: 12px; min-width: 20px; height: 20px; border-radius: 10px; background: #e5534b; color: #fff; font-size: .72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.empty-thread { min-height: 240px; display: flex; align-items: center; justify-content: center; }
.thread-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.thread-head > div { flex: 1; display: flex; flex-direction: column; }
.thread-back { display: none; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 4px 2px 8px; }
.chat-card .chat { max-height: none; }
.chat-empty { padding: 20px 0; }
.chat-date { align-self: center; font-size: .75rem; color: var(--muted); margin: 8px 0 2px; }
.msg { max-width: min(80%, 560px); padding: 9px 12px 6px; border-radius: 12px; display: flex; flex-direction: column; gap: 3px; }
.msg-them { align-self: flex-start; background: #f1f2f4; border-bottom-left-radius: 4px; }
.msg-me { align-self: flex-end; background: var(--graphite); color: #fff; border-bottom-right-radius: 4px; }
.msg-body { line-height: 1.45; overflow-wrap: anywhere; }
.msg-meta { font-size: .72rem; opacity: .65; align-self: flex-end; }
.msg-tag { font-size: .72rem; font-weight: 600; opacity: .8; }
.chat-form { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.login .chat-form { border-top: 0; }
.chat-day { display: flex; align-items: center; gap: 8px; }
.chat-day select { width: auto; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; }
.chat-input textarea { resize: none; min-height: 44px; max-height: 200px; }
.chat-input .btn { min-height: 44px; }
@media (max-width: 900px) {
  .inbox { grid-template-columns: 1fr; }
  .inbox.has-open .inbox-list { display: none; }
  .inbox:not(.has-open) .inbox-thread { display: none; }
  .thread-back { display: inline-flex; }
  .chat { max-height: none; }
  .msg { max-width: 88%; }
}

/* ───────── Lightbox ───────── */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(12,15,20,.95); display: flex; align-items: center; justify-content: center; padding: 50px 60px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox button { position: absolute; background: rgba(255,255,255,.08); color: #fff; border: 0; width: 42px; height: 42px; border-radius: 50%; font-size: 1.3rem; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.16); }
.lb-close { top: 12px; right: 12px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-cap { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: #aeb6c2; font-size: .8rem; margin: 0; }

/* ───────── Tagesdispo ───────── */
.sheet-body { background: #e9ecf0; }
.sheet-tools { max-width: 880px; margin: 20px auto 0; display: flex; gap: 8px; justify-content: flex-end; padding: 0 16px; flex-wrap: wrap; }
.sheet { max-width: 880px; margin: 14px auto 40px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; padding-bottom: 20px; }
.sheet > section, .sheet-foot { padding: 0 32px; margin-top: 24px; }
.sheet h2 { font-size: .8rem; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--text); padding-bottom: 5px; margin-bottom: 10px; letter-spacing: 0; }
.sheet h2 .muted { font-weight: 400; }
.sheet-head { background: var(--graphite); color: #fff; }
.sheet-title { display: flex; justify-content: space-between; gap: 20px; padding: 24px 32px; flex-wrap: wrap; }
.sheet-film { color: #9aa4b2; margin: 0; font-size: .85rem; }
.sheet-title h1 { font-size: 1.5rem; margin: 2px 0 2px; }
.sheet-date { font-weight: 500; margin: 0; color: #dfe3e9; }
.sheet-times { display: grid; grid-template-columns: repeat(4, auto); gap: 0; margin: 0; align-self: flex-end; }
.sheet-times div { padding: 2px 16px; border-left: 1px solid rgba(255,255,255,.14); }
.sheet-times dt { font-size: .75rem; color: #9aa4b2; }
.sheet-times dd { margin: 0; font-weight: 600; font-size: 1.25rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sheet-times .call dd { font-size: 1.5rem; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.sheet-grid ul { padding-left: 18px; margin: 0; }
.sheet-emergency p { font-weight: 500; }
.pre { white-space: normal; }
.sheet-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.sheet-table th, .sheet-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
.sheet-table thead th { font-size: .75rem; color: var(--muted); font-weight: 500; }
.sheet-table.script td strong { font-family: var(--script); }
.sheet-table .sc-nr { font-weight: 600; width: 3em; font-variant-numeric: tabular-nums; }
.sc-desc { color: var(--muted); font-size: .85rem; }
.team-row th { background: #f5f6f8; font-size: .8rem; font-weight: 600; padding-top: 8px; }
.sheet-foot { font-size: .78rem; }

/* Dispo: Aufklappbares, Bilder, Fragen */
.dispo-list { list-style: none; padding: 0; margin: 0; }
.dispo-item { padding: 5px 0; border-bottom: 1px solid #f0f2f5; }
.dispo-item:last-child { border-bottom: 0; }
.dispo-item summary, .dispo-more summary { cursor: pointer; }
.dispo-item summary::marker, .dispo-more summary::marker { color: var(--accent); }
.dispo-more summary { color: var(--accent); font-size: .88rem; }
.dispo-detail { padding: 6px 0 4px 18px; font-size: .88rem; }
.dispo-detail p { margin: 0 0 4px; }
.dispo-thumbs, .dispo-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; margin-top: 6px; }
.dispo-gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.dispo-thumbs img, .dispo-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }
.dispo-docs { padding-left: 18px; margin: 8px 0 0; font-size: .9rem; }
.dispo-ask { background: var(--accent-soft); border-top: 1px solid #c6d6e6; margin-top: 28px !important; padding-top: 18px !important; padding-bottom: 18px !important; }
.dispo-ask h2 { border-bottom-color: #c6d6e6; }
.sheet-notice { max-width: 880px; margin: 12px auto 0; }
@media print { .dispo-gallery img, .dispo-thumbs img { max-height: 120px; } }

/* Lesebestätigung */
.sheet > .ack-box { margin: 0; padding: 14px 32px; background: #fff7ed; border-bottom: 1px solid #fde3c8; }
.ack-box p { margin: 0 0 8px; }
.sheet > .ack-box.is-done { background: #effaf3; border-bottom-color: #cdebd8; }
.ack-box.is-done p { margin: 0; color: #22603d; }
.sheet > .ack-box.ack-admin { background: var(--accent-soft); border-bottom-color: #c6d6e6; }
.sheet .ack-box h2 { border: 0; padding: 0; margin: 0 0 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); }
.ack-form { display: flex; gap: 8px; flex-wrap: wrap; }
.ack-form input { flex: 1 1 200px; min-width: 0; }
.ack-sum { margin-bottom: 8px; }
.ack-bar { height: 6px; background: #e3e7ec; border-radius: 3px; margin-top: 6px; overflow: hidden; max-width: 320px; }
.ack-bar span { display: block; height: 100%; background: #2f855a; }
.nd-ack { color: inherit; text-decoration: none; }
.ack-done { color: #22603d; font-weight: 500; align-self: center; }
form.inline { display: inline; margin: 0; }
@media (max-width: 640px) { .sheet > .ack-box { padding: 12px 16px; } }

/* ───────── Responsive ───────── */
@media (max-width: 1080px) {
  .view-grid.has-media, .msg-grid, .settings-grid, .send-layout { grid-template-columns: 1fr; }
  .view-grid.has-media .media { order: -1; }
  .send-panel { position: static; }
  .next-day { grid-template-columns: 1fr; }
  .nd-facts { border-left: 0; border-top: 1px solid var(--line); grid-template-columns: repeat(6, 1fr); }
  .nd-facts > div, .nd-facts > div:nth-last-child(-n+3) { border-bottom: 0; }
  .nd-facts > div:nth-child(3n) { border-right: 1px solid var(--line); }
  .nd-facts > div:last-child { border-right: 0; }
}
@media (max-width: 900px) {
  .side { transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s; width: min(84vw, 290px); }
  .nav-open .side { transform: none; visibility: visible; transition: transform .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(12,15,20,.4); z-index: 30; }
  .side-close { display: block; color: #fff; }
  .main-wrap { margin-left: 0; }
  .topbar { display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; background: var(--graphite); color: #fff; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .main { padding-top: 22px; }
  .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-form { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .w-s { grid-column: span 1; } .w-m, .w-l { grid-column: span 2; }
  .card, .form-card { padding: 16px; }
  .seg { margin-left: 0; }
  .tb-search { max-width: none; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn-primary { flex: 1; }
  .table-wrap { background: transparent; border: 0; overflow: visible; }
  table.list, .list tbody, .list tr, .list td { display: block; }
  .list thead { display: none; }
  .list tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-l); margin-bottom: 8px; padding: 10px 14px; }
  .list td { border: 0; padding: 3px 0; display: flex; gap: 10px; }
  .list td:empty { display: none; }
  .list td::before { content: attr(data-label); flex: 0 0 38%; color: var(--muted); font-size: .78rem; padding-top: 2px; }
  .list td:first-child { font-size: 1rem; padding-bottom: 6px; }
  .list td:first-child::before { display: none; }
  .td-files { justify-content: flex-start; }
  .cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tile-body { padding: 9px 10px 11px; }
  .day-list a { grid-template-columns: 1fr auto; }
  .day-list a span:nth-child(2) { grid-column: 1 / -1; grid-row: 2; color: var(--muted); }
  .cat-row { grid-template-columns: 1fr auto; }
  .cat-track { grid-column: 1 / -1; grid-row: 2; }
  .nd-main { padding: 18px; }
  .nd-facts { grid-template-columns: repeat(3, 1fr); }
  .nd-facts > div { padding: 12px 14px; border-bottom: 1px solid var(--line); min-width: 0; }
  .nd-facts > div:nth-child(3n) { border-right: 0; }
  .nd-facts > div:nth-last-child(-n+3) { border-bottom: 0; }
  .nd-facts dd { font-size: 1.2rem; }
  .day-pick select { min-width: 0; width: 100%; }
  .recip-meta, .recip-preview, .recip-tasks { margin-left: 0; padding-left: 0; }
  .recip-tasks { padding-left: 16px; }
  .recip-actions { margin-left: -8px; }
  .checks { columns: 1; }
  .sheet > section, .sheet-foot { padding: 0 16px; }
  .sheet-title { padding: 18px 16px; }
  .sheet-times { grid-template-columns: repeat(2, 1fr); width: 100%; }
  .sheet-times div { padding: 6px 0; border: 0; }
  .lightbox { padding: 50px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print {
  @page { margin: 12mm; }
  body, .sheet-body { background: #fff; font-size: 10.5pt; }
  .no-print, .sheet-tools { display: none !important; }
  .sheet { border: 0; margin: 0; max-width: none; border-radius: 0; }
  .sheet-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet > section, .sheet-foot { padding: 0; }
  .sheet-title { padding: 14px 16px; }
  .sheet-table tr { break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
