/* =============================================================================
   style.css — Agenda tool (live group work management)
   Color space: oklch · Theme: light-dark() · Layout: logical properties
   ============================================================================= */

/* Delte tokens (type-skala, spacing, radius, farvepalet, --bg) kommer fra rolig.css */
:root {
  /* Agenda uses teal as accent (poll uses green) */
  --accent:        var(--teal);
  /* --teal-hover/-subtle fandtes kun i den gamle tokens.css (ikke længere linket),
     så de var udefinerede og 12 elementer mistede deres svage teal-baggrund.
     Defineres nu afledt af --teal — samme mønster som rolig.css bruger for --accent-*. */
  --teal-hover:    oklch(from var(--teal) calc(l - 0.05) c h);
  --teal-subtle:   oklch(from var(--teal) l c h / 12%);
  --accent-hover:  var(--teal-hover);
  --accent-subtle: var(--teal-subtle);

  /* Semantic surfaces */
  --card: light-dark(oklch(1 0 0), oklch(0.18 0.02 260));
  --input-bg: light-dark(oklch(0.96 0.005 240), oklch(0.22 0.02 260));
  --text: light-dark(oklch(0.15 0.02 260), oklch(0.93 0.01 80));
  --text-muted: light-dark(oklch(0.45 0.02 260), oklch(0.65 0.02 240));
  --border: light-dark(oklch(0 0 0 / 8%), oklch(1 0 0 / 10%));
  --muted: light-dark(oklch(0.55 0.01 260), oklch(0.55 0.01 240));

  /* Shadows in tokens.css */
}


/* =============================================================================
   BASE (reset + body-fundament er i /tokens.css)
   ============================================================================= */

body {
  min-block-size: 100dvh;
}

/* All <dialog> elements are centered in viewport by default */
dialog {
  margin: auto;
}

::selection {
  background: oklch(0.7 0.14 180 / 25%);
}


/* =============================================================================
   INDEX PAGE — Join + Create
   Shared styles (.page, .page-header, .join-section, .code-digit, etc.)
   are in /components.css. Only tool-specific overrides below.
   ============================================================================= */

/* Create section */
.create-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  font-size: var(--step--1);

  & .text-input {
    font-size: var(--step--1);
    padding: var(--space-xs) var(--space-s);
  }

  & .toggle-label {
    font-size: var(--step--1);
  }

  & .form-card-label {
    font-size: var(--step--1);
  }
}

/* Onboarding stepper (matches poll) */
.onboarding-hint {
  display: flex;
  align-items: center;
  gap: var(--space-m);
  padding: var(--space-xs) var(--space-m);
  background: var(--teal-subtle);
  border: 1.5px dashed oklch(0.7 0.14 180 / 30%);
  border-radius: var(--radius-m);
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--muted);
}

.onboarding-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal);
  color: oklch(1 0 0);
  font-size: var(--step--1);
  font-weight: 700;
  flex-shrink: 0;
}

/* Form cards (sections with label) */
.form-card {
  background: var(--card);
  border-radius: var(--radius-l);
  padding: var(--space-m);
  box-shadow: var(--shadow-s);
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.form-card-label {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: var(--space-s);
}

.total-time-badge {
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  background: var(--teal-subtle);
  color: var(--teal);
  padding: 0.15em 0.5em;
  border-radius: var(--radius-full);
}

.text-input-large {
  font-size: var(--step-0) !important;
  font-weight: 600;
}

/* CTA row */
.cta-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  align-items: stretch;

  & .btn-muted {
    text-align: center;
    justify-content: center;
  }
}

/* Import (collapsed details) */
.import-details {
  border-radius: var(--radius-m);
}

.import-summary {
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  padding: var(--space-s) 0;
  text-align: center;
  list-style: none;

  &::marker, &::-webkit-details-marker { display: none; }

  &:hover { color: var(--teal); }
}

.import-box {
  background: var(--teal-subtle);
  border: 1.5px dashed oklch(0.7 0.14 180 / 30%);
  border-radius: var(--radius-l);
  padding: var(--space-m);
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  margin-block-start: var(--space-s);
}

.import-textarea {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: var(--step--1);
}

.field-row { display: flex; gap: var(--space-m); flex-wrap: wrap; }
.field-row-2 > .field { flex: 1; min-inline-size: 10rem; }
.field { display: flex; flex-direction: column; gap: var(--space-2xs); flex: 1; }
.field-inline {
  flex-direction: row;
  align-items: center;
  gap: var(--space-s);
  flex: 0 0 auto;

  & .text-input {
    inline-size: 2.8rem;
    padding-inline: 0.3em;
    text-align: center;
    font-weight: 600;
  }
  & .group-name-label-input {
    inline-size: 8rem;
    text-align: start;
    font-weight: 400;
    padding-inline: var(--space-s);
    font-size: var(--step--1);
  }
  & .field-hint { margin-block-start: 0; }
}
.field-label { font-size: var(--step--1); font-weight: 600; color: var(--text-muted); }

/* Toggle-row + toggle-switch — now in components.css */

/* Step builder */
.step-list { display: flex; flex-direction: column; gap: var(--space-xs); }

.step-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--space-s) var(--space-m);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.step-header {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto auto;
  align-items: center;
  gap: var(--space-xs);
  position: relative; /* for drag handle positioning */
}

@media (max-width: 480px) {
  .step-header {
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
  }

  .step-drag-handle { display: none; }

  .step-heading {
    grid-column: 2 / -1;
  }

  .step-duration-wrap {
    grid-column: 1 / 2;
    grid-row: 2;
  }

  .step-type {
    grid-row: 2;
  }

  .step-remove {
    grid-row: 2;
  }
}

/* Handle: position absolute so it's outside the grid, flush at card's left edge */
.step-drag-handle {
  position: absolute;
  inset-block: 0;
  inset-inline-start: calc(-1 * var(--space-m) + var(--space-2xs));
  display: flex;
  align-items: center;
  color: var(--text-muted);
  opacity: 0.35;
  font-size: var(--step-0);
  line-height: 1;
  cursor: grab;
  padding-inline: var(--space-2xs);
  transition: opacity 0.15s;

  .step-card:hover & { opacity: 0.65; }
}

.step-nr {
  background: var(--teal);
  color: oklch(1 0 0);
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--step--1);
  flex-shrink: 0;
}

.step-card.dragging { opacity: 0.4; }

/* Accordion */
.step-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.step-card.collapsed .step-body { display: none; }

/* Trin toggle-row — always visible under header (not inside collapsible body) */
.step-header-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
  padding-block: var(--space-2xs);
  padding-inline: var(--space-xs);
}

.step-header-toggle {
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-s);
  transition: background 0.15s;
  margin: calc(-1 * var(--space-2xs));
  padding: var(--space-2xs);

  &:hover { background: light-dark(oklch(0 0 0 / 4%), oklch(1 0 0 / 5%)); }
}

.step-card.collapsed .step-header-toggle {
  margin-block-end: 0;
}


.step-card[draggable="true"] {
  cursor: grab;

  &:active { cursor: grabbing; }
}

.step-heading { flex: 1; font-size: var(--step--1); padding: var(--space-2xs) var(--space-s); }

.step-duration-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--step--1);
  color: var(--text-muted);
  white-space: nowrap;
}

.step-duration { width: 3.5rem; text-align: center; padding: var(--space-2xs) var(--space-xs); font-size: var(--step--1); }

.step-type {
  font-family: var(--font-body);
  font-size: var(--step--1);
  padding: var(--space-2xs) var(--space-xs);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--card);
  color: var(--text);
}

.step-remove {
  background: none;
  border: none;
  font-size: var(--step-1);
  color: var(--muted);
  cursor: pointer;
  padding: 0 var(--space-2xs);

  &:hover { color: var(--red); }
}

.step-instruction {
  min-block-size: 2.2rem;
  font-size: var(--step--1);
}

.step-extras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xs);
}

.step-note, .step-doc {
  font-size: var(--step--1);
  padding: var(--space-2xs) var(--space-s);
}

/* requiresAnswer toggle in step-builder */
.step-requires-answer-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--step--1);
  color: var(--text-muted);
  cursor: pointer;
  padding: var(--space-2xs) 0;
  user-select: none;

  input[type="checkbox"] { accent-color: var(--teal); cursor: pointer; }

  &:has(input:checked) { color: var(--teal); font-weight: 600; }
}

/* My agendas */
/* .my-sessions, .my-item, .my-link etc. now in shared /components.css */

.item-edit, .item-delete {
  font-size: var(--step-0);
  padding: var(--space-2xs) var(--space-xs);
  color: var(--muted);

  &:hover { color: var(--text); }
}

.item-delete:hover { color: oklch(0.63 0.24 27); }

/* .page-footer is now in /components.css */


/* =============================================================================
   LIVE PAGE — Timer + Step view
   ============================================================================= */

.live-container {
  block-size: 100dvh;    /* Lock container to viewport */
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Lobby */
.lobby {
  flex: 1;
  min-block-size: 0;     /* Allows internal scroll with many groups */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-l);
  padding: var(--space-xl);
  text-align: center;
}

/* Lobby: dida.dk/d + code as one combined logo */
.lobby-link {
  display: flex;
  align-items: baseline;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}

.lobby-logo {
  font-size: clamp(2.5rem, 1rem + 4vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text);
}

.lobby-logo-dot {
  color: var(--green);
}

.lobby-slash {
  color: var(--text);
  font-weight: 800;
}

.lobby-code {
  font-size: clamp(2.5rem, 1rem + 4vw, 4.5rem);
  font-weight: 900;
  color: var(--teal);
  letter-spacing: 0.05em;
}

.lobby-url-part {
  display: none;
}

.lobby-title {
  font-size: var(--step-2);
  font-weight: 600;
  color: var(--text-muted);
}

.lobby-count {
  font-size: var(--step-1);
  color: var(--text-muted);
}

.lobby-count-num {
  font-weight: 800;
  color: var(--teal);
  font-size: var(--step-2);
}

.lobby-groups-list {
  display: block;
  font-size: var(--step--1);
  color: var(--muted);
  font-weight: 400;
  margin-block-start: 0.2rem;
}

.topbar-groups {
  font-size: var(--step--1);
  color: var(--muted);
}

.lobby-waiting {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  color: var(--muted);
  font-size: var(--step-0);
}

.lobby-dot-pulse {
  width: 8px;
  height: 8px;
  background: var(--teal);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}


.btn-lobby-start {
  font-size: var(--step-1);
  padding: var(--space-m) var(--space-2xl);

  & kbd {
    background: oklch(1 0 0 / 20%);
    padding: 0.1em 0.5em;
    border-radius: var(--radius-s);
    font-size: 0.8em;
    margin-inline-start: 0.3em;
  }
}

/* Role selection */
.role-select {
  width: min(400px, 90vw);
}

.role-select-title {
  font-size: var(--step-1);
  font-weight: 700;
  margin-block-end: var(--space-m);
}


/* Live view */
.live-view {
  flex: 1;
  min-block-size: 0;     /* Tillader flex-barn at krympe ned */
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Topbar */
.live-topbar {
  display: flex;
  align-items: center;
  padding: var(--space-s) var(--space-m);
  gap: var(--space-m);
  background: light-dark(oklch(1 0 0 / 80%), oklch(0.14 0.02 260 / 80%));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-block-end: 1px solid var(--border);
  position: sticky;
  inset-block-start: 0;
  z-index: 10;
}

.topbar-link {
  display: flex;
  align-items: baseline;
  gap: 0.2rem;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s;
}

/* brand-klasser i live-topbar: se /brand.css */

.topbar-code-badge {
  background: var(--teal);
  color: oklch(1 0 0);
  font-weight: 800;
  font-size: var(--step--1);
  padding: 0.15em 0.5em;
  border-radius: var(--radius-s);
  margin-inline-start: 0.3rem;
  letter-spacing: 0.05em;
}

.topbar-step {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-subtle);
  padding: 0.15em 0.5em;
  border-radius: var(--radius-full);
}

/* Student: group badge in topbar */
.topbar-group-badge {
  --group-hue: 180;
  font-size: var(--step--1);
  font-weight: 600;
  color: light-dark(oklch(0.4 0.06 240), oklch(0.75 0.06 240));
  background: light-dark(oklch(0.93 0.02 240), oklch(0.22 0.03 240));
  padding: 0.15em 0.5em;
  border-radius: var(--radius-full);
  margin-inline-start: var(--space-xs);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;

  /* Farvekodet badge baseret på gruppenummer (fra JS via --group-hue) */
  &.group-colored {
    color: oklch(0.42 0.15 var(--group-hue));
    background: oklch(0.42 0.15 var(--group-hue) / 12%);
  }

  /* Clickable state — within 3-min change window */
  &.changeable {
    cursor: pointer;
    color: var(--teal);
    background: var(--teal-subtle);

    &::after {
      content: ' ↺';
      font-size: 0.85em;
      opacity: 0.7;
    }

    &:hover {
      background: light-dark(oklch(0.88 0.05 180), oklch(0.28 0.06 180));
    }
  }
}

.topbar-spacer { flex: 1; }
.topbar-count { font-size: var(--step--1); color: var(--text-muted); white-space: nowrap; }

/* On mobile: hide "dida.dk / d" brand text — code badge is enough */
@media (max-width: 639px) {
  .live-topbar .brand,
  .live-topbar .brand-sep,
  .live-topbar .brand-sub {
    display: none;
  }
}

/* On narrow mobile: hide help button text, keep icon only */
@media (max-width: 479px) {
  .topbar-help-text {
    display: none;
  }

  /* Remove ↺ suffix on very narrow screens — just show "Gr. 2" */
  .topbar-group-badge.changeable::after {
    display: none;
  }
}

/* On very narrow screens (320px iPhone SE): hide step counter to make room */
@media (max-width: 349px) {
  .topbar-step {
    display: none;
  }
}

/* Topbar-timer — kompakt, kun desktop */
.topbar-timer {
  display: none; /* hidden on mobile */
  font-size: var(--step-0);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--teal);
  padding-inline-start: var(--space-s);
  &.timer-warning { color: var(--amber); }
  &.timer-danger  { color: var(--red);   }
}

/* Live content — mobil: stacked kolonne */
.live-content {
  flex: 1;
  min-block-size: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center; /* vertikalt centreret når indhold er kort */
  gap: var(--space-s);
  padding: var(--space-s) var(--space-m);
  padding-block-end: 5rem; /* plads til kontrolbar */
  overflow: hidden;
}

/* Wide screen: timer in topbar, content full width */
@media (min-width: 640px) {
  /* Timer flyttes til topbar — gem den store cirkel */
  .live-content .timer-wrap { display: none; }
  .topbar-timer { display: inline; }

  /* Indhold: fuld bredde, venstrestillet, mere luft */
  .live-content {
    gap: var(--space-m);
    padding-inline: var(--space-xl);
    align-items: center;
  }

  .live-content .step-card-mini {
    max-inline-size: min(720px, 100%);
    width: 100%;
    text-align: start;
  }

  /* Larger font now that there is room */
  .live-content .step-heading {
    font-size: clamp(1.4rem, 4dvh, var(--step-3));
  }

  .live-content .step-instruction {
    font-size: var(--step-0);
    line-height: 1.7;
  }
}


/* =============================================================================
   TIMER CIRCLE
   ============================================================================= */

.timer-wrap {
  position: relative;
  flex-shrink: 0;
  /* SVG circles hidden — wrap shrinks to text content */
}

.timer-svg {
  /* Circles hidden — collapse SVG so it takes no space */
  display: none;
}

.timer-track {
  display: none;
}

.timer-progress {
  display: none;
}

.timer-warning .timer-progress { stroke: var(--amber); }
.timer-danger .timer-progress { stroke: var(--red); }

.timer-text {
  display: block;
  text-align: center;
  font-size: clamp(1.5rem, 8dvh, 4.5rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.timer-paused {
  position: absolute;
  inset-block-end: 15%;
  inset-inline: 0;
  text-align: center;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--amber);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.timer-warning .timer-text { color: var(--amber); }
.timer-danger .timer-text { color: var(--red); }


/* =============================================================================
   TRIN-KORT
   ============================================================================= */

.step-card-mini {
  max-width: min(600px, 90vw);
  width: 100%;
  margin-inline: auto;
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.step-heading {
  font-size: clamp(1.1rem, 4dvh, 1.8rem); /* Compact but readable */
  font-weight: 700;
  text-wrap: balance;
  text-align: center;    /* Overskrift centreres — instruktion arver start */
  flex: none;            /* Overstyr flex:1 fra form-CSS — titlen fylder kun sit indhold */
}

.step-instruction {
  font-size: var(--step--1);  /* Kompakt — var --step-0 */
  line-height: 1.6;
  color: var(--text);
  text-align: start;
  text-wrap: pretty;
  max-inline-size: 65ch;
}

.step-note {
  background: oklch(0.75 0.17 75 / 10%);
  border-inline-start: 3px solid var(--amber);
  padding: var(--space-s) var(--space-m);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  font-size: var(--step--1);
  text-align: start;
  color: light-dark(oklch(0.45 0.12 75), oklch(0.80 0.12 75));
  flex-shrink: 0;        /* OBS er altid synlig — forsvinder ikke ved lang tekst */
}

.step-doc {
  background: var(--teal-subtle);
  border-inline-start: 3px solid var(--teal);
  padding: var(--space-s) var(--space-m);
  border-radius: 0 var(--radius-m) var(--radius-m) 0;
  font-size: var(--step--1);
  text-align: start;
  color: light-dark(oklch(0.40 0.10 180), oklch(0.80 0.10 180));

  &::before {
    content: 'Pas-på-doc: ';
    font-weight: 700;
  }
}

.step-linked-poll-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  align-self: flex-start;
  background: var(--teal-subtle);
  border: 1px solid var(--teal);
  color: light-dark(oklch(0.35 0.10 180), oklch(0.85 0.10 180));
  padding: var(--space-xs) var(--space-m);
  border-radius: var(--radius-full);
  font-size: var(--step--1);
  font-weight: 600;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.15s;

  &:hover { background: oklch(from var(--teal) l c h / 20%); }
}


/* =============================================================================
   PROGRESS DOTS
   ============================================================================= */

.progress-dots {
  display: flex;
  gap: var(--space-xs);
  align-items: center;

  /* Skjul på desktop — sidebaren viser allerede trin-overblikket */
  @media (min-width: 900px) { display: none; }
}

.dot {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--step--1);
  font-weight: 700;
  border: 2px solid var(--border);
  color: var(--muted);
  transition: all 0.2s;
}

.dot-done {
  background: var(--teal);
  border-color: var(--teal);
  color: oklch(1 0 0);
}

.dot-active {
  border-color: var(--teal);
  color: var(--teal);
  font-weight: 800;
  transform: scale(1.15);
  box-shadow: 0 0 0 3px var(--teal-subtle);
}


/* =============================================================================
   CONTROL BAR (teacher)
   ============================================================================= */

.controls-bar {
  position: fixed;
  inset-block-end: 0;
  inset-inline: 0;
  transform: none;
  display: flex;
  justify-content: center;
  gap: var(--space-xs);
  padding: var(--space-m);
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  z-index: 20;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;

  /* Desktop: shrink bar to exclude sidebar so justify-content:center is truly centered */
  @media (min-width: 900px) {
    inset-inline-end: 280px;
  }
}

body.mouse-active .controls-bar {
  opacity: 1;
  pointer-events: auto;
}

.ctrl-pill {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  padding: var(--space-s) var(--space-m);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.3em;

  &:hover {
    border-color: var(--teal);
    background: var(--teal-subtle);
  }

  & kbd {
    font-family: var(--font-body);
    font-size: 0.75em;
    background: var(--input-bg);
    padding: 0.1em 0.4em;
    border-radius: var(--radius-s);
    font-weight: 500;
  }
}


/* =============================================================================
   FINISHED OVERLAY
   ============================================================================= */

.finished-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 250; /* Over sidebar (z-index: 200) og kontrolbar */
}

.finished-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-l);
}

.finished-icon {
  font-size: var(--step-3);
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: var(--teal-subtle);
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: center;
}



/* =============================================================================
   GRUPPE-TEMPO
   ============================================================================= */

/* Gruppevalg i lobby */
.group-select-panel {
  inline-size: min(400px, 90vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
  text-align: center;
}

.group-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
}

.group-btn {
  --group-hue: 180;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: 2px solid oklch(0.42 0.15 var(--group-hue) / 30%);
  background: oklch(0.42 0.15 var(--group-hue) / 8%);
  font-family: var(--font-body);
  font-size: var(--step-1);
  font-weight: 700;
  color: oklch(0.38 0.15 var(--group-hue));
  cursor: pointer;
  transition: all 0.15s;

  &:not(.group-btn-selected):hover {
    border-color: oklch(0.42 0.15 var(--group-hue));
    background: oklch(0.42 0.15 var(--group-hue) / 15%);
  }
}

.group-btn.group-btn-selected {
  background: oklch(0.42 0.15 var(--group-hue));
  border-color: oklch(0.42 0.15 var(--group-hue));
  color: oklch(1 0 0);
  box-shadow: 0 0 0 3px oklch(0.42 0.15 var(--group-hue) / 20%);
}

/* Gruppe-kort med label (fx "1 — Liberalismen") */
.group-card-btn {
  --group-hue: 180;
  display: flex;
  align-items: center;
  gap: var(--space-s);
  width: 100%;
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-m);
  border: 2px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: var(--step-0);
  color: var(--text);
  text-align: start;
  transition: all 0.15s;

  &:not(.group-card-selected):hover {
    border-color: oklch(0.42 0.15 var(--group-hue));
    background: oklch(0.42 0.15 var(--group-hue) / 6%);
  }
}

.group-card-nr {
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 50%;
  background: oklch(0.42 0.15 var(--group-hue, 180) / 12%);
  color: oklch(0.38 0.15 var(--group-hue, 180));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--step--1);
  flex-shrink: 0;
}

.group-card-label {
  font-weight: 500;
}

.group-card-btn.group-card-selected {
  border-color: oklch(0.42 0.15 var(--group-hue));
  background: oklch(0.42 0.15 var(--group-hue) / 8%);
  box-shadow: var(--shadow-m);

  & .group-card-nr {
    background: oklch(0.42 0.15 var(--group-hue));
    color: oklch(1 0 0);
  }
}

/* Create: group labels */
.group-setup {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
}

.group-labels {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.group-label-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.group-label-nr {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--teal);
  color: oklch(1 0 0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--step--1);
  flex-shrink: 0;
}

.group-label-input {
  flex: 1;
}

/* ── Differentiate per group + Require answer — toggle-switches ── */
.step-diff-toggle-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.step-linked-poll {
  width: 6rem;
  text-align: center;
  padding: var(--space-2xs) var(--space-xs);
  font-size: var(--step--1);
}

.step-diff-switch {
  position: relative;
  width: 28px;
  height: 16px;
  border: none;
  border-radius: 9999px;
  background: light-dark(oklch(0 0 0 / 15%), oklch(1 0 0 / 20%));
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s;

  &::after {
    content: '';
    position: absolute;
    inset-block: 2px;
    inset-inline-start: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: oklch(1 0 0);
    transition: inset-inline-start 0.15s;
  }

  &.active {
    background: var(--accent);
    &::after { inset-inline-start: 14px; }
  }
}

.step-diff-label {
  font-size: var(--step--2);
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

/* Shared instruction label (shown only when diff is active) */
.step-instr-label {
  font-size: var(--step--2);
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-block-end: var(--space-2xs);
}
.step-instr-label-opt {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.step-diff-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-block-start: var(--space-xs);
  padding-inline-start: var(--space-s);
  border-inline-start: 2px solid var(--border);
}

.diff-group-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.diff-group-label {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--step--2);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.diff-group-text {
  min-block-size: 1.8rem;
  font-size: var(--step--1) !important;
}

/* Student "Next step" button */
.group-next-btn {
  margin-block-start: var(--space-m);
  font-size: var(--step--1);
  padding: var(--space-xs) var(--space-l);
  align-self: center;
  width: fit-content;
}

/* Overview dialog (reuses name-dialog pattern) */
.overview-dialog {
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  max-width: min(500px, 92vw);
  width: 90vw;
  max-height: 80vh;
  overflow: hidden;
  margin: auto;
  background: var(--card);
  box-shadow: var(--shadow-hover);
  color: inherit;

  &::backdrop {
    background: oklch(0 0 0 / 40%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
}

.overview-panel {
  display: flex;
  flex-direction: column;
  max-height: 80vh;
}

.overview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-l) var(--space-xl) var(--space-m);
  flex-shrink: 0;
}

.overview-title {
  font-size: var(--step-1);
  font-weight: 700;
}

.overview-close {
  background: none;
  border: none;
  font-size: var(--step-2);
  cursor: pointer;
  color: var(--muted);
  padding: var(--space-xs);
  line-height: 1;
  border-radius: var(--radius-s);

  &:hover { background: var(--input-bg); }
}

.overview-content {
  padding: 0 var(--space-xl) var(--space-l);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.overview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step-0);

  & th {
    text-align: start;
    font-weight: 600;
    font-size: var(--step--1);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    padding: var(--space-xs) var(--space-s);
    border-block-end: 2px solid var(--border);
  }

  & td {
    padding: var(--space-s);
    border-block-end: 1px solid var(--border);
    text-align: start;
  }

  & tbody tr:last-child td { border-block-end: none; }
}

.overview-nr {
  font-weight: 700;
  text-align: start;
}

/* Farvede gruppe-cirkler i overblik (fra rollespil-design) */
.grp-circle {
  --group-hue: 180;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 1.5em;
  block-size: 1.5em;
  border-radius: 50%;
  background: oklch(0.42 0.15 var(--group-hue) / 15%);
  color: oklch(0.38 0.15 var(--group-hue));
  font-size: 0.75em;
  font-weight: 800;
  vertical-align: middle;
  flex-shrink: 0;
}

.overview-step-nr {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  width: 4rem;
}

.overview-done td {
  background: var(--teal-subtle);
}

.overview-done .overview-step-nr {
  color: var(--teal);
}

.overview-online {
  color: oklch(0.72 0.19 163);
  font-size: 0.7em;
}

.overview-offline {
  color: var(--muted);
  font-size: 0.7em;
}

.overview-answer-ok {
  color: oklch(0.72 0.19 163);
  font-weight: 600;
}

.overview-answer-missing {
  color: var(--muted);
  font-style: italic;
}


/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 480px) {
.field-row-2 { flex-direction: column; }
  /* Timer and text now scale via dvh — no fixed px overrides needed */
}

@media (min-width: 1200px) {
  /* Large screen (smartboard): slightly larger timer circle on mobile-like displays */
  /* timer-wrap: no size needed (SVG removed) */
  /* Font sizes handled by the 640px block */
}


/* =============================================================================
   ACCESSIBILITY
   ============================================================================= */

/* prefers-reduced-motion er i /tokens.css */

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

/* Text fields already have a border-color focus indicator — no need for an
   extra outline ring that reads as a double frame */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.text-input:focus-visible {
  outline: none;
}

@media (prefers-contrast: more) {
  .step-card, .form-card, .my-item, .group-card-btn {
    border: 2px solid currentColor;
  }

  .timer-progress { stroke-width: 8; }
  .step-note, .step-doc { border-inline-start-width: 4px; }
}

@media (forced-colors: active) {
  .step-nr, .onboarding-num, .my-code, .topbar-code-badge, .dot-done {
    forced-color-adjust: none;
  }

  .timer-progress { stroke: LinkText; }
  .btn-teal { border: 2px solid ButtonText; }
}


/* =============================================================================
   TEST-PANEL (kun synlig med ?test i URL)
   ============================================================================= */

.test-panel {
  position: fixed;
  inset-block-end: 5.5rem;   /* over kontrolbaren */
  inset-inline-start: var(--space-m);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: light-dark(oklch(0.15 0.02 260 / 85%), oklch(0.1 0.02 260 / 90%));
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  z-index: 900;
  box-shadow: var(--shadow-m);
}

.test-panel-label {
  font-size: var(--step--2);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(0.6 0.05 260);
  padding-inline-end: var(--space-xs);
}

.test-btn {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  border: 1px solid oklch(0.4 0.05 260);
  background: oklch(0.25 0.04 260);
  color: oklch(0.85 0.02 260);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;

  &:hover {
    background: oklch(0.35 0.06 260);
    border-color: oklch(0.55 0.08 260);
  }

  &.test-btn-active {
    background: var(--teal);
    border-color: var(--teal);
    color: oklch(0.15 0.02 180);
  }
}


/* =============================================================================
   LIVE-BODY: Horisontal flex-container (live-content + sidebar)
   ============================================================================= */

.live-body {
  flex: 1;
  min-block-size: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
}

/* On mobile: live-content fills full width */
.live-body > .live-content {
  flex: 1;
  min-inline-size: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Remove overflow: hidden from .live-content directly (now handled by .live-body) */
.live-content { overflow: visible; }


/* =============================================================================
   SIDEBAR
   ============================================================================= */

.live-sidebar {
  /* Mobile: hidden slide-in panel from the right */
  position: fixed;
  inset-block: 0;
  inset-inline-end: 0;
  inline-size: min(320px, 90vw);
  background: light-dark(oklch(0.99 0.005 240), oklch(0.17 0.02 260));
  border-inline-start: 1px solid var(--border);
  box-shadow: -4px 0 24px oklch(0 0 0 / 8%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow: hidden;

  &.sidebar-open {
    transform: translateX(0);
  }
}

/* Desktop (≥ 900px): sidebar always visible in layout */
@media (min-width: 900px) {
  .live-sidebar {
    position: static;
    transform: none;
    inline-size: 280px;
    flex-shrink: 0;
    box-shadow: none;
    border-inline-start: 1px solid var(--border);
    transition: none;
  }

  /* Give live-content slightly less padding when sidebar is present */
  .live-body > .live-content {
    padding-inline-end: var(--space-m);
  }

  /* Hide toggle button on desktop */
  .sidebar-toggle-btn { display: none !important; }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-s) var(--space-m);
  border-block-end: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-title {
  font-size: var(--step--1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.sidebar-luk-btn {
  background: none;
  border: none;
  font-size: var(--step-2);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-s);
  transition: background 0.15s, color 0.15s;
  line-height: 1;

  &:hover { background: var(--border); color: var(--text); }

  /* Hide close button on desktop (sidebar cannot be closed) */
  @media (min-width: 900px) { display: none; }
}

.sidebar-step-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-s);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar-item {
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-m);
  margin-block-end: 0.25rem;
  transition: background 0.15s;

  &:hover { background: light-dark(oklch(0.95 0.005 240), oklch(0.22 0.02 260)); }
}

.sidebar-item-active {
  background: oklch(0.7 0.14 180 / 12%);
  border-inline-start: 3px solid var(--teal);
  padding-inline-start: calc(var(--space-s) - 3px);
}

.sidebar-item-done {
  opacity: 0.65;
}

.sidebar-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.sidebar-item-nr {
  font-size: var(--step--2);
  font-weight: 700;
  color: var(--text-muted);
  background: var(--border);
  inline-size: 1.4em;
  block-size: 1.4em;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;

  .sidebar-item-active & {
    background: var(--teal);
    color: oklch(0.1 0.02 180);
  }
}

.sidebar-item-heading {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  text-wrap: balance;
}

.sidebar-answer-status {
  margin-block-start: 0.3rem;
  padding-inline-start: calc(1.4em + var(--space-xs));  /* aligned med overskrift */
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.sidebar-answer-badge {
  font-size: var(--step--2);
  font-weight: 700;
  padding: 0.1em 0.5em;
  border-radius: var(--radius-full);

  &.sidebar-answer-badge-ok {
    background: oklch(0.72 0.19 163 / 15%);
    color: oklch(0.5 0.19 163);
  }

  &.sidebar-answer-badge-pending {
    background: var(--border);
    color: var(--text-muted);
  }
}

.sidebar-answer-names {
  font-size: var(--step--2);
  color: var(--text-muted);
}

.sidebar-indsend-btn {
  font-family: var(--font-body);
  font-size: var(--step--2);
  font-weight: 600;
  padding: 0.2em 0.6em;
  border-radius: var(--radius-full);
  border: 1px solid var(--teal);
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;

  &:hover {
    background: var(--teal);
    color: oklch(0.1 0.02 180);
  }
}

.sidebar-dashboard-link {
  flex-shrink: 0;
  padding: var(--space-s) var(--space-m);
  border-block-start: 1px solid var(--border);
}

.sidebar-dashboard-btn {
  display: block;
  text-align: center;
  padding: var(--space-xs) var(--space-m);
  border-radius: var(--radius-m);
  background: var(--teal-subtle);
  color: var(--teal);
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 600;
  transition: background 0.15s;

  &:hover { background: oklch(0.7 0.14 180 / 20%); }
}

/* Sidebar-toggle knap (mobil, i topbar) */
.sidebar-toggle-btn {
  background: none;
  border: none;
  font-size: var(--step-1);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem 0.4rem;
  border-radius: var(--radius-s);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
  line-height: 1;

  &:hover { background: var(--border); color: var(--text); }
}


/* =============================================================================
   SVAR-SEKTION (elev-input under step-instruction)
   ============================================================================= */

.answer-section {
  margin-block-start: var(--space-m);
  border-block-start: 1px solid var(--border);
  padding-block-start: var(--space-m);
}

.answer-label {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-block-end: var(--space-xs);
}

/* Shared editor style (used in inline + modal) */
.answer-editor {
  min-block-size: 6rem;
  max-block-size: 16rem;
  overflow-y: auto;
  padding: var(--space-s) var(--space-m);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--card); /* White — makes field stand out for students */
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step--1);
  line-height: 1.6;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  scrollbar-width: thin;

  &:focus {
    border-color: var(--teal);
  }

  /* Placeholder via data-attribut */
  &:empty::before {
    content: attr(data-placeholder);
    color: var(--text-muted);
    pointer-events: none;
  }
}

/* Rich text formatting inside answer editors and displays */
.answer-editor,
.dash-answer-text,
.remote-answer-text {
  & ul, & ol {
    margin-block: 0.3em;
    padding-inline-start: 1.4em;
  }
  & li { margin-block: 0.1em; }
  & p {
    margin-block: 0.3em;
    &:first-child { margin-block-start: 0; }
    &:last-child { margin-block-end: 0; }
  }
  & a { color: var(--teal); text-decoration: underline; }
}

.answer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-s);
  margin-block-start: var(--space-s);
  flex-wrap: wrap;
}

.answer-submitted-badge {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 0.3em;
}

.answer-submit-btn {
  /* bruger .btn .btn-teal fra eksisterende CSS */
}


/* =============================================================================
   SVAR MODAL (til indsend svar for tidligere trin)
   ============================================================================= */

.answer-modal {
  border: none;
  border-radius: var(--radius-l);
  padding: 0;
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-hover);
  inline-size: min(540px, calc(100vw - 2rem));
  max-block-size: 90dvh;
  overflow: hidden;

  /* Ingen block-size tvang — dialog skalerer til indholdet */
  &[open] { display: flex; }

  &::backdrop {
    background: oklch(0 0 0 / 40%);
    backdrop-filter: blur(4px);
  }
}

.answer-modal-content {
  display: flex;
  flex-direction: column;
  inline-size: 100%;
}

.answer-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-m) var(--space-l);
  border-block-end: 1px solid var(--border);

  h3 {
    font-size: var(--step-0);
    font-weight: 700;
    text-wrap: balance;
  }
}

.answer-modal-close {
  background: none;
  border: none;
  font-size: var(--step-2);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-s);
  transition: background 0.15s;
  line-height: 1;
  flex-shrink: 0;

  &:hover { background: var(--border); }
}

.answer-modal-body {
  padding: var(--space-m) var(--space-l);
  overflow-y: auto;
}

.answer-modal-label {
  font-size: var(--step--1);
  color: var(--text-muted);
  margin-block-end: var(--space-xs);
}

.answer-modal-editor {
  min-block-size: 8rem;
  max-block-size: 20rem;
}

.answer-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-s);
  padding: var(--space-m) var(--space-l);
  border-block-start: 1px solid var(--border);
}


/* =============================================================================
   TOAST NOTIFIKATION
   ============================================================================= */

.answer-toast {
  position: fixed;
  /* At the top of screen — below topbar, never over buttons at the bottom */
  inset-block-start: 4.5rem;
  inset-inline: 0;
  margin-inline: auto;
  inline-size: fit-content;
  max-inline-size: min(380px, calc(100vw - 2rem));
  background: light-dark(oklch(0.2 0.02 260), oklch(0.9 0.01 80));
  color: light-dark(oklch(0.95 0.01 80), oklch(0.15 0.02 260));
  padding: var(--space-xs) var(--space-l);
  border-radius: var(--radius-full);
  font-size: var(--step--1);
  font-weight: 600;
  box-shadow: var(--shadow-m);
  z-index: 500;
  opacity: 0;
  transform: translateY(-0.5rem);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;

  &.answer-toast-vis {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =============================================================================
   GROUP-NEXT BLOCKED (requires answer before continuing)
   ============================================================================= */

.group-next-blocked {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(40%);
}


/* =============================================================================
   GRUPPE-FEATURE: NYE ELEMENTER (fritGruppeNr + gruppeMode valg)
   ============================================================================= */

/* Free group number — input + button side by side */
.free-group-wrap {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  flex-wrap: wrap;

  & .free-group-label {
    font-size: var(--step-0);
    font-weight: 600;
    color: light-dark(oklch(0.3 0.02 260), oklch(0.8 0.01 260));
  }

  & .free-group-input {
    width: 6rem;
    text-align: center;
    font-size: var(--step-1);
    font-weight: 600;
  }

  & .free-group-input.input-error {
    border-color: var(--red);
    background: oklch(from var(--red) l c h / 8%);
    animation: shake 0.3s ease;
  }

  /* Text-name mode: wider input, left-aligned */
  & .free-group-name-input {
    width: 14rem;
    text-align: start;
    font-weight: 400;
  }
}

/* Confirmation text after selection */
.free-group-confirm {
  font-size: var(--step-0);
  color: var(--teal);
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-s);
}

/* Small inline "Skift" link inside free-group confirm */
.change-group-btn {
  all: unset;
  font-size: var(--step--1);
  font-weight: 400;
  color: light-dark(oklch(0.5 0.01 260), oklch(0.6 0.01 260));
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  padding-block: 2px;

  &:hover {
    color: var(--teal);
  }
}

/* Gruppe-mode radioknapper (foruddefineret vs frit) */
.group-mode-select {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.group-mode-option {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-s);
  border-radius: var(--radius-m);
  border: 1.5px solid transparent;
  background: var(--input-bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;

  & input[type="radio"] {
    margin-block-start: 0.25em;
    accent-color: var(--teal);
    flex-shrink: 0;
  }

  &:has(input:checked) {
    border-color: var(--teal);
    background: oklch(from var(--teal) l c h / 6%);
  }
}

.group-mode-text {
  display: flex;
  flex-direction: column;
  gap: 0.1em;

  & span { font-weight: 500; }

  & small {
    font-size: var(--step--2);
    color: var(--text-muted);
    line-height: 1.4;
  }
}

/* Indented toggle (Groups control their own pace under group setup) */
.toggle-row-indented {
  padding-inline-start: var(--space-m);
  border-inline-start: 2px solid var(--teal-subtle);
  margin-block-start: var(--space-2xs);
}

/* Hint text below input */
.field-hint {
  font-size: var(--step--2);
  color: var(--text-muted);
  margin-block-start: var(--space-2xs);
}

/* Hint text below a toggle row */
.toggle-hint {
  margin-block-start: calc(-1 * var(--space-2xs));
  margin-block-end: var(--space-2xs);
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}


/* =============================================================================
   MARKDOWN EDITOR MODAL
   ============================================================================= */

.step-instruction-wrap { display: flex; flex-direction: column; }

/* Mobil: vis textarea, skjul klikbar preview */
.step-instruction-mobil { display: block; }
.step-instruction-preview { display: none; }

/* Desktop: vis klikbar preview, skjul mobil-textarea */
@media (min-width: 640px) {
  .step-instruction-mobil { display: none; }
  .step-instruction-preview { display: block; }
}

.step-instruction-preview {
  min-block-size: 2rem;
  padding-block: var(--space-xs);
  padding-inline: 0;
  border-block-end: 1.5px solid var(--border);
  cursor: text;
  font-size: var(--step--1);
  color: var(--text);
  line-height: 1.6;
  transition: border-color 0.15s;

  &:hover { border-block-end-color: var(--teal); }
  &:focus { outline: none; border-block-end-color: var(--teal); }
}

.step-instruction-placeholder { color: var(--muted); }

.md-dialog {
  inline-size: min(900px, 95vw);
  block-size: min(640px, 90dvh);
  border: none;
  border-radius: var(--radius-l);
  padding: 0;
  background: var(--card);
  box-shadow: var(--shadow-hover);
  flex-direction: column;
  margin: auto;

  &[open] { display: flex; }

  &::backdrop {
    background: oklch(0 0 0 / 35%);
    backdrop-filter: blur(2px);
  }
}

.md-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-m) var(--space-l);
  border-block-end: 1px solid var(--border);
  flex-shrink: 0;
}

.md-dialog-titel {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.md-dialog-luk {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--step-0);
  padding: var(--space-2xs);
  border-radius: var(--radius-s);
  line-height: 1;

  &:hover { background: var(--input-bg); color: var(--text); }
}

/* Quill WYSIWYG editor i modal */
.quill-editor-wrap {
  flex: 1;
  min-block-size: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;

  & .ql-toolbar.ql-snow {
    border-block-end: 1px solid var(--border);
    border-block-start: none;
    border-inline: none;
    background: var(--card);
    flex-shrink: 0;
    font-family: var(--sans);

    & .ql-stroke { stroke: var(--text); }
    & .ql-fill { fill: var(--text); }
    & .ql-picker-label { color: var(--text); font-family: var(--sans); }
    & button:hover .ql-stroke, & .ql-active .ql-stroke { stroke: var(--accent); }
    & button:hover .ql-fill, & .ql-active .ql-fill { fill: var(--accent); }
    & .ql-picker-label:hover { color: var(--accent); }
    & .ql-picker-options { background: var(--card); border-color: var(--border); color: var(--text); font-family: var(--sans); }
    & button { border-radius: var(--r-s); }
  }

  & .ql-container.ql-snow {
    flex: 1;
    min-block-size: 0;
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  & .ql-editor {
    flex: 1;
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.7;
    background: var(--card);
    color: var(--text);
    overflow-y: auto;
    padding: var(--space-m);
    max-block-size: none;
  }

  & .ql-editor.ql-blank::before {
    color: var(--muted);
    font-style: normal;
    left: var(--space-m);
  }

  & img { max-inline-size: 100%; block-size: auto; border-radius: var(--radius-s); margin-block: var(--space-s); }
}

.md-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-s);
  padding: var(--space-m) var(--space-l);
  border-block-start: 1px solid var(--border);
  flex-shrink: 0;
}

/* Admin confirmation dialog (QR pairing) */
.admin-dialog {
  inline-size: min(420px, 95vw);
  border: none;
  border-radius: var(--radius-l);
  padding: 0;
  background: var(--card);
  box-shadow: var(--shadow-hover);
  flex-direction: column;
  margin: auto;

  &[open] { display: flex; }

  &::backdrop {
    background: oklch(0 0 0 / 35%);
    backdrop-filter: blur(2px);
  }
}

.admin-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-m) var(--space-l);
  border-block-end: 1px solid var(--border);
  flex-shrink: 0;
}

.admin-dialog-titel {
  font-size: var(--step--1);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.admin-dialog-luk {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: var(--step-0);
  padding: var(--space-2xs);
  border-radius: var(--radius-s);
  line-height: 1;

  &:hover { background: var(--input-bg); color: var(--text); }
}

.admin-dialog-body {
  padding: var(--space-l);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
}

.admin-dialog-code-line {
  margin: 0;
  font-size: var(--step-0);
  color: var(--text);
}

.admin-dialog-code {
  font-size: var(--step-2);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--teal);
}

.admin-dialog-sub {
  margin: 0;
  font-size: var(--step--1);
  color: var(--text-muted);
  text-align: center;
}

.admin-qr-container {
  background: oklch(1 0 0); /* ren hvid til QR-scanning — må ikke tematiseres */
  border-radius: var(--radius-m);
  padding: var(--space-s);
  box-shadow: var(--shadow-s);

  & img { display: block; }
}

.admin-dialog-link-row {
  display: flex;
  gap: var(--space-s);
  inline-size: 100%;
}

.admin-dialog-linkinput {
  flex: 1;
  font-size: var(--step--2);
  padding: var(--space-xs) var(--space-s);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--input-bg);
  color: var(--text-muted);
  font-family: monospace;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-s);
  padding: var(--space-m) var(--space-l);
  border-block-start: 1px solid var(--border);
  flex-shrink: 0;
}

/* =============================================================================
   OPRET-SIDE — /d/opret.html
   To-kolonne layout med sticky sidebar + editor
   ============================================================================= */

.create-body {
  min-block-size: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Topbar: base styles now in shared /components.css (.create-topbar) */
/* Only dagsorden-specific overrides here */

.topbar-tid-badge {
  font-size: var(--step--1);
  font-weight: 600;
  background: var(--accent-subtle);
  color: var(--accent);
  padding: 0.15em 0.5em;
  border-radius: var(--radius-full);
}

/* Layout: sidebar + main */
.create-layout {
  display: flex;
  flex: 1;
  min-block-size: 0;
}

/* ===== SIDEBAR ===== */
.create-sidebar {
  display: none; /* Hidden on mobile */
}

@media (min-width: 900px) {
  .create-sidebar {
    display: block;
    inline-size: 300px;
    flex-shrink: 0;
    border-inline-end: 1px solid var(--border);
    background: var(--card);
  }

  .create-sidebar-inner {
    position: sticky;
    inset-block-start: 53px; /* topbar height */
    block-size: calc(100dvh - 53px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
  }
}

/* Sidebar overview card */
.sidebar-overview-card {
  padding: var(--space-m);
  border-block-end: 1px solid var(--border);
}

.sidebar-overview-title {
  font-size: var(--step-1);
  font-weight: 700;
  margin: 0;
  margin-block-end: var(--space-s);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.sidebar-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2xs);
  margin: 0;
}

.sidebar-meta-chip {
  font-size: var(--step--2);
  font-weight: 600;
  color: var(--text-muted);
  background: light-dark(oklch(0.94 0.005 240), oklch(0.22 0.02 260));
  padding: 0.2em 0.55em;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* Sidebar tidslinje-header */
.sidebar-timeline-header {
  padding: var(--space-s) var(--space-m) var(--space-2xs);
}

.sidebar-timeline-label {
  font-size: var(--step--2);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* Sidebar tidslinje (genbruger sidebar-item-stil fra live.html) */
.sidebar-timeline {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-xs) var(--space-s);
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;

  /* Genbruger .sidebar-item m.fl. fra live-sidebar sektionen */
  & .sidebar-item {
    cursor: pointer;
    padding: var(--space-2xs) var(--space-s);
    border-radius: var(--radius-m);
    transition: background 0.15s;

    &:hover { background: light-dark(oklch(0.95 0.005 240), oklch(0.22 0.02 260)); }
  }

  & .sidebar-item-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
  }

  & .sidebar-item-nr {
    font-size: var(--step--2);
    font-weight: 700;
    color: var(--text-muted);
    background: var(--border);
    inline-size: 1.6em;
    block-size: 1.6em;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  & .sidebar-item-heading {
    flex: 1;
    font-size: var(--step--1);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  & .sidebar-item-tid {
    font-size: var(--step--2);
    font-weight: 600;
    color: var(--teal);
    white-space: nowrap;
    flex-shrink: 0;
  }

  & .sidebar-item-badges {
    display: flex;
    gap: var(--space-2xs);
    padding-inline-start: calc(1.4em + var(--space-xs));
    padding-block-start: 0.15rem;
  }
}

.sidebar-badge {
  font-size: var(--step--2);
  font-weight: 600;
  padding: 0.1em 0.4em;
  border-radius: var(--radius-full);
}

.sidebar-badge-individuel {
  background: oklch(0.62 0.21 264 / 12%);
  /* var(--blue) findes ikke i rolig.css — brug samme blå som baggrunden */
  color: oklch(0.62 0.21 264);
}

.sidebar-badge-pause {
  background: oklch(0.75 0.17 75 / 12%);
  color: var(--amber);
}

.sidebar-badge-answer {
  background: oklch(0.7 0.14 180 / 12%);
  color: var(--teal);
}

.sidebar-timeline-empty {
  font-size: var(--step--1);
  color: var(--text-muted);
  padding: var(--space-m) var(--space-s);
  text-align: center;
  font-style: italic;
}

/* Sidebar CTA */
.sidebar-cta {
  padding: var(--space-m);
  border-block-start: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-block-start: auto;

  & .btn { justify-content: center; text-align: center; }
}

/* ===== MAIN EDITOR ===== */
.create-main {
  flex: 1;
  min-inline-size: 0;
  max-inline-size: 800px;
  margin-inline: auto;
  padding: var(--space-l) var(--space-m) var(--space-2xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-s);

  /* Genbrug create-section styles */
  font-size: var(--step--1);

  & .toggle-label { font-size: var(--step--1); }
  & .form-card-label { font-size: var(--step--1); }

  /* Borderless step-cards — no left padding so "1" aligns with button below */
  & .step-card {
    border-color: transparent;
    padding-inline-start: 0;
  }

  /* ── Underline inputs: no boxed borders, only bottom line ── */
  & .text-input {
    border: none;
    border-radius: 0;
    border-block-end: 1.5px solid var(--border);
    background: transparent;
    box-shadow: none;
    padding-inline: 0;

    &:focus {
      border-block-end-color: var(--accent);
      box-shadow: none;
      outline: none;
    }
  }

  /* Step header inputs: compact padding */
  & input.step-heading,
  & .step-duration {
    font-size: var(--step--1);
    padding-block: var(--space-xs);
    font-weight: 400;
  }

  /* Step type dropdown keeps its box (it's a select, not a text field) */
  & .step-type {
    border: 1.5px solid var(--border);
    background: var(--card);
    border-radius: var(--radius-s);
    padding: var(--space-xs) var(--space-s);
    transition: border-color 0.15s;

    &:focus {
      border-color: var(--accent);
      outline: none;
    }
  }

  /* Group label inputs: compact font */
  & .group-label-input {
    font-size: var(--step--1);
  }

  /* Remove spinner arrows on number inputs */
  & input[type="number"]::-webkit-inner-spin-button,
  & input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }
  & input[type="number"] { -moz-appearance: textfield; }

  /* Textarea: transparent med bundlinje, udvider ved fokus */
  & textarea.text-input {
    padding-block: var(--space-xs);
    padding-inline: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    border-block-end: 1.5px solid var(--border);
    resize: none;
    min-block-size: 2.2rem;
    transition: min-block-size 0.2s ease;

    &:focus {
      border-block-end-color: var(--teal);
      background: transparent;
      min-block-size: 7rem;
    }
  }

  /* OBS-felt i editor: ingen amber farve — neutral hint */
  & .step-note {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted);

    &::placeholder { color: var(--muted); }
    &:focus {
      border-color: var(--teal);
      background: var(--card);
    }
  }

  /* Add step — more visible */
  & #addStepBtn {
    align-self: flex-start;
    font-weight: 600;
    color: var(--teal);
    border: 1.5px dashed oklch(from var(--teal) l c h / 40%);
    background: oklch(from var(--teal) l c h / 4%);
    padding: var(--space-xs) var(--space-m);
    width: 100%;
    justify-content: center;
    margin-block-start: var(--space-2xs);

    &:hover {
      background: oklch(from var(--teal) l c h / 8%);
      border-color: oklch(from var(--teal) l c h / 70%);
    }
  }
}

@media (min-width: 900px) {
  .create-main {
    padding-inline: var(--space-xl);
  }
}

/* Mobil CTA (under editor) */
.create-mobile-cta {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding-block-start: var(--space-m);

  & .btn { justify-content: center; text-align: center; }
}

@media (min-width: 900px) {
  .create-mobile-cta { display: none; }
}

/* Alert-toast (fixed i bunden) */
/* Kladde-gendan banner */
.draft-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-s);
  background: light-dark(oklch(0.97 0.04 75), oklch(0.22 0.04 75));
  border: 1px solid oklch(0.75 0.17 75 / 40%);
  border-radius: var(--radius-m);
  padding: var(--space-s) var(--space-m);
  margin-block-end: var(--space-m);
  font-size: var(--step--1);

  & .draft-banner-text {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25em;
    color: light-dark(oklch(0.35 0.08 75), oklch(0.88 0.06 75));

    & strong {
      color: light-dark(oklch(0.25 0.1 75), oklch(0.95 0.08 75));
    }
  }

  & .draft-banner-actions {
    display: flex;
    gap: var(--space-xs);
  }
}

.create-alert {
  position: fixed;
  inset-block-end: var(--space-l);
  inset-inline: var(--space-m);
  max-inline-size: 480px;
  margin-inline: auto;
  background: var(--teal);
  color: oklch(1 0 0);
  padding: var(--space-s) var(--space-m);
  border-radius: var(--radius-m);
  font-weight: 600;
  font-size: var(--step--1);
  text-align: center;
  z-index: 1000;
  box-shadow: var(--shadow-m);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(1rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}


/* =============================================================================
   ADVISORY TIMER — pulsing red text when time has expired (teacher-paced)
   ============================================================================= */

@keyframes timerPuls {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.45; }
}

.timer-expired-text {
  animation: timerPuls 1.2s ease-in-out infinite;
}

/* =============================================================================
   ADMIN OFFLINE-BADGE + ELEV FALLBACK-KNAP
   ============================================================================= */

.admin-offline-badge {
  background: light-dark(oklch(0.95 0.05 75), oklch(0.25 0.06 75));
  color: light-dark(oklch(0.45 0.12 75), oklch(0.85 0.1 75));
  border: 1px solid oklch(0.75 0.17 75 / 40%);
  border-radius: var(--radius-m);
  padding: var(--space-xs) var(--space-m);
  font-size: var(--step--1);
  font-weight: 600;
  text-align: center;
  margin-block: var(--space-xs);
  animation: slideUp 0.3s ease;
}

.student-fallback-next {
  margin-block-start: var(--space-s);
  opacity: 0.85;
  animation: slideUp 0.4s ease;

  &:hover { opacity: 1; }
}


/* =============================================================================
   HELP QUEUE (student request help + teacher queue)
   ============================================================================= */

/* Help icon (inline SVG) — used in buttons, badges, titles */
.hi {
  inline-size: 1em;
  block-size: 1em;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* (help-status-icon removed — status shown only in topbar) */

/* Help icon in request button */
.help-request-icon .hi {
  inline-size: 1.1em;
  block-size: 1.1em;
}

/* Help icon in badge */
.help-control-badge .hi {
  inline-size: 0.9em;
  block-size: 0.9em;
}

/* Student: topbar seat location button */
.topbar-seat-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  background: light-dark(oklch(0.94 0.02 240), oklch(0.22 0.03 240));
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.3em 0.8em;
  font-size: var(--step--1);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;

  &:hover {
    background: var(--border);
    color: var(--text);
  }

  &:active { transform: scale(0.96); }
}

@media (max-width: 479px) {
  .topbar-seat-text { display: none; }
}

/* Compact dialog: used for seat location + help request */
.compact-dialog {
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  max-inline-size: min(420px, 92vw);
  inline-size: 90vw;
  margin: auto;
  background: var(--card);
  box-shadow: var(--shadow-hover);
  color: inherit;

  &::backdrop {
    background: oklch(0 0 0 / 40%);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  &[open] { display: flex; }
}

.compact-dialog-inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-s);
  padding: var(--space-l);
  inline-size: 100%;
}

.compact-dialog-title {
  font-size: var(--step-0);
  font-weight: 700;
  margin: 0;
}

.compact-dialog-field {
  inline-size: 100%;
  font-family: var(--font-body);
  font-size: var(--step--1);
  padding: 0.5em 0.8em;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--bg);
  color: var(--text);
  outline: none;
  box-sizing: border-box;

  &::placeholder {
    color: var(--text-muted);
  }

  &:focus {
    border-color: var(--teal);
  }
}

.compact-dialog-textarea {
  resize: vertical;
  min-block-size: 3rem;
  max-block-size: 7rem;
  field-sizing: content;
}

.compact-dialog-actions {
  display: flex;
  gap: var(--space-s);
  justify-content: flex-end;
  margin-block-start: var(--space-xs);
}

/* Overview table: seat column */
.overview-seat {
  font-size: var(--step--2);
  color: var(--text-muted);
  max-inline-size: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-seat-empty {
  opacity: 0.4;
}

/* Student: topbar help button */
.topbar-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  background: light-dark(oklch(0.94 0.04 180), oklch(0.25 0.06 180));
  color: light-dark(oklch(0.35 0.12 180), oklch(0.85 0.1 180));
  border: 1px solid oklch(0.7 0.14 180 / 25%);
  border-radius: var(--radius-full);
  padding: 0.3em 0.8em;
  font-size: var(--step--1);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;

  &:hover {
    background: light-dark(oklch(0.88 0.07 180), oklch(0.3 0.08 180));
  }

  &:active {
    transform: scale(0.96);
  }
}

/* Student: topbar leave button */
.topbar-leave-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  background: transparent;
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: var(--r-m);
  padding: 0.3em 0.7em;
  font-size: var(--step--1);
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;

  &:hover { color: var(--ink); border-color: var(--ink-3); }

  @media (max-width: 479px) {
    .topbar-leave-text { display: none; }
  }
}

/* Student: topbar help status badge (when in queue) — clickable to cancel */
.topbar-help-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  background: light-dark(oklch(0.94 0.04 180), oklch(0.25 0.04 180));
  color: light-dark(oklch(0.35 0.12 180), oklch(0.85 0.08 180));
  border-radius: var(--radius-full);
  padding: 0.3em 0.8em;
  font-size: var(--step--1);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  animation: fadeIn 0.2s ease;

  &:hover {
    opacity: 0.8;
  }

  /* "På vej!" state — green */
  &.topbar-help-responded {
    background: light-dark(oklch(0.92 0.06 163), oklch(0.22 0.06 163));
    color: light-dark(oklch(0.35 0.12 163), oklch(0.85 0.1 163));
  }

  /* "Kom ind!" state — red + pulse so students notice immediately */
  &.topbar-help-enroute {
    background: light-dark(oklch(0.93 0.06 27), oklch(0.28 0.08 27));
    color: light-dark(oklch(0.38 0.18 27), oklch(0.92 0.1 27));
    animation: helpEnroutePulse 1.4s ease-in-out infinite;
  }
}

@keyframes helpEnroutePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.75; transform: scale(1.04); }
}

@media (prefers-reduced-motion: reduce) {
  .topbar-help-enroute { animation: none !important; }
}

.topbar-help-icon .hi,
.topbar-help-status-icon .hi {
  inline-size: 1em;
  block-size: 1em;
}

/* (topbar-help-cancel span removed — badge text swaps instead) */

/* (help-input panels replaced by .compact-dialog — see above) */

/* (main-content help-status removed — queue info shown only in topbar badge) */

/* Teacher: overview help section */
.overview-help-section {
  margin-block-end: var(--space-l);
  padding-block-end: var(--space-m);
  border-block-end: 1px solid light-dark(oklch(0.9 0.01 264), oklch(0.3 0.01 264));
}

.overview-help-title {
  font-size: var(--step-0);
  font-weight: 700;
  margin-block-end: var(--space-s);
}

.overview-help-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs) var(--space-s);
  padding: var(--space-s) var(--space-m);
  background: light-dark(oklch(0.97 0.01 264), oklch(0.2 0.02 264));
  border-radius: var(--radius-s);
  margin-block-end: var(--space-xs);

  &.help-enroute {
    background: light-dark(oklch(0.95 0.04 163), oklch(0.2 0.04 163));
    border-inline-start: 3px solid oklch(0.72 0.19 163);
  }

  &.help-comehere {
    background: light-dark(oklch(0.96 0.04 75), oklch(0.2 0.04 75));
    border-inline-start: 3px solid oklch(0.75 0.17 75);
  }
}

.overview-help-pos {
  font-weight: 800;
  color: light-dark(oklch(0.5 0.15 264), oklch(0.8 0.12 264));
  margin-inline-end: 0.15em;
}

.overview-help-group {
  font-weight: 700;
  font-size: var(--step-0);
}

.overview-help-step {
  font-size: var(--step--2);
  color: light-dark(oklch(0.5 0.08 264), oklch(0.7 0.08 264));
  background: light-dark(oklch(0.93 0.02 264), oklch(0.25 0.03 264));
  padding: 0.1em 0.5em;
  border-radius: var(--radius-full);
}

.overview-help-location {
  font-size: var(--step--1);
  font-weight: 600;
  color: light-dark(oklch(0.45 0.1 75), oklch(0.8 0.1 75));
}

.overview-help-time {
  font-size: var(--step--1);
  color: light-dark(oklch(0.55 0.02 264), oklch(0.65 0.02 264));
}

.overview-help-message {
  flex-basis: 100%;
  font-size: var(--step--1);
  color: light-dark(oklch(0.45 0.02 264), oklch(0.75 0.02 264));
  font-style: italic;
}

.overview-help-actions {
  margin-inline-start: auto;
  display: flex;
  gap: var(--space-xs);
}

/* Teacher desktop: badge in control bar — styled as ctrl-pill */
.help-control-badge {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  padding: var(--space-s) var(--space-m);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  animation: slideUp 0.3s ease;
  transition: background 0.2s ease;

  &:hover {
    background: oklch(0.62 0.21 264 / 35%);
  }
}

/* Mobile remote: help panel */
.remote-help-entry {
  padding: var(--space-m);
  background: light-dark(oklch(0.97 0.01 264), oklch(0.2 0.02 264));
  border-radius: var(--radius-m);
  margin-block-end: var(--space-s);

  &.help-enroute {
    background: light-dark(oklch(0.95 0.04 163), oklch(0.2 0.04 163));
    border-inline-start: 3px solid oklch(0.72 0.19 163);
  }

  &.help-comehere {
    background: light-dark(oklch(0.96 0.04 75), oklch(0.2 0.04 75));
    border-inline-start: 3px solid oklch(0.75 0.17 75);
  }
}

.remote-help-info {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  margin-block-end: var(--space-xs);
}

.remote-help-pos {
  font-weight: 800;
  color: light-dark(oklch(0.5 0.15 264), oklch(0.8 0.12 264));
}

.remote-help-group { font-weight: 700; }

.remote-help-step {
  font-size: var(--step--2);
  color: light-dark(oklch(0.5 0.08 264), oklch(0.7 0.08 264));
  background: light-dark(oklch(0.93 0.02 264), oklch(0.25 0.03 264));
  padding: 0.1em 0.5em;
  border-radius: var(--radius-full);
}

.remote-help-meta {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  margin-block-end: var(--space-xs);
}

.remote-help-location {
  font-size: var(--step--1);
  font-weight: 600;
  color: light-dark(oklch(0.45 0.1 75), oklch(0.8 0.1 75));
  flex: 1;
}

.remote-help-time {
  font-size: var(--step--1);
  color: light-dark(oklch(0.55 0.02 264), oklch(0.65 0.02 264));
  margin-inline-start: auto;
}

.remote-help-msg {
  font-size: var(--step--1);
  color: light-dark(oklch(0.45 0.02 264), oklch(0.75 0.02 264));
  font-style: italic;
  margin-block-end: var(--space-xs);
}

.remote-help-actions {
  display: flex;
  gap: var(--space-xs);
  margin-block-start: var(--space-s);
}

/* Badge on help tab in remote control */
.help-tab-badge {
  background: oklch(0.63 0.24 27);
  color: oklch(0.98 0.01 80);
  font-size: var(--step--2);
  font-weight: 800;
  border-radius: var(--radius-full);
  padding: 0.1em 0.45em;
  margin-inline-start: 0.3em;
  min-inline-size: 1.2em;
  text-align: center;
  line-height: 1.3;
}


/* =============================================================================
   LOBBY QR-KNAP + DIALOG
   ============================================================================= */

.btn-lobby-qr {
  font-size: var(--step--1);
  padding: var(--space-xs) var(--space-m);
  margin-block-start: var(--space-xs);
  opacity: 0.8;

  &:hover { opacity: 1; }
}

.lobby-qr-dialog {
  inline-size: min(320px, 95vw);
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  background: var(--card);
  box-shadow: var(--shadow-hover);
  text-align: center;
  margin: auto;

  &[open] { display: block; }

  &::backdrop {
    background: oklch(0 0 0 / 40%);
    backdrop-filter: blur(3px);
  }
}

.lobby-qr-dialog-inner {
  padding: var(--space-xl) var(--space-l);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
}

.lobby-qr-heading {
  margin: 0;
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--text);
}

.lobby-qr-boks {
  background: oklch(1 0 0); /* ren hvid til QR-scanning — må ikke tematiseres */
  border-radius: var(--radius-m);
  padding: var(--space-s);
  box-shadow: var(--shadow-s);

  & img { display: block; }
}


/* =============================================================================
   MOBILE TEACHER REMOTE (.remote-control)
   Fills entire viewport — shown only on admin + mobile (via JS)
   ============================================================================= */

.remote-control {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: light-dark(oklch(0.97 0.008 240), oklch(0.12 0.02 260));
  overflow: hidden;
  z-index: 10;
}

/* Topbar */
.remote-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-s) var(--space-m);
  background: var(--card);
  border-block-end: 1px solid var(--border);
  flex-shrink: 0;
}

.remote-topbar-brand {
  font-size: var(--step-0);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.remote-topbar-dot { color: var(--green); }
.remote-topbar-d { color: var(--teal); }
.remote-topbar-code {
  color: var(--teal);
  margin-inline-start: 0.1em;
}

.remote-topbar-step {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text-muted);
}

/* Panel-tabs */
.remote-tabs {
  display: flex;
  background: var(--card);
  border-block-end: 1px solid var(--border);
  flex-shrink: 0;
}

.remote-tab {
  flex: 1;
  background: none;
  border: none;
  border-block-end: 3px solid transparent;
  padding: var(--space-s) var(--space-xs);
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;

  &:hover { color: var(--text); }
  &.remote-tab-active {
    color: var(--teal);
    border-block-end-color: var(--teal);
  }
}

/* Panels */
.remote-panel {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-m);
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.remote-panel-scroll {
  flex: 1;
}

/* Kontrol-panel: lobby */
.remote-lobby-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-l);
  flex: 1;
}

.remote-lobby-count {
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.remote-start-btn {
  font-size: var(--step-1);
  padding: var(--space-m) var(--space-2xl);
}

/* Kontrol-panel: live */
.remote-step-info {
  background: var(--card);
  border-radius: var(--radius-m);
  padding: var(--space-m);
  box-shadow: var(--shadow-s);
}

.remote-step-title {
  margin: 0;
  font-size: var(--step-1);
  font-weight: 700;
  color: var(--text);
  text-wrap: balance;
}

.remote-timer-stor {
  font-size: clamp(3rem, 15vw, 5rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--teal);
  letter-spacing: -0.02em;
  line-height: 1;
  padding-block: var(--space-s);

  &.remote-timer-expired {
    color: var(--red);
    animation: timerPuls 1.2s ease-in-out infinite;
  }
}

.remote-ctrl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-s);
}

.remote-ctrl-btn {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--space-m);
  font-family: var(--font-body);
  font-size: var(--step-0);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, transform 0.1s;
  box-shadow: var(--shadow-s);
  min-block-size: 56px;

  &:hover { background: light-dark(oklch(0.93 0.01 240), oklch(0.2 0.02 260)); }
  &:active { transform: scale(0.97); }

  &.remote-ctrl-next {
    background: var(--teal);
    color: oklch(1 0 0);
    border-color: var(--teal);
    &:hover { background: oklch(0.65 0.14 180); }
  }

  &.remote-ctrl-active {
    background: oklch(0.75 0.17 75 / 20%);
    border-color: oklch(0.75 0.17 75);
    color: oklch(0.55 0.15 75);
  }
}

/* Grupper-panel */
.remote-tabel {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
  background: var(--card);
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-s);

  & th, & td {
    padding: var(--space-xs) var(--space-s);
    text-align: start;
    border-block-end: 1px solid var(--border);
  }
  & th {
    font-weight: 700;
    color: var(--text-muted);
    font-size: var(--step--1);
    background: light-dark(oklch(0.95 0.005 240), oklch(0.18 0.02 260));
  }
  & tr:last-child td { border-block-end: none; }
}

/* Trin-oversigt-panel */
.remote-step-item {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding: var(--space-s) var(--space-m);
  background: var(--card);
  border-radius: var(--radius-m);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-s);

  &.remote-step-active {
    border-color: var(--teal);
    background: oklch(0.7 0.14 180 / 10%);
  }
  &.remote-step-done {
    opacity: 0.5;
  }
}

.remote-step-nr {
  inline-size: 1.8rem;
  block-size: 1.8rem;
  border-radius: var(--radius-full);
  background: light-dark(oklch(0.9 0.01 240), oklch(0.22 0.02 260));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--step--1);
  font-weight: 700;
  flex-shrink: 0;

  .remote-step-active & {
    background: var(--teal);
    color: oklch(1 0 0);
  }
}

.remote-step-item-title {
  flex: 1;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--text);
}

.remote-step-duration {
  font-size: var(--step--1);
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Svar-panel */
.remote-answer-card {
  background: var(--card);
  border-radius: var(--radius-m);
  border: 1px solid var(--border);
  padding: var(--space-m);
  box-shadow: var(--shadow-s);
}

.remote-answer-group {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--teal);
  margin-block-end: var(--space-xs);
}

.remote-answer-text {
  font-size: var(--step-0);
  color: var(--text);
  line-height: 1.5;
}

/* Tom besked */
.remote-tom-besked {
  color: var(--text-muted);
  font-size: var(--step--1);
  text-align: center;
  padding-block: var(--space-xl);
  margin: 0;
}

/* Bekræftelsesdialog: afslut gruppe-session */
#afslutDialog {
  inline-size: min(380px, 92vw);
  border: none;
  border-radius: var(--radius-l);
  padding: 0;
  background: var(--card);
  box-shadow: var(--shadow-hover);
  margin: auto;

  &[open] { display: block; }

  &::backdrop {
    background: oklch(0 0 0 / 35%);
    backdrop-filter: blur(2px);
  }
}

.dialog-box {
  padding: var(--space-xl);

  & h3 {
    font-size: var(--step-1);
    font-weight: 700;
    margin: 0 0 var(--space-s);
  }

  & p {
    font-size: var(--step--1);
    color: var(--text-muted);
    margin: 0 0 var(--space-l);
  }
}

.dialog-actions {
  display: flex;
  gap: var(--space-s);
  justify-content: flex-end;
}


/* =============================================================================
   BROADCAST BESKED
   ============================================================================= */

/* Elev-dialog: besked fra læreren */
#beskedDialog,
#beskedSendDialog {
  border: none;
  border-radius: var(--radius-l);
  padding: 0;
  background: var(--card);
  box-shadow: var(--shadow-hover);
  margin: auto;
}

#beskedSendDialog {
  inline-size: min(520px, 92vw);
}

#beskedSendDialog[open] { display: block; }

#beskedSendDialog::backdrop,
#beskedDialog::backdrop {
  background: oklch(0 0 0 / 35%);
  backdrop-filter: blur(2px);
}

.besked-dialog-box {
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-l);
}

.besked-dialog-header {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding: var(--space-s) var(--space-l);
  background: oklch(0.7 0.14 180);
  color: oklch(1 0 0);
  font-weight: 700;
  font-size: var(--step-0);
  letter-spacing: 0.02em;
}

.besked-dialog-box p {
  font-size: var(--step-1);
  font-weight: 600;
  padding: var(--space-l) var(--space-l) var(--space-s);
  margin: 0;
  line-height: 1.4;
}

.besked-dialog-box .dialog-actions {
  padding: 0 var(--space-l) var(--space-l);
}

/* Hurtigbesked-knapper (deles af desktop-dialog og mobil-remote) */
.besked-quick-btns {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-block-end: var(--space-m);
}

.quick-msg-btn {
  font-family: var(--font-body);
  font-size: var(--step--1);
  font-weight: 600;
  padding: var(--space-xs) var(--space-m);
  border: 1.5px solid oklch(0.7 0.14 180 / 50%);
  border-radius: var(--radius-full);
  background: oklch(0.7 0.14 180 / 8%);
  color: light-dark(oklch(0.35 0.1 180), oklch(0.75 0.1 180));
  cursor: pointer;
  transition: background 0.12s;

  &:hover {
    background: oklch(0.7 0.14 180 / 18%);
    border-color: oklch(0.7 0.14 180 / 70%);
  }
}

/* Aktiv-besked-indikator i lærer-send-dialog */
.aktiv-besked-viser {
  font-size: var(--step--1);
  color: var(--muted);
  padding: var(--space-xs) var(--space-s);
  background: light-dark(oklch(0.96 0.01 240), oklch(0.2 0.01 240));
  border-radius: var(--radius-s);
  margin-block-end: var(--space-s);

  & span { font-style: italic; color: oklch(0.7 0.14 180); }
}

/* Mobil-remote: besked-sektion */
.remote-besked-section {
  padding-block-start: var(--space-l);
  margin-block-start: var(--space-l);
  border-block-start: 1px solid light-dark(oklch(0.9 0.01 240), oklch(0.25 0.01 240));
}

.remote-besked-label {
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-block-end: var(--space-s);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.remote-besked-input-row {
  display: flex;
  gap: var(--space-xs);
  margin-block-end: var(--space-s);
}

.remote-besked-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: var(--step-0);
  padding: var(--space-s) var(--space-m);
  border: 1.5px solid light-dark(oklch(0.85 0.02 240), oklch(0.3 0.02 240));
  border-radius: var(--radius-m);
  background: light-dark(oklch(1 0 0), oklch(0.18 0.02 260));
  color: inherit;

  &:focus { outline: none; border-color: oklch(0.7 0.14 180); }
}

.remote-aktiv-besked {
  font-size: var(--step--1);
  color: oklch(0.7 0.14 180);
  font-style: italic;
  margin-block-end: var(--space-s);
}


/* =============================================================================
   NAME PROMPT PANEL — shown in lobby when requiresName=true
   ============================================================================= */

.name-prompt-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
  padding: var(--space-m) var(--space-l);
  background: light-dark(oklch(0.96 0.01 240), oklch(0.2 0.015 240));
  border-radius: var(--radius-l);
  inline-size: min(340px, 92vw);
  margin-block: var(--space-m);
}

.name-prompt-row {
  display: flex;
  gap: var(--space-s);
  inline-size: 100%;

  & .text-input {
    flex: 1;
    min-inline-size: 0;
  }
}

/* Generic error state for text inputs (name prompt, group code input) */
.text-input.input-error {
  border-color: var(--red) !important;
  background: oklch(0.63 0.24 27 / 8%) !important;
  animation: shake 0.3s ease;
}


/* =============================================================================
   SELF-ORGANIZED GROUPS (mode C) — in lobby groupSelectPanel
   ============================================================================= */

/* Container shown when selfOrganized and no group chosen yet */
#selfOrgPanel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
  inline-size: min(320px, 90vw);
}

/* Divider between "Opret" and "Join" */
.self-org-divider {
  font-size: var(--step--1);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-s);
  inline-size: 100%;

  &::before, &::after {
    content: '';
    flex: 1;
    block-size: 1px;
    background: var(--border);
  }
}

/* Row with code input + join button */
.join-group-row {
  display: flex;
  gap: var(--space-s);
  inline-size: 100%;

  & .text-input {
    flex: 1;
    min-inline-size: 0;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
  }
}

/* Error message under input */
.self-org-error {
  font-size: var(--step--1);
  color: var(--red);
  text-align: center;
  padding: var(--space-xs) var(--space-s);
  background: oklch(0.63 0.24 27 / 8%);
  border-radius: var(--radius-s);
  inline-size: 100%;
}

/* Confirmation panel — shown after successfully creating/joining */
#selfOrgConfirm {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-s);
  inline-size: min(320px, 90vw);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: var(--space-l);
  box-shadow: var(--shadow-s);
  text-align: center;
}

.self-org-confirm-text {
  font-size: var(--step-0);
  text-align: center;
  line-height: 1.5;
  margin: 0;

  & strong {
    color: var(--teal);
  }
}

/* The shareable group code badge — monospaced, prominent */
.self-org-code-badge {
  display: inline-block;
  font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
  font-size: var(--step-2);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: oklch(1 0 0);
  background: var(--teal);
  padding: 0.1em 0.5em;
  border-radius: var(--radius-m);
  margin-block-start: 0.1em;
}

.self-org-share-hint {
  font-size: var(--step--1);
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* Late-join self-org panel (shown in live mode) */
.late-self-org-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-m);
  padding-block-start: var(--space-s);
  inline-size: 100%;
}


/* =============================================================================
   GROUP-PACED ISOLATION — label shown when teacher cannot control steps
   ============================================================================= */

.paced-info-label {
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--muted);
  background: light-dark(oklch(0.93 0.01 240), oklch(0.22 0.01 240));
  border-radius: var(--radius-full);
  padding: 0.3em 0.9em;
  white-space: nowrap;
}

/* Mobile remote: paced label inside ctrl area */
.remote-paced-label {
  grid-column: 1 / -1;
  text-align: center;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--muted);
  padding: var(--space-s);
  background: light-dark(oklch(0.93 0.01 240), oklch(0.22 0.01 240));
  border-radius: var(--radius-m);
}


/* =============================================================================
   ALL-ANSWERS ACCORDION — mobile remote "Svar" tab
   ============================================================================= */

/* One block per step with requiresAnswer=true */
.answer-step-block {
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  margin-block-end: var(--space-s);
  overflow: hidden;

  /* Highlight the currently active step */
  &.answer-step-block-active {
    border-color: oklch(0.7 0.14 180 / 50%);
    box-shadow: 0 0 0 2px oklch(0.7 0.14 180 / 15%);
  }
}

.answer-step-header {
  display: flex;
  align-items: center;
  gap: var(--space-s);
  padding: var(--space-s) var(--space-m);
  background: light-dark(oklch(0.96 0.005 240), oklch(0.2 0.01 240));
  font-size: var(--step--1);
  font-weight: 600;
}

.answer-step-nr {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 1.4em;
  block-size: 1.4em;
  border-radius: 50%;
  background: var(--teal);
  color: oklch(1 0 0);
  font-size: var(--step--2);
  font-weight: 700;
  flex-shrink: 0;
}

.answer-step-title {
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.answer-step-count {
  font-size: var(--step--2);
  font-weight: 500;
  color: var(--muted);
  flex-shrink: 0;
}

.answer-step-body {
  padding: var(--space-s);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

