/* Tourbuch – Gestaltung
   Handy: eine Spalte, große Tippflächen, Tab-Leiste unten.
   PC: Seitenleiste + Arbeitsfläche mit Tabellen, Bearbeiten im Seitenfenster. */
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap;
  src: url(/vendor/fonts/atkinson-hyperlegible-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-display: swap;
  src: url(/vendor/fonts/atkinson-hyperlegible-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-display: swap; unicode-range: U+0100-024F;
  src: url(/vendor/fonts/atkinson-hyperlegible-latin-ext-400-normal.woff2) format("woff2"); }

:root {
  --bg: #f3f5f4; --surface: #ffffff; --sunk: #e8eceb; --line: #d3dbd9; --line-strong: #b9c5c2;
  --fg: #18231f; --muted: #56665f; --accent: #0b6b63; --accent-ink: #ffffff; --accent-soft: #d9eeeb;
  --ok: #2f7d32; --ok-soft: #dcefdc; --warn: #995600; --warn-soft: #fbead1; --bad: #b3261e; --bad-soft: #f8dcd9;
  --font: "Atkinson Hyperlegible", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111816; --surface: #19221f; --sunk: #0c1210; --line: #2c3a36; --line-strong: #3e504a;
    --fg: #e5ece9; --muted: #9aaba5; --accent: #4fb8ad; --accent-ink: #06211e; --accent-soft: #163632;
    --ok: #7fc782; --ok-soft: #1b3320; --warn: #e8a64a; --warn-soft: #3a2a12; --bad: #f08a80; --bad-soft: #3d1a17;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 16px/1.45 var(--font); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); }
.laden { padding: 40px 20px; color: var(--muted); text-align: center; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.klein { font-size: .86rem; }
.zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spalte { display: flex; flex-direction: column; gap: 12px; }
.weg { margin-left: auto; }

/* Bedienelemente */
.btn { border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; min-height: 44px; }
.btn.gross { width: 100%; font-size: 1.12rem; padding: 18px; border-radius: var(--r); }
.btn.zweit { background: var(--sunk); color: var(--fg); }
.btn.rand { background: transparent; border: 1px solid var(--line-strong); color: var(--fg); }
.btn.gefahr { background: var(--bad-soft); color: var(--bad); }
.btn.klein { padding: 7px 12px; min-height: 34px; border-radius: 9px; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; text-decoration: underline; }
.feld { display: flex; flex-direction: column; gap: 5px; font-size: .9rem; min-width: 0; }
.feld > span { color: var(--muted); }
.feld input, .feld select, .feld textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); min-height: 44px; }
.feld textarea { min-height: 80px; resize: vertical; }
.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.haken { display: flex; gap: 10px; align-items: center; font-size: .95rem; }
.haken input { width: 20px; height: 20px; accent-color: var(--accent); }

.chip { display: inline-block; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; letter-spacing: .02em; }
.c-offen { background: var(--sunk); color: var(--muted); }
.c-lauf { background: var(--warn-soft); color: var(--warn); }
.c-ok { background: var(--ok-soft); color: var(--ok); }
.c-bad { background: var(--bad-soft); color: var(--bad); }
.c-acc { background: var(--accent-soft); color: var(--accent); }

.hinweis { padding: 12px 14px; border-radius: 12px; font-size: .93rem; }
.h-warn { background: var(--warn-soft); }
.h-ok { background: var(--ok-soft); }
.h-bad { background: var(--bad-soft); }
.h-info { background: var(--accent-soft); }

/* Anmeldung */
.anmeldung { max-width: 400px; margin: 0 auto; padding: 48px 20px; display: flex; flex-direction: column; gap: 18px; }
.marke { display: flex; align-items: center; gap: 12px; }
.marke img { width: 44px; height: 44px; border-radius: 12px; }
.marke b { font-size: 1.5rem; letter-spacing: -.01em; }

/* ---------- Handy ---------- */
.mobil { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; background: var(--bg); }
.m-kopf { position: sticky; top: 0; z-index: 5; background: var(--surface); border-bottom: 1px solid var(--line);
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; display: flex; align-items: center; gap: 10px; }
.m-kopf .wer { font-weight: 700; line-height: 1.2; }
.m-kopf .wer small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.netz { font-size: .75rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.m-inhalt { flex: 1; padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.m-tabs { position: sticky; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px); }
.m-tabs button { border: 0; background: transparent; padding: 14px 8px; font-weight: 700; color: var(--muted); min-height: 52px; }
.m-tabs button[aria-current="page"] { color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.tage { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--sunk); border-radius: 12px; padding: 4px; gap: 4px; }
.tage button { border: 0; background: transparent; border-radius: 9px; padding: 9px 4px; font-weight: 700; color: var(--muted); }
.tage button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.stopp { display: grid; grid-template-columns: auto 1fr auto; gap: 3px 12px; align-items: center; padding: 14px; border: 1px solid var(--line);
  border-radius: var(--r); background: var(--surface); text-align: left; width: 100%; }
.stopp:hover { border-color: var(--accent); }
.stopp .t { font-family: var(--mono); font-size: 1.05rem; }
.stopp .n { font-weight: 700; }
.stopp .a { grid-column: 2 / 4; font-size: .9rem; color: var(--muted); }
.zurueck { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 700; align-self: flex-start; }
.stempel { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--r); background: var(--accent-soft); }
.stempel .mono { font-size: 1.35rem; }
.scan { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 18px; border: 2px dashed var(--accent);
  border-radius: 18px; text-align: center; }
.puls { width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; font-weight: 700; color: var(--accent); }
@media (prefers-reduced-motion: no-preference) { .scannt .puls { animation: puls .9s ease-in-out infinite; } @keyframes puls { 50% { transform: scale(1.15); } } }
.leist { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.leist label { display: flex; gap: 14px; align-items: center; padding: 14px; border-top: 1px solid var(--line); cursor: pointer; min-height: 56px; }
.leist label:first-child { border-top: 0; }
.leist input { width: 26px; height: 26px; accent-color: var(--accent); flex: none; }
.leist .art { margin-left: auto; }
.kontakt { display: flex; flex-wrap: wrap; gap: 8px; }
.tabelle-m { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle-m th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tabelle-m td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.unterschrift { border: 1px solid var(--line-strong); border-radius: var(--r); background: #fff; position: relative; }
.unterschrift canvas { display: block; width: 100%; height: 190px; touch-action: none; border-radius: var(--r); }
.unterschrift .platz { position: absolute; left: 14px; bottom: 10px; font-size: .82rem; color: #66756f; pointer-events: none; }
.sig-bild { background: #fff; border-radius: 10px; max-height: 120px; max-width: 100%; border: 1px solid var(--line); }
.karte { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; justify-content: space-between; gap: 10px;
  align-items: center; background: var(--surface); width: 100%; text-align: left; }

/* ---------- PC ---------- */
.pc { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100vh; }
.leiste { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.leiste .marke { padding: 0 8px 14px; }
.leiste .marke img { width: 34px; height: 34px; border-radius: 9px; }
.leiste .marke b { font-size: 1.2rem; }
.leiste a { display: flex; align-items: center; justify-content: space-between; padding: 9px 10px; border-radius: 9px; color: var(--fg); text-decoration: none; font-weight: 700; }
.leiste a:hover { background: var(--sunk); }
.leiste a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.leiste .unten a { padding: 0; color: var(--accent); }
.mobil ~ .meldung { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
.leiste .unten { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--line); font-size: .86rem; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
.flaeche { padding: 24px clamp(16px, 3vw, 36px) 48px; display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.kopfzeile { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.kopfzeile h1 { font-size: 1.55rem; margin-right: auto; }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kachel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kachel b { display: block; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.kachel span { font-size: .82rem; color: var(--muted); }
.kachel.warn b { color: var(--bad); }
.tabwrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.tab { width: 100%; border-collapse: collapse; font-size: .93rem; }
.tab th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 12px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface); }
.tab td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tab tr:last-child td { border-bottom: 0; }
.tab tr.klick { cursor: pointer; }
.tab tr.klick:hover td { background: var(--sunk); }
.tab tr.fehlt td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.tab tr.abgesagt td { color: var(--muted); text-decoration: line-through; }
.leer { padding: 28px; text-align: center; color: var(--muted); }
.wt { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.wt button { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px; width: 40px; height: 36px; font-weight: 700; }
.wt button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.auswahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; }

/* Seitenfenster */
.schleier { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 20; display: flex; justify-content: flex-end; }
.fenster { width: min(560px, 100%); height: 100%; background: var(--bg); overflow-y: auto; padding: 22px 22px 40px; display: flex; flex-direction: column; gap: 16px;
  box-shadow: -8px 0 30px rgb(0 0 0 / .15); }
.fenster-kopf { display: flex; align-items: flex-start; gap: 10px; }
.fenster-kopf h2 { font-size: 1.3rem; margin-right: auto; }
.abschnitt { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.abschnitt h3 { font-size: 1rem; }
.meldung { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 12px 18px;
  border-radius: 12px; font-weight: 700; z-index: 40; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgb(0 0 0 / .2); }
.meldung.fehler { background: var(--bad); color: #fff; }
.protokoll-daten { font-family: var(--mono); font-size: .78rem; color: var(--muted); white-space: pre-wrap; word-break: break-word; max-width: 420px; }

@media (max-width: 820px) {
  .pc { grid-template-columns: minmax(0, 1fr); }
  .leiste { position: static; height: auto; flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 10px 12px; }
  .leiste .marke { padding: 0 8px 0 0; width: 100%; }
  .leiste .unten { margin: 0; border: 0; padding: 6px 10px; flex-direction: row; flex-wrap: wrap; width: 100%; }
}

/* ---------- Plantafel ---------- */
.pt-legende { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.pt-legende span { display: inline-flex; align-items: center; gap: 6px; }
.pt-punkt { display: inline-block; width: 12px; height: 12px; border-radius: 4px; border: 2px solid; }
.pt-rahmen { overflow: auto; max-height: calc(100vh - 210px); min-height: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.pt-gitter { display: grid; position: relative; min-width: min-content; }
.pt-ecke, .pt-kopf { position: sticky; top: 0; z-index: 4; background: var(--surface); border-bottom: 1px solid var(--line); }
.pt-ecke { left: 0; z-index: 5; }
.pt-kopf { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; border-left: 1px solid var(--line); min-width: 0; }
.pt-kopf b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-achse { position: sticky; left: 0; z-index: 3; background: var(--surface); }
.pt-achse span { position: absolute; right: 8px; transform: translateY(-50%); font-family: var(--mono); font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pt-achse span:first-child { transform: none; }
.pt-spalte { position: relative; border-left: 1px solid var(--line); cursor: copy; }
.pt-spalte.pt-ziel { background: var(--accent-soft); }
.pt-linie { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.pt-jetzt { position: absolute; left: 0; right: 0; border-top: 2px solid var(--bad); z-index: 2; pointer-events: none; }
.pt-puffer { position: absolute; left: 6px; right: 6px; display: flex; align-items: center; justify-content: center;
  font-size: .72rem; color: var(--muted); pointer-events: none; }
.pt-puffer.pt-knapp { color: var(--warn); font-weight: 700; }
.pt-block { position: absolute; left: 5px; right: 5px; border-radius: 9px; padding: 4px 8px; overflow: hidden; cursor: pointer;
  border: 1px solid var(--line-strong); border-left-width: 5px; background: var(--surface); font-size: .82rem; line-height: 1.25;
  display: flex; flex-direction: column; gap: 1px; z-index: 1; box-shadow: 0 1px 2px rgb(0 0 0 / .06); user-select: none; }
.pt-block.pt-ziehbar { cursor: grab; touch-action: none; }
.pt-block:hover { box-shadow: 0 2px 8px rgb(0 0 0 / .14); z-index: 2; }
.pt-block.pt-weg { opacity: .3; }
.pt-block.pt-geist { border-style: dashed; opacity: .95; z-index: 6; cursor: grabbing; box-shadow: 0 6px 18px rgb(0 0 0 / .2); pointer-events: none; }
.pt-zeile { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pt-zeile.pt-eng { flex-wrap: nowrap; min-width: 0; }
.pt-zeile.pt-eng .pt-name { min-width: 0; }
.pt-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pt-klein { color: var(--muted); font-size: .74rem; }
.pt-ist { font-size: .68rem; font-weight: 700; color: var(--muted); }
.pt-warn { font-size: .68rem; font-weight: 700; color: var(--bad); }
.pt-offen { border-color: var(--accent); }
.pt-block.pt-offen { background: var(--accent-soft); border-color: var(--line-strong); border-left-color: var(--accent); }
.pt-laeuft { border-color: var(--warn); }
.pt-block.pt-laeuft { background: var(--warn-soft); border-color: var(--line-strong); border-left-color: var(--warn); }
.pt-fertig { border-color: var(--ok); }
.pt-block.pt-fertig { background: var(--ok-soft); border-color: var(--line-strong); border-left-color: var(--ok); }
.pt-fehlt { border-color: var(--bad); }
.pt-block.pt-fehlt { background: var(--bad-soft); border-color: var(--line-strong); border-left-color: var(--bad); }
.pt-block.pt-abgesagt { background: var(--sunk); color: var(--muted); text-decoration: line-through; border-left-color: var(--line-strong); }
.pt-block.pt-konflikt { outline: 2px solid var(--bad); outline-offset: -1px; }
.schleier.pt-mitte { justify-content: center; align-items: center; padding: 16px; }
.pt-frage { background: var(--bg); border-radius: 16px; padding: 22px; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 10px 40px rgb(0 0 0 / .25); }
.pt-frage h2 { font-size: 1.2rem; }
