@font-face { font-family: 'LaddaBody'; src: url('assets/body.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'LaddaHeading'; src: url('assets/heading.woff2') format('woff2'); font-weight: 600 700; font-display: swap; }

:root {
  --ink: #16172e;
  --muted: #4b4d66;
  --line: #d9d8ec;
  --soft: #f4f3fd;
  --tint: #e6e4fa;
  --paper: #fcfcff;
  --indigo: #2e2a78;
  --success: #1f7a4d;
  --danger: #a52815;
  --warn-bg: #fff7e6;
  --warn-ink: #5c3b00;
  --radius: 12px;
  --body: 'LaddaBody', 'Atkinson Hyperlegible', system-ui, sans-serif;
  --heading: 'LaddaHeading', 'Familjen Grotesk', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { font-size: 106.25%; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--paper); line-height: 1.6; overflow-wrap: anywhere; }
h1, h2, h3, h4 { font-family: var(--heading); letter-spacing: -0.01em; line-height: 1.25; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 3px; box-shadow: 0 0 0 2px #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 1rem; top: -4rem; z-index: 50; padding: .6rem 1rem; background: var(--indigo); color: #fff; border-radius: 8px; font-weight: 700; }
.skip-link:focus { top: 1rem; }

.ld-header { display: flex; align-items: center; gap: 1rem; padding: .75rem clamp(1rem, 3vw, 2.5rem); border-bottom: 4px solid var(--brand, var(--indigo)); background: #fff; }
.ld-header img { max-height: 44px; width: auto; display: block; }
.ld-header .ld-client { font-weight: 700; color: var(--muted); }
.ld-header .ld-title { margin: 0 0 0 auto; font-size: 1rem; font-weight: 600; text-align: right; }
.ld-preview { margin-left: .5rem; padding: .1rem .6rem; border-radius: 999px; background: var(--tint); color: var(--indigo); font-size: .85rem; font-weight: 700; }
.ld-notices { padding-inline: clamp(1rem, 3vw, 2.5rem); }
#runtime-note:not(:empty), #save-error:not(:empty) { margin-top: .75rem; padding: .75rem 1rem; border-radius: var(--radius); }
#runtime-note:not(:empty) { background: var(--soft); border: 2px solid var(--line); }
#save-error:not(:empty) { background: #fdeceb; border: 2px solid var(--danger); color: var(--danger); font-weight: 700; }
.ld-root:focus { outline: none; }
.ld-loading { padding: 2rem; color: var(--muted); }

.ld-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding: 1.25rem clamp(1rem, 3vw, 2.5rem) 3rem; max-width: 1440px; margin-inline: auto; }
@media (min-width: 900px) { .ld-layout { grid-template-columns: 17rem minmax(0, 1fr); } }

.ld-toc-toggle { display: inline-flex; }
@media (min-width: 900px) { .ld-toc-toggle { display: none; } .ld-toc[hidden] { display: block !important; } }
.ld-toc { border: 2px solid var(--line); border-radius: var(--radius); background: #fff; padding: 1rem; align-self: start; }
@media (min-width: 900px) { .ld-toc { position: sticky; top: 1rem; max-height: calc(100dvh - 2rem); overflow: auto; } }
.ld-toc h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 1rem 0 .4rem; }
.ld-toc h2:first-child { margin-top: 0; }
.ld-toc ol { list-style: none; margin: 0; padding: 0; }
.ld-toc button { display: flex; gap: .5rem; width: 100%; text-align: left; padding: .5rem .6rem; border: 0; border-radius: 8px; background: transparent; font: inherit; color: var(--ink); cursor: pointer; }
.ld-toc button:hover:enabled { background: var(--soft); }
.ld-toc button[aria-current='page'] { background: var(--tint); font-weight: 700; color: var(--brand-text, var(--indigo)); box-shadow: inset 4px 0 0 var(--brand, var(--indigo)); }
.ld-toc button:disabled { color: var(--muted); cursor: not-allowed; }
.ld-toc .ld-tick { width: 1.1rem; flex: none; color: var(--success); font-weight: 700; }
.ld-progress { height: 8px; border-radius: 99px; background: var(--tint); overflow: hidden; margin-bottom: .4rem; }
.ld-progress span { display: block; height: 100%; background: var(--brand, var(--indigo)); transform-origin: left; transition: transform .3s ease; }

.ld-page { min-width: 0; }
.ld-page-head { max-width: 800px; margin: 0 auto 1.5rem; }
.ld-eyebrow { margin: 0; font-weight: 700; color: var(--brand-text, var(--indigo)); text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; }
.ld-page-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: .2rem 0 0; }
.ld-page-head h1:focus { outline: none; }
.ld-blocks { display: flex; flex-direction: column; gap: 2rem; }
.ld-medium { width: 100%; max-width: 800px; margin-inline: auto; min-width: 0; }
.ld-card { border: 2px solid var(--line); border-radius: var(--radius); background: #fff; padding: clamp(1rem, 3vw, 1.5rem); }
.ld-label { margin: 0 0 .5rem; font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-text, var(--indigo)); }
.ld-q { font-family: var(--heading); font-size: clamp(1.2rem, 2.6vw, 1.5rem); font-weight: 600; margin: 0 0 1rem; white-space: pre-line; }
.ld-muted { color: var(--muted); }
.ld-placeholder { max-width: 800px; margin-inline: auto; padding: 1rem 1.25rem; border-radius: var(--radius); background: var(--soft); border: 2px dashed var(--line); color: var(--muted); font-weight: 700; }

.rich { max-width: 70ch; margin-inline: auto; }
.rich > :first-child { margin-top: 0; }
.rich h2 { font-size: 1.5rem; margin: 1.1em 0 .4em; }
.rich h3 { font-size: 1.2rem; margin: 1em 0 .3em; }
.rich h4 { font-size: 1.05rem; margin: .9em 0 .3em; }
.rich a, .ld-link { color: var(--indigo); text-decoration: underline; text-underline-offset: 3px; }

.ld-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .6rem 1.2rem; border-radius: 10px; border: 2px solid var(--brand-text, var(--indigo)); background: var(--brand-text, var(--indigo)); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.ld-btn.secondary { background: #fff; color: var(--brand-text, var(--indigo)); border-color: var(--brand-text, var(--indigo)); }
.ld-btn.ghost { background: transparent; border-color: transparent; color: var(--brand-text, var(--indigo)); min-height: 44px; }
.ld-btn:hover:enabled { filter: brightness(.92); }
.ld-btn:disabled { background: var(--tint); border-color: var(--line); color: var(--muted); cursor: not-allowed; filter: none; }
.ld-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1rem; }

/* Images */
.ld-figure { margin: 0; min-width: 0; }
.ld-figure figcaption { margin-top: .5rem; color: var(--muted); }
.ld-zoom { display: block; width: 100%; padding: 0; border: 2px solid var(--line); border-radius: var(--radius); background: var(--soft); cursor: zoom-in; overflow: hidden; }
.ld-zoom img { display: block; width: 100%; }
.ld-ti-wide { display: flex; flex-direction: column; gap: 1.25rem; max-width: 1100px; margin-inline: auto; width: 100%; }
.ld-ti-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; max-width: 1100px; margin-inline: auto; width: 100%; }
@media (min-width: 768px) { .ld-ti-grid { grid-template-columns: 1fr 1fr; gap: 2rem; } .ld-ti-grid.right > :first-child { order: 2; } .ld-ti-grid .rich { margin-inline: 0; } }
dialog.ld-lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 1rem; border: 0; background: rgb(14 14 30 / .94); color: #fff; }
dialog.ld-lightbox::backdrop { background: rgb(14 14 30 / .7); }
dialog.ld-lightbox[open] { display: flex; align-items: center; justify-content: center; }
dialog.ld-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
dialog.ld-lightbox .ld-close { position: absolute; top: max(1rem, env(safe-area-inset-top)); right: max(1rem, env(safe-area-inset-right)); background: var(--indigo); border-color: #fff; color: #fff; }

/* Media */
.ld-video { aspect-ratio: 16 / 9; width: 100%; max-width: 1100px; margin-inline: auto; border-radius: var(--radius); overflow: hidden; background: #1c1b3a; color: #fff; display: flex; align-items: center; justify-content: center; text-align: center; padding: 1rem; }
.ld-video iframe, .ld-video video { width: 100%; height: 100%; border: 0; display: block; }
.ld-video.loaded { padding: 0; }
.ld-video p { margin: 0 0 1rem; max-width: 40ch; }
.ld-pdf canvas { display: block; width: 100%; height: auto; border: 2px solid var(--line); border-radius: 8px; background: #fff; }
.ld-pdf-stage { min-height: 12rem; display: flex; align-items: center; justify-content: center; background: var(--soft); border-radius: 8px; }

/* Choices */
.ld-options { display: flex; flex-direction: column; gap: .6rem; border: 0; margin: 0; padding: 0; }
.ld-option { display: flex; gap: .75rem; align-items: flex-start; padding: .75rem 1rem; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 1.05rem; }
.ld-option:hover { background: var(--soft); }
.ld-option input { width: 1.25rem; height: 1.25rem; margin-top: .25rem; accent-color: var(--indigo); flex: none; }
.ld-option:focus-within { outline: 3px solid var(--indigo); outline-offset: 2px; }
.ld-option.is-right { border-color: var(--success); background: #eaf6ef; }
.ld-option.is-wrong { border-color: var(--danger); background: #fdeceb; }
.ld-option.is-locked { cursor: default; }
.ld-fb { display: block; margin-top: .3rem; font-size: 1rem; }
.ld-tag { display: inline-block; margin-left: auto; padding: .05rem .6rem; border-radius: 99px; font-size: .9rem; font-weight: 700; color: #fff; background: var(--success); white-space: nowrap; }
.ld-tag.wrong { background: var(--danger); }
.ld-result { margin-top: 1rem; padding: .75rem 1rem; border-radius: 10px; font-weight: 700; }
.ld-result.good { background: #eaf6ef; color: var(--success); }
.ld-result.other { background: var(--warn-bg); color: var(--warn-ink); }
.ld-scenario { display: grid; gap: 1.25rem; }
@media (min-width: 768px) { .ld-scenario.has-image { grid-template-columns: 1fr minmax(0, 40%); } }
.ld-scenario img { border-radius: var(--radius); border: 2px solid var(--line); }

/* Text responses */
textarea.ld-textarea { width: 100%; min-height: 9rem; padding: .75rem; font: inherit; font-size: 1.05rem; border: 2px solid var(--muted); border-radius: 10px; resize: vertical; color: var(--ink); background: #fff; }
textarea.ld-textarea:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.ld-check { display: flex; gap: .75rem; align-items: flex-start; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.ld-check input { width: 1.5rem; height: 1.5rem; margin-top: .2rem; accent-color: var(--indigo); flex: none; }
.ld-note { max-width: 800px; margin-inline: auto; border: 2px solid #c9932e; background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius); padding: clamp(1rem, 3vw, 1.5rem); }
.ld-note h2 { margin: 0 0 .5rem; font-size: 1.3rem; }
.ld-note p { white-space: pre-line; margin: .4rem 0; }
.ld-note .ld-support { background: rgb(255 255 255 / .7); padding: .5rem .75rem; border-radius: 8px; }
.ld-download { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.ld-download h2 { margin: 0; font-size: 1.25rem; }
.ld-download p { margin: .3rem 0 0; white-space: pre-line; }

/* Accordion */
.ld-acc { border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.ld-acc details + details { border-top: 2px solid var(--line); }
.ld-acc summary { cursor: pointer; padding: 1rem 1.25rem; font-family: var(--heading); font-weight: 600; font-size: 1.15rem; color: var(--brand-text, var(--indigo)); list-style-position: inside; }
.ld-acc summary:hover, .ld-acc details[open] summary { background: var(--soft); }
.ld-acc summary:focus-visible { outline-offset: -4px; }
.ld-acc .ld-acc-body { padding: .5rem 1.25rem 1.25rem; }
.ld-acc .rich { margin-inline: 0; }

/* Flashcards */
.ld-fc-top { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-bottom: .75rem; }
.ld-fc-scene { perspective: 1400px; }
.ld-fc-btn { display: block; width: 100%; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 16px; font: inherit; color: inherit; }
.ld-fc-inner { display: grid; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.ld-fc-face { grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center; min-height: 15rem; padding: 2rem; border: 2px solid var(--line); border-radius: 16px; background: #fff; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ld-fc-front .ld-fc-text { font-family: var(--heading); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 600; }
.ld-fc-back { transform: rotateY(180deg); background: var(--soft); border-color: var(--brand-text, var(--indigo)); }
.ld-fc-back .ld-fc-text { font-size: clamp(1.15rem, 2.4vw, 1.5rem); }
.ld-fc-hint { margin-top: 1.25rem; font-weight: 700; color: var(--brand-text, var(--indigo)); }
.is-flipped .ld-fc-inner { transform: rotateY(180deg); }
.ld-again { margin-left: .5rem; padding: .05rem .6rem; border-radius: 99px; background: var(--tint); color: var(--indigo); }
@media (prefers-reduced-motion: reduce) {
  .ld-fc-inner, .is-flipped .ld-fc-inner { transform: none; transition: none; }
  .ld-fc-back { transform: none; opacity: 0; }
  .is-flipped .ld-fc-front { opacity: 0; }
  .is-flipped .ld-fc-back { opacity: 1; }
  .ld-progress span { transition: none; }
}

/* Footer navigation */
.ld-pager { max-width: 800px; margin: 2.5rem auto 0; padding-top: 1.25rem; border-top: 2px solid var(--line); display: flex; flex-wrap: wrap; gap: .75rem; justify-content: space-between; align-items: center; }
.ld-gate { flex-basis: 100%; margin: 0; color: var(--muted); }
.ld-done { max-width: 800px; margin: 2rem auto; text-align: center; }
.ld-done h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.ld-done h1:focus { outline: none; }
.ld-done ul { text-align: left; display: inline-block; }
.ld-bookend { max-width: 75ch; margin: 0 auto; }
.ld-bookend h2 { color: var(--brand-text); }
.ld-bookend blockquote { border-left: 4px solid var(--brand-text); padding: .5rem 1rem; margin: 1.5rem 0; background: #E6E4FA; border-radius: 0 12px 12px 0; }
.ld-bookend .ld-objectives { list-style: none; padding-left: 0; }
.ld-bookend .ld-objectives li { margin: .5rem 0; }

:root{--brand:#b4492b;--brand-text:#2E2A78}