:root {
  --bg: #0b1220;
  --kort: #131c2e;
  --tekst: #f8fafc;
  --dempet: #94a3b8;
  --gronn: #22c55e;
  --gul: #f59e0b;
  --rod: #ef4444;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--tekst);
  font-family: system-ui, "DejaVu Sans", "Noto Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

/* ---------- Skjermer (kiosk) ---------- */
body.skjerm { overflow: hidden; cursor: none; user-select: none; }

.qr-oppsett {
  height: 100vh; display: grid; grid-template-columns: auto 1fr;
  align-items: center; gap: 5vw; padding: 5vh 5vw;
}
.qr-boks {
  background: #fff; border-radius: 2vmin; padding: 2vmin;
  width: min(82vh, 48vw); aspect-ratio: 1;
  transition: transform .25s;
}
.qr-boks.ny { transform: scale(.96); }
.qr-boks img { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.qr-tekst h1 { font-size: 9vh; margin: 0 0 2vh; }
.hjelp { font-size: 3.6vh; color: var(--dempet); line-height: 1.35; margin: 0 0 5vh; }
.nokkeltall { display: flex; gap: 5vw; }
.nokkeltall > div { display: flex; flex-direction: column; }
.etikett { font-size: 3vh; color: var(--dempet); text-transform: uppercase; letter-spacing: .08em; }
.nokkeltall .tall { font-size: 14vh; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.blink {
  margin-top: 4vh; font-size: 3.6vh; color: var(--gronn); font-weight: 600;
  animation: inn .3s ease-out;
}
@keyframes inn { from { opacity: 0; transform: translateY(1vh); } }

.status-oppsett {
  height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 4vh;
}
.status-oppsett .etikett { font-size: 5vh; }
.stort-tall {
  font-size: 48vh; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums;
  color: var(--gronn);
}
.stort-tall.puls { animation: puls 1.2s ease-out 2; }
@keyframes puls { 0% { transform: scale(1.12); color: #fff; } 100% { transform: scale(1); } }
.neste-rad { margin-top: 3vh; font-size: 5vh; color: var(--dempet); }
.neste-rad b { color: var(--tekst); margin: 0 .6em; font-variant-numeric: tabular-nums; }

.frakoblet {
  position: fixed; left: 0; right: 0; bottom: 0; margin: 0; padding: 1.2vh;
  background: var(--rod); color: #fff; text-align: center; font-size: 3vh;
}

/* ---------- Mobil ---------- */
body.mobil { display: flex; justify-content: center; padding: 24px 16px 40px; min-height: 100%; }
.mobil main { width: 100%; max-width: 440px; }
.mobil h1 { font-size: 1.1rem; color: var(--dempet); font-weight: 600; margin: 0 0 16px; text-align: center; }
.lapp {
  background: var(--kort); border-radius: 20px; padding: 28px 20px; text-align: center;
  border: 2px dashed #334155;
}
.lapp .etikett { font-size: .85rem; }
.lapp-nr { font-size: 6.5rem; font-weight: 900; line-height: 1; margin: 6px 0 12px; font-variant-numeric: tabular-nums; }
.lapp-status { font-size: 1.5rem; font-weight: 700; margin: 0; }
.lapp-betjenes { color: var(--dempet); margin: 10px 0 0; font-size: 1.05rem; }
.din-tur .lapp { border-color: var(--gronn); background: #0f2e1d; animation: blink 1s ease-in-out infinite alternate; }
.din-tur .lapp-status { color: var(--gronn); font-size: 2rem; }
.ferdig .lapp { opacity: .55; }
@keyframes blink { to { background: #14532d; } }

.varsel { margin-top: 20px; text-align: center; }
.knapp {
  width: 100%; border: 0; border-radius: 14px; padding: 16px; font-size: 1.1rem; font-weight: 700;
  background: var(--gul); color: #111; cursor: pointer;
}
.knapp:disabled { opacity: .6; }
.knapp.av { background: #1e293b; color: var(--gronn); }
.liten { color: var(--dempet); font-size: .95rem; line-height: 1.45; }
.mobil .frakoblet { font-size: .95rem; padding: 10px; }
.melding { text-align: center; margin-top: 12vh; }
.melding h2 { font-size: 1.8rem; }
.melding p { color: var(--dempet); font-size: 1.15rem; line-height: 1.5; }
