:root {
  --ink: #1B1F24;
  --muted: #4B5560;
  --ground: #EEF0F2;
  --card: #FFFFFF;
  --line: #D5D9DE;
  --head: #22262C;
  --hot: #C2410C;
  --hot-bg: #FCE9DD;
  --hot-ink: #8A2D08;
  --cool: #1D4E89;
  --cool-bg: #E1EBF6;
  --peach: #FFB38A;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", "Helvetica Neue", sans-serif;
  padding-bottom: 76px;
}
a { color: var(--cool); }
a:hover { color: #12335B; }
h1, h2 { margin: 0; }
p { margin: 0 0 10px; }
p:last-child { margin-bottom: 0; }
:focus-visible { outline: 3px solid var(--cool); outline-offset: 2px; }

/* Kopf */
.top { background: var(--head); color: #fff; }
.top-in { max-width: 760px; margin: 0 auto; padding: 16px 16px 14px; }
.top .role { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--peach); }
.top .back { display: inline-flex; align-items: center; min-height: 44px; margin: -10px 0 -4px; color: var(--peach); font-weight: 600; text-decoration: none; }
.top h1 { font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }

/* Navigation: unten am Handy, oben am großen Bildschirm */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabs a { flex: 1; min-height: 56px; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; text-align: center; border-top: 3px solid transparent; }
.tabs a.on { color: var(--hot); border-top-color: var(--hot); }

.wrap { max-width: 760px; margin: 0 auto; padding: 14px 14px 24px; display: flex; flex-direction: column; gap: 12px; }
.sub { margin: 0; color: var(--muted); font-weight: 600; }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card > p { margin: 0; }
.card h2, fieldset legend { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card.dark { background: var(--head); color: #fff; border-color: var(--head); }
.card.dark .big { font-size: 40px; font-weight: 700; line-height: 1.05; }
.muted-l { color: var(--line); font-size: 14px; }
.muted { color: var(--muted); font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; margin: 0; }
.center { text-align: center; }
.pre { white-space: pre-line; overflow-wrap: anywhere; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; overflow-wrap: anywhere; background: var(--ground); padding: 2px 6px; border-radius: 4px; }
.month { margin: 8px 2px 0; font-size: 18px; font-weight: 700; }
a.card { text-decoration: none; color: inherit; }
a.card:hover { border-color: var(--muted); color: inherit; }
.person { gap: 3px; }

/* Veranstaltungskarte */
.ev-head { display: flex; gap: 12px; text-decoration: none; color: inherit; }
.ev-head:hover { color: inherit; }
.tile { width: 52px; flex: none; align-self: flex-start; display: flex; flex-direction: column; align-items: center; background: var(--head); color: #fff; border-radius: 8px; padding: 6px 0; line-height: 1.15; }
.tile .wd { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.tile .day { font-size: 24px; font-weight: 700; }
.tile .mon { font-size: 12px; }
.ev-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ev-title { font-size: 17px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.ev-meta { font-size: 14px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--ground); color: var(--ink); }
.chip.warm { background: var(--hot-bg); color: var(--hot-ink); }
.chip.cool { background: var(--cool-bg); color: var(--cool); }
.chip.hot { background: var(--hot); color: #fff; }

/* Besetzungsbalken */
.bar { display: flex; flex-direction: column; gap: 4px; }
.bar-l { display: flex; justify-content: space-between; font-size: 14px; }
.bar-t { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar-f { height: 8px; border-radius: 4px; }
.bar-f.low { background: var(--hot); }
.bar-f.full { background: var(--cool); }

/* Schaltflächen */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 16px; border: 1px solid var(--muted); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { background: var(--ground); color: var(--ink); }
.btn.primary { background: var(--hot); border-color: var(--hot); color: #fff; }
.btn.primary:hover { background: #9A3309; color: #fff; }
.btn.blue { background: var(--cool); border-color: var(--cool); color: #fff; }
.btn.blue:hover { background: #12335B; color: #fff; }
.btn.danger { border-color: var(--hot); color: var(--hot-ink); }
.btn.dashed { border-style: dashed; }
.btn.small { min-height: 44px; padding: 0 12px; font-size: 14px; }
.btn.sq { width: 46px; padding: 0; font-size: 22px; flex: none; }
.card > form { display: flex; flex-direction: column; }
.row { display: flex; gap: 8px; }
.row > *, .row > form > .btn { flex: 1; }
.row > form { display: flex; }
.row.flow { flex-wrap: wrap; }
.row.flow > * { flex: 0 1 auto; }

/* Umschalter */
.seg { display: flex; gap: 8px; }
.seg a { flex: 1; min-height: 44px; display: flex; align-items: center; justify-content: center; padding: 0 10px; border: 1px solid var(--head); border-radius: 8px; background: var(--card); color: var(--ink); font-weight: 600; text-decoration: none; text-align: center; }
.seg a.on { background: var(--head); color: #fff; }
.seg.scroll { overflow-x: auto; }
.seg.scroll a { flex: 0 0 auto; min-width: 72px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: center; }

/* Formulare */
.form { gap: 8px; }
.form.narrow { max-width: 420px; width: 100%; margin: 0 auto; }
label { font-size: 14px; font-weight: 600; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=time], input[type=file], select, textarea {
  width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #7A838D; border-radius: 8px; background: #fff; color: var(--ink); font: inherit;
}
textarea { resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 500; margin: 0; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--hot); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 4px 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.grid2, .grid3 { display: grid; gap: 10px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid2 > div, .grid3 > div { display: flex; flex-direction: column; gap: 4px; justify-content: flex-end; }
.inline { display: flex; flex-direction: row !important; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline input { width: 90px; }
.form.add { border-top: 1px solid var(--line); padding-top: 10px; }

/* Hinweise */
.flash, .note { border-radius: 8px; padding: 10px 12px; font-size: 15px; font-weight: 500; }
.flash.ok, .flash.info, .note.cool { background: var(--cool-bg); color: var(--cool); }
.flash.err, .note.warm { background: var(--hot-bg); color: var(--hot-ink); }
.note { background: var(--ground); margin: 0; }

.map-img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }

/* Detailseite */
.time { display: flex; gap: 12px; align-items: baseline; }
.time > b { width: 62px; flex: none; font-size: 22px; font-weight: 700; }
.hot { color: var(--hot); }
.cool { color: var(--cool); }
.kv { display: flex; gap: 10px; font-size: 15px; }
.kv > span:first-child { width: 110px; flex: none; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stats > div { display: flex; flex-direction: column; gap: 2px; }
.stats b { font-size: 26px; line-height: 1.1; }
.stats span { font-size: 13px; color: var(--muted); }
.app { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--ground); }
.app:first-of-type { border-top: none; padding-top: 0; }
.app.line { flex-direction: row; align-items: center; justify-content: space-between; }
details summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--cool); }
details[open] summary { margin-bottom: 6px; }
.hist, .log { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--ground); font-size: 15px; }
.hist:first-of-type, .log:first-of-type { border-top: none; }
.hist > span:first-child, .log > span:first-child { flex: none; width: 84px; }
.log > span:first-child { width: 118px; }
.hist > span:nth-child(2) { flex: 1; min-width: 0; }

/* Wochen- und Monatsplan */
.plan-box { padding: 8px; overflow-x: auto; }
.plan { border-collapse: collapse; width: 100%; font-size: 14px; }
.plan th, .plan td { padding: 3px 2px; text-align: center; border-top: 1px solid var(--ground); }
.plan thead th { border-top: none; font-size: 12px; font-weight: 600; color: var(--muted); }
.plan thead th span { display: block; }
.plan thead th.we { color: var(--ink); }
.plan thead th.today { color: var(--hot); }
.plan th[scope=row], .plan thead th:first-child { text-align: left; white-space: nowrap; font-weight: 500; position: sticky; left: 0; background: var(--card); padding-right: 8px; }
.plan th[scope=row] a { color: var(--ink); text-decoration: none; }
.plan.month td { min-width: 28px; }
.cell { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; font-size: 13px; font-weight: 700; font-style: normal; text-decoration: none; }
.cell.e { background: var(--cool); color: #fff; }
.cell.s { background: #F6C7A8; color: #5E1F05; }
.cell.x { background: var(--head); color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .cell { width: 20px; height: 20px; font-size: 11px; }

/* Großer Bildschirm */
@media (min-width: 760px) {
  body { padding-bottom: 0; }
  .tabs { position: static; justify-content: center; border-top: none; border-bottom: 1px solid var(--line); }
  .tabs a { flex: 0 0 auto; padding: 0 22px; font-size: 15px; border-top: none; border-bottom: 3px solid transparent; }
  .tabs a.on { border-bottom-color: var(--hot); }
  .wrap { padding-top: 20px; }
}

/* Servicezettel */
.sheet { background: #fff; padding: 16px; max-width: 800px; margin: 0 auto; }
.sheet h1 { font-size: 26px; }
.sheet h2 { font-size: 16px; margin: 22px 0 8px; }
.sheet-org { color: var(--muted); margin: 2px 0 16px; }
.sheet-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.sheet-t { width: 100%; border-collapse: collapse; font-size: 15px; }
.sheet-t th, .sheet-t td { border: 1px solid #9AA2AB; padding: 7px 9px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.sheet-t th { width: 34%; background: var(--ground); }
.sheet-t.list th { width: auto; }
.sheet-t.list td:last-child { width: 90px; }
@media print {
  .sheet-bar { display: none; }
  .sheet { padding: 0; }
}
