:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --text: #1d2430;
  --muted: #667085;
  --line: #e2ddd2;
  --accent: #1f4e79;
  --green: #1e8e4e;
  --green-dark: #166c3b;
  --red: #c4362d;
  --red-dark: #9d2a23;
  --warn-bg: #fff4d6;
  --warn-line: #e8c15a;
  --radius: 16px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181f;
    --card: #1e242e;
    --text: #eef1f5;
    --muted: #9aa4b2;
    --line: #2f3742;
    --accent: #7fb2e5;
    --warn-bg: #3a3218;
    --warn-line: #8a7230;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

header.top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
/* Doppeldecker aus dem Original-Formular, als Maske -> passt sich der Farbe an */
.logo {
  display: inline-block;
  width: 92px;
  height: 43px;
  flex: none;
  background: var(--accent);
  -webkit-mask: url(plane.png) center / contain no-repeat;
  mask: url(plane.png) center / contain no-repeat;
}
.logo.small { width: 34px; height: 16px; background: currentColor; vertical-align: -3px; margin-right: 6px; }
header.top h1 { font-size: 20px; margin: 0; line-height: 1.1; }
header.top small { color: var(--muted); font-size: 13px; }
header.top .back {
  margin-left: auto;
  min-height: 40px;
  padding: 8px 14px 8px 10px;
  gap: 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  border-color: var(--accent);
  border-radius: 99px;
}
header.top .back:active { background: var(--accent); color: #fff; }

.ph-light { font-size: 1.15em; vertical-align: -0.15em; }

footer.foot {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

h2 { font-size: 22px; margin: 4px 0 12px; }
h3 { font-size: 17px; margin: 22px 0 8px; color: var(--muted); font-weight: 600; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card.warn { background: var(--warn-bg); border-color: var(--warn-line); }

.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }

button, .btn {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}
button:disabled { opacity: .5; cursor: default; }
button.link {
  border: none;
  background: none;
  color: var(--accent);
  padding: 4px 0;
  min-height: 0;
  text-decoration: underline;
}
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--red); }

.big {
  width: 100%;
  min-height: 120px;
  font-size: 26px;
  font-weight: 700;
  border: none;
  border-radius: 22px;
  color: #fff;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .18);
}
.big small { font-size: 15px; font-weight: 500; opacity: .9; }
.big:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0, 0, 0, .18); }
.big.go { background: var(--green); }
.big.go:active { background: var(--green-dark); }
.big.stop { background: var(--red); }
.big.stop:active { background: var(--red-dark); }

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.grid button { min-height: 64px; font-size: 19px; font-weight: 600; }
.grid button.new { font-weight: 500; color: var(--accent); border-style: dashed; }

.menu { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.menu button { flex-direction: column; min-height: 84px; font-size: 16px; gap: 2px; }
.menu button .ph-light { font-size: 30px; color: var(--accent); margin-bottom: 4px; }
.big .ph-light { font-size: 34px; }
.hero-icon { font-size: 56px; color: var(--accent); }
.actions button .ph-light { font-size: 20px; }

.status-line { font-size: 18px; margin: 0 0 12px; text-align: center; }
.status-line b { font-size: 22px; }

ul.list { list-style: none; margin: 0; padding: 0; }
ul.list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
ul.list li:last-child { border-bottom: none; }
ul.list li .grow { flex: 1; min-width: 0; }
ul.list li.click { cursor: pointer; }
ul.list li .dur { font-weight: 700; white-space: nowrap; }

.tag {
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tag.open { background: var(--green); color: #fff; }

label { display: block; font-weight: 600; margin: 12px 0 6px; }
input, select {
  font: inherit;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  min-height: 48px;
}
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.actions { display: flex; gap: 10px; margin-top: 16px; }
.actions > * { flex: 1; }

table { width: 100%; border-collapse: collapse; font-size: 16px; }
th, td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; font-size: 14px; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tfoot td { font-weight: 700; border-bottom: none; }
.bar { height: 6px; border-radius: 3px; background: var(--accent); margin-top: 4px; }

dialog {
  border: none;
  border-radius: var(--radius);
  padding: 18px;
  width: min(520px, calc(100vw - 32px));
  background: var(--card);
  color: var(--text);
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog h2 { margin-top: 0; }

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #1d2430;
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 16px;
  max-width: calc(100vw - 32px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  z-index: 10;
}
#toast.show { opacity: 1; }
#toast.error { background: var(--red); }

/* QR-Aushang */
/* Aushang immer hell, damit Bildschirm und Ausdruck gleich aussehen */
.poster { text-align: center; background: #fff; color: #1d2430; border-color: #e2ddd2; }
.poster-plane { display: block; width: 240px; max-width: 70%; height: auto; margin: 4px auto 10px; }
.poster h1 { font-size: 30px; margin: 0 0 4px; }
.poster .qr svg { width: 300px; height: 300px; max-width: 100%; }
.poster ol { text-align: left; font-size: 18px; max-width: 420px; margin: 16px auto; }
.poster .url { font-size: 12px; word-break: break-all; color: var(--muted); }

@media print {
  body { background: #fff; color: #000; }
  .no-print, header.top, #toast { display: none !important; }
  .card { border: none; }
  .poster .qr svg { width: 11cm; height: 11cm; }
  .poster-plane { width: 7.5cm; max-width: none; }
  .poster { break-inside: avoid; }
  @page { size: A4; margin: 1.2cm; }
  .poster h1 { font-size: 34pt; }
  .poster ol { font-size: 18pt; }
}
