/* ===== FONTS ===== */
/* Self-hosted (app/assets/fonts, SIL Open Font License) so visitors' IP
   addresses are not sent to Google. Latin subset: covers Danish. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/inter-latin-wght-normal-1f021a24.woff2") format("woff2");
}

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fraunces-latin-opsz-normal-397b623a.woff2") format("woff2");
}

@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/fraunces-latin-opsz-italic-f4852aad.woff2") format("woff2");
}

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  --font-display: 'Fraunces', ui-serif, Georgia, serif;
  --forest: #23423D;
  --forest2: #315B54;
  --sage: #6F8F7D;
  --sageSoft: #EAF0E7;
  --sand: #F8F5EF;
  --sand2: #F2EDE3;
  --gold: #D9A85F;
  --goldSoft: #FFF4DD;
  --white: #FFFFFF;
  --ink: #1C2A2D;
  --muted: #66756E;
  --line: #E2DCCC;
  --green: #12805C;
  --greenSoft: #EAF8F1;
  --warn: #B76B12;
  --warnSoft: #FFF6E8;
  --reading: #27667A;
  --readingSoft: #EAF4F7;
  --writing: #9A5B32;
  --writingSoft: #FBF0E8;
  --violet: #675184;
  --violetSoft: #F2EDF8;
  --bg: #FBF9F4;
  --page: #F7F4ED;
  --shadow: 0 18px 42px rgba(47, 55, 48, .10);
  --softShadow: 0 8px 22px rgba(47, 55, 48, .06);
}

/* ===== BASE RESET ===== */
* { box-sizing: border-box }
/* Layout classes such as .field set display, which beats the browser default
   for [hidden] — without this, anything toggled via the hidden attribute stays visible. */
[hidden] { display: none !important }
html { scroll-behavior: smooth }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 }
button, input, textarea, select { font: inherit }
button { cursor: pointer }
a { color: inherit; text-decoration: none }

/* ===== TYPOGRAPHY ===== */
h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 58px;
  line-height: 1.05;
  letter-spacing: -.01em;
  margin: 0 0 18px;
  color: var(--forest);
}
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: -.005em;
  margin: 0 0 14px;
  color: var(--forest);
}
h3 {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--forest);
}
p { line-height: 1.58; color: var(--muted) }
.lead { font-size: 19px; max-width: 620px }

/* ===== SHARED COMPONENTS ===== */
.btn {
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--forest), var(--forest2));
  color: white;
  padding: 13px 20px;
  font-weight: 850;
  box-shadow: 0 10px 20px rgba(35, 66, 61, .18);
}
.btn:hover { transform: translateY(-1px) }
.btn.secondary {
  background: white;
  color: var(--forest);
  border: 1px solid #D4CCBE;
  box-shadow: 0 4px 10px rgba(47, 55, 48, .04);
}
.btn.ghost { background: transparent; color: var(--forest); box-shadow: none }
.btn.green { background: linear-gradient(135deg, #12805C, #189E72) }

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 25px;
  font-weight: 950;
  color: var(--forest);
  letter-spacing: -.035em;
}
.logo svg { filter: drop-shadow(0 10px 16px rgba(35, 66, 61, .16)) }
.app-header .logo { font-size: 22px }
.app-header .logo svg { width: 34px; height: 34px }

.kicker {
  display: inline-flex;
  background: var(--sageSoft);
  color: var(--forest);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-style: italic;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--sageSoft);
  color: var(--forest);
  font-size: 12px;
  font-weight: 900;
}
.pill.gold { background: var(--goldSoft); color: #8A5A13 }
.pill.green { background: var(--greenSoft); color: #067647 }

.card {
  background: rgba(255, 255, 255, .88);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--softShadow);
}

.progress-track {
  height: 10px;
  background: #E8E1D6;
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0;
}
.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sage), var(--green));
}

/* ===== PUBLIC LAYOUT ===== */
.public-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 44px;
  background: rgba(255, 255, 255, .78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.public-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
}
.public-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 52px 26px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 34px;
  align-items: center;
}
.hero-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .94), rgba(255, 255, 255, .82)),
    radial-gradient(circle at top right, rgba(217, 168, 95, .22), transparent 36%);
  border: 1px solid var(--line);
  border-radius: 34px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.mock-window {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  margin-top: 18px;
}
.mock-top {
  height: 52px;
  background: var(--forest);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  font-weight: 850;
}
.mock-body { padding: 20px; background: #FBF9F4 }
.mock-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 38px;
}

.public-footer {
  background: var(--forest);
  color: white;
  margin-top: 40px;
  padding: 38px 44px 24px;
}
.footer-grid {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr .8fr .8fr;
  gap: 32px;
}
.public-footer p, .public-footer a, .footer-bottom { color: #E7EFEA }
.footer-col { display: flex; flex-direction: column; gap: 10px }
.footer-divider {
  height: 1px;
  background: rgba(255, 255, 255, .16);
  max-width: 1180px;
  margin: 24px auto 16px;
}
.footer-bottom {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

/* ===== TRAINING / APP LAYOUT ===== */
.app-screen { min-height: 100vh; background: var(--page) }
.app-header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 4vw, 56px);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(35, 66, 61, .025);
  position: sticky;
  top: 0;
  z-index: 30;
}
.app-left, .app-right { display: flex; align-items: center; gap: 18px }
.support-tools { display: flex; align-items: center; gap: 6px }
.tool-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--forest);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tool-button:hover { background: var(--sageSoft); border-color: var(--sage) }
.tool-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.help-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(22, 36, 34, .52);
  z-index: 200;
}
.help-overlay.open { display: grid }
.help-dialog {
  width: min(540px, 100%);
  background: white;
  border-radius: 22px;
  padding: 26px;
  box-shadow: 0 26px 70px rgba(20, 30, 28, .3);
}
.help-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 4px;
}
.help-dialog h2 { font-size: 29px; margin-bottom: 7px }
.help-dialog p { margin-top: 0 }
.close-button {
  border: 0;
  background: var(--sand2);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 20px;
  color: var(--forest);
  font-weight: 900;
  flex: 0 0 auto;
}
.help-steps { display: grid; gap: 9px; margin: 18px 0 }
.help-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
}
.help-step b:first-child {
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--forest);
  color: white;
}
.help-actions {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}
.context-pill {
  background: var(--sand2);
  border: 1px solid var(--line);
  color: var(--forest);
  border-radius: 999px;
  padding: 9px 13px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-display);
  font-style: italic;
}
.app-main {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 34px 26px 46px;
}
.choice-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.choice-header h1 { font-size: clamp(38px, 4vw, 50px) }
.selected-summary {
  min-width: 250px;
  border-left: 4px solid var(--gold);
  background: white;
  padding: 15px 17px;
  border-radius: 4px 14px 14px 4px;
  box-shadow: 0 3px 14px rgba(47,55,48,.04);
}
.selected-summary strong { display: block; color: var(--forest); margin-bottom: 4px }
.selected-summary p { margin: 5px 0 10px }
.selected-summary a, .selected-summary button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--forest);
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 13px;
}
.summary-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 9px }
.training-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 14px;
}
.training-section-head h2 { margin: 0; font-size: 24px }
.training-section-head p { margin: 0; font-size: 14px }
.learning-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.path-card {
  cursor: pointer;
  transition: .16s;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.path-card:hover { transform: translateY(-2px); box-shadow: var(--shadow) }
.path-card.reading {
  background: var(--readingSoft);
  box-shadow: inset 0 0 0 1px #C9DEE5;
  border-color: transparent;
}
.path-card.writing {
  background: var(--writingSoft);
  box-shadow: inset 0 0 0 1px #EBD3C2;
  border-color: transparent;
}
.path-card.reading h2,
.path-card.reading .path-icon { color: var(--reading) }
.path-card.writing h2,
.path-card.writing .path-icon { color: var(--writing) }
.path-card.reading .btn { background: var(--reading); box-shadow: none }
.path-card.writing .btn { background: var(--writing); box-shadow: none }
.path-top {
  display: grid;
  grid-template-columns: 1fr 74px;
  gap: 16px;
}
.path-icon {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .72);
  display: grid;
  place-items: center;
}
.path-icon svg { width: 34px; height: 34px }
.task-list { display: grid; gap: 12px; margin-top: 16px }
.task-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 17px;
  border-radius: 20px;
  background: white;
  border: 1px solid var(--line);
}
.task-item:hover { border-color: #CDBFAD; box-shadow: var(--softShadow) }
.session-note {
  background: var(--greenSoft);
  border: 1px solid #BDE7D4;
  color: #067647;
  border-radius: 20px;
  padding: 16px 18px;
  font-weight: 800;
  margin-bottom: 20px;
}
.feedback-list { display: grid; gap: 12px; margin-top: 18px }
.feedback-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: #FBF9F4;
}
.feedback-card.good { background: var(--greenSoft); border-color: #BDE7D4 }
.feedback-card.warn { background: var(--warnSoft); border-color: #F3D3A2 }
textarea {
  width: 100%;
  min-height: 280px;
  border: 1px solid #D5CCBD;
  border-radius: 20px;
  padding: 20px;
  line-height: 1.6;
  font-size: 16px;
}
.wordcount {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

/* ===== PLAYER LAYOUT ===== */
.player-screen { min-height: 100vh; background: #F3EFE7 }
.player-header {
  height: 80px;
  display: grid;
  grid-template-columns: 210px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 clamp(18px, 3vw, 42px);
  background: white;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(35, 66, 61, .025);
  position: sticky;
  top: 0;
  z-index: 40;
}
.player-header .logo { font-size: 20px }
.player-center {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  color: var(--forest);
  font-weight: 900;
  font-size: 13px;
}
.player-center > span:not(.timer) { padding-right: 10px; border-right: 1px solid var(--line) }
.player-center > span:not(.timer):last-child { border-right: 0; padding-right: 0 }
.player-actions { display: flex; justify-content: flex-end; gap: 8px; align-items: center }
.tool-group { display: inline-flex; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: white }
.tool-group button, .tool-group a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  color: var(--forest);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
}
.tool-group > * + * { border-left: 1px solid var(--line) }
.tool-group button:hover, .tool-group a:hover { background: var(--sageSoft) }
.tool-group svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.tool-go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--forest);
  color: white;
  border: 0;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  white-space: nowrap;
}
.tool-go:hover { background: var(--forest2) }
.tool-go svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.timer {
  background: var(--forest);
  color: white;
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 900;
}
.player-main {
  max-width: 1220px;
  margin: 0 auto;
  padding: 30px 26px 110px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 24px;
}
.player-main.player-main-single {
  max-width: 1180px;
  width: 100%;
  display: block;
}
.paper {
  background: white;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 34px;
  box-shadow: var(--shadow);
}
.instruction {
  position: relative;
  border-left: 5px solid var(--gold);
  padding: 14px 18px 14px 54px;
  background: var(--goldSoft);
  border-radius: 16px;
  margin: 18px 0 26px;
}
/* A formatted prompt arrives as paragraphs/lists; keep the box as tight as plain text. */
.instruction > :first-child { margin-top: 0 }
.instruction > :last-child { margin-bottom: 0 }
.instruction::before {
  content: "1";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--gold);
  display: grid;
  place-items: center;
  color: #3E2A0C;
  font-weight: 900;
  font-size: 14px;
}
.exercise-box {
  background: #FBF9F4;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 22px;
}
.exercise-box::before {
  content: "2 \00b7  Løs opgaven";
  display: block;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--forest);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.ad-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.ad {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 15px;
}
.match-row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 14px;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin: 10px 0;
}
select {
  border: 1px solid #D5CCBD;
  border-radius: 12px;
  padding: 10px;
  background: white;
}
.side-panel { display: grid; gap: 16px; align-content: start }
.help-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--softShadow);
}
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, .94);
  border-top: 1px solid var(--line);
  box-shadow: 0 -10px 28px rgba(35, 66, 61, .07);
  backdrop-filter: blur(14px);
  z-index: 60;
}
.bottom-bar .btn { padding: 10px 15px; border-radius: 11px }
.bottom-inner {
  max-width: 1080px;
  min-height: 78px;
  margin: 0 auto;
  padding: 11px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.bottom-inner > div { font-size: 13px }
.task-save-note { display: flex !important; align-items: center; gap: 10px; color: var(--forest) !important }
.task-save-note > span {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: white;
  font-weight: 950;
}
.task-save-note small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px }

/* ===== RESPONSIVE ===== */
@media (max-width: 920px) {
  .hero-grid, .feature-grid, .footer-grid,
  .learning-grid, .player-main { grid-template-columns: 1fr }
  .public-header, .app-header { padding: 0 18px }
  .public-nav { display: none }
  h1 { font-size: 40px }
  .player-header {
    grid-template-columns: 1fr;
    height: auto;
    padding: 14px 18px;
  }
  .player-center { justify-content: flex-start; flex-wrap: wrap }
  .ad-grid { grid-template-columns: 1fr }
  .match-row { grid-template-columns: 1fr }
}
@media (max-width: 620px) {
  .bottom-inner { gap: 8px }
  .bottom-inner > div { display: none }
  .bottom-inner .btn { flex: 1 }
  .task-save-note { display: none !important }
}

/* ===== ADMIN LAYOUT ===== */
.admin-screen { background: var(--sand2) }

.admin-layout {
  display: flex;
  min-height: 100vh;
}

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--forest);
  color: white;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar-logo {
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.admin-badge {
  background: var(--gold);
  color: var(--ink);
  font-size: 10px;
  font-weight: 900;
  border-radius: 6px;
  padding: 3px 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.admin-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-nav-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,.75);
  transition: background .15s, color .15s;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.admin-nav-item:hover,
.admin-nav-item.active {
  background: rgba(255,255,255,.12);
  color: white;
}

.admin-sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid rgba(255,255,255,.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.btn-logout { color: rgba(255,180,180,.9) !important }

.admin-main {
  flex: 1;
  overflow: auto;
}

.admin-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 36px 40px;
}

.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 20px;
}

.admin-page-header h1 {
  font-size: 30px;
  margin: 4px 0 0;
}

.admin-page-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  align-items: center;
  padding-top: 4px;
}

.admin-breadcrumb {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.admin-breadcrumb a { color: var(--sage) }

.admin-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--sand);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #F0EDE6;
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: none }

.admin-table-actions {
  text-align: right;
  white-space: nowrap;
}

.admin-table-actions form,
.admin-table-actions a,
.admin-table-actions button {
  display: inline-block;
  margin-left: 4px;
}

.admin-content-preview {
  font-size: 13px;
  color: var(--muted);
  max-width: 300px;
}

.admin-empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
}

.admin-inline-link {
  display: inline-block;
  margin-right: 8px;
  font-size: 13px;
  color: var(--forest);
  text-decoration: underline;
}

.text-muted { color: var(--muted) }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
}

.admin-stat-value {
  font-size: 42px;
  font-weight: 900;
  color: var(--forest);
  line-height: 1;
}

.admin-stat-label {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

.admin-stat-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  color: var(--sage);
}

.admin-section h2 { font-size: 20px; margin-bottom: 14px }

.admin-quick-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-form { max-width: 640px }

.form-group { margin-bottom: 20px }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: white;
  color: var(--ink);
  transition: border-color .15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--sage);
}

.form-hint {
  font-size: 12px;
  color: var(--muted);
  margin-left: 8px;
}

.admin-json-label-row {
  display: flex;
  align-items: center;
  margin-bottom: 6px;
}

.admin-json-editor {
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  resize: vertical;
}

.admin-json-hint {
  margin: -10px 0 20px;
  font-size: 13px;
}

.admin-json-hint summary {
  cursor: pointer;
  color: var(--sage);
  padding: 4px 0;
}

.admin-json-template { margin-bottom: 14px }

.admin-json-template pre {
  background: var(--sand2);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  overflow-x: auto;
  margin: 4px 0 0;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.admin-errors {
  background: #FFF0F0;
  border: 1px solid #FFCDD2;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: #B71C1C;
}

.admin-errors p { margin: 2px 0; color: #B71C1C }

.btn-sm {
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 10px;
  box-shadow: none;
}

.btn.danger {
  background: linear-gradient(135deg, #B71C1C, #C62828);
  color: white;
  border: 0;
  box-shadow: 0 4px 10px rgba(183,28,28,.18);
}

.flash {
  padding: 14px 24px;
  font-size: 14px;
  font-weight: 600;
}

.flash-notice {
  background: var(--greenSoft);
  color: #067647;
  border-bottom: 1px solid #A7F3D0;
}

.flash-alert {
  background: var(--warnSoft);
  color: var(--warn);
  border-bottom: 1px solid #FED7AA;
}

/* ===== MODULE SELECTOR ===== */
.module-selector-course {
  margin-bottom: 28px;
}

.module-selector-course h3 {
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  margin-bottom: 10px;
}

.module-selector-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.module-selector-btn {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: white;
  padding: 14px 22px;
  cursor: pointer;
  font-weight: 700;
  color: var(--forest);
  font-size: 15px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: border-color .15s, box-shadow .15s;
  min-width: 110px;
}

.module-selector-btn:hover {
  border-color: var(--sage);
  box-shadow: var(--softShadow);
}

.module-selector-btn.active {
  border-color: var(--forest);
  background: var(--sageSoft);
}

.module-selector-num {
  font-size: 15px;
  font-weight: 800;
  color: var(--forest);
}

.module-selector-check {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
}

/* ===== QUESTION TYPE UIs ===== */
.fillblank-text {
  font-size: 18px;
  line-height: 2.2;
  color: var(--ink);
}

.fillblank-input {
  display: inline-block;
  width: 120px;
  border: 0;
  border-bottom: 2px solid var(--forest);
  border-radius: 0;
  padding: 2px 6px;
  font-size: 17px;
  font-weight: 700;
  color: var(--forest);
  background: transparent;
  text-align: center;
  margin: 0 4px;
}

.fillblank-input:focus {
  outline: none;
  border-bottom-color: var(--green);
}

.numbered-section {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.numbered-section:last-child {
  border-bottom: 0;
}

.section-number {
  width: 29px;
  height: 29px;
  border-radius: 9px;
  background: var(--sageSoft);
  display: grid;
  place-items: center;
  color: var(--forest);
  font-weight: 900;
}

.sentence {
  display: block;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  margin: 3px 0;
}

.sentence:hover {
  background: var(--sand2);
}

.sentence.selected {
  background: #FDECEC;
  border-color: #D67A7A;
}

/* ===== RESULTS DASHBOARD ===== */
.results-list {
  display: grid;
  gap: 16px;
  max-width: 800px;
}

.results-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
}

.results-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
}

.results-meta {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.results-score-badge {
  font-size: 28px;
  font-weight: 900;
  color: var(--forest);
  background: var(--sageSoft);
  border-radius: 14px;
  padding: 10px 18px;
  flex-shrink: 0;
  line-height: 1;
}

.results-score-badge.perfect {
  background: var(--greenSoft);
  color: var(--green);
}

.results-answers {
  border-top: 1px solid var(--line);
  padding: 14px 24px;
  display: grid;
  gap: 12px;
}

.results-answer-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.results-feedback {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.results-feedback-item {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

.results-feedback-item.ok {
  background: var(--greenSoft);
  color: #067647;
}

.results-feedback-item.wrong {
  background: var(--warnSoft);
  color: var(--warn);
}

.results-card-footer {
  border-top: 1px solid var(--line);
  padding: 12px 24px;
  font-size: 12px;
  color: var(--muted);
  background: var(--sand);
}

.results-retry-link {
  color: var(--sage);
  font-weight: 700;
  text-decoration: underline;
}

/* ===== TASK PLAYER COMPONENTS ===== */
.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sage);
  margin-bottom: 8px;
}

.task-paper {
  position: relative;
  overflow: hidden;
  padding-top: 0 !important;
  --task-accent: var(--reading);
  --task-soft: var(--readingSoft);
}
.task-paper::before {
  content: "";
  display: block;
  height: 7px;
  background: var(--task-accent);
  margin: 0 -34px 24px;
}
.task-paper[data-theme="language"] { --task-accent: var(--violet); --task-soft: var(--violetSoft) }
.task-paper[data-theme="information"] { --task-accent: var(--gold); --task-soft: var(--goldSoft) }
.task-paper .eyebrow { color: var(--task-accent) }
.task-paper .instruction {
  background: var(--task-soft);
  border-left-color: var(--task-accent);
}
.task-paper .instruction::before { background: var(--task-accent); color: #fff }

.task-tip-row { display: flex; justify-content: flex-end; margin-bottom: 16px }
.task-tip-row .task-tip { max-width: 340px }

.task-masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
}

.task-kind {
  display: flex;
  align-items: center;
  gap: 12px;
}

.task-kind-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--task-soft);
  color: var(--task-accent);
  font-size: 20px;
  font-weight: 900;
  flex: 0 0 auto;
}

.task-kind-copy { display: grid; gap: 3px }
.task-kind-copy small {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-weight: 700;
  line-height: 1;
}
.task-kind-copy strong {
  color: var(--forest);
  font-size: 14px;
}

.task-progress { width: min(240px, 36%); display: grid; gap: 6px }
.task-progress-copy {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.task-progress-track {
  height: 7px;
  background: #E7E2D8;
  border-radius: 999px;
  overflow: hidden;
}
.task-progress-track span {
  display: block;
  height: 100%;
  background: var(--task-accent);
  border-radius: inherit;
  transition: width .2s ease;
}

.task-tip {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.task-tip summary {
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--forest);
  list-style: none;
}
.task-tip summary::-webkit-details-marker { display: none }
.task-tip summary::before { content: "\2736  "; color: var(--green) }
.task-tip[open] summary { border-bottom: 1px solid var(--line) }
.task-tip > p { padding: 12px 16px; margin: 0; font-size: 13px }

/* ===== MODULE CHOICE CARDS ===== */
.module-selector-course h3 {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  margin-bottom: 10px;
}
.module-selector {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
}
.module-choice {
  min-height: 140px;
  border: 1px solid var(--line);
  border-bottom: 4px solid var(--sage);
  background: white;
  border-radius: 16px;
  padding: 16px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: .15s;
  width: 100%;
}
.module-choice:hover { border-color: var(--sage); background: var(--sageSoft); transform: translateY(-2px) }
.module-choice.active { border-color: var(--forest); background: var(--sageSoft) }
.module-label {
  font-size: 10px;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.module-number {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 42px;
  line-height: 1;
  color: var(--forest);
  font-weight: 500;
}
.module-check {
  font-size: 11px;
  color: var(--green);
  font-weight: 800;
}

/* ===== ADMIN CONTENT VIEW ===== */
.content-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 20px;
}

.filter-group {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.admin-filter-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 7px;
}

.education-tabs { display: flex; gap: 6px }
.education-tab {
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--forest);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  display: inline-block;
}
.education-tab:hover { border-color: var(--sage); background: var(--sageSoft) }
.education-tab.active { background: var(--forest); color: white; border-color: var(--forest) }

.admin-module-tabs { display: flex; gap: 6px }
.admin-module-tab {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--forest);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  line-height: 36px;
  text-decoration: none;
  display: block;
}
.admin-module-tab:hover { border-color: var(--sage); background: var(--sageSoft) }
.admin-module-tab.active { background: var(--forest); color: white; border-color: var(--forest) }

.admin-status-pill {
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 6px;
}

.area-stack { display: grid; gap: 18px }
.area-panel { overflow: hidden; padding: 0 !important }
.area-head {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--readingSoft);
  border-bottom: 1px solid #C9DEE5;
}
.area-head.writing { background: var(--writingSoft); border-bottom-color: #EBD3C2 }
.area-title { display: flex; align-items: center; gap: 12px }
.area-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: white;
  color: var(--reading);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 14px;
  flex: 0 0 auto;
}
.area-head.writing .area-icon { color: var(--writing) }
.area-head h2 { font-family: Inter, sans-serif; font-size: 17px; margin: 0 0 2px }
.area-head p { margin: 0; font-size: 12px }

.set-page-head {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.set-page-head h1 { font-size: clamp(38px, 4vw, 50px); margin: 5px 0 7px }
.set-page-head p { margin: 0 }
.set-count {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.set-count b {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--forest);
  color: white;
  font-size: 16px;
}

.set-list { display: grid; gap: 12px }
.set-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px 26px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--reading);
  border-radius: 16px;
  background: white;
  box-shadow: 0 3px 14px rgba(47,55,48,.04);
}
.set-row:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(47,55,48,.08) }
.set-row.writing, .set-row.writing-row { border-left-color: var(--writing) }
/* admin uses set-row inside a card — revert to simple row style */
.admin-card .set-row {
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  padding: 12px 10px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
}
.admin-card .set-row:hover { transform: none; box-shadow: none }
.admin-card .set-row:last-child { border-bottom: 0 }
.set-number {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--readingSoft);
  color: var(--reading);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  font-weight: 500;
  flex: 0 0 auto;
}
.set-row.writing .set-number { background: var(--writingSoft); color: var(--writing) }

.set-index {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--readingSoft);
  color: var(--reading);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 26px;
  font-weight: 500;
  flex: 0 0 auto;
}
.writing-row .set-index { background: var(--writingSoft); color: var(--writing) }
.set-main { min-width: 0 }

.status {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--sand2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}
.status.progress { background: var(--greenSoft); color: #067647 }
.status.completed { background: var(--forest); color: white }
.status.exam { background: var(--goldSoft); color: #8A5A13 }

.elapsed-meta {
  background: var(--greenSoft);
  color: #067647 !important;
  border-radius: 999px;
  padding: 4px 9px;
  font-weight: 850;
  white-space: nowrap;
}
.set-row.featured { background: linear-gradient(90deg, var(--readingSoft), #fff 43%) }
.set-row .progress-track { height: 7px; max-width: 360px; margin: 10px 0 0 }
.set-row .btn { box-shadow: none }
.set-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 5px;
}
.set-title-line strong { color: var(--forest); font-size: 19px }
.set-meta {
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  color: #56655F;
  font-size: 13px;
  font-weight: 750;
}
.set-meta span { display: flex; align-items: center; gap: 6px }
.row-actions {
  display: flex;
  gap: 7px;
  align-items: center;
}
.row-actions form { display: contents }
.reading-btn { background: var(--reading) !important; color: white !important }
.writing-btn { background: var(--writing) !important; color: white !important }

/* ===== ADMIN USERS ===== */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--sageSoft);
  color: var(--forest);
  display: inline-grid;
  place-items: center;
  font-weight: 900;
  font-size: 13px;
  flex: 0 0 auto;
}
.user-avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-size: 18px;
}
.user-role-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}
.user-role-pill.admin {
  background: var(--goldSoft);
  color: #8A5A13;
}
.user-role-pill.kursist {
  background: var(--sageSoft);
  color: var(--forest);
}

/* ===== ADMIN FEEDBACK CRITERIA ===== */
.criteria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.criterion-card {
  border-top: 5px solid var(--sage);
  padding: 20px;
}

.criterion-card:nth-child(2) { border-top-color: var(--gold) }
.criterion-card:nth-child(3) { border-top-color: var(--violet) }
.criterion-card:nth-child(4) { border-top-color: var(--writing) }

.criterion-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.criterion-card-head h2 {
  font-size: 17px;
  margin: 6px 0 0;
}

.criterion-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.criterion-status-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 800;
}

.criterion-status-pill.active {
  background: var(--greenSoft);
  color: #067647;
}

.criterion-status-pill.inactive {
  background: var(--sand2);
  color: var(--muted);
}

.admin-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--forest);
  cursor: pointer;
}

/* ===== RESUME PANEL ===== */
.resume-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: center;
  margin: 0 0 24px;
  padding: 22px 26px;
  background: linear-gradient(115deg, var(--forest), #315B54);
  color: white;
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.resume-eyebrow {
  display: block;
  color: #CFE0D8;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 6px;
}

.resume-panel h2 { color: white; margin: 0 0 4px; font-size: 22px }
.resume-panel p { color: #E4EEE9; margin: 0 0 10px; font-size: 14px }

.resume-meta {
  display: flex;
  gap: 6px 16px;
  flex-wrap: wrap;
  color: #F5F8F6;
  font-size: 13px;
  font-weight: 700;
}

.resume-progress-track {
  margin-top: 10px;
  max-width: 380px;
  height: 6px;
  background: rgba(255, 255, 255, .2);
  border-radius: 999px;
  overflow: hidden;
}

.resume-progress-track span {
  display: block;
  height: 100%;
  background: var(--gold);
  border-radius: inherit;
}

.resume-panel .btn {
  background: white;
  color: var(--forest);
  box-shadow: none;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== APP TOAST ===== */
.app-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--forest);
  color: white;
  padding: 13px 20px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 700;
  z-index: 150;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
}

.app-toast.app-toast-alert { background: var(--warn) }

/* ===== TURBO CONFIRM DIALOG ===== */
.turbo-confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 37, 34, .52);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 200;
  opacity: 0;
  transition: opacity .15s;
}

.turbo-confirm-backdrop.open { opacity: 1 }

.turbo-confirm-dialog {
  width: min(420px, 100%);
  background: white;
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 64px rgba(24, 44, 40, .18);
  text-align: center;
}

.turbo-confirm-dialog p {
  font-size: 16px;
  color: var(--ink);
  margin: 0 0 24px;
  max-width: none;
}

.turbo-confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

/* ===== PUBLIC INFO PAGES ===== */
.public-info-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(44px, 7vw, 80px) 26px 80px;
}

.info-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 48px;
  align-items: center;
  margin-bottom: 48px;
}

.info-hero h1 { font-size: clamp(40px, 5vw, 58px) }

.info-visual {
  background: var(--forest);
  border-radius: 26px;
  padding: 28px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow);
}

.info-visual h2 { color: white; margin-bottom: 10px }
.info-visual p { color: rgba(255,255,255,.82); margin: 0 }

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 48px;
}

.info-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: var(--softShadow);
}

.info-number {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--sageSoft);
  color: var(--forest);
  font-weight: 900;
  margin-bottom: 16px;
  font-size: 14px;
}

.info-section {
  padding: 40px 0;
  border-top: 1px solid var(--line);
}

.info-section h2 { font-size: 32px }

.info-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.info-checks li {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 15px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
}

.info-checks li::before {
  content: "✓";
  color: var(--green);
  font-weight: 900;
  flex-shrink: 0;
}

.info-cta {
  background: linear-gradient(135deg, var(--forest), #315B54);
  color: white;
  border-radius: 26px;
  padding: clamp(26px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 32px;
}

.info-cta h2 { color: white; margin-bottom: 6px }
.info-cta p { color: rgba(255,255,255,.8); margin: 0 }

/* Contact page */
.contact-grid {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 32px;
  align-items: start;
}

.contact-form {
  background: white;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 28px;
  box-shadow: var(--softShadow);
  display: grid;
  gap: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field { display: grid; gap: 6px }
.field label { font-weight: 800; color: var(--forest); font-size: 14px }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1px solid #CFC8BC;
  border-radius: 10px;
  padding: 11px 13px;
  background: white;
  color: var(--ink);
  font-size: 14px;
}
.field textarea { min-height: 140px; resize: vertical }

.form-note { font-size: 13px; color: var(--muted); margin: 0 }

@media (max-width: 920px) {
  .info-hero, .info-grid, .contact-grid { grid-template-columns: 1fr }
  .info-checks { grid-template-columns: 1fr }
  .form-row { grid-template-columns: 1fr }
  .info-cta { display: grid }
}

/* ===== ADMIN QUESTION TYPE MODAL ===== */
.type-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 37, 34, .52);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
}

.type-modal-backdrop[hidden] { display: none }

/* Capped to the viewport: the header stays put and only the type grid
   scrolls, so the close button is always reachable as the list grows. */
.type-modal-dialog {
  width: min(620px, 100%);
  max-height: min(680px, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 22px;
  padding: 28px;
  box-shadow: 0 24px 64px rgba(24, 44, 40, .18);
}

.type-modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.type-modal-head h2 { margin: 0 0 4px; font-size: 22px }
.type-modal-head p { margin: 0; font-size: 13px }

.modal-close-btn {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--sand2);
  color: var(--forest);
  font-size: 20px;
  font-weight: 900;
  flex-shrink: 0;
  cursor: pointer;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* Room for the scrollbar and for card borders/hover states at the edges. */
  padding: 2px 6px 2px 2px;
  margin: -2px -6px -2px -2px;
}

.type-card {
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 3px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color .15s, background .15s;
  background: white;
}

.type-card:hover {
  border-color: var(--forest);
  background: var(--sageSoft);
}

.type-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--sageSoft);
  color: var(--forest);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 900;
  margin-bottom: 8px;
}

.type-card strong {
  display: block;
  color: var(--forest);
  font-size: 14px;
  font-weight: 800;
}

.type-card small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

/* ===== QUESTION EDITOR ===== */
.question-editor-form { width: 100% }

.question-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 20px;
  align-items: start;
}

.editor-tab-bar {
  display: flex;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
}

.editor-tab {
  border: 0;
  background: transparent;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color .15s;
}

.editor-tab:hover { color: var(--forest) }
.editor-tab.active { color: var(--forest); border-bottom-color: var(--gold) }

.question-preview-sidebar {
  position: sticky;
  top: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--softShadow);
}

.preview-head {
  padding: 13px 16px;
  background: var(--forest);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.preview-head strong { font-size: 13px }

.preview-kind-badge {
  font-size: 11px;
  background: rgba(255,255,255,.18);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}

.preview-body { padding: 14px; min-height: 180px; font-size: 13px }
.preview-empty { color: var(--muted); font-size: 13px; margin: 0 }
.preview-error { color: var(--warn); font-size: 11px; font-family: monospace; margin: 0; word-break: break-all }

.preview-description {
  font-size: 12px; color: var(--muted); margin-bottom: 10px;
  padding: 7px 10px; background: var(--goldSoft);
  border-left: 3px solid var(--gold); border-radius: 0 7px 7px 0;
}

.preview-ads { display: grid; gap: 6px; margin-bottom: 12px }
.preview-ad-card { background: var(--sand); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 12px }
.preview-ad-card b { color: var(--forest) }
.preview-ad-card p { margin: 2px 0 0; color: var(--muted); font-size: 11px }

.preview-stmt {
  display: flex; justify-content: space-between; align-items: center; gap: 6px;
  padding: 6px 8px; background: white; border: 1px solid var(--line);
  border-radius: 8px; font-size: 12px; margin-bottom: 4px;
}

.preview-correct {
  font-weight: 800; color: var(--forest); background: var(--sageSoft);
  border-radius: 5px; padding: 1px 7px; white-space: nowrap; font-size: 11px;
}

.preview-text { font-size: 13px; line-height: 1.9; margin: 0 }
.preview-blank {
  display: inline-block; border-bottom: 2px solid var(--forest);
  min-width: 50px; color: var(--sage); font-style: italic; padding: 0 3px; cursor: help;
}

.preview-paragraph { margin-bottom: 12px }
.preview-odd-sentence { display: block; padding: 4px 8px; border-radius: 6px; font-size: 12px; margin-bottom: 3px; color: var(--ink) }
.preview-odd-sentence.odd { background: var(--warnSoft); color: var(--warn); font-weight: 700 }

.preview-pair {
  display: grid; grid-template-columns: 1fr 18px 1fr; gap: 4px;
  align-items: center; font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--line);
}
.preview-pair:last-child { border-bottom: 0 }
.preview-arrow { text-align: center; color: var(--sage) }

.preview-prompt { font-size: 12px; line-height: 1.6; padding: 9px 10px; background: var(--sand); border-radius: 8px; margin-bottom: 9px; color: var(--ink) }
.preview-meta { font-size: 11px; color: var(--muted); margin-bottom: 8px }
.preview-criteria { display: flex; flex-wrap: wrap; gap: 4px }
.preview-criteria-tag { font-size: 10px; background: var(--sageSoft); color: var(--forest); border-radius: 999px; padding: 2px 8px; font-weight: 700 }

/* ===== STRUCTURED QUESTION EDITOR ===== */
.scan-image-preview {
  margin-bottom: 10px;
  max-width: 240px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.scan-image-preview img { display: block; width: 100%; height: auto }

.structured-section {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--sand);
}

.structured-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.struct-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.struct-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px;
}

.struct-row-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.struct-row-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.struct-row-remove {
  border: 0;
  background: var(--warnSoft);
  color: var(--warn);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  margin-top: 2px;
  transition: background .15s, color .15s;
}
.struct-row-remove:hover { background: var(--warn); color: white; }

.blank-row { align-items: center; }
.blank-row-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--forest);
  min-width: 70px;
  flex-shrink: 0;
}

.odd-index-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.criteria-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.criteria-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 14px;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 8px;
  user-select: none;
}
.criteria-checkbox-label input { margin: 0; cursor: pointer; }
.criteria-checkbox-label:has(input:checked) {
  background: var(--sageSoft);
  border-color: var(--sage);
  color: var(--forest);
  font-weight: 600;
}

/* ===== READING QUESTION TYPES ===== */

.inline-select {
  display: inline-block;
  width: auto;
  min-width: 120px;
  margin: 0 4px;
  padding: 5px 8px;
  border: 1px solid var(--sage);
  border-radius: 8px;
  background: var(--sageSoft);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  vertical-align: baseline;
  cursor: pointer;
}

.dense-copy { font-size: 14px; line-height: 1.68; color: var(--ink) }
.dense-copy p { margin: 0 0 12px }
.dense-copy p:last-child { margin-bottom: 0 }
.dense-copy h2 { font-size: 20px; margin-bottom: 12px }

.long-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) { .long-layout { grid-template-columns: 1fr } }

.scan-image-trigger {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0;
  background: white;
  overflow: hidden;
  cursor: zoom-in;
}
.scan-image-trigger img { display: block; width: 100%; height: auto }
.scan-image-trigger:hover { border-color: var(--sage) }
.image-zoom-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 30px;
  background: rgba(22, 36, 34, .82);
  z-index: 200;
}
.image-zoom-overlay.open { display: grid }
.image-zoom-full { max-width: 90vw; max-height: 90vh; border-radius: 12px; cursor: zoom-out }
.image-zoom-close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: white;
  color: var(--forest);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.scroll-pane { max-height: 440px; overflow-y: auto; padding-right: 4px }

.person-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px }
.person-tab {
  border: 1px solid var(--line);
  background: white;
  border-radius: 11px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 700;
  color: var(--forest);
  cursor: pointer;
  transition: background .14s, border-color .14s;
}
.person-tab.active { background: var(--forest); color: white; border-color: var(--forest) }

.chat { display: grid; gap: 10px }
.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  background: var(--sageSoft);
  font-size: 14px;
  line-height: 1.5;
}
.bubble.me { justify-self: end; background: var(--forest); color: white }
.bubble-select {
  border: 2px dashed var(--sage);
  border-radius: 12px;
  padding: 8px 12px;
  background: white;
  font-size: 13px;
  min-width: 180px;
  color: var(--ink);
  cursor: pointer;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 12px 14px;
  background: var(--sand2);
  border-radius: 12px;
}
.word-chip {
  border: 1px solid #CFC6B7;
  background: white;
  color: var(--forest);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  font-size: 13px;
  display: inline-block;
}

.choice-stack { display: grid; gap: 9px }
.choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 13px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
  transition: border-color .14s, background .14s;
}
.choice:has(input:checked) { border-color: var(--sage); background: var(--sageSoft) }
.choice input[type="radio"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--forest) }

.dense-list { display: grid; gap: 7px }
.dense-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.dense-card b { display: block; color: var(--forest); font-size: 12px; margin-bottom: 3px }
.dense-card p { font-size: 12px; line-height: 1.5; margin: 0; color: var(--muted) }

.section-gap {
  margin: 9px 0;
  padding: 9px 12px;
  background: var(--goldSoft);
  border: 1px solid var(--gold);
  border-radius: 8px;
}
.section-gap select {
  width: 100%;
  border: 0;
  background: transparent;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}

/* ===== SECTION CHOICE (afsnitsvalg) ===== */
/* Larger reading text than the shared dense cards, with a number per afsnit
   so the learner sees each one is its own task. */
.section-choice-list { display: grid; gap: 18px }
.section-choice-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.section-choice-card .section-number {
  width: 34px;
  height: 34px;
  font-size: 16px;
}
.section-choice-body p { font-size: 17px; line-height: 1.65; margin: 0; color: var(--ink) }
.section-choice-body .section-gap { margin: 12px 0; padding: 11px 14px }
.section-choice-body .section-gap select { font-size: 16px }

@media (max-width: 600px) {
  .section-choice-card { grid-template-columns: 1fr; gap: 10px; padding: 16px }
  .section-choice-body p { font-size: 16px }
}

/* ===== EXERCISE EDITOR TWO-COLUMN LAYOUT ===== */
.exercise-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 20px;
  align-items: start;
}

.publish-sidebar {
  position: sticky;
  top: 20px;
  padding: 20px;
}

.publish-sidebar h2 { font-size: 18px; margin-bottom: 4px }
.publish-sidebar > p { font-size: 13px; margin: 0 0 4px }

.exercise-checklist {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.exercise-check {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 8px;
  align-items: start;
}

.check-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--warnSoft);
  color: var(--warn);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  flex-shrink: 0;
}

.check-icon.ok {
  background: var(--greenSoft);
  color: var(--green);
}

.exercise-check strong { display: block; font-size: 13px; color: var(--forest); margin-bottom: 2px }
.exercise-check small { font-size: 12px; color: var(--muted) }

.publish-actions {
  display: grid;
  gap: 8px;
  padding-top: 16px;
}

.publish-actions .btn { width: 100%; justify-content: center }

/* ===== DRAG REORDER ===== */
.drag-handle {
  color: var(--muted);
  font-size: 16px;
  cursor: grab;
  padding: 0 4px;
  user-select: none;
  text-align: center;
}

tr[draggable] { cursor: default }
tr[draggable].dragging { opacity: .45 }
tr[draggable].drag-over td { border-top: 2px solid var(--forest) }

/* ===== AUDIO MATCH (syllable + single) ===== */
.audio-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 16px;
  margin-bottom: 26px;
}

.audio-bar audio { width: 100%; height: 40px }

.audio-preview {
  display: grid;
  gap: 5px;
  margin-bottom: 9px;
}

.audio-preview audio { width: 100% }

.audio-slots {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 34px 0 30px;
}

.audio-slot {
  width: 128px;
  height: 52px;
  border: 1px solid var(--line);
  background: white;
  color: var(--forest);
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: border-color .14s, background .14s;
}

.audio-slot:first-of-type { border-radius: 10px 0 0 10px }
.audio-slot:last-of-type { border-radius: 0 10px 10px 0; border-left: 0 }
/* A single-slot question (audio_single_match) is both first and last, so it
   needs its own rule to keep all four corners and its left border. */
.audio-slot:only-of-type { border-radius: 10px; border-left: 1px solid var(--line) }
.audio-slot.filled { border-color: var(--sage); background: var(--sageSoft) }
.audio-slot:hover { border-color: var(--sage) }

.audio-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: white;
}

.audio-option {
  min-width: 62px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--forest);
  font-size: 15px;
  font-weight: 750;
  padding: 11px 18px;
  cursor: pointer;
  transition: border-color .14s, background .14s, opacity .14s;
}

.audio-option:hover:not(:disabled) { border-color: var(--sage); background: var(--sageSoft) }
.audio-option.used { opacity: .38; cursor: default }

/* ===== WORD CATEGORY ===== */
.category-progress {
  display: grid;
  gap: 7px;
  margin-bottom: 22px;
  font-size: 13px;
  font-weight: 750;
  color: var(--muted);
}

.category-round { display: grid; gap: 10px; justify-items: center; text-align: center }

.category-image {
  max-width: min(320px, 100%);
  max-height: 220px;
  border-radius: 12px;
  border: 1px solid var(--line);
  object-fit: contain;
  background: white;
}

.category-heading {
  margin: 4px 0 0;
  font-size: 28px;
  color: var(--forest);
}

.category-words {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;
  margin-top: 8px;
  width: 100%;
}

.category-word {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--forest);
  font-size: 16px;
  font-weight: 750;
  padding: 11px 18px;
  cursor: pointer;
  transition: border-color .14s, background .14s, opacity .14s;
}

/* The checkbox stays in the form for submission and keyboard use, but the
   whole chip is the visible control. */
.category-word input { position: absolute; opacity: 0; pointer-events: none }
.category-word:hover { border-color: var(--sage) }
.category-word:has(input:checked) { border-color: var(--forest); background: var(--sageSoft) }
.category-word:has(input:focus-visible) { outline: 2px solid var(--forest); outline-offset: 2px }
.category-word:has(input:disabled) { opacity: .4; cursor: default }

.category-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 26px;
}

/* ===== WORD CHAIN ===== */
.word-chain {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  padding: 26px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.chain-letter {
  font-size: 32px;
  font-weight: 800;
  color: var(--forest);
  line-height: 1.4;
  user-select: none;
}

.chain-gap {
  width: 16px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  touch-action: manipulation;
}

/* Invisible hit area: reaches over half of each neighbouring letter and well
   above and below the chain, so a click anywhere on the letters lands on the
   nearest gap instead of needing to hit the thin strip between them. */
.chain-gap::before {
  content: "";
  position: absolute;
  inset: -22px -12px;
}

/* The divider itself: faint on hover, solid once placed. */
.chain-gap::after {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  border-radius: 2px;
  background: transparent;
  transition: background .14s;
}

.chain-gap:hover::after { background: var(--line) }
.chain-gap.split::after { background: var(--gold) }
.chain-gap:focus-visible { outline: 2px solid var(--forest); outline-offset: -2px; border-radius: 4px }

.chain-tally { text-align: center; margin-top: 12px }

/* ===== ADMIN: WORD CATEGORY HEADINGS ===== */
.category-round-row .struct-row-fields { display: grid; gap: 8px }
.round-image-field { display: flex; flex-wrap: wrap; align-items: center; gap: 10px }
.round-image-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line);
}

/* ===== TEXT TITLE (cloze + section tasks) ===== */
.text-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1.25;
  color: var(--forest);
}

/* Admin preview: the optional text title above the rendered task. */
.preview-title { margin: 0 0 8px; font-size: 15px; color: var(--forest) }

/* ===== RICH TEXT ANSWER (writing tasks) ===== */
/* Selectors are prefixed with .rich-answer so they win over the vendored
   Quill theme, which is linked after this file. */
.rich-answer { margin-top: 4px }

.rich-answer .ql-toolbar.ql-snow {
  border: 1px solid #D5CCBD;
  border-radius: 20px 20px 0 0;
  background: var(--sand2);
  padding: 10px 14px;
  font-family: inherit;
}

.rich-answer .ql-container.ql-snow {
  border: 1px solid #D5CCBD;
  border-top: 0;
  border-radius: 0 0 20px 20px;
  background: white;
  font-family: inherit;
  font-size: 16px;
}

.rich-answer .ql-editor {
  min-height: 280px;
  padding: 20px;
  line-height: 1.6;
}
/* A short text in an admin list row, not a whole essay. */
.struct-row .rich-answer .ql-editor { min-height: 90px; padding: 12px 16px }
.struct-row .rich-answer .ql-editor.ql-blank::before { left: 16px; right: 16px }

.rich-answer .ql-editor.ql-blank::before { left: 20px; right: 20px; font-style: normal; color: var(--muted) }
.rich-answer .ql-snow.ql-toolbar button:hover .ql-stroke,
.rich-answer .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--forest) }
.rich-answer .ql-snow.ql-toolbar button:hover .ql-fill,
.rich-answer .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--forest) }

/* Danish labels for the text size picker. */
.rich-answer .ql-snow .ql-picker.ql-size { width: 120px }
.rich-answer .ql-snow .ql-picker.ql-size .ql-picker-label::before,
.rich-answer .ql-snow .ql-picker.ql-size .ql-picker-item::before { content: "Normal" }
.rich-answer .ql-snow .ql-picker.ql-size .ql-picker-label[data-value=small]::before,
.rich-answer .ql-snow .ql-picker.ql-size .ql-picker-item[data-value=small]::before { content: "Lille" }
.rich-answer .ql-snow .ql-picker.ql-size .ql-picker-label[data-value=large]::before,
.rich-answer .ql-snow .ql-picker.ql-size .ql-picker-item[data-value=large]::before { content: "Stor" }
.rich-answer .ql-snow .ql-picker.ql-size .ql-picker-label[data-value=huge]::before,
.rich-answer .ql-snow .ql-picker.ql-size .ql-picker-item[data-value=huge]::before { content: "Meget stor" }

/* A submitted answer shown back on the feedback page, outside the editor. */
.answer-text { color: var(--ink); line-height: 1.6 }
.answer-text p { margin: 0 0 .6em; color: inherit }
.answer-text ul, .answer-text ol { margin: 0 0 .6em; padding-left: 1.5em }
.answer-text .plain-answer { white-space: pre-wrap }

/* The admin's formatted text above a scan reading tab's image. */
.scan-tab-text { color: var(--ink); line-height: 1.6; margin-bottom: 14px }
.scan-tab-text p { margin: 0 0 .6em; color: inherit }
.scan-tab-text ul, .scan-tab-text ol { margin: 0 0 .6em; padding-left: 1.5em }

.answer-text .ql-size-small, .instruction .ql-size-small, .preview-prompt .ql-size-small, .scan-tab-text .ql-size-small,
.rich-answer .ql-editor .ql-size-small { font-size: .75em }
.answer-text .ql-size-large, .instruction .ql-size-large, .preview-prompt .ql-size-large, .scan-tab-text .ql-size-large,
.rich-answer .ql-editor .ql-size-large { font-size: 1.5em }
.answer-text .ql-size-huge, .instruction .ql-size-huge, .preview-prompt .ql-size-huge, .scan-tab-text .ql-size-huge,
.rich-answer .ql-editor .ql-size-huge { font-size: 2.5em }

.rich-answer-error {
  margin: 10px 0 0;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--warnSoft);
  color: var(--ink);
  font-weight: 600;
}

/* ===== PUBLIC PAGES: prototype v15 visual system =====
   Ported from the "v15: one coherent visual system" layer of
   KlarTilTest-kursistprototype.html, for the public layout only (landing,
   info pages, contact, login, header and footer). Shared classes such as
   .btn, .card, .lead and .field are also used by the training and admin
   pages, so they are scoped under body.public-page to leave those alone. */
:root {
  --surface: #FFFFFF;
  --surface-soft: #FBFAF7;
  --border: #DED8CC;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 26px;
  --shadow-card: 0 10px 28px rgba(35, 66, 61, .07);
  --shadow-float: 0 22px 58px rgba(35, 66, 61, .12);
}

body.public-page { background: var(--page); font-size: 16px; line-height: 1.5 }
.public-page :is(h1, h2, h3) { text-wrap: balance }
/* :where() keeps this at element specificity, as in the prototype, so class
   rules such as .lead { max-width: 620px } still win. */
:where(.public-page) p { max-width: 72ch }
.public-page .lead { font-size: 17px; line-height: 1.55 }

.public-page .btn {
  min-height: 46px;
  border-radius: var(--radius-sm);
  padding: 12px 19px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.public-page .btn.secondary { border-color: var(--border) }
.public-page .card {
  border-radius: var(--radius-md);
  border-color: var(--border);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

/* Header */
.public-header {
  height: 80px;
  padding: 0 clamp(20px, 4vw, 56px);
  border-color: var(--border);
  box-shadow: 0 2px 12px rgba(35, 66, 61, .025);
}
.public-nav a { position: relative; padding: 10px 0; color: #50645E }
/* Gold underline that slides in on hover; not on the button-styled login link. */
.public-nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 4px;
  height: 2px;
  background: var(--gold);
  transition: right .18s ease;
}
.public-nav a:not(.btn):hover::after { right: 0 }
.public-nav a.btn { padding: 12px 19px; color: var(--forest) }

/* Landing page */
.public-wrap { max-width: 1120px; padding: clamp(44px, 6vw, 78px) 26px }
.hero-grid { grid-template-columns: 1.08fr .92fr; gap: clamp(36px, 6vw, 72px) }
.hero-grid h1 { font-size: clamp(44px, 5vw, 66px); line-height: 1.04; max-width: 720px; margin-bottom: 15px }
.hero-card { border-color: var(--border); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-float) }
.feature-grid { gap: 14px; margin-top: 28px }
.public-page .feature-grid .card { padding: 26px; border-top: 4px solid var(--sage) }
.public-page .feature-grid .card:nth-child(2) { border-top-color: var(--gold) }
.public-page .feature-grid .card:nth-child(3) { border-top-color: var(--violet) }
.feature-grid p { font-size: 14px; margin-bottom: 0 }

/* Footer */
.public-footer { margin-top: 28px }
.public-footer a { width: max-content; border-bottom: 1px solid transparent }
.public-footer a:hover { border-bottom-color: rgba(255, 255, 255, .7) }

/* Info pages */
.public-info-main { max-width: 1180px; padding: clamp(44px, 7vw, 88px) 26px 76px }
.info-hero { grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); gap: 56px; margin-bottom: 56px }
.info-hero h1 { font-size: clamp(42px, 5vw, 62px) }
.info-visual {
  color: white;
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-float);
  min-height: 320px;
}
/* The prototype leaves these on the base h2/p margins; undo the app's overrides. */
.info-visual h2 { margin-bottom: 14px }
.info-visual p { color: white; opacity: .82; margin: revert }
.info-grid { gap: 18px; margin: 28px 0 48px }
.info-card { border-color: var(--border); border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-card) }
.info-number { margin-bottom: 18px; font-size: inherit }
.info-section { padding: 42px 0; border-top-color: var(--border) }
.info-section h2 { font-size: 34px }
.info-checks { gap: 12px; margin: 22px 0 0 }
.info-checks li {
  border-color: var(--border);
  border-radius: var(--radius-sm);
  padding: 15px 16px;
  gap: 12px;
  font-size: inherit;
}
.info-checks li::before { font-weight: 950 }
.info-cta { border-radius: var(--radius-lg); padding: clamp(28px, 5vw, 52px) }
.info-cta h2 { margin-bottom: 8px }
.info-cta p { color: white; opacity: .8; margin: 0 0 8px }

/* Contact */
.contact-grid { gap: 28px }
.contact-form {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  gap: 17px;
}
.contact-form .form-row { gap: 14px }
.contact-form .field { gap: 7px }
/* The prototype's labels inherit the body size; the shared .field rule shrinks them to 14px. */
.contact-form .field label { font-weight: 800; color: var(--forest); font-size: 16px }
.contact-form .field :is(input, textarea, select) {
  border-radius: var(--radius-sm);
  padding: 12px 13px;
  font-size: 16px;
}
.contact-form .field textarea { min-height: 150px }
.contact-form .form-note { font-size: 13px; color: var(--muted); margin: 0 }

@media (max-width: 1380px) {
  .public-wrap { max-width: 1080px }
}

@media (max-width: 900px) {
  .public-header { padding-inline: 18px }
  /* Keep the login button on small screens; only the text links are hidden. */
  .public-nav { display: flex; gap: 10px }
  .public-nav > a:not(.btn) { display: none }
  .hero-grid, .info-hero, .contact-grid { grid-template-columns: 1fr }
  .info-visual { min-height: 240px }
  .info-grid, .feature-grid { grid-template-columns: 1fr }
}

@media (max-width: 620px) {
  .public-header { height: 70px }
  .public-header .logo { font-size: 19px }
  .public-header .logo svg { width: 34px; height: 34px }
  .public-wrap, .public-info-main { padding-left: 16px; padding-right: 16px }
  .hero-grid h1 { font-size: 38px }
  .hero-card { padding: 22px }
  .info-checks, .contact-form .form-row { grid-template-columns: 1fr }
  .info-cta { display: grid }
  .info-cta .btn { width: 100% }
}
