/* KlasseKit app styles. All values come from tokens.css; see docs/design/README.md for the spec. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--kk-paper);
  color: var(--kk-ink);
  font: var(--kk-text-body);
  -webkit-font-smoothing: antialiased;
}
body.is-tool { background: var(--kk-tool); }
h1, h2, h3, p { margin: 0; }
a { color: var(--kk-ink); }
a:hover { color: var(--kk-muted); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

/* Custom properties resolve where they're declared, so re-derive the tool colors wherever a hue is set */
[style*="--kk-hue"] {
  --kk-tool-soft: oklch(0.94 0.045 var(--kk-hue));
  --kk-tool: oklch(0.86 0.085 var(--kk-hue));
  --kk-tool-ink: oklch(0.30 0.10 var(--kk-hue));
}

:focus-visible { outline: 2.5px solid var(--kk-tool-ink); outline-offset: 2px; }

/* Type helpers */
.kk-title   { font: var(--kk-text-title); letter-spacing: -0.015em; }
.kk-heading { font: var(--kk-text-heading); }
.kk-label   { font: var(--kk-text-label); }
.kk-small   { font: var(--kk-text-small); }
.kk-mono    { font: var(--kk-text-mono); color: var(--kk-muted); white-space: nowrap; flex-shrink: 0; }
.kk-muted   { color: var(--kk-muted); }

/* ---------- Logo ---------- */
.kk-logo {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 8px; background: var(--kk-ink);
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 6px;
}
.kk-logo i:nth-child(1) { background: oklch(0.85 0.09 250); border-radius: 2px; }
.kk-logo i:nth-child(2) { background: oklch(0.85 0.09 70);  border-radius: 50%; }
.kk-logo i:nth-child(3) { background: oklch(0.85 0.09 150); border-radius: 50%; }
.kk-logo i:nth-child(4) { background: oklch(0.85 0.09 330); border-radius: 2px; }

/* ---------- Buttons ---------- */
.kk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; text-decoration: none; white-space: nowrap; user-select: none;
  font-weight: 700;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.kk-btn:active:not(:disabled) { transform: scale(var(--kk-press-scale)); }

.kk-btn--md { height: var(--kk-h-md); padding: 0 22px; border-radius: var(--kk-radius-control); font-size: 17px; }
.kk-btn--sm { height: var(--kk-h-sm); padding: 0 16px; border-radius: var(--kk-radius-control-sm); font-size: 15px; }
.kk-btn--lg { height: var(--kk-h-lg); padding: 0 28px; border-radius: var(--kk-radius-control-lg); font-size: 24px; font-weight: 800; width: 100%; }

.kk-btn--primary { background: var(--kk-ink); color: #fff; }
.kk-btn--primary.kk-btn--md { padding: 0 26px; }
.kk-btn--primary:hover:not(:disabled) { background: var(--kk-ink-hover); color: #fff; }
.kk-btn--primary:disabled { background: var(--kk-control-off); cursor: not-allowed; }

.kk-btn--secondary { background: var(--kk-paper); border: 1.5px solid var(--kk-line); }
.kk-btn--secondary:hover { border-color: var(--kk-ink); color: var(--kk-ink); }

/* Tool-frame buttons (← KlasseKit, Fuld skærm) */
.kk-btn--frame {
  font-size: 15px; padding: 10px 16px; border-radius: 12px;
  background: var(--kk-paper); color: var(--kk-ink);
}
.kk-btn--frame:hover { background: #fff; color: var(--kk-ink); }

.kk-link {
  background: none; border: 0; padding: 0;
  font-weight: 700; font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px;
}
.kk-link:hover { color: var(--kk-muted); }

/* ---------- Text field (designsystem 05) ---------- */
.kk-field { display: flex; flex-direction: column; gap: 8px; }
.kk-field__label { font: var(--kk-text-label); }
.kk-field__optional { font-weight: 400; color: var(--kk-muted); }
.kk-field__hint { font: var(--kk-text-small); color: var(--kk-muted); }
.kk-field__error { font: var(--kk-text-small); font-weight: 600; color: var(--kk-error); }
.kk-input {
  width: 100%; height: var(--kk-h-md);
  border: 0; outline: none; border-radius: var(--kk-radius-control);
  background: var(--kk-fill); padding: 0 18px;
  font-size: 17px; color: var(--kk-ink);
  transition: background-color .15s, box-shadow .15s;
}
.kk-input:focus { background: #fff; box-shadow: 0 0 0 2.5px var(--kk-tool-ink); }
.kk-input::placeholder { color: var(--kk-faint); }
.kk-field.is-invalid :is(.kk-input, .kk-textarea) { background: #fff; box-shadow: 0 0 0 2px var(--kk-error); }
.kk-field.is-invalid :is(.kk-input, .kk-textarea):focus { box-shadow: 0 0 0 2.5px var(--kk-error); }

/* Messages: form-level error (error hue in text and stroke only) and neutral notice */
.kk-alert {
  border-radius: var(--kk-radius-control); padding: 14px 18px;
  border: 2px solid var(--kk-error); color: var(--kk-error);
  font-weight: 600; font-size: 15px; line-height: 1.45;
}
.kk-notice {
  border-radius: var(--kk-radius-control); padding: 14px 18px;
  background: var(--kk-tool-soft); color: var(--kk-tool-ink);
  font-weight: 600; font-size: 16px; line-height: 1.45;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
}
.kk-notice .kk-link { color: var(--kk-tool-ink); }

/* ---------- Badge ---------- */
.kk-badge {
  display: inline-block; white-space: nowrap;
  font-weight: 600; font-size: 12px; line-height: 1.3;
  padding: 5px 10px; border-radius: var(--kk-radius-pill);
  background: rgba(255, 255, 255, .6);
}
.kk-badge--frame { font-size: 13px; padding: 6px 12px; color: var(--kk-tool-ink); }

/* ---------- Forside ---------- */
.kk-home {
  min-height: 100vh; max-width: 1280px; margin: 0 auto;
  padding: 28px 32px 48px;
  display: flex; flex-direction: column; gap: var(--kk-space-7);
}
.kk-home__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 8px; }
.kk-account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.kk-account form { margin: 0; }
.kk-account__name { font: var(--kk-text-small); color: var(--kk-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kk-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.kk-brand:hover { color: var(--kk-ink); }
.kk-brand__word { font-weight: 800; font-size: 24px; letter-spacing: -0.01em; }

.kk-hero { padding: 0 8px; display: flex; flex-direction: column; gap: 16px; }
.kk-hero__title {
  font-weight: 850; font-size: clamp(44px, 6.5vw, 80px);
  letter-spacing: -0.03em; line-height: .95; max-width: 880px; text-wrap: balance;
}
.kk-hero__lead { font-size: clamp(17px, 1.6vw, 19px); line-height: 1.5; color: var(--kk-muted); max-width: 560px; }
.kk-hero .kk-btn { margin-top: 8px; }

.kk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }

.kk-tile {
  position: relative; overflow: hidden; min-height: 280px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: 26px 28px; border-radius: var(--kk-radius-tile);
  background: var(--kk-tool); color: var(--kk-tool-ink); text-decoration: none;
  transition: transform .15s;
}
.kk-tile:hover { transform: scale(.99); color: var(--kk-tool-ink); }
.kk-tile--lg { grid-column: span 2; }
.kk-tile__badges { display: flex; gap: 6px; flex-wrap: wrap; position: relative; z-index: 1; }
.kk-tile__icon {
  position: absolute; right: 36px; top: 50%; transform: translateY(-50%);
  width: 124px; height: 124px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.kk-tile__icon i { border-radius: 50%; background: oklch(0.95 0.04 var(--kk-hue)); }
.kk-tile__icon i:nth-child(1), .kk-tile__icon i:nth-child(4) { background: var(--kk-tool-ink); }
/* Svartavlen: a question bar on top, two answer bars below */
.kk-tile__icon--svar { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr 1fr; }
.kk-tile__icon--svar i { border-radius: 999px; background: oklch(0.95 0.04 var(--kk-hue)); }
.kk-tile__icon--svar i:nth-child(1) { background: var(--kk-tool-ink); }
.kk-tile__icon--svar i:nth-child(2) { width: 78%; justify-self: end; }
.kk-tile__icon--svar i:nth-child(3) { width: 58%; justify-self: end; }
.kk-tile__text { position: relative; display: flex; flex-direction: column; gap: 6px; }
.kk-tile__name { font-weight: 850; font-size: 32px; letter-spacing: -0.025em; line-height: 1; }
.kk-tile--lg .kk-tile__name { font-size: clamp(32px, 4vw, 48px); }
.kk-tile__desc { font-weight: 500; font-size: 18px; }

.kk-tile-placeholder {
  min-height: 280px; border-radius: var(--kk-radius-tile); border: 2px dashed var(--kk-line);
  padding: 26px 28px; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px;
}
.kk-tile-placeholder__title { font-weight: 800; font-size: 26px; letter-spacing: -0.015em; color: var(--kk-muted); }
.kk-tile-placeholder__text { font-size: 16px; line-height: 1.45; color: var(--kk-faint); }

/* ---------- Konto (opret, log ind, adgangskode) ---------- */
.kk-auth {
  width: 100%; max-width: 480px; margin: auto;   /* centered in the space below the header */
  display: flex; flex-direction: column; gap: 24px;
}
.kk-auth__title { font: var(--kk-text-display); letter-spacing: -0.025em; text-align: center; }
.kk-auth__card {
  background: var(--kk-fill); border-radius: var(--kk-radius-tile);
  padding: 32px; display: flex; flex-direction: column; gap: 24px;
}
/* Fields sit on the fill, so they rest on paper instead */
.kk-auth__card :is(.kk-input, .kk-textarea) { background: var(--kk-paper); }
.kk-auth__card :is(.kk-input, .kk-textarea):focus { background: #fff; }
.kk-auth__lead { font-size: 17px; line-height: 1.5; color: var(--kk-muted); }
.kk-auth__lead strong { color: var(--kk-ink); font-weight: 700; }
.kk-auth__form { display: flex; flex-direction: column; gap: 20px; }
.kk-auth__form .kk-btn--lg { margin-top: 4px; }
.kk-auth__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; }
.kk-auth__links { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.kk-auth__alt { font-size: 15px; color: var(--kk-muted); }
.kk-auth__alt .kk-link { font-size: 15px; }

/* ---------- Tool frame ---------- */
.kk-frame {
  min-height: 100vh; background: var(--kk-tool);
  padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
.kk-frame:fullscreen { overflow: auto; }
.kk-frame__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kk-frame__left, .kk-frame__right { display: flex; align-items: center; gap: 16px; }
.kk-frame__right { gap: 8px; }
.kk-frame__title { font-weight: 850; font-size: 28px; letter-spacing: -0.02em; color: var(--kk-tool-ink); }
.kk-stage { flex: 1; background: var(--kk-paper); border-radius: var(--kk-radius-stage); padding: 32px; }

/* ---------- Form controls ---------- */
.kk-textarea {
  width: 100%; resize: vertical;
  border: 0; outline: none; border-radius: var(--kk-radius-control);
  background: var(--kk-fill); padding: 16px 18px;
  font-size: 17px; line-height: 1.5; color: var(--kk-ink);
  transition: background-color .15s, box-shadow .15s;
}
.kk-textarea:focus { background: #fff; box-shadow: 0 0 0 2.5px var(--kk-tool-ink); }
.kk-textarea::placeholder { color: var(--kk-faint); }

.kk-seg { display: flex; gap: 4px; padding: 4px; border-radius: var(--kk-radius-control); background: var(--kk-paper); }
.kk-seg__opt {
  flex: 1; height: 48px; border: 0; border-radius: 11px;
  background: transparent; color: var(--kk-ink);
  font-weight: 700; font-size: 16px; white-space: nowrap; padding: 0 12px;
}
.kk-seg__opt[aria-pressed="true"] { background: var(--kk-ink); color: #fff; }
.kk-seg__opt[aria-pressed="false"]:hover { background: var(--kk-fill); }

.kk-stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.kk-stepper__label { font-weight: 700; font-size: 17px; white-space: nowrap; }
.kk-stepper__controls { display: flex; align-items: center; gap: 12px; }
.kk-stepper__btn {
  width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: var(--kk-paper); color: var(--kk-ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 24px; user-select: none;
  transition: transform .1s, background-color .15s;
}
.kk-stepper__btn:hover { background: #fff; }
.kk-stepper__btn:active { transform: scale(.94); }
.kk-stepper__btn--ink { background: var(--kk-ink); color: #fff; }
.kk-stepper__btn--ink:hover { background: var(--kk-ink-hover); }
.kk-stepper__value { font-weight: 850; font-size: 44px; min-width: 56px; text-align: center; line-height: 1; }

/* Switch (designsystem 06 Kontakt): 56×34 track, tool-ink when on */
.kk-switch { display: grid; grid-template-columns: auto; gap: 6px; }
.kk-switch__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.kk-switch__label { display: inline-flex; align-items: center; gap: 14px; font-size: 17px; cursor: pointer; user-select: none; width: fit-content; }
.kk-switch__track {
  flex-shrink: 0; width: 56px; height: 34px; padding: 4px; border-radius: var(--kk-radius-pill);
  background: #d9d3c9;   /* off track, from designsystem.dc.html */
  display: flex; transition: background-color .15s;
}
.kk-switch__track::after {
  content: ''; width: 26px; height: 26px; border-radius: 50%; background: #fff;
  transition: transform .15s var(--kk-ease-out);
}
.kk-switch__input:checked + .kk-switch__label .kk-switch__track { background: var(--kk-tool-ink); }
.kk-switch__input:checked + .kk-switch__label .kk-switch__track::after { transform: translateX(22px); }
.kk-switch__input:focus-visible + .kk-switch__label .kk-switch__track { outline: 2.5px solid var(--kk-tool-ink); outline-offset: 2px; }
.kk-switch__hint { font: var(--kk-text-small); color: var(--kk-muted); padding-left: 70px; }

.kk-empty {
  border-radius: 16px; padding: 20px 22px;
  background: repeating-linear-gradient(135deg, var(--kk-fill) 0 10px, var(--kk-paper) 10px 20px);
  font-size: 15px; line-height: 1.5; color: var(--kk-muted);
}

/* ---------- Holdmaskinen: opsætning ---------- */
.hm-setup { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.hm-left { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hm-names, .hm-history { display: flex; flex-direction: column; gap: 8px; }
.hm-history { gap: 10px; }
.hm-row-between { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.hm-row-between > .kk-title, .hm-row-between > .kk-heading { white-space: nowrap; }

.hm-history__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hm-hist {
  display: flex; align-items: center; gap: 16px;
  padding-right: 12px; border-radius: var(--kk-radius-control);
  background: var(--kk-fill); transition: background-color .15s;
}
.hm-hist:hover, .hm-hist.is-active { background: var(--kk-tool-soft); }
.hm-hist__load {
  flex: 1; min-width: 0; text-align: left;
  border: 0; background: none; border-radius: var(--kk-radius-control);
  padding: 12px 0 12px 18px;
  display: flex; flex-direction: column; gap: 2px;
}
.hm-hist__names { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-hist__meta { font: 400 12px/1.4 var(--kk-font-mono); color: var(--kk-muted); }
.hm-hist__del {
  width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 50%;
  background: none; color: var(--kk-muted); font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.hm-hist__del:hover { background: #fff; color: var(--kk-ink); }

.hm-panel {
  flex: 2 1 320px; min-width: 0; position: sticky; top: 20px;
  background: var(--kk-fill); border-radius: var(--kk-radius-tile); padding: 28px;
  display: flex; flex-direction: column; gap: 26px;
}
.hm-field { display: flex; flex-direction: column; gap: 10px; }
.hm-preview { border-top: 1.5px dashed #ddd6cb; padding-top: 22px; display: flex; flex-direction: column; gap: 4px; }
.hm-preview__main { font-weight: 850; font-size: 40px; letter-spacing: -0.02em; line-height: 1.1; color: var(--kk-tool-ink); }
.hm-preview__sub { font-size: 16px; color: var(--kk-muted); }

/* ---------- Holdmaskinen: blanding og resultat ---------- */
.hm-mix { display: flex; flex-direction: column; gap: 24px; }
.hm-mix__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hm-mix__heading { display: flex; flex-direction: column; gap: 4px; }
.hm-mix__title { font-weight: 850; font-size: clamp(32px, 5vw, 48px); letter-spacing: -0.025em; line-height: 1; }
.hm-mix__actions { display: flex; gap: 10px; flex-wrap: wrap; opacity: 1; transition: opacity .3s; }
.hm-mix__actions[inert] { opacity: 0; }

.hm-arena { position: relative; transition: height .4s; }
.hm-wheel {
  position: absolute; top: 0; border-radius: 50%;
  background: var(--kk-fill); box-shadow: inset 0 0 0 10px #ece7df;
  transition: opacity .45s, transform .45s;
}
.hm-card {
  position: absolute; border-radius: var(--kk-radius-tile); padding: 16px 18px;
  transition: opacity .4s, transform .4s, top .55s var(--kk-ease-inout);
}
.hm-arena.is-resizing, .hm-arena.is-resizing .hm-card, .hm-arena.is-resizing .hm-wheel { transition: none; }
.hm-card__title { font-weight: 850; font-size: 24px; letter-spacing: -0.015em; }
.hm-chip {
  position: absolute; left: 0; top: 0; height: 38px;
  display: block; padding: 0 14px;
  border-radius: var(--kk-radius-pill); background: #fff;
  font-weight: 600; font-size: 17px; line-height: 38px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  will-change: transform;
}

/* ---------- Svartavlen: tavler og editor ---------- */
.sv-stage { display: flex; flex-direction: column; gap: 28px; }
.sv-row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; }
.sv-row-between form { margin: 0; }
.sv-narrow { width: 100%; max-width: 860px; display: flex; flex-direction: column; gap: 20px; }

/* Page head on the teacher pages: trail, title + meta, actions (all small; the page's one big action lives in the content) */
.sv-head { display: flex; flex-direction: column; gap: 10px; }
.sv-head__crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; font: var(--kk-text-small); color: var(--kk-muted); }
.sv-head__crumbs li { min-width: 0; overflow-wrap: anywhere; }
.sv-head__crumbs li + li::before { content: '›'; padding: 0 8px; color: var(--kk-faint); }
.sv-head__crumbs .kk-link { font-size: 14px; }
.sv-head__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.sv-head__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sv-head__title { overflow-wrap: anywhere; }
.sv-head__meta { white-space: normal; }
.sv-head__actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sv-head__actions form { margin: 0; }
.sv-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sv-default-submit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); padding: 0; border: 0; }

.sv-intro { max-width: 720px; display: flex; flex-direction: column; gap: 16px; padding: 16px 0; }
.sv-intro__title { font: var(--kk-text-display); letter-spacing: -0.025em; text-wrap: balance; }
.sv-intro__lead { font-size: 19px; line-height: 1.5; color: var(--kk-muted); }
.sv-intro__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* Board rows: same look as "Seneste lister" in Holdmaskinen */
.sv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sv-list__row {
  display: flex; align-items: center; gap: 12px; padding-right: 14px;
  border-radius: var(--kk-radius-control); background: var(--kk-fill); transition: background-color .15s;
}
.sv-list__row:hover { background: var(--kk-tool-soft); }
.sv-list__main {
  flex: 1; min-width: 0; padding: 14px 0 14px 18px; border-radius: var(--kk-radius-control);
  display: flex; flex-direction: column; gap: 2px; text-decoration: none;
}
.sv-list__main:hover { color: var(--kk-ink); }
.sv-list__title { font-weight: 600; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-list__meta { font: 400 12px/1.4 var(--kk-font-mono); color: var(--kk-muted); }
.sv-list__actions { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; justify-content: flex-end; }
.sv-list__actions form { margin: 0; }

/* "Live" badge (designsystem 07): tool color with a dot */
.sv-live {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex-shrink: 0;
  font-weight: 600; font-size: 13px; padding: 6px 12px; border-radius: var(--kk-radius-pill);
  background: var(--kk-tool); color: var(--kk-tool-ink); text-decoration: none;
}
a.sv-live:hover { color: var(--kk-tool-ink); background: var(--kk-tool-soft); }
.sv-live__dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sv-live.is-off { background: var(--kk-fill); color: var(--kk-muted); }

/* Editor: content left, start panel right (as Holdmaskinen's setup) */
.sv-setup { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.sv-left { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.sv-block { display: flex; flex-direction: column; gap: 16px; }
.sv-delete { color: var(--kk-muted); }
.sv-delete .kk-link { color: inherit; }
.sv-delete .kk-link:hover { color: var(--kk-ink); }
.sv-side { flex: 2 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.sv-questions { display: flex; flex-direction: column; gap: 12px; scroll-margin-top: 20px; }
.sv-qlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sv-q {
  display: flex; gap: 12px; align-items: flex-start; scroll-margin-top: 20px;
  background: var(--kk-fill); border-radius: var(--kk-radius-tile); padding: 12px;
}
.sv-q__num {
  flex-shrink: 0; width: 30px; height: 30px; margin-top: 10px; border-radius: 50%;
  background: var(--kk-tool); color: var(--kk-tool-ink);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.sv-q__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sv-q__text { background: var(--kk-paper); resize: none; field-sizing: content; min-height: 48px; padding-top: 12px; padding-bottom: 12px; }
.sv-q__row { display: flex; align-items: center; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; }
.sv-q__row .kk-switch__label { font-size: 15px; }
/* Locked (round running): plain text instead of fields */
.sv-locked {
  display: flex; align-items: flex-start; gap: 12px;
  border-radius: var(--kk-radius-control); padding: 14px 18px;
  background: var(--kk-tool-soft); color: var(--kk-tool-ink); font-size: 16px; line-height: 1.45;
}
.sv-locked strong { font-weight: 700; }
.sv-locked svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; }
.sv-q--locked { padding: 14px 16px 14px 12px; }
.sv-q--locked .sv-q__num { margin-top: 0; }
.sv-q--locked .sv-q__body { gap: 2px; padding-top: 3px; }
.sv-q__locked-text { font-weight: 600; font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.sv-panel__unlock { align-self: stretch; display: flex; flex-direction: column; gap: 10px; margin: 6px 0 0; padding-top: 16px; border-top: 1.5px dashed #ddd6cb; }
.sv-q__tools { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.sv-q__tools .kk-mono { margin-right: 8px; }
.sv-icon-btn {
  width: 32px; height: 32px; flex-shrink: 0; border: 0; border-radius: 50%;
  background: none; color: var(--kk-muted); font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; transition: background-color .15s;
}
.sv-icon-btn:hover:not(:disabled) { background: var(--kk-paper); color: var(--kk-ink); }
.sv-icon-btn:disabled { color: var(--kk-control-off); cursor: default; }

.sv-panel {
  background: var(--kk-fill); border-radius: var(--kk-radius-tile); padding: 24px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
}
.sv-panel .kk-btn { align-self: stretch; }
.sv-code-inline { font: 500 15px var(--kk-font-mono); color: var(--kk-ink); }

/* Rounds in the editor's side column: links on their own line under each row */
.sv-rounds { display: flex; flex-direction: column; gap: 12px; }
.sv-rounds .sv-list__row { flex-wrap: wrap; padding-right: 0; }
.sv-rounds .sv-list__main { flex-basis: 100%; padding: 12px 16px 6px; }
.sv-rounds .sv-list__actions { flex-basis: 100%; justify-content: flex-start; gap: 4px 14px; padding: 0 16px 12px; }
.sv-rounds .sv-live { padding: 4px 10px; font-size: 12px; }

/* Status line when polling fails */
.sv-offline, .svar-offline {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; color: var(--kk-muted);
}
.sv-offline::before, .svar-offline::before { content: ''; width: 10px; height: 10px; border-radius: 3px; background: var(--kk-faint); }

/* ---------- Svartavlen: styring ---------- */
.sv-codebar {
  display: flex; align-items: center; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap;
  background: var(--kk-tool-soft); border-radius: var(--kk-radius-control); padding: 12px 20px;
}
.sv-codebar__label { font-size: 16px; color: var(--kk-tool-ink); overflow-wrap: anywhere; }
.sv-codebar__code { font: 700 28px/1.1 var(--kk-font-mono); letter-spacing: .02em; white-space: nowrap; }
.sv-control__grid { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.sv-control__main { flex: 3 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.sv-control__side {
  flex: 2 1 280px; min-width: 0; position: sticky; top: 20px;
  background: var(--kk-fill); border-radius: var(--kk-radius-tile); padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.sv-control.is-busy :is([data-sv-toggle], [data-sv-prev], [data-sv-next]) { opacity: .7; }

.sv-current {
  background: var(--kk-tool-soft); border-radius: var(--kk-radius-tile); padding: 20px 24px 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.sv-current__step { display: flex; align-items: center; gap: 4px; margin-left: -8px; }
.sv-current__step .kk-mono { padding: 0 4px; }
.sv-current .sv-icon-btn { color: var(--kk-tool-ink); }
.sv-current .sv-icon-btn:disabled { color: var(--kk-control-off); }
.sv-current .kk-mono { color: var(--kk-tool-ink); }
.sv-current__text { font: var(--kk-text-title); letter-spacing: -0.015em; overflow-wrap: anywhere; }
/* "Luk for svar" while open: the tool button (designsystem 04), so open and closed look different */
[data-sv-toggle].is-open { background: var(--kk-tool); color: var(--kk-tool-ink); }
[data-sv-toggle].is-open:hover:not(:disabled) { background: var(--kk-tool); color: var(--kk-tool-ink); filter: brightness(.97); }

.sv-qnav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sv-qnav__btn {
  width: 100%; display: flex; align-items: flex-start; gap: 12px; text-align: left;
  border: 0; border-radius: var(--kk-radius-control); padding: 10px 12px;
  background: var(--kk-paper); transition: background-color .15s;
}
.sv-qnav__btn:hover { background: #fff; }
.sv-qnav__btn.is-current { background: var(--kk-ink); color: #fff; }
.sv-qnav__num { font: 700 13px/1.55 var(--kk-font-mono); flex-shrink: 0; min-width: 18px; }
.sv-qnav__text { font-weight: 600; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }

.sv-feed { display: flex; flex-direction: column; gap: 10px; }
.sv-feed__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sv-answer {
  display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px;
  border-radius: var(--kk-radius-control); background: var(--kk-fill);
}
.sv-answer__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sv-answer__text { font-size: 17px; line-height: 1.4; overflow-wrap: anywhere; }
.sv-answer__meta { font: 400 12px/1.4 var(--kk-font-mono); color: var(--kk-muted); }
.sv-answer.is-hidden { background: none; box-shadow: inset 0 0 0 1.5px var(--kk-line); }
.sv-answer.is-hidden .sv-answer__text { color: var(--kk-faint); text-decoration: line-through; }

/* ---------- Svartavlen: skærm (projektor; tekst aldrig under 32px på fuld skærm) ---------- */
/* The screen has no tool frame: paper edge to edge, the KlasseKit mark small at the bottom */
.sv-screen {
  min-height: 100vh; background: var(--kk-paper);
  padding: clamp(20px, 3vw, 48px); display: flex; flex-direction: column; gap: 32px;
}
.sv-screen:fullscreen { overflow: auto; }
.sv-screen .sv-display { flex: 1; }
.sv-screen__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sv-screen__brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.sv-screen__brand .kk-logo { width: 24px; height: 24px; border-radius: 6px; padding: 5px; gap: 2px; }
.sv-screen__tool { font-weight: 600; color: var(--kk-muted); }
.sv-screen:fullscreen [data-kk-fullscreen] { display: none; }
.sv-display { display: flex; flex-direction: column; gap: 32px; }
.sv-join {
  display: flex; align-items: center; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap;
  background: var(--kk-tool-soft); border-radius: var(--kk-radius-tile); padding: 24px 28px;
}
.sv-join__text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sv-join__label { font-weight: 600; font-size: clamp(22px, 2.4vw, 36px); color: var(--kk-tool-ink); }
.sv-join__label strong { font-weight: 850; }
.sv-join__code { font: 700 clamp(64px, 9vw, 160px)/0.9 var(--kk-font-mono); letter-spacing: -0.02em; white-space: nowrap; }
.sv-join__qr {
  width: 180px; height: 180px; flex-shrink: 0;
  background: #fff; padding: 12px; border-radius: 16px; box-sizing: content-box;
}

.sv-board { display: flex; flex-direction: column; gap: 12px; }
.sv-board__meta { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.sv-board__index, .sv-board__count { font: 500 clamp(16px, 1.6vw, 24px)/1.3 var(--kk-font-mono); color: var(--kk-muted); }
.sv-live--board { font-size: clamp(14px, 1.4vw, 20px); padding: 6px 14px; }
.sv-board__question { font-weight: 850; font-size: clamp(36px, 4.4vw, 72px); letter-spacing: -0.025em; line-height: 1.05; text-wrap: balance; overflow-wrap: anywhere; }
.sv-board__closed { font-weight: 850; font-size: clamp(44px, 6vw, 96px); letter-spacing: -0.03em; line-height: 1; padding: 48px 0; }

.sv-cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start;
}
.sv-card {
  background: var(--kk-tool); color: var(--kk-tool-ink); border-radius: var(--kk-radius-tile);
  padding: 20px 24px; display: flex; flex-direction: column; gap: 8px;
}
.sv-card__text { font-weight: 700; font-size: clamp(20px, 1.9vw, 32px); line-height: 1.25; overflow-wrap: anywhere; }
.sv-card__name { font-weight: 500; font-size: clamp(15px, 1.2vw, 22px); }
/* New answers glide in; the shadow exists only during the animation (as the name chips in Holdmaskinen) */
.sv-card.is-new { animation: sv-card-in .55s var(--kk-ease-out); }
@keyframes sv-card-in {
  from { opacity: 0; transform: translateY(-16px) scale(.97); box-shadow: 0 3px 10px rgba(40,30,20,.12); }
  70%  { box-shadow: 0 3px 10px rgba(40,30,20,.12); }
  to   { opacity: 1; transform: none; box-shadow: none; }
}
/* On the projector (fullscreen) everything a class reads is at least 32px */
.sv-screen:fullscreen .sv-card__text { font-size: max(32px, 1.9vw); }
.sv-screen:fullscreen :is(.sv-card__name, .sv-board__index, .sv-board__count, .sv-live--board, .sv-join__label) { font-size: 32px; }

/* ---------- Svar (elevens telefon) ---------- */
.svar {
  min-height: 100vh; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 20px 16px 32px; display: flex; flex-direction: column; gap: 20px;
}
.svar__brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; align-self: flex-start; }
.svar__brand:hover { color: var(--kk-ink); }
.svar__brand .kk-logo { width: 24px; height: 24px; border-radius: 6px; padding: 5px; gap: 2px; }
.svar__brandword { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.svar__card {
  background: var(--kk-tool-soft); border-radius: var(--kk-radius-tile); padding: 24px 20px;
  display: flex; flex-direction: column; gap: 20px;
}
.svar__card :is(.kk-input, .kk-textarea) { background: var(--kk-paper); }
.svar__card :is(.kk-input, .kk-textarea):focus { background: #fff; }
.svar__main { display: flex; flex-direction: column; gap: 12px; }
.svar__title { font: var(--kk-text-title); letter-spacing: -0.015em; }
.svar__lead { font-size: 17px; line-height: 1.5; color: var(--kk-muted); }
.svar__question { font-weight: 800; font-size: 26px; line-height: 1.2; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.svar__privacy { margin-top: auto; font: var(--kk-text-small); color: var(--kk-muted); text-align: center; }
.svar-as { font-size: 15px; color: var(--kk-muted); padding: 0 4px; }
.svar-as strong { color: var(--kk-ink); }
.svar-as .kk-link { margin-left: 6px; font-size: 15px; }
.svar-wait {
  border-radius: 16px; padding: 18px 20px; font-size: 17px; line-height: 1.5; color: var(--kk-muted);
  background: repeating-linear-gradient(135deg, var(--kk-fill) 0 10px, var(--kk-paper) 10px 20px);
}
.svar-form { display: flex; flex-direction: column; gap: 14px; }
.svar-form__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.svar-form__count { margin-left: auto; }
.svar-mine { display: flex; flex-direction: column; gap: 8px; }
.svar-mine__label { font: var(--kk-text-label); }
.svar-mine__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.svar-mine__list li {
  background: var(--kk-paper); border-radius: var(--kk-radius-control); padding: 12px 16px;
  font-size: 17px; line-height: 1.4; overflow-wrap: anywhere;
}

/* CodeInput (designsystem 05): six 52×64 boxes, mono 28px, narrower when the phone is. The real input lies on top, invisible. */
.svar-code__wrap { position: relative; width: fit-content; max-width: 100%; }
.svar-code__boxes { display: none; gap: 8px; }
.svar-code__boxes span {
  flex: 0 1 52px; min-width: 0; height: 64px; border-radius: var(--kk-radius-control); background: var(--kk-paper);
  display: flex; align-items: center; justify-content: center; font: 700 28px var(--kk-font-mono);
  transition: background-color .15s, box-shadow .15s;
}
.svar-code__boxes span.is-active { background: #fff; box-shadow: 0 0 0 2.5px var(--kk-tool-ink); }
.kk-field.is-invalid .svar-code__boxes span { box-shadow: 0 0 0 2px var(--kk-error); }
.svar-code.is-enhanced .svar-code__boxes { display: flex; }
.svar-code.is-enhanced .svar-code__input {
  position: absolute; inset: 0; height: 100%; opacity: 0; cursor: text;
}
.svar-code:not(.is-enhanced) .svar-code__input { width: 220px; font: 700 28px var(--kk-font-mono); letter-spacing: .1em; }

/* ---------- Small screens ---------- */
@media (max-width: 680px) {
  .kk-home { padding: 20px 16px 40px; gap: 36px; }
  .kk-home__head, .kk-hero { padding: 0; }
  .kk-auth { margin: 0 auto; }
  .kk-auth__title { font-size: 40px; }
  .kk-auth__card { padding: 22px 18px; }
  .kk-account__name { display: none; }
  .kk-grid { grid-template-columns: 1fr; }
  .kk-tile--lg { grid-column: auto; }
  .kk-tile, .kk-tile-placeholder { min-height: 230px; padding: 22px; }
  .kk-tile__icon { right: 22px; width: 88px; height: 88px; gap: 8px; top: 42%; }

  .kk-frame { padding: 12px; gap: 12px; }
  .kk-frame__title { font-size: 24px; }
  .kk-frame__left { gap: 12px; }
  .kk-badge--frame, [data-kk-fullscreen] { display: none; }
  .kk-stage { padding: 20px 16px; }
  .hm-setup { gap: 24px; }
  .hm-left { flex-basis: 100%; }
  .hm-panel { position: static; padding: 22px; flex-basis: 100%; }
  .sv-intro__title { font-size: 40px; }
  .sv-left, .sv-side { flex-basis: 100%; }
  .sv-panel { padding: 20px; }
  .sv-q { padding: 10px; gap: 8px; }
  .sv-q__num { width: 26px; height: 26px; font-size: 13px; margin-top: 12px; }
  .sv-control__main, .sv-control__side { flex-basis: 100%; }
  .sv-control__side { position: static; padding: 18px; }
  .sv-current { padding: 18px; }
  .sv-current__text { font-size: 26px; }
  .sv-codebar { padding: 12px 16px; }
  .sv-join { padding: 18px; }
  .sv-join__qr { width: 120px; height: 120px; padding: 8px; }
}

@media (max-width: 380px) {
  .svar-code__boxes { gap: 6px; }
  .svar-code__boxes span { height: 58px; font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .kk-btn, .kk-input, .kk-textarea, .kk-switch__track, .kk-switch__track::after { transition: none; }
  .kk-btn:active:not(:disabled) { transform: none; }
  .sv-card.is-new { animation: none; }
}

/* ---------- Svartavlen: svar på en runde ---------- */
.sv-group { display: flex; flex-direction: column; gap: 10px; }
.sv-group .kk-heading { overflow-wrap: anywhere; }
