/* Skitser til optagestudiet. Trin 0: kun layout, falske data, ingen logik.
   Layoutidé: ét bånd øverst fortæller altid, om der optages. Alt andet er roligt.
   Status vises altid med form, ord og farve sammen, aldrig farve alene. */

:root {
  /* Studiet kører kun i mørkt tema, uanset computerens indstilling. */
  color-scheme: dark;
  --bg: #282828;
  --surface: #323232;
  --surface-2: #3c3c3c;
  --ink: #ffffff;
  --muted: #a8a8a8;
  --line: #484848;
  --stripe: #303030;
  --accent: #ffffff;
  --accent-ink: #282828;
  --rec: #e5484d;
  --rec-ink: #ffffff;
  --ok: #62d49c;
  --ok-bg: #143224;
  --warn: #f1c25b;
  --warn-bg: #392d10;
  --bad: #ff8b95;
  --bad-bg: #3c181d;
  --stage: #282828;
  --tile: #333333;
  --tile-ink: #f1f3f9;
  --meter-bg: #4a4a4a;

  --display: "Albert Sans", "Segoe UI", system-ui, sans-serif;
  --body: "Albert Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3 { font-family: var(--display); line-height: 1.15; text-wrap: balance; }
h1 { font-size: 1.875rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 700; }
a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.lille { font-size: 0.875rem; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.etiket {
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}

/* ---------- Skitsebjælken (hører ikke til det færdige produkt) ---------- */
.skitse {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem;
  padding-block: 0.4rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--surface-2);
  border-bottom: 1px dashed var(--muted);
  font-family: var(--mono); font-size: 0.75rem; color: var(--muted);
}
.skitse strong { color: var(--ink); font-weight: 600; }
.skitse .tilstande { display: flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.skitse input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.skitse label {
  padding: 0.2rem 0.6rem; border: 1px solid var(--line); border-radius: 4px;
  cursor: pointer; background: var(--surface); color: var(--ink);
}
.skitse input:checked + label { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.skitse input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }
.skitse nav { margin-left: auto; display: flex; gap: 0.75rem; }

/* Tilstande uden script: elementer med data-s vises kun i de nævnte tilstande */
body:has(#st1:checked) [data-s]:not([data-s~="1"]),
body:has(#st2:checked) [data-s]:not([data-s~="2"]),
body:has(#st3:checked) [data-s]:not([data-s~="3"]),
body:has(#st4:checked) [data-s]:not([data-s~="4"]),
body:has(#st5:checked) [data-s]:not([data-s~="5"]),
body:has(#st6:checked) [data-s]:not([data-s~="6"]),
body:has(#st7:checked) [data-s]:not([data-s~="7"]),
body:has(#st8:checked) [data-s]:not([data-s~="8"]) { display: none !important; }

/* ---------- Skærmramme ---------- */
body.skaerm { display: flex; flex-direction: column; min-height: 100%; }
.app { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.kun-computer { display: none; }
@media (max-width: 760px) {
  .app { display: none !important; }
  .kun-computer {
    flex: 1; display: grid; place-content: center; gap: 0.75rem; text-align: center;
    padding-block: 3rem;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .kun-computer p { max-width: 22rem; margin-inline: auto; color: var(--muted); }
}
.topbar {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.5rem; background: var(--surface); border-bottom: 1px solid var(--line);
}
.topbar .logo { font-family: var(--display); font-weight: 800; font-size: 1.0625rem; }
.topbar .hvem { margin-left: auto; font-size: 0.875rem; color: var(--muted); }
.midte { flex: 1; display: grid; place-items: center; padding: 2rem 1.5rem; }
.kort {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 2rem; width: 100%;
}
.stak { display: flex; flex-direction: column; gap: 1rem; }
.stak-s { display: flex; flex-direction: column; gap: 0.5rem; }
.stak-l { display: flex; flex-direction: column; gap: 1.5rem; }
.raekke { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }

/* ---------- Knapper og felter ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  padding: 0.7rem 1.25rem; border-radius: 8px; border: 2px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
}
.btn.stor { font-size: 1.125rem; padding: 0.95rem 1.5rem; width: 100%; }
.btn.stille { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.rec { background: var(--rec); border-color: var(--rec); color: var(--rec-ink); }
.btn.stop { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn[disabled] { background: var(--stripe); border-color: var(--line); color: var(--muted); cursor: not-allowed; }
.btn .ikon-rec { width: 0.9em; height: 0.9em; border-radius: 50%; background: currentColor; }
.btn .ikon-stop { width: 0.85em; height: 0.85em; border-radius: 2px; background: currentColor; }
.felt { display: flex; flex-direction: column; gap: 0.35rem; }
.felt label { font-weight: 600; }
.felt input {
  font: inherit; color: var(--ink); background: var(--surface);
  padding: 0.7rem 0.85rem; border: 2px solid var(--line); border-radius: 8px; width: 100%;
}
.felt .hjaelp { font-size: 0.875rem; color: var(--muted); }
.linkboks {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.6rem 0.6rem 1rem; border: 2px solid var(--line); border-radius: 8px;
  background: var(--surface-2);
}
.linkboks code { font-family: var(--mono); font-size: 0.9375rem; flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Status: form, ord og farve ---------- */
.st {
  display: inline-flex; align-items: center; gap: 0.4em; white-space: nowrap;
  font-size: 0.8125rem; font-weight: 600; line-height: 1.2;
  padding: 0.25em 0.7em 0.25em 0.4em; border-radius: 999px;
  background: var(--ok-bg); color: var(--ok);
}
.st::before {
  content: "✓"; display: grid; place-items: center; flex: none;
  width: 1.3em; height: 1.3em; border-radius: 50%;
  background: var(--ok); color: var(--ok-bg); font-size: 0.85em; font-weight: 800;
}
.st.warn { background: var(--warn-bg); color: var(--warn); }
.st.warn::before {
  content: "!"; border-radius: 0; background: var(--warn); color: var(--warn-bg);
  clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: 0.3em; width: 1.45em;
}
.st.bad { background: var(--bad-bg); color: var(--bad); }
.st.bad::before { content: "✕"; border-radius: 3px; background: var(--bad); color: var(--bad-bg); }
.st.vent { background: var(--stripe); color: var(--muted); }
.st.vent::before {
  content: "…"; background: transparent; color: var(--muted);
  border: 2px dotted var(--muted); line-height: 0.6;
}

.meter {
  position: relative; height: 10px; border-radius: 5px; overflow: hidden;
  background: var(--meter-bg); min-width: 3rem;
}
.meter i {
  position: absolute; inset: 0 auto 0 0; width: var(--v, 0%); background: var(--ok);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px);
  mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px);
}
.meter.hoej i { background: var(--warn); }

.fremgang { height: 14px; border-radius: 7px; background: var(--meter-bg); overflow: hidden; }
.fremgang i { display: block; height: 100%; width: var(--v, 0%); background: var(--accent); }
.fremgang.faerdig i { background: var(--ok); }

.besked {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.85rem 1rem; border-radius: 10px; border: 2px solid var(--line); background: var(--surface-2);
}
.besked.warn { border-color: var(--warn); background: var(--warn-bg); }
.besked.bad { border-color: var(--bad); background: var(--bad-bg); }
.besked.ok { border-color: var(--ok); background: var(--ok-bg); }
.besked .tegn { font-size: 1.5rem; line-height: 1.1; flex: none; }
.besked strong { display: block; font-family: var(--display); font-size: 1.0625rem; }

/* ---------- Optagebåndet: kan ikke overses ---------- */
.baand {
  display: flex; align-items: center; gap: 1rem; padding: 0.75rem 1.5rem;
  font-family: var(--display);
}
.baand .stort { font-size: 1.625rem; font-weight: 800; letter-spacing: 0.06em; }
.baand .under { font-family: var(--body); font-size: 0.9375rem; }
.baand .tid { margin-left: auto; font-family: var(--mono); font-size: 1.625rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.baand .lampe { width: 1.25rem; height: 1.25rem; border-radius: 50%; flex: none; }
.baand.rec { background: var(--rec); color: var(--rec-ink); }
.baand.rec .lampe { background: var(--rec-ink); animation: blink 1.4s ease-in-out infinite; }
.baand.fri {
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 14px, var(--stripe) 14px 28px);
  color: var(--ink); border-bottom: 2px dashed var(--muted);
}
.baand.fri .lampe { border: 3px solid var(--muted); }
.baand.vent { background: var(--warn-bg); color: var(--warn); border-bottom: 3px solid var(--warn); }
.baand.klar { background: var(--ok-bg); color: var(--ok); border-bottom: 3px solid var(--ok); }
.baand.vent .tegn, .baand.klar .tegn { font-size: 1.5rem; }
.rec-ramme { position: absolute; inset: 0; border: 6px solid var(--rec); pointer-events: none; z-index: 5; }
@keyframes blink { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .baand.rec .lampe { animation: none; } }

/* ---------- Studiet ---------- */
.studie { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
.studie.vaert { grid-template-columns: minmax(0, 1fr) 23rem; }
.scene {
  background: var(--stage); padding: 1rem;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; align-content: center;
}
.flise {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background: linear-gradient(160deg, hsl(var(--h, 225) 26% 30%), hsl(var(--h, 225) 30% 17%));
  color: var(--tile-ink); display: grid; place-items: center;
}
.flise .hoved {
  width: 28%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: hsl(var(--h, 225) 30% 44%); font-family: var(--display); font-weight: 700; font-size: 1.5rem;
}
.flise .navn {
  position: absolute; left: 0.5rem; bottom: 0.5rem; padding: 0.15rem 0.55rem; border-radius: 6px;
  background: rgb(0 0 0 / 0.55); font-size: 0.875rem; font-weight: 600;
}
.flise .lyd { position: absolute; right: 0.5rem; bottom: 0.65rem; width: 28%; }
.flise .lyd .meter { display: block; background: rgb(255 255 255 / 0.22); height: 8px; }
.flise .lyd .meter i { background: #7be0ae; }
.flise.dig { outline: 3px solid var(--tile-ink); outline-offset: -3px; }
.flise .maerke { position: absolute; left: 0.5rem; top: 0.5rem; }
.flise .over {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 0.35rem; text-align: center;
  padding: 1rem; background: rgb(10 12 20 / 0.82); font-size: 0.9375rem;
}
.flise .over strong { font-family: var(--display); font-size: 1.125rem; }
.bund {
  display: flex; align-items: center; gap: 1.25rem; padding: 0.75rem 1.5rem;
  background: var(--surface); border-top: 1px solid var(--line);
}
.bund .egen { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.bund .egen .meter { width: 12rem; height: 14px; border-radius: 7px; }

/* Værtspanelet */
.panel {
  background: var(--surface); border-left: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto;
}
.panel > section { padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.panel .samlet { font-family: var(--display); font-size: 1.125rem; font-weight: 700; }
.delt { border-bottom: 1px solid var(--line); }
.delt:last-child { border-bottom: 0; }
.delt summary {
  display: grid; grid-template-columns: minmax(0, 1fr) 4.5rem auto 1rem; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0; cursor: pointer; list-style: none;
}
.delt summary::-webkit-details-marker { display: none; }
.delt summary::after { content: "▸"; color: var(--muted); font-size: 0.875rem; }
.delt[open] summary::after { content: "▾"; }
.delt .hvem { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.delt .hvem small { font-weight: 400; color: var(--muted); }
.tal {
  display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem;
  padding: 0.25rem 0 0.85rem; font-size: 0.875rem;
}
.tal dt { color: var(--muted); }
.tal dd { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Lobby ---------- */
.lobby { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 2rem; max-width: 62rem; }
.tjek li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.25rem 1rem; align-items: center;
  padding: 0.6rem 0; border-bottom: 1px solid var(--line);
}
.tjek li:last-child { border-bottom: 0; }
.tjek .hvad { font-weight: 600; }
.tjek .note { grid-column: 1 / -1; font-size: 0.875rem; color: var(--muted); }
.hoeretelefoner { display: flex; gap: 0.9rem; align-items: center; padding: 0.9rem 1rem; border-radius: 10px; background: var(--ink); color: var(--surface); }
.hoeretelefoner .tegn { font-size: 2rem; line-height: 1; }
.hoeretelefoner strong { display: block; font-family: var(--display); font-size: 1.125rem; }

/* ---------- Runes oversigt ---------- */
.side { max-width: 76rem; width: 100%; margin-inline: auto; padding: 2rem 1.5rem 4rem; display: flex; flex-direction: column; gap: 2rem; }
.noegletal { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.noegletal > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.noegletal .vaerdi { font-family: var(--display); font-size: 1.375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.afsnit { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.afsnit + .afsnit { margin-top: 0.75rem; }
.afsnit > summary { display: grid; grid-template-columns: 11rem minmax(0, 1fr) 1rem; gap: 1.25rem; align-items: center; padding: 1rem 1.25rem; cursor: pointer; list-style: none; }
.afsnit > summary::-webkit-details-marker { display: none; }
.afsnit > summary::after { content: "▸"; color: var(--muted); }
.afsnit[open] > summary::after { content: "▾"; }
.kaede { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.5rem; }
.led { position: relative; padding-top: 0.6rem; border-top: 4px solid var(--line); display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start; }
.led.ok { border-top-color: var(--ok); }
.led.igang { border-top: 4px dashed var(--accent); }
.led.bad { border-top: 4px double var(--bad); }
.led .hvor { font-size: 0.8125rem; font-weight: 600; }
.led .note { font-size: 0.8125rem; color: var(--muted); }
.spor { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.spor th, .spor td { text-align: left; padding: 0.5rem 0.75rem; border-top: 1px solid var(--line); vertical-align: middle; }
.spor th { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.rul { overflow-x: auto; padding: 0 0.5rem 0.75rem; }
.log li { display: grid; grid-template-columns: 8.5rem auto minmax(0, 1fr); gap: 0.75rem; align-items: baseline; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.log li:last-child { border-bottom: 0; }

/* ---------- Fejlsiden ---------- */
.tre { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.rude { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.sms { background: var(--surface-2); border-radius: 14px 14px 14px 4px; padding: 0.75rem 0.9rem; font-size: 0.9375rem; border: 1px solid var(--line); }
.minibrowser { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.minibrowser .linje { display: flex; gap: 0.4rem; align-items: center; padding: 0.45rem 0.75rem; background: var(--surface-2); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 0.75rem; color: var(--muted); }
.minibrowser .linje i { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--line); }
.minibrowser .indhold { padding: 2.5rem 1.5rem; display: grid; place-items: center; }
.telefon { width: 15rem; max-width: 100%; border: 3px solid var(--ink); border-radius: 26px; padding: 2.5rem 1rem; background: var(--bg); text-align: center; display: flex; flex-direction: column; gap: 0.6rem; }

@media (max-width: 1000px) {
  .noegletal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tre { grid-template-columns: minmax(0, 1fr); }
  .studie.vaert { grid-template-columns: minmax(0, 1fr) 20rem; }
  .studie.vaert .scene { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Oversigtssiden ---------- */
.oversigt { max-width: 46rem; margin-inline: auto; padding-block: 2.5rem 4rem; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 2rem; }
.oversigt .liste { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.oversigt .liste li { border-bottom: 1px solid var(--line); }
.oversigt .liste li:last-child { border-bottom: 0; }
.oversigt .liste a { display: grid; grid-template-columns: 2rem minmax(0, 1fr) auto; gap: 0.75rem; align-items: baseline; padding: 0.9rem 1.1rem; text-decoration: none; color: var(--ink); }
.oversigt .liste a:hover { background: var(--surface-2); }
.oversigt .liste .nr { font-family: var(--mono); color: var(--muted); }
.oversigt .liste .titel { font-weight: 600; display: block; }
.oversigt .liste .om { font-size: 0.875rem; color: var(--muted); display: block; }
.oversigt .liste .pil { color: var(--accent); }
.oversigt .punkter { display: flex; flex-direction: column; gap: 0.6rem; padding-left: 1.1rem; list-style: disc; }

/* ---------- Studiet, ny opbygning: topbjælke, scene der fylder, dok i bunden ---------- */
body.skaerm.fast { height: 100%; overflow: hidden; }
body.skaerm.fast .studie { overflow: hidden; position: relative; }
body.skaerm.fast .scene { grid-auto-rows: minmax(0, 1fr); align-content: stretch; padding: 0.25rem 1rem; }
body.skaerm.fast .scene .flise { aspect-ratio: auto; min-height: 6rem; border-radius: 14px; }
body.skaerm.fast .scene .flise .hoved { width: auto; height: 38%; max-height: 7rem; }
body.skaerm.fast .scene .flise .navn { background: none; font-size: 1rem; left: 0.9rem; bottom: 0.7rem; text-shadow: 0 1px 4px rgb(0 0 0 / 0.8); }
body.skaerm.fast .scene .flise .lyd { right: 0.9rem; bottom: 0.95rem; width: 22%; }
.top {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 1rem;
  padding: 0.6rem 1rem; background: var(--stage);
}
.top .venstre { display: flex; align-items: center; gap: 0.9rem; min-width: 0; }
.top .logo { font-family: var(--display); font-weight: 800; font-size: 1.0625rem; }
.top .rum { font-weight: 600; padding-left: 0.9rem; border-left: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .hoejre { display: flex; justify-content: flex-end; align-items: center; gap: 0.6rem; }
.optag {
  display: inline-flex; align-items: center; gap: 0.75rem; white-space: nowrap;
  padding: 0.5rem 1.25rem; border-radius: 999px; border: 2px solid transparent;
  font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: 0.06em;
}
.optag .afs { font-family: var(--body); font-weight: 600; font-size: 0.9375rem; letter-spacing: 0; }
.optag .tid { font-family: var(--mono); font-weight: 600; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.optag .lampe { width: 0.9rem; height: 0.9rem; border-radius: 50%; flex: none; }
.optag.rec { background: var(--rec); color: var(--rec-ink); }
.optag.rec .lampe { background: var(--rec-ink); animation: blink 1.4s ease-in-out infinite; }
.optag.fri { border: 2px dashed var(--muted); color: var(--muted); }
.optag.fri .lampe { border: 2px solid var(--muted); }
@media (prefers-reduced-motion: reduce) { .optag.rec .lampe { animation: none; } }
.pille {
  display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap;
  padding: 0.55rem 0.9rem; border-radius: 10px; background: var(--surface-2);
  font: inherit; font-weight: 600; font-size: 0.9375rem; color: var(--ink); border: 0; cursor: pointer;
}
.pille.ok { color: var(--ok); background: var(--ok-bg); }
.pille.warn { color: var(--warn); background: var(--warn-bg); }
.dok {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: 1rem;
  padding: 0.6rem 1rem 0.7rem; background: var(--stage);
}
.dok .gruppe { display: flex; align-items: flex-end; gap: 0.6rem; }
.dok .gruppe.hoejre { justify-content: flex-end; }
.knap {
  display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  font: inherit; font-size: 0.75rem; color: var(--muted); background: none; border: 0; padding: 0;
  cursor: pointer; text-decoration: none;
}
.knap .ik {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  height: 3rem; min-width: 3rem; padding: 0 0.8rem; border-radius: 12px;
  background: var(--surface-2); color: var(--ink); font-size: 1rem; font-weight: 600;
}
.knap svg { width: 1.4rem; height: 1.4rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.knap.rec .ik { background: var(--rec); color: var(--rec-ink); padding: 0 1.25rem; }
.knap.stop .ik { outline: 2px solid var(--rec); outline-offset: -2px; padding: 0 1.25rem; }
.knap.stop .ikon-stop { background: var(--rec); }
.knap .ikon-rec { width: 0.9rem; height: 0.9rem; border-radius: 50%; background: currentColor; }
.knap .ikon-stop { width: 0.9rem; height: 0.9rem; border-radius: 3px; }
.knap.forlad .ik { background: var(--bad-bg); color: var(--bad); }
.knap.aktiv .ik { outline: 2px solid var(--accent); outline-offset: -2px; }
.dok .egen-lyd { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.75rem; color: var(--muted); padding-bottom: 0.1rem; }
.dok .egen-lyd .meter { width: 10rem; height: 12px; border-radius: 6px; }
.varsel { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); width: min(38rem, calc(100% - 2rem)); z-index: 4; }
.studie.vaert .panel { border-left: 0; border-radius: 14px; margin: 0.25rem 1rem 0.25rem 0; }

/* Sporliste i Runes oversigt */
.sporliste { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 1.25rem 1.25rem; }
.sporliste li {
  display: grid; grid-template-columns: 3rem minmax(0, 1.4fr) minmax(0, 1fr) auto auto auto; align-items: center; gap: 1rem;
  padding: 0.6rem 1rem 0.6rem 0.6rem; border-radius: 12px; background: var(--surface-2);
}
.sporliste .billede {
  width: 3rem; height: 3rem; border-radius: 8px; display: grid; place-items: center;
  background: hsl(var(--h, 225) 30% 34%); color: var(--tile-ink); font-family: var(--display); font-weight: 700;
}
.sporliste .navn { font-weight: 600; font-size: 1.0625rem; display: block; }
.sporliste .hent {
  display: inline-flex; align-items: center; gap: 0.4rem; font: inherit; font-weight: 600; color: var(--ink);
  background: none; border: 0; cursor: pointer; padding: 0.4rem 0.5rem; border-radius: 8px;
}
.sporliste .hent::before { content: "↓"; }
.sporliste .hent[disabled] { color: var(--muted); cursor: not-allowed; text-decoration: line-through; }

/* ---------- Runde 4: studie og lobby i neutral sort, samme opbygning som forlægget ---------- */
:root { --rec-soft: #4a2022; --rec-text: #ff6369; }
.logo, .r-logo { font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; font-size: 1.0625rem; display: inline-flex; align-items: center; gap: 0.6rem; white-space: nowrap; }
.logo, .r-logo, .topbar .logo { font-size: 0; letter-spacing: 0; gap: 0; }
.sporliste .st { justify-self: start; }
.logo::before, .r-logo::before { content: ""; width: 1.75rem; height: 1.75rem; background: url(logo.png) center / contain no-repeat; }
.kortlogo { width: 3.5rem; height: 3.5rem; object-fit: contain; }
.logo-over { width: 100%; max-width: 34rem; display: flex; flex-direction: column; align-items: center; gap: 1.75rem; }
.r-app { background: var(--bg); }
.r-app svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.r-app svg.fyldt { fill: currentColor; stroke: none; }
.r-top { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; min-height: 4.75rem; }
.r-rum { padding-left: 1rem; border-left: 1px solid var(--line); font-weight: 600; font-size: 1.0625rem; white-space: nowrap; }
.r-rum.enkel { border-left: 0; padding-left: 0.5rem; font-weight: 500; }
.r-rec { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.6rem 1.1rem; border-radius: 10px; background: var(--rec); color: #ffffff; font-weight: 700; font-size: 1.0625rem; letter-spacing: 0.03em; white-space: nowrap; }
.r-rec::before { content: ""; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: currentColor; animation: blink 1.4s ease-in-out infinite; }
.r-rec.fri::before { animation: none; }
@media (prefers-reduced-motion: reduce) { .r-rec::before { animation: none; } }
.r-rec.fri { background: var(--surface-2); color: var(--muted); }
.r-rec.fri::before { background: none; border: 2px solid currentColor; }
.r-top .sp { margin-left: auto; }
.r-pille { display: inline-flex; align-items: center; gap: 0.6rem; height: 3.25rem; padding: 0 1.15rem; border-radius: 12px; border: 0; background: var(--surface-2); color: var(--ink); font: inherit; font-weight: 600; font-size: 1.0625rem; white-space: nowrap; cursor: pointer; }
.r-pille.warn { background: var(--warn-bg); color: var(--warn); }
.r-avatar { width: 3rem; height: 3.25rem; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; }

.r-body { flex: 1; min-height: 0; display: flex; gap: 0.75rem; padding: 0 0.75rem; }
.r-scene { flex: 1; min-width: 0; min-height: 0; position: relative; container-type: size; display: grid; place-content: center; }
.r-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; width: min(100cqw, calc((100cqh - 0.75rem) * 8 / 3 + 1.5rem)); }
.r-flise { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--tile); overflow: hidden; display: grid; place-items: center; }
.r-flise .bogstav, .r-preview .bogstav { font-size: 2rem; font-weight: 700; color: var(--muted); }
.r-flise .navn { position: absolute; left: 1.1rem; bottom: 0.9rem; font-size: 1.125rem; font-weight: 500; }
.r-flise .maerke { position: absolute; right: 0.9rem; bottom: 0.85rem; }
.r-flise img, .r-preview img, .r-person .mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.r-flise::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgb(0 0 0 / 0.55)); pointer-events: none; }
.r-flise .navn, .r-flise .r-bars, .r-flise .maerke { z-index: 1; }
.r-person .mini { position: relative; overflow: hidden; }
.r-bars { position: absolute; right: 1.1rem; bottom: 1rem; display: flex; align-items: center; gap: 3px; height: 1.1rem; }
.r-bars i { width: 3px; border-radius: 2px; background: var(--ink); height: 45%; }
.r-bars i:nth-child(2) { height: 100%; }
.r-scene .varsel { bottom: 1rem; box-shadow: 0 20px 60px rgb(0 0 0 / 0.6); }
.besked, .besked.warn, .besked.bad, .besked.ok { background: var(--surface); border: 0; border-radius: 14px; padding: 1.1rem 1.25rem; gap: 1rem; align-items: center; color: var(--muted); }
.r-panel .besked, .r-udstyr .besked, .kort .besked, .rude .besked { background: var(--surface-2); }
.besked strong { color: var(--ink); font-size: 1.125rem; font-weight: 700; }
.besked .tegn { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; font-size: 1.125rem; font-weight: 800; line-height: 1; background: var(--surface-2); color: var(--ink); border: 2px solid var(--ink); }
.besked.warn .tegn { background: var(--warn); color: var(--bg); border: 0; clip-path: polygon(50% 4%, 100% 96%, 0 96%); border-radius: 0; padding-top: 0.45rem; }
.besked.bad .tegn { background: var(--bad); color: var(--bg); border: 0; border-radius: 8px; }
.besked.ok .tegn { background: var(--ok); color: var(--bg); border: 0; }
.r-start { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5; width: min(30rem, calc(100% - 2rem)); display: flex; align-items: center; gap: 1.1rem; padding: 1.5rem 1.75rem; border-radius: 16px; background: var(--surface); border: 2px solid var(--rec); box-shadow: 0 20px 60px rgb(0 0 0 / 0.6); color: var(--muted); }
.r-vent { place-content: center; gap: 1.75rem; }
.r-venttekst { text-align: center; display: flex; flex-direction: column; gap: 0.5rem; color: var(--muted); font-size: 1.0625rem; }
.r-venttekst h1 { font-size: 2rem; font-weight: 800; color: var(--ink); }
.r-ventgrid { display: flex; justify-content: center; gap: 0.75rem; width: min(100cqw, 64rem); }
.r-ventgrid .r-flise { flex: 0 1 20.75rem; }
.r-start.ind { border-color: var(--ok); animation: none; }
.r-start .flueben { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ok); color: var(--bg); display: grid; place-items: center; font-weight: 800; }
.r-venter { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.9rem; border-radius: 14px; border: 2px solid var(--ink); }
.r-lukind.afvis { background: none; color: var(--muted); padding: 0 0.5rem; text-decoration: underline; }
.r-start.afvist { border-color: var(--bad); animation: none; }
.r-start .kryds { flex: none; width: 2rem; height: 2rem; border-radius: 6px; background: var(--bad); color: var(--bg); display: grid; place-items: center; font-weight: 800; }
.sporliste li { grid-template-columns: 3rem minmax(0, 1.4fr) minmax(0, 1fr) auto; }
.r-ventende { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto auto; align-items: center; gap: 0.9rem; }
.r-ventende .mini { position: relative; overflow: hidden; height: 3.25rem; border-radius: 8px; background: var(--line); display: grid; place-items: center; font-weight: 700; }
.r-ventende .mini img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.r-ventende .navn { font-weight: 600; font-size: 1.0625rem; }
.r-lukind { height: 2.5rem; padding: 0 1rem; border-radius: 10px; border: 0; background: var(--ink); color: var(--bg); font: inherit; font-weight: 700; cursor: pointer; }
.r-lukind.alle { background: var(--surface-2); color: var(--ink); }
.r-knap .ik { position: relative; }
.prikmaerke { position: absolute; top: -0.4rem; right: -0.4rem; min-width: 1.4rem; height: 1.4rem; border-radius: 0.7rem; background: var(--rec); color: #ffffff; font-size: 0.8125rem; font-weight: 700; display: grid; place-items: center; }
.r-start strong { display: block; font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.r-start .lampe { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--rec); flex: none; animation: blink 1.4s ease-in-out infinite; }
.r-start { animation: start-boks 5s ease both; }
@keyframes start-boks { 0% { opacity: 0; } 6%, 88% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) {
  .r-start .lampe { animation: none; }
  .r-start { animation: start-boks-rolig 5s step-end both; }
}
@keyframes start-boks-rolig { 0% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }

.r-panel { width: 26rem; flex: none; background: var(--surface); border-radius: 16px; display: flex; flex-direction: column; gap: 1.1rem; padding: 1.25rem; overflow-y: auto; }
.r-panel header { display: flex; align-items: center; justify-content: space-between; }
.r-panel h2 { font-size: 1.25rem; }
.r-panel .luk { width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; }
.r-invit { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 1.1rem; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 0.875rem; cursor: pointer; }
.antal { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; margin-left: 0.4rem; border-radius: 6px; background: var(--surface-2); font-size: 0.8125rem; }
.r-raekke { display: flex; align-items: center; justify-content: space-between; }
.r-personer { display: flex; flex-direction: column; gap: 0.6rem; }
.r-person { background: var(--surface-2); border-radius: 12px; }
.r-person summary { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr) auto 1.25rem; align-items: center; gap: 0.9rem; padding: 0.6rem 0.9rem 0.6rem 0.6rem; cursor: pointer; list-style: none; }
.r-person summary::-webkit-details-marker { display: none; }
.r-person summary::after { content: ""; width: 0.5rem; height: 0.5rem; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); justify-self: center; margin-top: -0.3rem; }
.r-person[open] summary::after { transform: rotate(-135deg); margin-top: 0.3rem; }
.r-person .mini { height: 3.25rem; border-radius: 8px; background: var(--line); display: grid; place-items: center; font-weight: 700; }
.r-person .hvem { display: flex; flex-direction: column; min-width: 0; }
.r-person .navn { font-weight: 600; font-size: 1.0625rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-person .under { font-size: 0.875rem; color: var(--muted); }
.r-person .tal { padding: 0.25rem 1rem 0.9rem; }

.r-dok { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 1rem; padding: 0.9rem 1.5rem 1rem; }
.r-dok .gruppe { display: flex; gap: 0.75rem; }
.r-dok .gruppe.hoejre { justify-content: flex-end; }
.r-knap { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; padding: 0; border: 0; background: none; font: inherit; font-size: 0.8125rem; color: var(--muted); cursor: pointer; text-decoration: none; }
.r-knap .ik { display: flex; align-items: center; justify-content: center; gap: 0.7rem; height: 3.5rem; min-width: 3.5rem; padding: 0 1rem; border-radius: 14px; background: var(--surface-2); color: var(--ink); font-size: 1.0625rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.r-knap.aktiv .ik { background: var(--line); }
.r-knap.forlad .ik { background: var(--rec-soft); color: var(--rec-text); }
.r-knap.optag .ik { min-width: 8rem; }
.r-knap.optag.start .ik { background: var(--rec); color: #ffffff; }
.r-knap .firkant { width: 1.1rem; height: 1.1rem; border-radius: 4px; background: var(--rec); }
.r-knap .prik { width: 1rem; height: 1rem; border-radius: 50%; background: #ffffff; }
.r-knap .ring { width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--muted); }
div.r-knap { cursor: default; }

.r-lobby { flex: 1; display: grid; grid-template-columns: minmax(0, 59rem) 26.25rem; gap: 2rem; justify-content: center; align-items: center; padding: 1rem 2rem 5rem; }
.r-preview { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; background: var(--tile); display: grid; place-items: center; overflow: hidden; }
.r-preview .maerke { position: absolute; left: 1rem; top: 1rem; display: flex; flex-direction: column; padding: 0.55rem 0.75rem; border-radius: 8px; background: rgb(0 0 0 / 0.6); font-size: 0.875rem; font-weight: 600; }
.r-preview .skift { position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%); display: flex; gap: 1rem; }
.r-preview .skift button { width: 3rem; height: 3rem; border-radius: 10px; border: 0; background: rgb(60 60 60 / 0.85); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.r-modal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 1.5rem; background: rgb(0 0 0 / 0.65); }
.r-dialog { width: min(34rem, 100%); display: flex; flex-direction: column; gap: 1rem; padding: 2rem; border-radius: 18px; background: var(--surface); color: var(--muted); box-shadow: 0 30px 80px rgb(0 0 0 / 0.6); }
.r-dialog h2 { font-size: 1.625rem; font-weight: 800; color: var(--ink); }
.r-hvorfor { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.15rem; border-radius: 12px; background: var(--surface-2); }
.r-hvorfor strong, .r-hvorfor .vigtigt { color: var(--ink); font-weight: 700; }
/* Fejl er røde med hvid skrift. Mærker, der arbejder, drejer rundt. */
.st.bad { background: var(--rec); color: #ffffff; }
.st.bad::before { background: #ffffff; color: var(--rec); }
.r-udstyr .r-felt.fejl { background: var(--rec); color: #ffffff; outline: 0; }
.r-udstyr .r-felt.fejl .pil { color: #ffffff; }
.st.vent::before { content: ""; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: drej 0.9s linear infinite; }
@keyframes drej { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .st.vent::before { animation-duration: 4s; } }
.r-prim .hjul { width: 1.1rem; height: 1.1rem; margin-right: 0.6rem; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: drej 0.9s linear infinite; }
.r-gul { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.15rem; border-radius: 12px; background: #f5c542; color: #1f1a05; }
.r-gul strong { display: block; font-size: 1.125rem; font-weight: 800; }
.r-app .r-gul svg { width: 2rem; height: 2rem; stroke-width: 2; }
.r-prim.anden { background: var(--surface-2); color: var(--ink); }
.r-ind { display: flex; flex-direction: column; gap: 0.6rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.r-ind h3 { display: flex; align-items: center; gap: 0.6rem; font-size: 1.0625rem; }
.r-panel .r-felt, .r-panel .r-test { background: var(--surface-2); }
.r-kontakt { display: flex; align-items: center; gap: 1rem; font-size: 0.875rem; color: var(--muted); cursor: pointer; }
.r-kontakt > span:first-child { flex: 1; }
.r-kontakt strong { display: block; font-size: 1rem; color: var(--ink); }
.r-kontakt .knop { flex: none; width: 3rem; height: 1.75rem; border-radius: 1rem; background: var(--line); position: relative; }
.r-kontakt .knop::after { content: ""; position: absolute; top: 0.2rem; left: 0.2rem; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--ink); }
.r-kontakt .knop.til { background: #4cd964; }
.r-kontakt .knop.til::after { left: auto; right: 0.2rem; background: #ffffff; }
.r-styrke { display: flex; align-items: center; gap: 1rem; color: var(--muted); }
.r-styrke .r-niveau { flex: 1; height: 6px; overflow: visible; position: relative; }
.r-styrke .r-niveau i { background: var(--ink); }
.r-styrke .r-niveau::after { content: ""; position: absolute; left: 70%; top: 50%; width: 1rem; height: 1rem; border-radius: 50%; background: var(--ink); transform: translate(-50%, -50%); }
.r-dialog .r-felt.valg { background: var(--surface-2); }
.r-knap.muted { color: var(--ink); font-weight: 600; }
.r-knap.muted .ik { background: var(--rec); color: #ffffff; }
.r-infolink { display: none; align-items: center; gap: 0.7rem; padding: 0.85rem 1rem; border-radius: 12px; border: 0; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.r-infolink .tegn { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 0.875rem; font-weight: 700; }
.r-venstre { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.r-privat { display: flex; gap: 0.9rem; align-items: flex-start; padding: 1rem 1.15rem; border-radius: 12px; background: var(--surface); color: var(--muted); }
.r-privat .tegn { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid var(--ink); color: var(--ink); display: grid; place-items: center; font-weight: 700; font-size: 0.875rem; }
.r-privat strong { display: block; margin-top: 0.35rem; color: var(--ink); }
.r-udstyr { display: flex; flex-direction: column; gap: 0.75rem; }
.r-udstyr h1 { font-size: 1.625rem; font-weight: 800; text-align: center; margin-bottom: 0.75rem; }
.r-felt { display: flex; align-items: center; gap: 0.9rem; flex: none; height: 3.25rem; padding: 0 1.1rem; border-radius: 12px; background: var(--surface); font-size: 1.0625rem; min-width: 0; }
.r-linje { display: flex; align-items: center; gap: 0.6rem; }
.r-linje .r-felt { flex: 1; }
.r-felt .hvad { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-felt .pil { display: grid; color: var(--ink); }
.r-felt .pil svg { width: 1.25rem; height: 1.25rem; }
.r-felt input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; color: var(--ink); font: inherit; }
.r-felt .rolle { font-size: 0.875rem; font-weight: 700; }
.r-felt.fejl { color: var(--bad); outline: 2px solid var(--bad); outline-offset: -2px; }
.r-test { height: 3.25rem; padding: 0 1.15rem; border-radius: 12px; border: 0; background: var(--surface); color: var(--ink); font: inherit; font-size: 1.0625rem; font-weight: 700; cursor: pointer; }
.r-test[disabled] { color: var(--muted); cursor: not-allowed; }
.r-test.valgt { background: var(--ink); color: var(--bg); }
.r-niveau { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.r-niveau i { display: block; height: 100%; width: var(--v, 0%); background: #4cd964; border-radius: 2px; }
.r-spoerg { flex: 1; display: flex; align-items: center; gap: 0.9rem; padding-left: 1.1rem; font-size: 1.0625rem; }
.r-prim { display: flex; align-items: center; justify-content: center; height: 3.25rem; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 1.0625rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.r-prim[disabled] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.r-note { display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; font-size: 0.875rem; color: var(--muted); padding: 0 0.25rem; }
.r-smaatjek { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; padding-top: 0.25rem; }
@media (max-width: 1100px) { .r-panel { width: 21rem; } .r-lobby { grid-template-columns: minmax(0, 1fr) 22rem; } }

/* ---------- Runde 5: navngivne tilstande, kant under optagelse, bekræftelser ---------- */
body:has(#st-faerdig:checked) [data-v]:not([data-v~="faerdig"]),
body:has(#st-faldet:checked) [data-v]:not([data-v~="faldet"]),
body:has(#st-forlad:checked) [data-v]:not([data-v~="forlad"]),
body:has(#st-hforlad:checked) [data-v]:not([data-v~="hforlad"]),
body:has(#st-igen:checked) [data-v]:not([data-v~="igen"]),
body:has(#st-ind:checked) [data-v]:not([data-v~="ind"]),
body:has(#st-kam:checked) [data-v]:not([data-v~="kam"]),
body:has(#st-kanikke:checked) [data-v]:not([data-v~="kanikke"]),
body:has(#st-klar:checked) [data-v]:not([data-v~="klar"]),
body:has(#st-lobby:checked) [data-v]:not([data-v~="lobby"]),
body:has(#st-lyd:checked) [data-v]:not([data-v~="lyd"]),
body:has(#st-lydfejl:checked) [data-v]:not([data-v~="lydfejl"]),
body:has(#st-mellem:checked) [data-v]:not([data-v~="mellem"]),
body:has(#st-mute:checked) [data-v]:not([data-v~="mute"]),
body:has(#st-net:checked) [data-v]:not([data-v~="net"]),
body:has(#st-pause:checked) [data-v]:not([data-v~="pause"]),
body:has(#st-rec:checked) [data-v]:not([data-v~="rec"]),
body:has(#st-sender:checked) [data-v]:not([data-v~="sender"]),
body:has(#st-slut:checked) [data-v]:not([data-v~="slut"]),
body:has(#st-start:checked) [data-v]:not([data-v~="start"]),
body:has(#st-stop:checked) [data-v]:not([data-v~="stop"]),
body:has(#st-tom:checked) [data-v]:not([data-v~="tom"]),
body:has(#st-upl:checked) [data-v]:not([data-v~="upl"]),
body:has(#st-venter:checked) [data-v]:not([data-v~="venter"]) { display: none !important; }
.r-kant { position: absolute; inset: 0; z-index: 15; border: 4px solid var(--rec); pointer-events: none; }
.r-slor { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgb(20 20 20 / 0.78); font-weight: 600; color: var(--ink); }
.r-sort { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; background: #000000; color: var(--muted); font-weight: 600; }
.r-flise .r-sort ~ .navn { z-index: 2; }
.r-prim.farlig { background: var(--rec); color: #ffffff; }
.r-start.kort { border-color: var(--ok); animation: start-boks 2s ease both; }
.r-knap.optag.kanikke { cursor: not-allowed; }
.r-knap.optag.kanikke .ik { color: var(--muted); }
.r-midt { flex: 1; display: grid; place-items: center; padding: 1rem 1.5rem 4rem; }
.r-dialog.bred { width: min(40rem, 100%); }
.r-dialog.flad { box-shadow: none; text-align: center; align-items: stretch; }
.r-dialog.flad .kortlogo { align-self: center; }
.r-groen { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.15rem; border-radius: 12px; background: #4cd964; color: #06250f; }
.r-groen strong { display: block; font-size: 1.125rem; font-weight: 800; }
.udraab { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 1.25rem; background: rgb(0 0 0 / 0.18); }
.r-linjer { display: flex; flex-direction: column; gap: 1.1rem; padding: 1.1rem 1.15rem; border-radius: 12px; background: var(--surface-2); color: var(--ink); }
.minibrowser .indhold { padding: 1.5rem; }
.besked.bad .tegn { background: var(--rec); color: #ffffff; }
.r-panel .r-prim { flex: none; }
.besked.bad .tegn { background: var(--rec); color: #ffffff; }
.r-panel .r-prim { flex: none; }
[hidden] { display: none !important; }
.r-styrke input { flex: 1; min-width: 0; accent-color: #ffffff; }
/* Prototype */
body.proto .skitse { display: none; }
.sim { position: fixed; left: 0.75rem; bottom: 0.75rem; z-index: 60; width: 15.5rem; padding: 0.6rem; border-radius: 12px; border: 1px dashed var(--muted); background: var(--bg); font-size: 0.8125rem; }
.sim summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 0.15rem 0.25rem; }
.sim .kort { display: none; }
.sim[open] summary { margin-bottom: 0.35rem; }
.sim button { display: block; width: 100%; text-align: left; margin-bottom: 0.3rem; padding: 0.45rem 0.6rem; border-radius: 8px; border: 0; background: var(--surface-2); color: var(--ink); font: inherit; cursor: pointer; }
.sim a { display: block; padding: 0.3rem 0.25rem 0; color: var(--muted); }
.r-valg { width: min(34rem, 100%); display: flex; flex-direction: column; gap: 0.9rem; color: var(--muted); }
.r-valg h1 { color: var(--ink); font-size: 2rem; font-weight: 800; }
.r-valg .kortlogo { align-self: flex-start; }
.r-valgkort { display: flex; flex-direction: column; gap: 0.2rem; padding: 1.1rem 1.25rem; border-radius: 14px; background: var(--surface); color: var(--muted); text-decoration: none; }
.r-valgkort:hover { background: var(--surface-2); }
.r-valgkort strong { color: var(--ink); font-size: 1.1875rem; }
.protoknap { display: flex; flex-direction: column; gap: 0.2rem; padding: 1.1rem 1.25rem; border-radius: 14px; background: var(--ink); color: var(--bg); text-decoration: none; }
.protoknap strong { font-size: 1.1875rem; }
.r-toast { position: fixed; left: 50%; top: 5.5rem; transform: translate(-50%, -0.5rem); z-index: 70; padding: 0.7rem 1.1rem; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: calc(100% - 2rem); text-align: center; }
.r-toast.vis { opacity: 1; transform: translate(-50%, 0); }
.r-menu { position: fixed; z-index: 80; display: flex; flex-direction: column; padding: 0.35rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 16px 40px rgb(0 0 0 / 0.55); }
.r-menu button { text-align: left; padding: 0.65rem 0.8rem; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; cursor: pointer; }
.r-menu button:hover { background: var(--line); }
.r-menu button.valgt::after { content: " ✓"; }
a.r-prim.laast { background: var(--surface-2); color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .r-toast { transition: none; } }
/* Telefon: samme skærme i én kolonne. Erstatter beskeden om, at studiet kræver en computer. */
@media (max-width: 760px) {
  .app { display: flex !important; }
  .kun-computer { display: none !important; }
  body.skaerm.fast { height: 100dvh; }
  .skitse nav { margin-left: 0; }
  .r-top { flex: none; padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1rem 1rem; gap: 0.6rem; min-height: 0; }
  .r-top .r-logo::before { width: 2rem; height: 2rem; }
  .r-rum.enkel { font-size: 1.0625rem; padding-left: 0.25rem; }
  .r-top .r-rum:not(.enkel), .r-top .r-avatar, .r-top button.r-pille { display: none; }
  .r-rec { font-size: 0.8125rem; padding: 0.45rem 0.7rem; }
  .r-pille { height: 2.25rem; padding: 0 0.7rem; font-size: 0.8125rem; border-radius: 10px; }
  .r-body { flex-direction: column; padding: 0 0.5rem; gap: 0.5rem; }
  .r-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; width: min(100cqw, calc((100cqh - 1rem) * 32 / 27 + 0.5rem)); }
  .r-flise { border-radius: 10px; }
  .r-flise .navn { left: 0.6rem; bottom: 0.5rem; font-size: 0.875rem; }
  .r-bars { right: 0.6rem; bottom: 0.6rem; height: 0.9rem; }
  .r-flise .maerke { right: 0.4rem; bottom: 0.4rem; font-size: 0.6875rem; }
  .r-slor, .r-sort { font-size: 0.8125rem; text-align: center; padding: 0.25rem; }
  .r-panel { width: auto; flex: 0 0 46%; border-radius: 14px; padding: 0.9rem; gap: 0.8rem; }
  .r-person summary { grid-template-columns: 3.5rem minmax(0, 1fr) auto 1rem; gap: 0.6rem; }
  .r-person .mini { height: 2.5rem; }
  .r-ventende { grid-template-columns: 3.5rem minmax(0, 1fr) auto auto; gap: 0.5rem; }
  .r-ventende .mini { height: 2.5rem; }
  .r-dok { display: flex; justify-content: center; gap: 0.4rem; padding: 0.5rem 0.5rem 0.6rem; }
  .r-dok .gruppe { gap: 0.4rem; }
  .r-dok .gruppe:empty { display: none; }
  .r-knap { font-size: 0.6875rem; max-width: 5.5rem; text-align: center; line-height: 1.15; }
  .r-knap .ik { height: 3rem; min-width: 3rem; padding: 0 0.6rem; border-radius: 12px; font-size: 0.875rem; gap: 0.4rem; }
  .r-knap.optag { max-width: none; }
  .r-knap.optag .ik { min-width: 5.25rem; padding: 0 0.7rem; }
  .r-start { width: calc(100% - 1.5rem); padding: 1rem 1.1rem; gap: 0.8rem; }
  .r-start strong { font-size: 1.1875rem; }
  .varsel { width: calc(100% - 1rem); }
  .r-modal { padding: 0.75rem; align-items: center; }
  .r-dialog { padding: 1.25rem; gap: 0.8rem; max-height: 100%; overflow-y: auto; }
  .r-dialog h2 { font-size: 1.3125rem; }
  .r-lobby { grid-template-columns: minmax(0, 1fr); padding: 0.5rem 1rem 2rem; gap: 1.25rem; align-items: start; }
  .r-udstyr h1 { font-size: 1.375rem; margin-bottom: 0.25rem; }
  .r-spoerg { padding-left: 0.25rem; gap: 0.6rem; font-size: 1rem; }
  .r-venttekst h1 { font-size: 1.375rem; }
  .r-venttekst { padding: 0 0.5rem; font-size: 0.9375rem; }
  .r-ventgrid { gap: 0.5rem; }
  .r-midt, .midte { padding: 1rem 1rem 3rem; }
  .kort { padding: 1.25rem; }
  .r-valg h1, h1 { font-size: 1.5rem; }
  .side { padding: 1.25rem 1rem 3rem; gap: 1.5rem; }
  .noegletal { grid-template-columns: minmax(0, 1fr); }
  .afsnit > summary { grid-template-columns: minmax(0, 1fr) 1rem; }
  .afsnit > summary .kaede { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 0.5rem; }
  .sporliste { padding: 0 0.75rem 0.75rem; }
  .sporliste li { grid-template-columns: 3rem minmax(0, 1fr); gap: 0.4rem 0.75rem; }
  .sporliste li > :nth-child(n+3) { grid-column: 2; }
  .log li { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
  .log li .st { justify-self: start; }
  .topbar { flex: none; padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1rem 1rem; }
  .topbar > span:not(.logo):not(.hvem) { display: none; }
  .sim { left: auto; right: 0.5rem; bottom: 0.5rem; width: auto; max-width: 15rem; max-height: 60dvh; overflow-y: auto; padding: 0.35rem 0.5rem; font-size: 0.75rem; opacity: 0.92; }
  .sim:not([open]) .lang { display: none; }
  .sim:not([open]) .kort { display: inline; }
  body.fast .sim { bottom: 6.25rem; }
  .r-privat { display: none; }
  .r-infolink { display: flex; }
  .r-lobby { padding-top: 0; gap: 0.9rem; }
  .r-venstre { gap: 0.6rem; }
  .r-preview { aspect-ratio: 2 / 1; }
  .r-preview .maerke { left: 0.6rem; top: 0.6rem; font-size: 0.75rem; padding: 0.4rem 0.6rem; }
  .r-udstyr { gap: 0.6rem; }
  .r-udstyr h1 { text-align: left; }
  .r-kant { border-width: 3px; }
}
