/* Ski Individuell 2027 – gemeinsames Stylesheet
   Große Schaltflächen und hoher Kontrast: bedienbar mit Handschuhen und bei Sonne/Schnee. */

/* ---------- Grundlagen ---------- */
:root {
  --blau: #0b3d91;
  --blau-hell: #e8eefb;
  --text: #111;
  --grau: #5b6470;
  --linie: #d5dbe3;
  --gruen: #13795b;
  --gruen-bg: #e3f4ec;
  --gelb: #9a6700;
  --gelb-bg: #fff4d6;
  --rot: #b3261e;
  --rot-bg: #fde7e6;
  --bg: #f6f8fb;
  --karte: #fff;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 18px; line-height: 1.45; color: var(--text); background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
main { max-width: 640px; margin: 0 auto; padding: 16px; }
main.breit { max-width: 1400px; }
h2 { font-size: 20px; margin: 24px 0 10px; }
.oben { margin-top: 0; }
.abschnitt { margin: 12px 0 0; }
.mitte { text-align: center; }
.hinweis { color: var(--grau); font-size: 15px; }
.umbruch { white-space: normal; }
.versteckt { display: none !important; }
.zeile { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.reihe { display: flex; gap: 10px; }
.reihe > * { flex: 1; }
:focus-visible { outline: 3px solid #f0a500; outline-offset: 2px; }
/* Text nicht markierbar (versehentliches Markieren beim Tippen mit Handschuhen); Eingabefelder bleiben bedienbar */
.kein-markieren { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.kein-markieren input, .kein-markieren textarea { -webkit-user-select: text; user-select: text; }

/* ---------- Kopfzeile ---------- */
header.kopf {
  background: var(--blau); color: #fff; padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  position: sticky; top: 0; z-index: 5;
}
header.kopf.gruen { background: var(--gruen); }
header.kopf h1 { font-size: 20px; margin: 0; }
header.kopf .sub { font-size: 14px; opacity: .85; }
.pille { display: inline-block; font-size: 14px; padding: 3px 10px; border-radius: 999px; background: var(--blau-hell); color: var(--blau); white-space: nowrap; text-decoration: none; }
.pille.offline { background: var(--gelb-bg); color: var(--gelb); }

/* ---------- Karten, Listen, Meldungen ---------- */
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.liste { list-style: none; padding: 0; margin: 0; }
.liste li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--linie); }
.liste li:last-child { border-bottom: 0; }
.top5 .platz { display: inline-block; min-width: 2em; font-weight: 700; color: var(--blau); }
.st-ok, .st-bestaetigt { color: var(--gruen); font-weight: 600; }
.st-pruefen, .st-wartet { color: var(--gelb); font-weight: 600; }
.st-abgelehnt { color: var(--rot); font-weight: 600; }
.fehler, .ok-box, .aufgabe-box { padding: 12px; border-radius: 8px; margin: 10px 0; }
.fehler { background: var(--rot-bg); color: var(--rot); }
.ok-box { background: var(--gruen-bg); color: var(--gruen); }
.aufgabe-box { background: var(--rot-bg); color: var(--rot); font-weight: 600; }
.code { font-family: ui-monospace, monospace; font-size: 15px; word-break: break-all; background: var(--blau-hell); padding: 10px; border-radius: 8px; }
.notfall a { color: var(--rot); }

/* ---------- Formulare ---------- */
label { display: block; font-weight: 600; margin: 14px 0 6px; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
label.check input { width: 26px; height: 26px; flex: 0 0 auto; margin-top: 2px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=search], input[type=datetime-local], select, textarea {
  width: 100%; font-size: 18px; padding: 12px; border: 1px solid var(--linie); border-radius: 8px; background: #fff; font-family: inherit;
}
input[type=number], input.gross-eingabe { font-size: 24px; text-align: center; }

/* ---------- Schaltflächen ---------- */
button, .knopf {
  display: block; width: 100%; font-size: 20px; font-weight: 700; padding: 16px; border: 0; border-radius: var(--radius);
  background: var(--blau); color: #fff; text-align: center; text-decoration: none; cursor: pointer; margin: 10px 0;
}
button.zweit, .knopf.zweit { background: var(--blau-hell); color: var(--blau); }
button.gross { font-size: 26px; padding: 26px 16px; }
button.gruen { background: var(--gruen); }
button.rot { background: var(--rot); }
button.rot-zweit { background: var(--rot-bg); color: var(--rot); font-size: 17px; padding: 12px; }
button.klein, .knopf.klein { width: auto; display: inline-block; margin: 0; padding: 6px 12px; font-size: 15px; }
button.schmal, .knopf.schmal { display: inline-block; width: auto; padding: 10px 18px; font-size: 17px; margin: 0; }
.knopfleiste { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0; }
.knopfleiste input { width: auto; min-width: 220px; padding: 9px 12px; font-size: 16px; }
.ohne-rand { margin: 0; }
button:disabled { opacity: .5; }

/* ---------- Posten-Auswahl ---------- */
.raster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.raster button { margin: 0; font-size: 24px; padding: 18px 0; }
.raster button.erledigt { background: var(--gruen-bg); color: var(--gruen); }
.raster button.ziel { grid-column: span 4; background: var(--gruen); }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 14px; padding: 20px; width: min(92vw, 460px); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.dlg-titel-klein { margin: 8px 0 0; }
dialog.dlg-breit { width: min(96vw, 720px); max-height: 92vh; overflow-y: auto; }
dialog .reihe { flex-wrap: wrap; }
dialog .reihe > label { flex: 1 1 200px; }
dialog summary { cursor: pointer; padding: 10px 0; font-size: 17px; }
dialog form { margin-bottom: 8px; }
.code-inline { font-family: ui-monospace, monospace; background: var(--blau-hell); padding: 1px 6px; border-radius: 6px; }
.dlg-extra label { font-weight: 400; display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.dlg-extra input { width: 26px; height: 26px; }

/* ---------- QR-Scanner und Startkarte ---------- */
.scanner { position: fixed; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.scanner video { width: 100%; max-width: 520px; max-height: 65vh; object-fit: cover; border-radius: var(--radius); }
.scanner-kopf { color: #fff; font-weight: 700; font-size: 20px; margin-bottom: 10px; }
.scanner-rahmen { position: absolute; width: 60vmin; height: 60vmin; max-width: 320px; max-height: 320px; border: 4px solid rgba(255, 255, 255, .8); border-radius: 16px; pointer-events: none; }
.scanner-info { color: #fff; text-align: center; }
.scanner button { max-width: 520px; }
.mein-qr svg { width: 220px; height: 220px; }
.startkarte { background: #fff; border: 2px solid var(--text); border-radius: var(--radius); padding: 18px; text-align: center; max-width: 380px; margin: 0 auto 14px; }
.sk-kopf { font-size: 14px; color: var(--grau); }
.sk-nr { font-size: 44px; font-weight: 800; line-height: 1.1; }
.sk-name { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.sk-qr svg { width: 230px; height: 230px; }
.sk-code { font-family: ui-monospace, monospace; font-size: 18px; }
.sk-text, .sk-notfall { font-size: 14px; margin-top: 8px; }

/* ---------- Dashboard, Ergebnisliste, Karte ---------- */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kachel { background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px; }
.kachel b { display: block; font-size: 28px; }
.tabelle-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--linie); text-align: left; white-space: nowrap; }
th { background: var(--blau-hell); position: sticky; top: 0; }
tr.warn td { background: var(--rot-bg); }
tr.klickbar { cursor: pointer; }
tr.klickbar:hover td { background: var(--blau-hell); }
tr.warn.klickbar:hover td { background: #f9d3d0; }
tr.inaktiv td { color: var(--grau); background: #f1f2f4; }
td.knoepfe { white-space: nowrap; }
td.knoepfe button { margin: 2px 4px 2px 0; }
.zeile.umbrechen { flex-wrap: wrap; }
.zeile.umbrechen h2 { margin-bottom: 0; }
details summary { cursor: pointer; }
.karte-box { height: 480px; border: 1px solid var(--linie); border-radius: var(--radius); margin-bottom: 14px; }
.kartennr { background: #fff; border: 2px solid var(--blau); border-radius: 999px; font: 700 12px/1 system-ui, sans-serif; padding: 3px 6px; white-space: nowrap; text-align: center; }
.kartennr.ziel { border-color: var(--gruen); color: var(--gruen); }

/* ---------- Druck (Startkarte, Ergebnisliste) ---------- */
@media print {
  .nicht-drucken { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .tabelle-wrap { border: 0; overflow: visible; }
  table { font-size: 12px; }
  th { position: static; }
  th, td { white-space: normal; }
}
