
/* Spielplatz-Prüfung app styles (from the approved mockup). Layout: tablet app, sticky top bar, one column of cards, bottom tab bar. Light theme only (outdoor glare), every colour set explicitly. */
:root {
  --page: #F1F5F9; --surface: #FFFFFF; --ink: #0F172A; --ink2: #334155; --line: #64748B; --hairline: #CBD5E1;
  --link: #1D4ED8; --ok: #166534; --ok-tint: #DCFCE7; --defect: #92400E; --defect-tint: #FEF3C7;
  --nc: #334155; --nc-tint: #E2E8F0; --danger: #B91C1C; --danger-strong: #991B1B; --danger-tint: #FEE2E2;
  --serious: #9A3412; --serious-tint: #FFEDD5; --light: #854D0E; --light-tint: #FEF9C3;
  --sealed: #1E3A8A; --sealed-tint: #DBEAFE; --sel: #EFF6FF;
  --font: Roboto, "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { background: var(--page); color: var(--ink); }
body { font: 18px/1.45 var(--font); min-height: 100%; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 50; background: var(--surface); }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
svg.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; min-height: 72px; background: var(--surface); border-bottom: 1px solid var(--hairline);
  display: flex; align-items: center; gap: 12px; padding-block: 4px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top h1 { font-size: 26px; font-weight: 700; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved { color: var(--ok); font-size: 16px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; }
.conn { min-height: 64px; border: 0; border-radius: 12px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; cursor: pointer; color: var(--nc); background: var(--nc-tint); }
.panel { position: absolute; right: 16px; top: 76px; background: var(--surface); border: 1px solid var(--hairline); border-radius: 12px; padding: 16px 20px; box-shadow: 0 8px 24px rgba(15,23,42,.15); max-width: 340px; font-size: 16px; }
main { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px;
  padding-block: 24px 120px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.card { background: var(--surface); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
h2 { font-size: 22px; font-weight: 600; margin: 0; text-wrap: balance; }
h3 { font-size: 20px; font-weight: 600; margin: 0; }
.sub { color: var(--ink2); font-size: 16px; }
.num { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.btn { min-height: 80px; min-width: 64px; border-radius: 12px; padding: 0 24px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 18px; font-weight: 600; cursor: pointer; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.btn.primary { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.btn.danger { background: var(--danger); color: #FFFFFF; border-color: var(--danger); }
.btn.sm { min-height: 64px; padding: 0 16px; }
.btn.wide { width: 100%; }
.link { min-height: 64px; padding: 0 16px; border: 0; background: transparent; color: var(--link); font-weight: 600; text-decoration: underline; cursor: pointer; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 12px; font-size: 16px; font-weight: 600; white-space: nowrap; }
.c-ok { color: var(--ok); background: var(--ok-tint); } .c-def { color: var(--defect); background: var(--defect-tint); }
.c-nc { color: var(--nc); background: var(--nc-tint); } .c-lock { color: var(--danger-strong); background: var(--danger-tint); }
.c-ser { color: var(--serious); background: var(--serious-tint); } .c-lig { color: var(--light); background: var(--light-tint); }
.c-seal { color: var(--sealed); background: var(--sealed-tint); }
.group { background: var(--surface); border-radius: 16px; overflow: hidden; }
.ghead { min-height: 80px; padding: 12px 24px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--hairline); }
.ghead .t { flex: 1; min-width: 200px; } .ghead b { font-size: 22px; font-weight: 600; display: block; }
.lrow { min-height: 80px; width: 100%; padding: 12px 24px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border: 0; border-bottom: 1px solid var(--hairline); background: var(--surface); text-align: left; cursor: pointer; }
.lrow:last-child { border-bottom: 0; }
.lrow .t { flex: 1; min-width: 180px; } .lrow .t b { display: block; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { font-weight: 600; } .opt { color: var(--ink2); font-weight: 400; font-size: 16px; margin-left: 8px; }
.field input, .field textarea { min-height: 64px; border: 2px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--surface); width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.err { color: var(--danger); font-size: 16px; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.tile { min-height: 80px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink2); font-weight: 600; cursor: pointer; padding: 0 16px; position: relative; }
.tile[aria-pressed="true"] { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.tile[aria-pressed="true"]::before { content: "\2713"; margin-right: 8px; }
.tile.ok[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.tile.def[aria-pressed="true"] { background: var(--defect); border-color: var(--defect); }
.clrow { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-block: 8px; border-bottom: 1px solid var(--hairline); }
.clrow span { flex: 1; min-width: 200px; }
.clrow .tile { min-height: 64px; min-width: 120px; }
.switch { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.switch button { width: 64px; height: 36px; border-radius: 18px; border: 0; background: #64748B; position: relative; cursor: pointer; }
.switch button::after { content: ""; position: absolute; top: 4px; left: 4px; width: 28px; height: 28px; border-radius: 50%; background: #FFFFFF; transition: left .15s; }
.switch button[aria-checked="true"] { background: var(--danger); } .switch button[aria-checked="true"]::after { left: 32px; }
.visit { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: start; }
.secs { background: var(--surface); border-radius: 16px; overflow: hidden; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 88px); }
.secs .lrow[aria-current="true"] { background: var(--sel); box-shadow: inset 4px 0 0 var(--link); font-weight: 700; }
@media (max-width: 860px) { .visit { grid-template-columns: 1fr; } .secs { position: static; } }
table.reg { width: 100%; border-collapse: collapse; }
.tw { overflow-x: auto; }
table.reg th { text-align: left; font-size: 16px; color: var(--ink2); padding: 8px 12px; border-bottom: 1px solid var(--hairline); font-weight: 600; }
table.reg td { padding: 0 12px; height: 80px; border-bottom: 1px solid var(--hairline); }
.scrim { position: fixed; inset: 0; background: rgba(15,23,42,.6); z-index: 40; display: flex; align-items: flex-end; justify-content: center; padding-top: 24px; }
.sheet { background: var(--surface); border-radius: 16px 16px 0 0; width: 100%; max-width: 720px; padding: 24px; padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 16px; max-height: 100%; overflow: auto; }
.typecard { min-height: 96px; width: 100%; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); display: flex; align-items: center; gap: 16px; padding: 0 24px; font-size: 20px; font-weight: 600; cursor: pointer; text-align: left; }
.photo { width: 140px; height: 100px; border-radius: 12px; background: repeating-linear-gradient(45deg, #E2E8F0 0 10px, #F1F5F9 10px 20px); border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink2); font-size: 14px; font-weight: 600; text-align: center; }
.sig { width: 100%; height: 220px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); touch-action: none; display: block; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; min-height: 80px; background: var(--surface); border-top: 1px solid var(--hairline); display: flex; z-index: 20;
  padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: max(0px, env(safe-area-inset-left, 0px)); padding-right: max(0px, env(safe-area-inset-right, 0px)); }
.tabs button { flex: 1; min-height: 80px; border: 0; background: transparent; color: var(--ink2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 16px; cursor: pointer; position: relative; }
.tabs button[aria-current="page"] { color: var(--ink); font-weight: 700; }
.tabs button[aria-current="page"]::before { content: ""; position: absolute; top: 0; left: 20%; right: 20%; height: 4px; background: var(--link); }
.badge { border-radius: 999px; padding: 0 8px; font-size: 14px; font-weight: 700; background: var(--ink); color: #FFFFFF; }
.bar { border-radius: 12px; padding: 14px 18px; display: flex; gap: 12px; align-items: center; font-weight: 600; flex-wrap: wrap; }
.paper { height: auto !important; aspect-ratio: auto !important; overflow: visible !important; background: #FFFFFF; color: #0F172A; border: 1px solid var(--hairline); box-shadow: 0 6px 24px rgba(15,23,42,.12); max-width: 760px; width: 100%; margin: 0 auto;
  padding: 40px 44px; font-size: 14px; line-height: 1.45; display: flex; flex-direction: column; gap: 10px; aspect-ratio: 210 / 297; overflow: hidden; }
.paper h4 { font-size: 22px; margin: 0; } .paper h5 { font-size: 15px; margin: 10px 0 0; }
.paper .foot { margin-top: auto; border-top: 1px solid var(--hairline); padding-top: 8px; font-size: 11px; color: #334155; word-break: break-all; }
.paper .red { color: var(--danger); font-weight: 700; }
.hash { font-family: ui-monospace, Menlo, monospace; font-size: 14px; word-break: break-all; color: var(--ink2); }
.empty { text-align: center; padding: 32px; color: var(--ink2); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.photo img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.photo { position: relative; overflow: hidden; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 80;
  background: var(--ink); color: var(--surface); padding: 12px 18px; border-radius: 12px; max-width: calc(100% - 32px); }
.welcome { display: flex; flex-direction: column; gap: 12px; }
.top > * { flex-shrink: 0; }
.top h1 { flex-shrink: 1; }
@media (max-width: 600px) {
  .top { flex-wrap: wrap; row-gap: 0; }
  .top h1 { order: 10; flex-basis: 100%; font-size: 22px; padding-bottom: 8px; white-space: normal; }
  .top .conn { margin-left: auto; }
  .top h1 { padding-top: 8px; }
  .tabs button span { font-size: 14px; white-space: nowrap; }
  table.reg thead { display: none; }
  table.reg, table.reg tbody, table.reg tr, table.reg td { display: block; width: 100%; }
  table.reg tr { padding: 12px 0; border-bottom: 1px solid var(--hairline); }
  table.reg td { border: 0; padding: 2px 0; }
  table.reg td[data-l]::before { content: attr(data-l) ": "; color: var(--ink2); }
  table.reg td { height: auto; }
  table.reg td:last-child { padding-top: 8px; }
  .top .btn.sm, .top .conn { min-height: 48px; }
  .top .conn .lbl, .top .saved .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .clrow { gap: 8px; }
  .clrow span { flex-basis: 100%; min-width: 0; }
  .clrow .tile { flex: 1 1 0; min-width: 0; padding-inline: 4px; white-space: normal; overflow-wrap: normal; hyphens: none; line-height: 1.2; font-size: 15px; }
  .clrow .tile[aria-pressed="true"]::before { margin-right: 4px; font-size: 15px; }
}
.toast { cursor: pointer; left: 16px; right: 16px; margin: 0 auto; width: fit-content; transform: none; }

/* Sheets never run past the screen: the title and the action row stay, only the middle scrolls. */
.sheet { max-height: calc(100dvh - 24px); overflow-y: auto; overscroll-behavior: contain; }
.sheet > h2:first-child { position: sticky; top: -24px; margin: -24px -24px 0; padding: 24px 24px 12px; background: var(--surface); z-index: 1; }
.sheet > .row:last-child { position: sticky; bottom: calc(-24px - env(safe-area-inset-bottom, 0px)); margin: 0 -24px calc(-24px - env(safe-area-inset-bottom, 0px)); padding: 12px 24px calc(24px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--hairline); }
.sighint { color: var(--ink2); font-size: 16px; }
