:root {
  --brand: #A72920;   /* RAL 3000 Flame Red */
  --politi: #1B3A6B;  /* dark Danish police blue */
  --bg: #F7F6F4;
  --card: #ffffff;
  --ink: #26241f;
  --muted: #6f6a61;
  --line: #e5e1da;
  --ok: #2e7d32;
  --warn: #b26a00;
  --accent: var(--brand);
}
body[data-role="politi"] { --accent: var(--politi); }

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 520px; margin: 0 auto; padding: 12px 14px 90px; }

header.app {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px;
}
header.app .logo {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; letter-spacing: .5px;
  flex: none;
}
header.app h1 { font-size: 17px; font-weight: 700; }
header.app .sub { font-size: 12.5px; color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; margin: 10px 0;
}
.card h2 { font-size: 16px; margin-bottom: 8px; }
.card h3 { font-size: 14px; margin: 10px 0 4px; }
.small { font-size: 13px; color: var(--muted); }
.center { text-align: center; }

label { display: block; font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
input[type=text], input[type=tel], textarea, select {
  width: 100%; padding: 11px 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-family: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus { outline: 2px solid var(--accent); border-color: transparent; }

.btn {
  display: block; width: 100%; padding: 13px 16px; margin-top: 12px;
  font-size: 16px; font-weight: 700; font-family: inherit;
  border: none; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff;
}
.btn.sec { background: #fff; color: var(--ink); border: 1.5px solid var(--line); font-weight: 600; }
.btn.small { padding: 9px 12px; font-size: 14px; margin-top: 8px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.99); }

.rolepick { display: flex; gap: 10px; margin-top: 6px; }
.rolepick button {
  flex: 1; padding: 14px 8px; border-radius: 12px; cursor: pointer;
  font-weight: 800; font-size: 15px; font-family: inherit;
  border: 2px solid var(--line); background: #fff; color: var(--muted);
}
.rolepick button.brand.on { border-color: var(--brand); background: var(--brand); color: #fff; }
.rolepick button.politi.on { border-color: var(--politi); background: var(--politi); color: #fff; }

.pill {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .3px;
}
.pill.brand { background: var(--brand); color: #fff; }
.pill.politi { background: var(--politi); color: #fff; }
.pill.ghost { background: #eee9e2; color: var(--muted); }
.pill.ok { background: #e3f0e4; color: var(--ok); }

.code-big {
  font-size: 40px; font-weight: 800; letter-spacing: 8px;
  text-align: center; padding: 8px 0; font-variant-numeric: tabular-nums;
}

/* step progress */
.steps { display: flex; gap: 5px; margin: 8px 0 2px; }
.steps .s {
  flex: 1; height: 5px; border-radius: 3px; background: #e3ded6;
}
.steps .s.done { background: var(--ok); }
.steps .s.cur { background: var(--accent); }
.steplabel { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* case */
.zone {
  border-left: 4px solid var(--accent);
  padding: 10px 12px; background: #fbfaf8; border-radius: 0 10px 10px 0;
  margin: 8px 0; font-size: 14.5px;
}
.zone.kort {
  white-space: pre-wrap; font-size: 13.5px; background: #fff;
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
}
.tasktabs { display: flex; gap: 6px; margin: 10px 0 6px; }
.tasktabs button {
  flex: 1; padding: 8px; border-radius: 9px; font-size: 13px; font-weight: 700;
  border: 1.5px solid var(--line); background: #fff; color: var(--muted);
  cursor: pointer; font-family: inherit;
}
.tasktabs button.on.brand { border-color: var(--brand); color: var(--brand); background: #faf1f0; }
.tasktabs button.on.politi { border-color: var(--politi); color: var(--politi); background: #eff3fa; }
.tasktabs button.on.faelles { border-color: var(--ink); color: var(--ink); background: #f3f1ee; }

/* recorder */
.rec {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 0 6px;
}
.recbtn {
  width: 74px; height: 74px; border-radius: 50%;
  border: none; cursor: pointer; background: var(--accent); color: #fff;
  font-size: 30px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.recbtn.recording { animation: pulse 1.2s infinite; background: #c62828; }
.recbtn.sm { width: 56px; height: 56px; font-size: 24px; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.recrow { display: flex; align-items: center; gap: 14px; padding: 10px 0 4px; }
.phasehead { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.phasehead .st { margin-left: auto; }
.linklike { background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; font-family: inherit; font-size: 13px; padding: 4px 0; }
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.08);} }
.rectime { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

audio { width: 100%; margin-top: 8px; }

/* quiz */
.q-opt {
  display: block; width: 100%; text-align: left; margin-top: 8px;
  padding: 12px 13px; border-radius: 11px; font-size: 15px; font-family: inherit;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.q-opt.sel { border-color: var(--accent); background: #faf8f5; font-weight: 600; }
.q-opt.right { border-color: var(--ok); background: #e9f4ea; font-weight: 700; }
.q-opt.wrong { border-color: #c62828; background: #fbeaea; }
.q-opt:disabled { cursor: default; opacity: 1; }
.why {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: #f3f1ee; font-size: 13.5px;
}

/* versus */
.versus { display: flex; align-items: stretch; gap: 8px; margin: 10px 0; }
.versus .side {
  flex: 1; text-align: center; border-radius: 12px; padding: 12px 6px; color: #fff;
}
.versus .side.brand { background: var(--brand); }
.versus .side.politi { background: var(--politi); }
.versus .side .nm { font-size: 12.5px; opacity: .85; }
.versus .side .sc { font-size: 30px; font-weight: 800; }
.versus .vs { align-self: center; font-weight: 800; color: var(--muted); }

.qrow { display: flex; gap: 6px; justify-content: center; margin-top: 4px; }
.qdot { width: 20px; height: 20px; border-radius: 50%; font-size: 12px; line-height: 20px; text-align: center; color:#fff; }
.qdot.ok { background: var(--ok); }
.qdot.no { background: #c62828; }

/* notes / feed */
.notebox {
  border: 1px solid var(--line); border-radius: 11px; padding: 11px 12px; margin-top: 8px;
  background: #fbfaf8; font-size: 14.5px; white-space: pre-wrap;
}
.notebox .who { font-size: 12px; font-weight: 700; margin-bottom: 4px; }

.tipbox {
  border: 1.5px dashed var(--warn); background: #fdf6ea;
  border-radius: 12px; padding: 13px 14px; margin: 10px 0;
}
.tipbox .t { font-weight: 800; font-size: 14px; color: var(--warn); margin-bottom: 4px; }

.waiting { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); padding: 8px 0; }
.dotanim { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 0%,100% { opacity: .25;} 50% { opacity: 1;} }

.banner {
  font-size: 12px; padding: 7px 10px; border-radius: 9px;
  background: #fdf3d7; color: #7a5a00; margin: 6px 0;
}
.err { color: #c62828; font-size: 13.5px; margin-top: 8px; min-height: 1em; }

.contactrow {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.contactrow:last-child { border-bottom: none; }
.contactrow button { border: none; background: none; color: var(--accent); font-weight: 700; cursor: pointer; font-size: 14px; font-family: inherit; }

.hidden { display: none !important; }
