:root {
  color-scheme: light dark;
  --bg: #f3f7f3;
  --surface: #ffffff;
  --surface-2: #eaf1eb;
  --border: #d3e0d6;
  --text: #14261b;
  --muted: #55705f;
  --accent: #2e7d32;
  --accent-text: #ffffff;
  --good: #2e7d32;
  --warn: #9a6700;
  --bad: #c62828;
  --private: #7b2cbf;
  --shadow: 0 1px 2px rgba(20, 38, 27, .08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1812;
    --surface: #15231b;
    --surface-2: #1c2e23;
    --border: #2a4033;
    --text: #e6f2ea;
    --muted: #9bb3a4;
    --accent: #6fcb45;
    --accent-text: #0e1812;
    --good: #7fd957;
    --warn: #f0b429;
    --bad: #ff8a80;
    --private: #d59bff;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}

h1, h2, h3 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .95rem; margin-top: 20px; }
p { margin: 0; }

code, .mono { font-family: ui-monospace, "Cascadia Code", "DejaVu Sans Mono", Menlo, Consolas, monospace; }
code { font-size: .9em; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

.muted { color: var(--muted); }
.small { font-size: .8rem; }
.hint { color: var(--muted); font-size: .85rem; margin-top: 8px; }
.error { color: var(--bad); margin-top: 10px; }
.pre { white-space: pre-wrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.logo { width: 32px; height: 32px; image-rendering: pixelated; border-radius: 6px; }
.logo-large { width: 96px; height: 96px; border-radius: 14px; }

/* ---------- Eingaben ---------- */

label { display: block; font-weight: 600; margin: 14px 0 6px; }

input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="date"], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}

input.mono, textarea.mono { font-size: .88rem; }
textarea { resize: vertical; line-height: 1.45; tab-size: 2; white-space: pre; overflow: auto; margin-top: 12px; }

button {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover { border-color: var(--accent); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); margin-top: 16px; }
button.danger { color: var(--bad); border-color: var(--bad); background: transparent; }
button.ghost { background: transparent; }
button.link { background: none; border: none; padding: 0; color: var(--bad); font-weight: 600; }

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

.row { display: flex; gap: 8px; }
.row > input, .row > select { flex: 1 1 0; }
.inline-form { margin-top: 6px; }

.switch-row { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 12px 0 4px; cursor: pointer; }
.switch-row input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* ---------- Anmeldung ---------- */

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; text-align: center; }
.login-card label { text-align: left; }
.login-card button { width: 100%; }
.login-card h1 { margin-top: 12px; }

/* ---------- Gerüst ---------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 5;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.tab { border-color: transparent; background: transparent; color: var(--muted); }
.tab.active { color: var(--text); background: var(--surface-2); border-color: var(--border); }

main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 48px; }
section > * + * { margin-top: 16px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head input, .card-head select { width: auto; flex: 0 1 260px; }

.columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }

/* ---------- Kennzahlen ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); }
.tile-label { color: var(--muted); font-size: .82rem; }
.tile-value { font-size: 1.55rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.3; }
.tile-note { font-size: .82rem; color: var(--muted); }
.tile-note.good { color: var(--good); }
.tile-note.warn { color: var(--warn); }
.tile-note.bad { color: var(--bad); }

/* ---------- Tabellen ---------- */

.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--muted); font-size: .8rem; font-weight: 600; }
th.num, td.num { text-align: right; }
tbody tr:last-child td { border-bottom: none; }
table.clickable tbody tr { cursor: pointer; }
table.clickable tbody tr:hover, table.clickable tbody tr:focus-visible { background: var(--surface-2); }

.status { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--good); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .82rem; }

/* ---------- Formulare und Chat ---------- */

.forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.forms .check { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.forms .check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); flex: none; }
.forms textarea { margin-top: 0; }
.forms .hint { margin-top: 4px; }

.filters > input, .filters > select { flex: 1 1 160px; width: auto; }
table.chat tr.private td:last-child, table.chat tr.private strong { color: var(--private); }
.private-badge { margin-left: 8px; color: var(--private); border-color: var(--private); }
table.chat td { white-space: normal; vertical-align: top; }
table.chat td:nth-child(-n+3) { white-space: nowrap; }
table.chat td:last-child { overflow-wrap: anywhere; min-width: 240px; }
#chat-more { margin-top: 12px; }
.scroll { max-height: 260px; overflow-y: auto; }
.plus { color: var(--good); }
.minus { color: var(--bad); }
dialog .card-head { margin-top: 20px; }
dialog .card-head h3 { margin-top: 0; }
#pd-money-block td:last-child { white-space: normal; overflow-wrap: anywhere; min-width: 180px; }

/* ---------- Module ---------- */

.module { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.module:last-child { border-bottom: none; }
.module label { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; }
.module input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Dialog ---------- */

dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
}

dialog::backdrop { background: rgba(0, 0, 0, .55); }
.dialog-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dialog-head p { overflow-wrap: anywhere; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 16px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

.rank-list { list-style: none; margin: 8px 0 0; padding: 0; }
.rank-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }

.checklist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.checklist li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); }
.checklist li.done span { color: var(--accent); }
.checklist li.open span { color: var(--text); }

button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
#pd-property-block h4 { margin: 12px 0 0; font-size: .9rem; color: var(--muted); }

/* ---------- Moderation ---------- */

.tab .count { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--bad); color: #fff; font-size: .78rem; line-height: 20px; text-align: center; }
table.wrap-text td { white-space: normal; vertical-align: top; }
table.wrap-text td.nowrap { white-space: nowrap; }
table.wrap-text td .row { flex-wrap: nowrap; }
table.wrap-text td .row input { min-width: 140px; }
.badge.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
button.link { padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; text-decoration: underline; cursor: pointer; }
#pun-form button.primary { margin-top: 0; }
label.check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
label.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- Ränge ---------- */

table.styles td { vertical-align: middle; }
table.styles td small { display: block; font-size: .75rem; }
table.styles input[type="text"] { min-width: 150px; }
table.styles input[type="color"] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); cursor: pointer; }
table.styles input[type="color"]:disabled { opacity: .35; cursor: default; }
table.styles input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.gradient-pick { display: inline-flex; align-items: center; gap: 8px; }
.warn-text { color: var(--warn); }
/* Immer dunkel wie der Chat im Spiel, damit die Farben so wirken wie dort. */
.chat-preview { background: #1b1b1f; border-radius: 8px; padding: 6px 12px; font-family: ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; font-weight: 600; white-space: nowrap; min-width: 210px; }

/* ---------- Rechte ---------- */

.chips { flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 12px; border-radius: 999px; font-size: .88rem; }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.perm-wrap { max-height: 72vh; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
table.perm { border-collapse: separate; border-spacing: 0; }
table.perm th, table.perm td { padding: 7px 10px; text-align: center; background: var(--surface); }
table.perm thead th { position: sticky; top: 0; z-index: 2; color: var(--text); font-size: .85rem; vertical-align: bottom; }
table.perm small { display: block; font-weight: 400; font-size: .75rem; }
table.perm .perm-label {
  position: sticky; left: 0; z-index: 1;
  text-align: left; white-space: normal; min-width: 230px; max-width: 300px;
  color: var(--text); font-size: .92rem; font-weight: 600;
  border-right: 1px solid var(--border);
}
table.perm thead .perm-label { z-index: 3; color: var(--muted); font-size: .8rem; }
table.perm .perm-group {
  text-align: left; background: var(--surface-2); color: var(--text); font-size: .92rem; white-space: normal;
}
table.perm .perm-group span { position: sticky; left: 10px; }
table.perm .perm-group small { display: inline; margin-left: 10px; }
table.perm input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); vertical-align: middle; cursor: pointer; }
table.perm input[type="checkbox"]:disabled { cursor: default; }
table.perm td.inherited input { opacity: .45; }
table.perm select { width: auto; min-width: 84px; padding: 4px 6px; font-size: .88rem; }
table.perm td.no-effect select { color: var(--warn); border-color: var(--warn); }
table.perm tbody tr:hover td, table.perm tbody tr:hover .perm-label { background: var(--surface-2); }
.perm-other code { display: inline-block; margin: 1px; }
.perm-actions { align-items: center; flex-wrap: wrap; margin-top: 16px; }
.perm-actions button.primary { margin-top: 0; }

/* ---------- Meldungen ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  z-index: 20;
}

.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 640px) {
  .topbar { padding: 10px 16px; }
  .tabs { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .row { flex-wrap: wrap; }
  .row > button { flex: 1 1 100%; }
  .chips > button { flex: 0 1 auto; }
  table.perm .perm-label { min-width: 132px; max-width: 150px; font-size: .85rem; }
  table.perm .perm-label small { display: none; }
}

/* ---------- Battlepass im Spieler-Dialog ---------- */
.pass-levels { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; padding: 0; }
.pass-level { min-width: 46px; padding: 6px 8px; font-variant-numeric: tabular-nums; }
.pass-level.claimed { border-color: var(--good); color: var(--good); }
.pass-level.ready { border-color: var(--warn); color: var(--warn); font-weight: 700; }
.pass-level.locked { color: var(--muted); }

/* ---------- Neuen Rang anlegen ---------- */
.rank-new { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; align-items: end; }
.rank-new label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.rank-new input[type="color"] { width: 100%; }

/* Geldfluss: zwei Balken pro Tag, oben was entstanden ist, unten was verschwunden ist */
.flow-cell { min-width: 160px; width: 30%; }
.flow-bar { display: block; height: 7px; border-radius: 4px; min-width: 2px; }
.plus-bar { background: var(--good); margin-bottom: 3px; }
.minus-bar { background: var(--bad); }

/* Übersicht: zweite Reihe Kacheln, Liste der Fakten, anklickbare Zeilen */
#tiles-day { margin-top: 12px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 4px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts dd.highlight { color: var(--accent); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--surface-2); }

/* Whitelist bearbeiten */
.whitelist-box { margin: 4px 0 12px 30px; }
.whitelist-box summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 4px 0; }
.whitelist-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.whitelist-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.whitelist-list li:last-child { border-bottom: 0; }
.bad-text { color: var(--bad); }

/* Konsole */
.console-log { height: min(62vh, 640px); overflow: auto; margin: 12px 0; padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: #0b0f0d; color: #d6e2d9; font: 0.82rem/1.45 ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  white-space: pre-wrap; overflow-wrap: anywhere; }
.console-form { display: flex; gap: 8px; }
.console-form input { flex: 1; font-family: ui-monospace, "Cascadia Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.9rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Protokoll des Dashboards */
table.audit td { white-space: normal; vertical-align: top; }
table.audit td:nth-child(3) { overflow-wrap: anywhere; min-width: 260px; }
table.audit tr.failed td:nth-child(2) { color: var(--bad); }

/* Umschalter im Bereich Protokoll, Besuche der Spieler */
.segments { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); max-width: 100%; flex-wrap: wrap; }
.segment { border: 0; background: none; border-radius: 999px; padding: 6px 16px; color: inherit; font-weight: 600; }
.segment.active { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.badge.good { border-color: var(--good); color: var(--good); }
table.sessions td { vertical-align: middle; }

/* Ereignisse in den Einstellungen: ein kleines Formular je Ereignis */
#events-card { margin-bottom: 16px; }
.events-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 12px; align-items: start; }
.event { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.event.new { border-style: dashed; border-color: var(--accent); }
.event .wide, .event .event-days, .event .error, .event .row, .event .check { grid-column: 1 / -1; }
.event-field { display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
.event-field input { width: 100%; }
.event .check { display: flex; gap: 10px; align-items: center; color: var(--text); font-weight: 600; }
.event .check input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.event-days { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.event-days legend { font-size: .88rem; color: var(--muted); padding: 0; margin-bottom: 4px; }
.event-day { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: .9rem; }
.event-day input { accent-color: var(--accent); }

/* Plots: Karte der Stadt und Liste */
.plot-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .86rem; color: var(--muted); }
.plot-legend span { display: inline-flex; align-items: center; gap: 6px; }
.plot-legend .pm { width: 12px; height: 12px; }
.plot-map-wrap { margin-top: 12px; overflow: auto; max-height: 520px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.plot-map { --cell: 18px; display: grid; gap: 2px; width: max-content; margin: 0 auto; }
.pm { display: block; width: var(--cell); height: var(--cell); padding: 0; border: 0; border-radius: 3px; background: rgba(127, 127, 127, .16); }
.pm.ring { background: rgba(240, 169, 59, .22); }
.pm.spawn { background: #6f6fd8; }
.pm.online { background: #7fd957; }
.pm.active { background: #3f9a52; }
.pm.idle { background: #e0a43a; }
.pm.gone { background: #d9614f; }
button.pm { cursor: pointer; }
button.pm:hover, button.pm.focus { outline: 2px solid var(--text); outline-offset: 1px; }
table.plots tr.focus td { background: rgba(127, 217, 87, .1); }
.plot-seen.gone { color: #e2806f; font-weight: 600; }
.plot-seen.idle { color: #e0a43a; }
.plot-seen.online { color: var(--good); font-weight: 600; }
.plot-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.plot-badges:empty { display: none; }
.badge.warn { border-color: #e0a43a; color: #e0a43a; }

/* Übersicht: Abschnitte, Hinweise, Säulen und kurze Listen */
.section-title { margin: 26px 0 10px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.section-title + .tiles { margin-top: 0; }
#view-overview .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { #view-overview .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#view-overview .facts { margin-top: 12px; }
#view-overview .columns { margin-top: 12px; }
#view-overview .card { margin-top: 0; }
.alerts { display: grid; gap: 8px; }
.alert { margin: 0; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); border-left-width: 4px; background: var(--surface); }
.alert.good { border-left-color: var(--good); }
.alert.info { border-left-color: var(--accent); }
.alert.warn { border-left-color: var(--warn); }
.alert.bad { border-left-color: var(--bad); font-weight: 600; }
.facts dd.problem { color: var(--warn); }
.day-chart { display: flex; align-items: flex-end; gap: 4px; height: 190px; margin-top: 12px; }
.day { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .74rem; color: var(--muted); }
.day-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.day-track i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--border); }
.day.today .day-track i { background: var(--accent); }
.day-value { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.day.today .day-label, .day.today .day-date { color: var(--text); font-weight: 600; }
.top-list { list-style: none; margin: 10px 0 0; padding: 0; counter-reset: place; }
.top-list li { counter-increment: place; display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.top-list li:last-child { border-bottom: 0; }
.top-list li::before { content: counter(place) "."; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.4em; }
.top-list li.muted::before { content: ""; min-width: 0; }
.top-list li span { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; }
.inline-form.first { margin-top: 12px; }

/* Einstellungen: Bereiche */
.settings-lead { margin: 0 0 14px; }
#view-settings .forms, #view-settings [data-settings] { margin-top: 16px; }
#view-settings .settings-lead + [data-settings], #view-settings .settings-lead + [hidden] + [data-settings] { margin-top: 0; }
#view-settings .forms .card, #view-settings .columns .card { margin-top: 0; }
.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 28px; }
.modules .module:last-child { border-bottom: 1px solid var(--border); }

/* Changelog */
.changelog-list { margin-top: 8px; }
.changelog-entry { padding: 14px 0; border-top: 1px solid var(--border); }
.changelog-entry h3 { margin: 0; font-size: 1rem; }
.changelog-version { display: inline-block; min-width: 3.6em; color: var(--accent); font-variant-numeric: tabular-nums; }
.changelog-entry ul { margin: 8px 0 0; padding-left: 4.6em; color: var(--text); }
.changelog-entry li { margin: 3px 0; }
.badge.team { border-color: var(--warn); color: var(--warn); }
@media (max-width: 640px) { .changelog-entry ul { padding-left: 1.2em; } }

/* Serverzustand: vier Verläufe, jeder mit eigener Achse */
.health-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (max-width: 900px) { .health-charts { grid-template-columns: minmax(0, 1fr); } }
#view-health .tiles { margin-top: 12px; }
.health-chart { margin: 0; }
.health-chart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.health-chart svg { display: block; width: 100%; height: auto; touch-action: pan-y; }
.health-readout { font-size: .85rem; font-variant-numeric: tabular-nums; text-align: right; }
.health-readout.bad { color: var(--bad); }
.health-grid { stroke: var(--border); stroke-width: 1; }
.health-axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.health-line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.health-cross { stroke: var(--muted); stroke-width: 1; }
.health-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.feedback-text { min-width: 260px; white-space: pre-wrap; overflow-wrap: anywhere; }

/* Karte der Siedlerwelt: ein Kästchen je Chunk, deshalb kleiner als bei den Plots */
.land-map { --cell: 12px; gap: 1px; }
.land-map .pm { border-radius: 2px; }

/* Befehle zum Kopieren und das Inaktivitäts-Radar */
.copy-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.copy-item { display: inline-flex; align-items: center; gap: 6px; }
button.copy { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; padding: 4px 8px; }
.radar { margin-bottom: 16px; border-left: 4px solid #e0a43a; }

/* Votes */
.vote-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; margin: 14px 0 8px; padding-bottom: 1px; border-bottom: 1px solid var(--line, rgba(255, 255, 255, .12)); }
.vote-bar { flex: 1 1 0; min-width: 3px; border-radius: 4px 4px 0 0; background: var(--accent); }
.vote-bar.none { background: var(--line, rgba(255, 255, 255, .12)); }
.vote-bar:hover { filter: brightness(1.25); }
.vote-key { display: block; flex: 1 1 320px; max-height: 5.2em; overflow: auto; padding: 8px 10px; border-radius: 8px; font-size: .78rem; word-break: break-all; user-select: all; }
#votes-state.bad { color: var(--bad); font-weight: 600; }

/* Backups: Herunterladen und Zurückspielen */
td.actions { white-space: normal; }
td.actions > * { display: block; width: max-content; margin: 4px 0 4px auto; }
a.button { display: inline-block; text-decoration: none; padding: 6px 12px; border-radius: 8px; font-size: .9rem; }
.notice { margin: 12px 0; padding: 12px 14px; border-radius: 10px; border-left: 4px solid var(--accent); background: rgba(127, 127, 127, .12); }
.notice p { margin: 0 0 6px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice.warn { border-left-color: #e0a43a; }
.notice.good { border-left-color: var(--good, #4caf7a); }
.notice.bad { border-left-color: var(--bad); }
fieldset.checks { border: 0; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
fieldset.checks legend { padding: 0; margin-bottom: 6px; font-weight: 600; }
fieldset.checks label { display: flex; gap: 8px; align-items: flex-start; }
#rd-form > label { display: block; margin: 14px 0 6px; }
#rd-form .row { margin-top: 14px; }
.plain-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.backup-name { overflow-wrap: anywhere; }

/* Anmeldung des Teams und der Reiter Zugänge */
.login-card .ghost { margin-top: 8px; }
.login-card form, #setup-form { margin: 0 auto; }
.setup-secret { display: block; margin: 10px 0 4px; padding: 10px; border-radius: 8px; font-size: 1.05rem; letter-spacing: .06em; word-break: break-all; user-select: all; }
#whoami { margin-left: auto; white-space: nowrap; }
.access-table th { font-size: .78rem; white-space: nowrap; }
.access-table td { padding: 4px 6px; }
.access-table select { min-width: 6.8rem; padding: 4px 6px; }
.access-table select.access-none { opacity: .55; }
.access-table select.access-view { border-color: #e0a43a; }
.access-table select.access-edit { border-color: var(--good); }
.owner-only-off { display: none !important; }
.setup-qr { width: 220px; max-width: 100%; margin: 12px auto 8px; border-radius: 8px; overflow: hidden; line-height: 0; }
.setup-qr svg { display: block; width: 100%; height: auto; }
.setup-manual { margin: 6px 0 4px; text-align: left; }
.setup-manual summary { cursor: pointer; font-size: .9rem; }
