/* Farben, Schriften und Bauteile wie in der ZAC Zentrale (zentrale.html). */
:root {
  --ink: #141413;
  --panel: #1D1D1B;
  --panel-2: #262624;
  --line: #3a3936;
  --text: #F2F0EC;
  --muted: #A3A09A;
  --red: #C62828;
  --red-hot: #FF4B3E;
  --red-soft: rgba(198, 40, 40, .16);
  --ok: #6FBF73;
  --warn: #E0A84A;
  --f-display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-body: "Barlow", "Segoe UI", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--ink); color: var(--text); font-family: var(--f-body); font-size: 15px;
  padding: max(16px, env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--red-hot); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.shell { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* Navigationsleiste */
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 4px; border-bottom: 1px solid var(--line); min-height: 50px; }
.brand { display: flex; align-items: center; gap: 8px; padding: 8px 18px 8px 4px; margin-right: 4px; border-right: 1px solid var(--line); font-family: var(--f-display); font-weight: 700; font-size: 18px; letter-spacing: .04em; white-space: nowrap; }
.brand i { width: 9px; height: 9px; background: var(--red); transform: rotate(45deg); display: inline-block; }
.crumb { font-family: var(--f-display); font-weight: 600; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; padding: 12px 6px 10px; border-bottom: 2px solid var(--red); }
.crumb:empty { display: none; }
.who { margin-left: auto; display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.who-n { font-weight: 600; }
.who-id { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.view { display: flex; flex-direction: column; gap: 16px; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 34px; letter-spacing: .02em; line-height: 1.05; }
.page-head .sub { color: var(--muted); font-size: 14px; }
.head-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.savestate { font-family: var(--f-mono); font-size: 12px; color: var(--muted); margin-right: 4px; }
.savestate.dirty { color: var(--warn); }
.savestate.ok { color: var(--ok); }
.savestate.err { color: var(--red-hot); }

/* Knöpfe */
.btn { background: var(--red); border: 1px solid var(--red); border-radius: 5px; padding: 8px 14px; font-weight: 600; color: var(--text); white-space: nowrap; }
.btn:hover { background: #d63030; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { padding: 13px 22px; font-family: var(--f-display); font-size: 20px; letter-spacing: .06em; text-transform: uppercase; width: 100%; }
.ghost { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 8px 14px; color: var(--text); white-space: nowrap; }
.ghost:hover { border-color: var(--muted); }
.ghost.sm { padding: 4px 10px; font-size: 13px; }

/* Formulare */
label, .lbl { display: grid; gap: 4px; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
input:not([type=checkbox]), textarea, select {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; color: var(--text);
  font-family: var(--f-body); font-size: 15px; text-transform: none; letter-spacing: 0; padding: 9px 10px; width: 100%;
}
input:focus, textarea:focus { outline: none; border-color: var(--red); }
input[readonly] { background: transparent; border-style: dashed; color: var(--text); }
textarea { resize: vertical; line-height: 1.5; min-height: 90px; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=time]::-webkit-calendar-picker-indicator { filter: invert(.8); }
.err { color: var(--red-hot); margin: 0; font-size: 14px; }

/* Anmeldung */
.login { width: min(440px, 100%); margin: 6vh auto 0; padding: 26px 26px 24px; display: grid; gap: 14px; border-top: 3px solid var(--red); }
.login h1 { margin: 0; font-family: var(--f-display); font-size: 30px; font-weight: 700; }
.login p { margin: 0; }
.login-icon { width: 64px; height: 64px; }
.done { text-align: center; justify-items: center; }
.okmark { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: var(--red); }

/* Auswahl */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tile { text-align: left; padding: 18px 18px 16px; display: grid; gap: 6px; color: var(--text); border-left: 3px solid var(--red); }
button.tile:hover { background: var(--panel-2); }
.tile b { font-family: var(--f-display); font-size: 30px; font-weight: 700; letter-spacing: .02em; }
.tile-k { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--red-hot); }
.tile-d { color: var(--muted); font-size: 14px; }
.tile-s { font-family: var(--f-mono); font-size: 12px; color: var(--warn); }
.tile.off { opacity: .45; border-left-color: var(--line); }
.tile.off .tile-k { color: var(--muted); }

/* Wachbuch */
.wb { display: grid; gap: 14px; }
.sec { padding: 14px 16px 16px; display: grid; gap: 12px; }
.sec h2 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 22px; letter-spacing: .02em; }
.sec-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 10px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.seg { display: flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.seg button { flex: 1; background: var(--panel-2); border: 0; padding: 9px 10px; font-family: var(--f-body); font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--red); color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 99px; padding: 7px 14px; font-size: 14px; }
.chips button::before { content: ""; display: inline-block; width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 2px; margin-right: 8px; vertical-align: -1px; }
.chips button[aria-pressed="true"] { border-color: var(--red); color: var(--text); background: var(--red-soft); }
.chips button[aria-pressed="true"]::before { background: var(--red-hot); border-color: var(--red-hot); }
.temp span { display: flex; align-items: center; gap: 8px; color: var(--text); font-family: var(--f-body); font-size: 15px; text-transform: none; }
.temp input { width: 90px !important; }
.temp { max-width: 320px; }

.rg { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rg li { display: grid; grid-template-columns: 140px 1fr auto; gap: 8px; align-items: start; padding: 8px; background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 5px; }
.rg textarea { min-height: 44px; background: var(--panel); }
.rg input { background: var(--panel); font-family: var(--f-mono); }
.rg .del { background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); width: 34px; height: 34px; padding: 0; }
.rg .del:hover { color: var(--red-hot); border-color: var(--red-hot); }

.abschluss { border-top: 3px solid var(--red); }
.confirm { display: flex; gap: 12px; align-items: flex-start; font-family: var(--f-body); font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text); cursor: pointer; }
.confirm input { width: 22px; height: 22px; accent-color: var(--red); flex: none; margin: 1px 0 0; }

/* Dialog und Hinweis */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(10,10,9,.72); display: grid; place-items: center; padding: 16px; }
.mbox { width: min(520px, 100%); background: var(--panel); border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 6px; box-shadow: 0 30px 80px rgba(0,0,0,.5); padding: 18px 20px; display: grid; gap: 12px; }
.mbox h2 { margin: 0; font-family: var(--f-display); font-size: 26px; }
.mbox p { margin: 0; line-height: 1.5; }
.mbox-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--red); border-radius: 6px; padding: 10px 16px; box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: calc(100vw - 32px); }

@media (max-width: 820px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .g4 { grid-template-columns: 1fr; }
  .brand { border-right: 0; }
  .crumb { display: none; }
  .who { margin-left: 0; width: 100%; justify-content: space-between; }
  .page-head h1 { font-size: 28px; }
  .head-act { width: 100%; }
  .head-act .ghost, .head-act .btn { flex: 1; }
  .savestate { width: 100%; }
  .rg li { grid-template-columns: 1fr auto; }
  .rg li textarea { grid-column: 1 / -1; grid-row: 2; }
}
.install { align-self: start; }
@media (max-width: 520px) { .install { width: 100%; } }
.ausgang { margin: 0; padding: 10px 14px; border-left: 3px solid var(--warn); color: var(--warn); font-size: 14px; }
