/* Material-3-Stil, schwarz mit grünem Akzent (Grün nur für Auswahl und Hauptaktionen). Alle Textpaare mindestens 7:1. */
:root {
  color-scheme: dark;
  --bg: #000000;
  --bar: #0d0d0d;
  --card: #121212;
  --high: #1a1a1a;
  --highest: #262626;
  --text: #f0f0f0;
  --muted: #c8c8c8;
  --outline: #8f8f8f;
  --line: #333333;
  --primary: #6bdc92;
  --on-primary: #00391c;
  --primary-container: #00522b;
  --on-primary-container: #93f9b0;
  --secondary-container: #2b2b2b;
  --on-secondary-container: #f0f0f0;
  --error: #ffb4ab;
  --on-error: #690005;
  --warn-container: #5a4300;
  --on-warn-container: #ffe0a0;
  --role-container: #4b3b70;
  --on-role-container: #ecdfff;
  --error-container: #6b1a12;
  --on-error-container: #ffdad4;
  --plan: #9ec5ff;
  --plan-container: #0b3a73;
  --on-plan-container: #cfe3ff;
  --focus: #ffd24d;
  --hover: linear-gradient(rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.09));
  --press: linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16));
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.125rem/1.6 Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}

main, .top-inner { max-width: 50rem; margin: 0 auto; padding: 0 1rem; }
main { padding-bottom: 7rem; }

a { color: var(--primary); text-underline-offset: 0.2em; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.75rem 1rem;
  z-index: 30;
}
.skip:focus { left: 0; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

h1 { font-size: 1.75rem; line-height: 1.3; font-weight: 500; margin: 1.5rem 0 1rem; }
h2 { font-size: 1.4rem; line-height: 1.3; font-weight: 500; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.2rem; line-height: 1.3; font-weight: 500; margin: 0 0 0.5rem; }
h4 { font-size: 1.125rem; line-height: 1.3; font-weight: 500; margin: 0 0 0.35rem; color: var(--muted); }

/* App-Leiste und Tabs */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bar);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 56px;
  margin: 0;
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.3;
}
.brand a { display: flex; align-items: center; gap: 0.75rem; color: var(--text); text-decoration: none; }
.brand .dot {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  border-radius: 50%;
  background: var(--primary);
}
nav { margin: 0 -1rem; }
nav ul {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  list-style: none;
  padding: 0 0.5rem;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
nav ul::-webkit-scrollbar { display: none; }
nav li { flex: none; }
nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 0.9rem;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
nav a:hover { background-image: var(--hover); }
nav a:active { background-image: var(--press); }
nav a[aria-current="page"] { color: var(--primary); border-bottom-color: var(--primary); }
.top :focus-visible { outline-offset: -3px; }

/* Formulare */
.stack > * + * { margin-top: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; }
label { font-weight: 500; color: var(--muted); }
input[type="text"], input[type="date"], input[type="time"], input[type="email"],
input[type="number"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.9rem;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--outline);
  border-radius: 12px;
}
input:focus, select:focus, textarea:focus { border: 2px solid var(--primary); padding: calc(0.5rem - 1px) calc(0.9rem - 1px); outline: none; }
textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }
fieldset { border: 1px solid var(--line); background: var(--card); border-radius: 16px; padding: 0.75rem 1rem 1rem; margin: 0; }
fieldset > .field + .field { margin-top: 1rem; }
legend { font-weight: 500; color: var(--text); padding: 0 0.4rem; }

.check {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.25rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-weight: 400;
  cursor: pointer;
}
.check:hover { background-image: var(--hover); }
.check:has(input:checked) { background-color: var(--high); border-color: var(--primary); color: var(--text); }
.check input { width: 1.5rem; height: 1.5rem; flex: none; accent-color: var(--primary); }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 0.5rem; }
.checks > p { grid-column: 1 / -1; }

.assign {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.assign.chosen { background: var(--high); border-color: var(--primary); }
@media (min-width: 40rem) {
  .assign { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
}

/* Knöpfe */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  min-width: 48px;
  padding: 0.4rem 1.5rem;
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  color: var(--on-secondary-container);
  background-color: var(--secondary-container);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
.btn:hover { background-image: var(--hover); }
.btn:active { background-image: var(--press); }
.btn.primary { background-color: var(--primary); color: var(--on-primary); }
.btn.danger { background-color: var(--error); color: var(--on-error); }
.btn.success { background-color: transparent; color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
.btn:disabled {
  background: transparent;
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--outline);
  cursor: not-allowed;
}
.btn:disabled:hover { background-image: none; }

.fab-bar {
  position: fixed;
  right: max(1rem, calc((100vw - 50rem) / 2 + 1rem));
  bottom: 1.25rem;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.75rem;
  margin: 0;
  max-width: calc(100vw - 2rem);
}
.fab-spacer { height: 6rem; }
.fab {
  min-height: 56px;
  padding: 0 1.5rem 0 1.25rem;
  border-radius: 16px;
  background-color: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
}
.fab .plus { font-size: 1.75rem; font-weight: 400; line-height: 1; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 1rem 0; }
.actions > p { margin: 0; }
form.inline { display: inline; margin: 0; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin: 0.5rem 0; }
.row.item {
  justify-content: space-between;
  padding: 0.75rem 1rem;
  margin: 0 0 0.5rem;
  background: var(--card);
  border-radius: 16px;
}
.row.item .actions { margin: 0; }

/* Inhalt */
.card {
  background: var(--high);
  border-radius: 20px;
  padding: 1rem 1.25rem 0.5rem;
  margin: 0 0 1rem;
}
.card.current { box-shadow: inset 0 0 0 2px var(--primary); }
.card > p { margin: 0.5rem 0; }
.card h3 a { color: var(--text); text-decoration-color: var(--primary); text-decoration-thickness: 2px; }
.muted { color: var(--muted); }
.notes { white-space: pre-wrap; }
.lead { font-weight: 500; }
.empty {
  color: var(--muted);
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--card);
  border-radius: 16px;
}
.votes { min-width: 2.5rem; text-align: center; font-size: 1.4rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; }
dt { font-weight: 500; color: var(--muted); }
dd { margin: 0; }
details { margin: 0.75rem 0; }
summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-weight: 500; }

.people { margin: 0.75rem 0; padding: 0.75rem 1rem; background: var(--card); border-radius: 16px; }
.people .btn { margin-top: 0.5rem; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 0.35rem 0; }
ul.plain li + li { border-top: 1px solid var(--line); }

.badge {
  display: inline-block;
  padding: 0.1rem 0.65rem;
  margin: 0 0.35rem 0.25rem 0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--highest);
  color: var(--text);
}
.badge.info { background: var(--secondary-container); color: var(--on-secondary-container); }
.badge.warn { background: var(--warn-container); color: var(--on-warn-container); }
.badge.ok { background: var(--primary-container); color: var(--on-primary-container); }
.badge.role { background: var(--role-container); color: var(--on-role-container); }

.flash, .notice {
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  margin: 1rem 0;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
}
.flash.ok { background: var(--high); color: var(--text); box-shadow: inset 4px 0 0 var(--primary); }
.flash.error { background: var(--error-container); color: var(--on-error-container); }
.flash ul { margin: 0; padding-left: 1.25rem; }
.notice a { color: inherit; }

.table-wrap { overflow-x: auto; background: var(--card); border-radius: 16px; }
table { border-collapse: collapse; min-width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 0.5rem 0.75rem; text-align: center; white-space: nowrap; }
thead th { background: var(--high); color: var(--muted); font-weight: 500; }
th[scope="row"] { text-align: left; }
tbody th[scope="row"] { position: sticky; left: 0; background: var(--card); }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.95em; }

/* Sitzungsliste */
.card details { margin: 0; }
.card summary { min-height: 56px; padding-bottom: 0.5rem; }
.card .sum { display: block; line-height: 1.5; }
.card.cancelled { background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.card.cancelled .sum strong { text-decoration: line-through; text-decoration-thickness: 2px; }

/* Unterreiter (Sitzungen: kommend / Archiv) */
.subtabs { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1rem; }
.subtabs a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  text-decoration: none;
  font-weight: 500;
}
.subtabs a:hover { background-image: var(--hover); }
.subtabs a[aria-current="page"] { background: var(--primary); color: var(--on-primary); }

/* Einklappbare Gruppe (Zukünftig) */
details.group { margin: 0; }
details.group > summary { list-style: none; min-height: 56px; padding: 0; justify-content: space-between; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary h2 { margin: 1rem 0 0.5rem; flex: 1; }
details.group > summary::after { content: "▾"; font-size: 1.5rem; color: var(--primary); padding: 0 0.5rem; }
details.group[open] > summary::after { content: "▴"; }

details.filter { background: var(--high); border-radius: 20px; padding: 0 1.25rem 0.25rem; margin-bottom: 0.5rem; }
details.filter > summary { color: var(--primary); }
details.filter form { padding-bottom: 0.75rem; }

/* Ablauf-Tabelle einer Sendung */
.runsheet table { width: 100%; }
.runsheet th.left, .runsheet td.left { text-align: left; white-space: normal; }
.runsheet td, .runsheet th { vertical-align: top; }
.runsheet th.dur, .runsheet td.dur { text-align: right; white-space: nowrap; width: 1%; padding-top: 0.9rem; }
.runsheet td.left { padding: 0 0.75rem; }
.runsheet details { margin: 0; }
.runsheet .sum { display: block; line-height: 1.5; padding: 0.5rem 0; }
.runsheet tfoot th, .runsheet tfoot td { font-weight: 700; border-top: 2px solid var(--primary); border-bottom: 0; color: var(--text); }
.runsheet .people { background: var(--high); }
.runsheet th.num, .runsheet td.num { width: 1%; padding: 0.4rem 0.25rem 0.4rem 0.5rem; text-align: center; }
.runsheet .pos { display: flex; gap: 0.25rem; align-items: center; margin: 0; }
.runsheet input.quiet {
  width: 2.75rem; min-height: 48px; padding: 0; text-align: center;
  background: transparent; border: 0; border-bottom: 1px dotted var(--outline); border-radius: 0;
}
.runsheet td.dur input.quiet { text-align: right; width: 2.5rem; }
.runsheet input.quiet:hover { background: var(--high); }
.runsheet input.quiet:focus { border: 0; border-bottom: 2px solid var(--primary); padding: 0; background: var(--high); }
.runsheet .unit { color: var(--muted); }
.runsheet .btn.ghost { min-width: 48px; padding: 0 0.5rem; background: transparent; color: var(--primary); box-shadow: none; }
.runsheet tfoot tr.over th, .runsheet tfoot tr.over td { color: var(--on-error-container); background: var(--error-container); }
.runsheet tfoot tr.under th, .runsheet tfoot tr.under td { color: var(--on-primary-container); background: var(--primary-container); }
.log td.left, .log th.left { text-align: left; white-space: normal; vertical-align: top; }
.changes { margin: 0.25rem 0 0; }
.changes summary { min-height: 48px; color: var(--primary); }
.changes del { color: var(--muted); text-decoration-thickness: 2px; }
.changes ins { text-decoration: none; font-weight: 700; }
.attend .row.item { padding: 0.25rem 0; }
.attend select.status { width: auto; min-width: 11rem; }

/* geplant = blau, abgemeldet = rot, anwesend = grün */
.check.planned:has(input:checked) { background-color: var(--plan-container); border-color: var(--plan); color: var(--on-plan-container); }
.check.planned input { accent-color: var(--plan); }
li.planned { color: var(--plan); }
li.away { color: var(--error); }
.attend select.st-da { border-color: var(--primary); background: var(--primary-container); color: var(--on-primary-container); }
.attend select.st-away { border-color: var(--error); background: var(--error-container); color: var(--on-error-container); }
.attend select.st-plan { border-color: var(--plan); background: var(--plan-container); color: var(--on-plan-container); }
.cell-away { display: inline-block; min-width: 1.75rem; border-radius: 8px; background: var(--error-container); color: var(--on-error-container); font-weight: 700; }
.cell-plan { display: inline-block; min-width: 1.75rem; border-radius: 8px; background: var(--plan-container); color: var(--on-plan-container); font-weight: 700; }
