:root {
  --ink: #120F2D;
  --muted: #5b5876;
  --faint: #8b88a3;
  --line: #dcd9e6;
  --line-soft: #e8e6f0;
  --paper: #ffffff;
  --ground: #f4f3f8;
  --violet: #7C5CFF;
  --blue: #2F7BFF;
  --grad: linear-gradient(135deg, #7C5CFF, #2F7BFF);
  --green-bg: #e1f5ee; --green-line: #1d9e75; --green-ink: #04342c; --green-mid: #0f6e56;
  --amber-bg: #faeeda; --amber-line: #ba7517; --amber-ink: #633806;
  --red-bg: #fcebeb; --red-line: #e24b4a; --red-ink: #501313;
  --coral-bg: #faece7; --coral-line: #f0997b; --coral-ink: #4a1b0c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--paper); font-size: 15px; line-height: 1.4;
  -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.screen { min-height: 100dvh; display: flex; flex-direction: column; padding: 0 20px; padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.screen.dark { background: #0d0b20; color: #fff; padding: 0; }
.brand { display: flex; align-items: center; gap: 8px; padding: 20px 0 6px; }
.brand img { height: 22px; width: auto; display: block; }
.brand small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 8px; }
h1 { font-family: Outfit, Inter, system-ui, sans-serif; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; margin: 8px 0 4px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 8px; align-items: center; }
.grow { flex: 1; }
.spacer { flex: 1; }

.btn { height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-size: 16px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn.primary { background: var(--grad); color: #fff; border: 0; font-weight: 600; }
.btn.small { height: 40px; font-size: 14px; border-radius: 10px; padding: 0 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.danger { border-color: var(--red-line); color: var(--red-ink); background: var(--red-bg); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select { height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); font-size: 16px; width: 100%; }
.field input.big { font-size: 20px; letter-spacing: 1px; text-transform: uppercase; }
.field input:focus, .field select:focus { outline: 2px solid var(--violet); outline-offset: -1px; }

.card { border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px; background: var(--paper); }
.card.ok { border-color: var(--green-line); background: var(--green-bg); color: var(--green-ink); }
.card.warn { border-color: var(--amber-line); background: var(--amber-bg); color: var(--amber-ink); }
.card.bad { border-color: var(--red-line); background: var(--red-bg); color: var(--red-ink); }
.card .title { font-weight: 600; }
.card .meta { font-size: 13px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.pill.green { background: var(--green-bg); color: var(--green-ink); }
.pill.amber { background: var(--amber-bg); color: var(--amber-ink); }
.pill.gray { background: #ebeae6; color: #444441; }
.pill.blue { background: #ece8ff; color: #3b2a99; }

.list { display: flex; flex-direction: column; gap: 10px; }
.list .card { cursor: pointer; }
.note { font-size: 13px; color: var(--muted); text-align: center; }
.footer { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; font-size: 13px; }
.specs div span { display: block; color: var(--muted); font-size: 12px; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; }
.seg button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* camera */
.cam { position: relative; flex: 1; background: #2c2c2a; overflow: hidden; display: flex; align-items: center; justify-content: center; min-height: 50dvh; }
.cam video, .cam canvas.preview, .cam img.ref { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam img.ref { opacity: .45; }
.cam svg.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cam .hint { position: absolute; top: 14px; left: 16px; right: 16px; text-align: center; background: rgba(0,0,0,.55); border-radius: 10px; padding: 10px 12px; font-size: 14px; color: #fff; }
.cam .refpill { position: absolute; left: 12px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12px; }
.camhead { padding: max(16px, env(safe-area-inset-top)) 20px 10px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.camhead .t { font-size: 13px; color: #b4b2a9; }
.camhead .n { font-weight: 600; }
.progress { display: flex; gap: 4px; padding: 0 20px; }
.progress span { flex: 1; height: 4px; border-radius: 2px; background: #444441; }
.progress span.done { background: #9b85ff; }
.progress span.now { background: #fff; }
.camfoot { padding: 14px 20px max(24px, env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; }
.shutter { width: 76px; height: 76px; border-radius: 50%; border: 4px solid #fff; background: #fff; box-shadow: inset 0 0 0 3px #0d0b20; }
.ghost { height: 44px; width: 70px; border-radius: 10px; border: 1px solid #5f5e5a; background: transparent; color: #fff; font-size: 13px; }
.camsub { padding: 10px 20px 0; font-size: 13px; color: #b4b2a9; display: flex; justify-content: space-between; gap: 12px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 20px 0; }
.compare .box { border-radius: 10px; overflow: hidden; background: #2c2c2a; aspect-ratio: 4 / 3; position: relative; }
.compare .box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.compare .box .lbl { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.6); color: #fff; border-radius: 6px; padding: 2px 8px; font-size: 11px; }

/* damage map */
.map { position: relative; border: 1px solid var(--line); border-radius: 12px; background: var(--ground); overflow: hidden; touch-action: manipulation; }
.map svg { width: 100%; height: auto; display: block; }
.map .dot { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: var(--coral-line); border: 2px solid #fff; transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0,0,0,.3); color: #4a1b0c; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.map .dot.old { background: #b4b2a9; color: #2c2c2a; }
.dmg { display: flex; flex-direction: column; gap: 6px; }
.dmg .item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; font-size: 14px; }
.dmg .item.new { border-color: var(--coral-line); background: var(--coral-bg); color: var(--coral-ink); }
.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.thumbs img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--ground); }

/* signature */
.sig { border: 1px solid var(--line); border-radius: 12px; background: var(--paper); touch-action: none; width: 100%; height: 180px; display: block; }

.toast { position: fixed; left: 16px; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); background: var(--ink); color: #fff; padding: 12px 14px; border-radius: 12px; font-size: 14px; z-index: 50; }
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; z-index: 40; }
.sheet .panel { background: var(--paper); width: 100%; border-radius: 16px 16px 0 0; padding: 20px 20px max(28px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }

/* v0.2: account, sync, archief */
.acct { margin-left: auto; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; font-weight: 500; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.syncbar { margin: 4px 0 8px; padding: 10px 12px; border-radius: 10px; background: #efeaff; color: #3b2a99; font-size: 13px; }
.syncbar.off { background: var(--amber-bg); color: var(--amber-ink); }
.pill.violet { background: #efeaff; color: #3b2a99; }
.card.row-thumb { display: flex; gap: 12px; align-items: center; }
.card.row-thumb img, .card.row-thumb .ph { width: 56px; height: 42px; border-radius: 6px; object-fit: cover; background: var(--ground); flex: none; }
.thumbs img { cursor: pointer; }
.link-box { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-size: 12px; word-break: break-all; color: var(--muted); }

/* taalkeuze NL · DE · EN */
.langsw { margin-left: auto; display: inline-flex; padding: 3px; gap: 2px; border-radius: 17px; border: 1px solid var(--line); background: var(--paper); flex: none; }
.langsw button { height: 26px; min-width: 34px; padding: 0 8px; border: 0; border-radius: 13px; background: transparent; font: 600 12px/1 Inter, sans-serif; color: var(--muted); letter-spacing: .02em; cursor: pointer; }
.langsw button.on { background: var(--ink); color: #fff; }
.panel .row .langsw { align-self: flex-start; }
.seg.cap button { text-transform: capitalize; }
