/* Gestaltung angelehnt an Typenschilder und DC-Warnaufkleber:
   Aluminiumgrau als Fläche, Marineblau als Schrift, Signalgelb für die eine Hauptaktion. */
:root {
  --blech: #E6E9ED;
  --platte: #FFFFFF;
  --tinte: #14233A;
  --tinte-2: #4A586B;
  --linie: #C3CAD3;
  --signal: #FFC400;
  --signal-dunkel: #E0AC00;
  --gruen: #1B7F4B;
  --rot: #C62828;
  --r: 10px;
  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cond: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--blech); color: var(--tinte);
  font: 17px/1.45 var(--font);
}
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
h1 { font: 700 30px/1.1 var(--cond); margin: 0 0 18px; letter-spacing: .2px; }
h3 { font: 700 21px/1.2 var(--cond); margin: 0 0 8px; }
p { margin: 0 0 12px; }
.lead { color: var(--tinte-2); }
:focus-visible { outline: 3px solid var(--tinte); outline-offset: 2px; }

/* Kopf + Fortschritt */
.bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; padding-top: max(12px, env(safe-area-inset-top)); }
.back { background: none; border: 0; color: var(--tinte); font: 600 16px var(--font); padding: 8px 0; }
.back::before { content: '‹ '; font-size: 20px; }
.who { font: 700 20px var(--cond); }
.progress { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 0 16px 14px; }
.seg { height: 8px; border: 0; border-radius: 2px; background: var(--linie); padding: 0; }
.seg.is-done { background: var(--tinte); }
.seg.is-cur { background: var(--signal); box-shadow: inset 0 0 0 1px var(--signal-dunkel); }

.step, .picker, .done { flex: 1; padding: 4px 16px 120px; }
.step h1 .n { display: block; font: 600 15px var(--font); color: var(--tinte-2); margin-bottom: 2px; letter-spacing: 0; }

/* Felder */
.field { margin: 0 0 18px; }
.lbl { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { font-size: 14px; color: var(--tinte-2); margin: 6px 0 0; }
input, select, textarea {
  width: 100%; font: 500 18px var(--font); color: var(--tinte);
  background: var(--platte); border: 2px solid var(--linie); border-radius: var(--r);
  padding: 12px 14px; min-height: 52px; appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--tinte) 50%), linear-gradient(135deg, var(--tinte) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
input:focus, select:focus, textarea:focus { border-color: var(--tinte); outline: none; }
textarea { min-height: 96px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 .field { margin-bottom: 18px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 600 16px var(--font); color: var(--tinte); background: var(--platte);
  border: 2px solid var(--linie); border-radius: 999px; padding: 11px 16px; min-height: 48px;
}
.chip[aria-checked="true"] { background: var(--tinte); border-color: var(--tinte); color: #fff; }

.card.proj { background: var(--platte); border-left: 6px solid var(--tinte); border-radius: 4px var(--r) var(--r) 4px; padding: 12px 14px; margin-bottom: 20px; display: grid; gap: 2px; }
.card.proj span { color: var(--tinte-2); font-size: 15px; }

/* Messwert-Anzeigen */
.readout { display: flex; align-items: baseline; gap: 8px; background: var(--tinte); color: #fff; border-radius: var(--r); padding: 12px 16px; margin: -4px 0 20px; }
.readout output { font: 700 32px var(--cond); font-variant-numeric: tabular-nums; }
.readout.small output { font: 600 16px var(--font); }
.readout span:first-child { flex: 1; font-size: 15px; opacity: .8; }

.meter { display: grid; grid-template-columns: 1fr 1fr; background: var(--tinte); color: #fff; border-radius: var(--r); margin-bottom: 20px; overflow: hidden; }
.meter div { padding: 14px 16px; display: grid; }
.meter div:nth-child(even) { border-left: 1px solid rgba(255,255,255,.2); }
.meter div:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.2); }
.meter span { font-size: 14px; opacity: .75; }
.meter b { font: 700 28px var(--cond); font-variant-numeric: tabular-nums; }
.verdict { border-radius: var(--r); font-weight: 600; margin: -6px 0 20px; }
.verdict.good, .verdict.bad { padding: 14px 16px; color: #fff; }
.verdict.good { background: var(--gruen); }
.verdict.bad { background: var(--rot); }

/* Fotos */
.photo { background: var(--platte); border-radius: var(--r); padding: 14px; margin: 0 0 18px; border: 2px dashed var(--linie); }
.photo.req { border-color: var(--tinte-2); }
.photo-head { display: flex; gap: 8px; align-items: baseline; }
.photo .opt { font-size: 14px; color: var(--tinte-2); font-weight: 500; }
.photo .hint { margin: 2px 0 10px; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.figs { display: contents; }
.thumb { margin: 0; position: relative; }
.thumb img, .thumb .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; background: var(--blech); }
.thumb .noimg { display: grid; place-items: center; font-size: 28px; color: var(--gruen); }
.thumb figcaption { font-size: 13px; color: var(--tinte-2); margin-top: 3px; }
.thumb.s-ok figcaption { color: var(--gruen); font-weight: 600; }
.thumb.s-fehler figcaption { color: var(--rot); font-weight: 600; }
.thumb.s-lädt img, .thumb.s-wartet img { opacity: .55; }
.add { aspect-ratio: 1; border-radius: 8px; background: var(--blech); display: grid; place-items: center; align-content: center; gap: 6px; text-align: center; font: 600 14px var(--font); cursor: pointer; padding: 6px; }
.add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.add:focus-within { outline: 3px solid var(--tinte); }
.cam { width: 30px; height: 22px; border: 3px solid var(--tinte); border-radius: 5px; position: relative; }
.cam::after { content: ''; position: absolute; inset: 3px 8px; border: 3px solid var(--tinte); border-radius: 50%; }

.link { background: none; border: 0; padding: 0; color: var(--tinte); font: 600 inherit var(--font); text-decoration: underline; cursor: pointer; }

/* Aktionsleiste */
.actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: grid; grid-template-columns: 1fr 2fr; gap: 10px;
  max-width: 560px; margin: 0 auto; padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--blech) 75%, rgba(230,233,237,0));
}
.btn { min-height: 56px; border-radius: var(--r); font: 700 20px var(--cond); letter-spacing: .3px; border: 2px solid var(--tinte); padding: 0 18px; }
.btn.primary { background: var(--signal); border-color: var(--signal-dunkel); color: var(--tinte); }
.btn.primary:active { background: var(--signal-dunkel); }
.btn.ghost { background: transparent; color: var(--tinte); }
.btn:disabled { opacity: .6; }

/* Projektauswahl */
.picker { padding-top: max(24px, env(safe-area-inset-top)); }
#search { margin: 4px 0 14px; }
.plist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plist button { width: 100%; text-align: left; background: var(--platte); border: 2px solid transparent; border-radius: var(--r); padding: 12px 14px; display: grid; gap: 2px; font: inherit; color: inherit; }
.plist button:active { border-color: var(--tinte); }
.plist span { font-size: 15px; color: var(--tinte-2); }
.plist em { font-style: normal; font-size: 14px; font-weight: 600; color: var(--tinte); background: var(--signal); justify-self: start; padding: 1px 8px; border-radius: 4px; margin-top: 4px; }
.plist .empty { color: var(--tinte-2); padding: 8px 0; }

/* Abschluss */
.summary h3.ok { color: var(--gruen); }
.miss { padding-left: 18px; margin: 0 0 12px; }
.miss li { margin-bottom: 6px; }
.done { text-align: center; padding-top: 80px; display: grid; justify-items: center; gap: 8px; }
.done .btn { margin-top: 16px; width: 100%; }
.tick { width: 72px; height: 72px; border-radius: 50%; background: var(--gruen); position: relative; margin-bottom: 8px; }
.tick::after { content: ''; position: absolute; left: 25px; top: 16px; width: 18px; height: 32px; border: solid #fff; border-width: 0 6px 6px 0; transform: rotate(45deg); }

@media (prefers-reduced-motion: no-preference) {
  .chip, .seg, .btn { transition: background-color .15s, border-color .15s; }
}

/* Bestandsanlagen */
.card.bestand { background: var(--platte); border-left: 6px solid var(--signal); border-radius: var(--r); padding: 12px 14px; margin: 0 0 14px; }
.bestand-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.btn.full { width: 100%; margin-bottom: 20px; }
.hint.warn { color: var(--rot); font-weight: 600; }

/* ---------- Checkliste (Prototyp) ---------- */
.proto { background: var(--signal); color: var(--tinte); font: 600 14px var(--font); text-align: center; padding: 6px 12px; }
.progress { grid-template-columns: repeat(var(--steps, 7), 1fr); }
.chip.multi[aria-checked="true"]::before { content: '✓ '; }
.sub { border-left: 3px solid var(--linie); padding-left: 14px; margin: -6px 0 18px; }
.card.wb { background: var(--platte); border-left: 6px solid var(--tinte); border-radius: var(--r); padding: 12px 14px 2px; margin: 0 0 14px; }
.card.wb strong { display: block; margin-bottom: 8px; }
.readout.info { background: var(--gruen); }
.readout.info output { font: 600 16px var(--font); }
.start { flex: 1; padding: 24px 16px 120px; }
.ov { padding: 4px 16px 40px; }
.ov h2 { font: 700 22px/1.2 var(--cond); margin: 24px 0 8px; }
.ov dl { margin: 0; background: var(--platte); border-radius: var(--r); overflow: hidden; }
.ov dl div { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 9px 12px; border-top: 1px solid var(--blech); }
.ov dl div:first-child { border-top: 0; }
.ov dt { color: var(--tinte-2); font-size: 15px; }
.ov dd { margin: 0; font-weight: 600; font-size: 15px; }
.pos { width: 100%; border-collapse: collapse; background: var(--platte); border-radius: var(--r); overflow: hidden; font-size: 15px; }
.pos th, .pos td { text-align: left; padding: 9px 10px; border-top: 1px solid var(--blech); vertical-align: top; }
.pos th { background: var(--tinte); color: #fff; font: 600 14px var(--font); border-top: 0; }
.pos td.n { white-space: nowrap; color: var(--tinte-2); }
.pos td.m { text-align: right; font-weight: 700; white-space: nowrap; }
.pos small { display: block; color: var(--tinte-2); font-size: 13px; }
.note { background: var(--platte); border-left: 6px solid var(--signal); border-radius: var(--r); padding: 12px 14px; margin: 14px 0; font-size: 15px; }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.ov .btn { width: 100%; margin-top: 12px; }
