:root {
  --bg: #f3f5f6; --card: #fff; --text: #1d2327; --muted: #64707a; --line: #dde2e6;
  --accent: #1f6f78; --accent-text: #fff;
  --ok: #1e7a46; --ok-bg: #e3f4ea; --warn: #8a5a00; --warn-bg: #fff1d6; --bad: #a3242c; --bad-bg: #fde4e5;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111416; --card: #1b2023; --text: #e7ebee; --muted: #98a3ab; --line: #2d3439;
    --accent: #4fb3bd; --accent-text: #0b1214;
    --ok: #7fd6a2; --ok-bg: #173323; --warn: #f2c46b; --warn-bg: #3a2c10; --bad: #ff9aa0; --bad-bg: #3d1a1d;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 760px; margin: 0 auto; padding: 12px 12px calc(24px + env(safe-area-inset-bottom)); }
a { color: var(--accent); }
h1 { font-size: 1.4rem; margin: 0 0 12px; }
h2 { font-size: 1rem; margin: 0 0 10px; }

nav.top { position: sticky; top: 0; z-index: 5; display: flex; background: var(--card); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
nav.top a { flex: 1; text-align: center; padding: 12px 4px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; }
nav.top a.active { color: var(--accent); border-bottom-color: var(--accent); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
details.card > summary { cursor: pointer; font-weight: 600; }

label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 12px; }
input, select, button { font: inherit; color: inherit; }
input:not([type=radio]):not([type=file]), select {
  display: block; width: 100%; margin-top: 4px; padding: 10px 12px; font-size: 1.1rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--text);
}
input:focus-visible, select:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

fieldset { border: 0; padding: 0; margin: 0 0 12px; }
legend { font-size: .85rem; color: var(--muted); margin-bottom: 6px; padding: 0; }
.rooms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.rooms legend, .segmented legend { grid-column: 1 / -1; }
.chip { margin: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: block; text-align: center; padding: 11px 4px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: .92rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }

.minutes .quick { display: flex; gap: 6px; margin: -6px 0 12px; }
.minutes .quick button { flex: 1; padding: 8px 0; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.minutes.hidden { display: none; }

.backdate .toggle { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); }
.backdate .toggle input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.backdate:not(:has(input[name=nachtragen]:checked)) .when { display: none; }
.backdate:has(input[name=nachtragen]:checked) .when input { border-color: var(--accent); }

details.more { margin: 4px 0 14px; }
details.more summary { font-size: .9rem; color: var(--muted); cursor: pointer; padding: 4px 0 10px; }
.hint { font-size: .8rem; color: var(--muted); margin: 0 0 8px; }
.muted { color: var(--muted); font-size: .85rem; }

button { cursor: pointer; }
button.primary { display: block; width: 100%; padding: 14px; border: 0; border-radius: 10px; background: var(--accent); color: var(--accent-text); font-size: 1.1rem; font-weight: 700; }
button.icon { border: 0; background: none; color: var(--muted); padding: 6px 8px; }

.flash { border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 2px; }
.flash ul { margin: 4px 0 0; padding-left: 18px; }
.ok { background: var(--ok-bg); color: var(--ok); }
.warn { background: var(--warn-bg); color: var(--warn); }
.bad { background: var(--bad-bg); color: var(--bad); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap; }

ul.status { list-style: none; margin: 0; padding: 0; }
ul.status li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "room badge" "info badge"; padding: 8px 0; border-top: 1px solid var(--line); }
ul.status li:first-child { border-top: 0; }
ul.status li > :nth-child(1) { grid-area: room; font-weight: 600; }
ul.status li > :nth-child(2) { grid-area: info; }
ul.status li > :nth-child(3) { grid-area: badge; align-self: center; }

.filters { display: flex; gap: 8px; }
.filters select { margin: 0; }
.table-wrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.import { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; align-items: flex-start; }
.import button { padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); }
.explain p { font-size: .9rem; margin: 0 0 8px; }
.logout { text-align: center; }
.logout button { border: 0; background: none; color: var(--muted); text-decoration: underline; font-size: .85rem; }

.login { max-width: 360px; margin: 15vh auto 0; }
.chart { position: relative; height: 260px; }

#queue-banner .flash { margin: 8px 0 0; }
#queue-banner button { align-self: flex-start; margin-top: 6px; padding: 6px 12px; border-radius: 8px; border: 1px solid currentColor; background: none; color: inherit; }
#queue-banner a { color: inherit; }
