/*
 * Playful Geometric — the single shared stylesheet. Rules and rationale: STYLE.md.
 * Sections: 1 fonts · 2 tokens · 3 base · 4 layout & surfaces · 5 type · 6 masthead/cover/footer · 7 controls
 *           8 forms & choices · 9 components · 10 shapes · 11 exam player · 12 responsive · 13 reduced motion
 */

/* 1. Fonts ---------------------------------------------------------------------------------------
 * Display: Host Grotesk (SIL OFL, static/fonts/host-grotesk/OFL.txt)  → "PlayfulGeometricDisplay"
 * Reading: Instrument Sans (SIL OFL, static/fonts/instrument-sans/OFL.txt) → "PlayfulGeometricReading" */
@font-face {
  font-family: "PlayfulGeometricDisplay";
  src: url("../fonts/host-grotesk/HostGrotesk-latin.565b7019ea62.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PlayfulGeometricDisplay";
  src: url("../fonts/host-grotesk/HostGrotesk-latin-ext.179806adc75a.woff2") format("woff2");
  font-weight: 300 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "PlayfulGeometricDisplay";
  src: url("../fonts/host-grotesk/HostGrotesk-Italic-latin.d5e11dd9816a.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PlayfulGeometricDisplay";
  src: url("../fonts/host-grotesk/HostGrotesk-Italic-latin-ext.274043da546c.woff2") format("woff2");
  font-weight: 300 800;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "PlayfulGeometricReading";
  src: url("../fonts/instrument-sans/InstrumentSans-latin.e35fad09c70b.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PlayfulGeometricReading";
  src: url("../fonts/instrument-sans/InstrumentSans-latin-ext.e2385a017626.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "PlayfulGeometricReading";
  src: url("../fonts/instrument-sans/InstrumentSans-Italic-latin.ba4ed4ed7590.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "PlayfulGeometricReading";
  src: url("../fonts/instrument-sans/InstrumentSans-Italic-latin-ext.fd76d1df2b71.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* 2. Tokens ------------------------------------------------------------------------------------- */
:root {
  /* Authoritative tokens (do not change without updating STYLE.md) */
  --dp-color-ground: #fffdf5;
  --dp-color-panel: #ffffff;
  --dp-color-ink: #253044;
  --dp-color-outline: #252b3a;
  --dp-color-accent: #6434df;
  --dp-color-accent-secondary: #ff78c5;
  --dp-color-accent-warm: #ffd05b;
  --dp-color-accent-fresh: #9bf1cd;
  --dp-color-field-soft: #e9fff5;
  --dp-color-selection: #f1ebff;
  --dp-color-rule-muted: #b8b6c5;
  --dp-typography-display: "PlayfulGeometricDisplay", sans-serif;
  --dp-typography-reading: "PlayfulGeometricReading", sans-serif;
  --dp-typography-reading-compact: 16px;
  --dp-typography-label: 14px;
  --dp-typography-metadata: 13px;
  --dp-typography-reading-leading: 1.65;
  --dp-spacing-gap-compact: 12px;
  --dp-radius-corner: 17px;
  --dp-border-outline-width: 3px;
  --dp-border-detail-width: 2px;
  --dp-motion-interaction: 180ms;

  /* Derived values (built only from the tokens above) */
  --dp-size-display: clamp(62px, 7.1cqw, 102px); /* opening statements: 62px up to 102px (from ~1440px) */
  --dp-size-title: clamp(44px, 5.2cqw, 76px); /* inner page titles */
  --dp-size-heading: clamp(28px, 2.6cqw, 40px); /* book headings */
  --dp-size-figure: clamp(34px, 3.3cqw, 52px); /* facts, timer, component scores */
  --dp-size-item-title: 22px;
  --dp-size-lead: 18px;
  --dp-weight-regular: 400;
  --dp-weight-strong: 600;
  --dp-weight-heading: 750;
  --dp-weight-display: 800;
  --dp-spacing-gutter: clamp(16px, 3.6cqw, 56px); /* page margins */
  --dp-spacing-column: clamp(14px, 2.2cqw, 36px); /* column gaps */
  --dp-space-section: clamp(44px, 5cqw, 84px); /* between books */
  --dp-space-block: clamp(20px, 2.2cqw, 32px); /* inside books */
  --dp-book-inset: clamp(18px, 3.2cqw, 52px); /* book padding */
  --dp-radius-book: calc(var(--dp-radius-corner) * 2); /* broad silhouettes: books, cover, facts strip */
  --dp-radius-small: calc(var(--dp-radius-corner) * 0.6); /* gap inputs, navigator tiles, code */
  --dp-radius-round: 999px; /* tabs, pills, circular badges */
  --dp-offset-book: 14px; /* violet backing behind books */
  --dp-offset-panel: 7px; /* tickets, facts base, side panels */
  --dp-offset-control: 4px; /* buttons, badges */
  --dp-outline: var(--dp-border-outline-width) solid var(--dp-color-outline);
  --dp-detail: var(--dp-border-detail-width) solid var(--dp-color-outline);
  --dp-rule: var(--dp-border-detail-width) solid var(--dp-color-rule-muted);
  --dp-perforation: var(--dp-border-detail-width) dashed var(--dp-color-outline);

  /* Context colours: the dark footer re-declares these */
  --dp-fg: var(--dp-color-ink);
  --dp-bg: var(--dp-color-ground);
  --dp-focus: var(--dp-color-accent);
}

/* 3. Base --------------------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--dp-color-ground);
  color: var(--dp-color-ink);
  font-family: var(--dp-typography-reading);
  font-size: var(--dp-typography-reading-compact);
  font-weight: var(--dp-weight-regular);
  line-height: var(--dp-typography-reading-leading);
  container-type: inline-size; /* gutters and display sizes use cqw */
  font-kerning: normal;
  font-variant-numeric: lining-nums;
  /* the back cover always reaches the bottom of the window */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main {
  flex: 1 0 auto;
}
img,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}
ul[role="list"],
.dp-plain-list {
  list-style: none;
  padding: 0;
}
a {
  color: inherit;
  text-decoration-thickness: var(--dp-border-detail-width);
  text-underline-offset: 0.22em;
}
a:hover {
  text-decoration-color: var(--dp-color-accent);
  text-decoration-thickness: var(--dp-border-outline-width);
}
:focus-visible {
  outline: var(--dp-border-outline-width) solid var(--dp-focus);
  outline-offset: 3px;
}
::selection {
  background: var(--dp-color-selection);
  color: var(--dp-color-ink);
}
main:focus {
  outline: none;
}
.dp-visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.dp-skip {
  position: absolute;
  inset-inline-start: var(--dp-spacing-gutter);
  top: -100px;
  z-index: 10;
  padding: 10px 18px;
  border: var(--dp-outline);
  border-radius: var(--dp-radius-round);
  background: var(--dp-color-accent);
  color: var(--dp-color-panel);
  font-weight: var(--dp-weight-strong);
}
.dp-skip:focus {
  top: 12px;
}

/* 4. Layout & surfaces -------------------------------------------------------------------------- */
.dp-shell {
  padding-inline: var(--dp-spacing-gutter);
}
.dp-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--dp-spacing-column);
  row-gap: var(--dp-space-block);
}
/* Opening: slightly wider text column (7) beside the support column or the shape assembly */
.dp-col-wide {
  grid-column: 1 / span 7;
  min-width: 0;
}
.dp-col-narrow {
  grid-column: 9 / -1;
  min-width: 0;
}
.dp-opening__art {
  grid-column: 8 / -1;
  min-width: 0;
}
/* Art beside a two-row opening (exam list): spans heading and language bar, centred */
@media (min-width: 761px) {
  .dp-opening__art--tall {
    grid-row: 1 / span 2;
    align-self: center;
  }
}
/* Inside books: heading column (1–3) + content from the 4th column */
.dp-rail {
  grid-column: 1 / span 3;
}
.dp-content {
  grid-column: 4 / -1;
  min-width: 0;
}
.dp-content--reading {
  grid-column: 4 / span 6;
  min-width: 0;
}
.dp-content--aside {
  grid-column: 10 / -1;
  min-width: 0;
}

.dp-opening {
  padding-block: var(--dp-space-section) calc(var(--dp-space-section) * 0.6);
  align-items: end;
  align-content: start;
}
.dp-opening--art {
  align-items: center;
  row-gap: calc(var(--dp-space-block) * 1.6);
}
.dp-opening__facts {
  grid-column: 1 / -1;
}

/* Book: white reading area, broad rounded silhouette, outlined violet backing and a coloured tab */
.dp-section {
  position: relative;
  margin: var(--dp-space-section) var(--dp-spacing-gutter) 0;
  padding: calc(var(--dp-book-inset) + 10px) var(--dp-book-inset) var(--dp-book-inset);
  background: var(--dp-color-panel);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-book);
  box-shadow:
    var(--dp-offset-book) var(--dp-offset-book) 0 0 var(--dp-color-accent),
    var(--dp-offset-book) var(--dp-offset-book) 0 var(--dp-border-outline-width) var(--dp-color-outline);
}
.dp-opening + .dp-section {
  margin-top: calc(var(--dp-space-section) * 0.5);
}
main > :last-child.dp-section {
  margin-bottom: calc(var(--dp-space-section) * 0.5);
}
/* Pale-mint panel for related steps and suggestions */
.dp-section--soft {
  background: var(--dp-color-field-soft);
  box-shadow: var(--dp-offset-panel) var(--dp-offset-panel) 0 0 var(--dp-color-outline);
}
/* Strip layout: heading across the top, content over the full width (numbered steps) */
.dp-section--strip .dp-rail,
.dp-section--strip .dp-content {
  grid-column: 1 / -1;
}
.dp-section--strip .dp-rail__inner {
  position: static;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px var(--dp-spacing-column);
}
.dp-tab {
  position: absolute;
  top: calc(var(--dp-border-outline-width) / -2);
  inset-inline-start: var(--dp-book-inset);
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  max-width: calc(100% - var(--dp-book-inset) * 2);
  padding: 3px 16px;
  border: var(--dp-outline);
  border-radius: var(--dp-radius-round);
  background: var(--dp-color-accent-warm);
  color: var(--dp-color-ink);
  font-family: var(--dp-typography-display);
  font-size: var(--dp-typography-label);
  font-weight: var(--dp-weight-heading);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dp-section--soft .dp-tab {
  background: var(--dp-color-accent-secondary);
}
.dp-rail__inner {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 10px;
  align-content: start;
}
/* Mascot under a book heading (home Catalogue): decorative, sized to the heading column */
.dp-rail__art {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  margin-top: 14px;
}

.dp-rail__title {
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-heading);
  font-weight: var(--dp-weight-heading);
  line-height: 1.02;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: balance;
}
.dp-rail__note {
  font-size: var(--dp-typography-metadata);
  max-width: 30ch;
}
.dp-index {
  font-size: var(--dp-typography-label);
  font-weight: var(--dp-weight-strong);
  font-variant-numeric: tabular-nums;
}
.dp-panel {
  padding: var(--dp-space-block);
  background: var(--dp-color-panel);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-corner);
  box-shadow: var(--dp-offset-panel) var(--dp-offset-panel) 0 0 var(--dp-color-outline);
}
.dp-stack > * + * {
  margin-top: var(--dp-space-block);
}
.dp-stack-sm > * + * {
  margin-top: var(--dp-spacing-gap-compact);
}

/* 5. Typography --------------------------------------------------------------------------------- */
.dp-display {
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-display);
  font-weight: var(--dp-weight-display);
  line-height: 0.94;
  letter-spacing: -0.04em;
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: balance;
}
.dp-title {
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-title);
  font-weight: var(--dp-weight-display);
  line-height: 0.98;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
  hyphens: auto;
  text-wrap: balance;
}
.dp-heading {
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-heading);
  font-weight: var(--dp-weight-heading);
  line-height: 1.02;
  letter-spacing: -0.025em;
  text-wrap: balance;
}
.dp-item-title {
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-item-title);
  font-weight: var(--dp-weight-heading);
  line-height: 1.18;
  letter-spacing: -0.012em;
}
.dp-lead {
  font-size: var(--dp-size-lead);
  line-height: 1.6;
  max-width: 60ch;
}
.dp-label {
  font-size: var(--dp-typography-label);
  font-weight: var(--dp-weight-strong);
  line-height: 1.35;
}
.dp-meta {
  font-size: var(--dp-typography-metadata);
  line-height: 1.5;
}
.dp-figure-number {
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-figure);
  font-weight: var(--dp-weight-display);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.dp-strong {
  font-weight: var(--dp-weight-strong);
}
.dp-measure {
  max-width: 68ch;
}

/* Markdown content (lessons, passages, explanations) */
.dp-prose {
  max-width: 68ch;
}
.dp-prose > * + * {
  margin-top: 1em;
}
.dp-prose h1,
.dp-prose h2,
.dp-prose h3,
.dp-prose h4 {
  font-family: var(--dp-typography-display);
  font-weight: var(--dp-weight-heading);
  line-height: 1.18;
  letter-spacing: -0.012em;
  margin-top: 1.6em;
}
.dp-prose h1,
.dp-prose h2 {
  font-size: var(--dp-size-item-title);
  padding-top: 14px;
  border-top: var(--dp-rule);
}
.dp-prose h3 {
  font-size: 19px;
}
.dp-prose ul,
.dp-prose ol {
  padding-inline-start: 1.3em;
}
.dp-prose li + li {
  margin-top: 0.35em;
}
.dp-prose li::marker {
  color: var(--dp-color-accent);
  font-weight: var(--dp-weight-strong);
}
.dp-prose code {
  font-size: 0.92em;
  padding: 1px 6px;
  border-radius: var(--dp-radius-small);
  background: var(--dp-color-field-soft);
}
.dp-prose table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.dp-prose th,
.dp-prose td {
  text-align: start;
  padding: 10px 12px 10px 0;
  border-bottom: var(--dp-rule);
  vertical-align: top;
}
.dp-prose th {
  border-bottom: var(--dp-outline);
  font-size: var(--dp-typography-label);
  font-weight: var(--dp-weight-strong);
}

/* Speech-like panels: quotations, examiner notes */
.dp-prose blockquote,
.dp-review-note {
  position: relative;
  margin: 0 0 14px;
  padding: 14px 18px;
  max-width: 68ch;
  background: var(--dp-color-selection);
  border: var(--dp-detail);
  border-radius: var(--dp-radius-corner);
}
.dp-prose blockquote::after,
.dp-review-note::after {
  content: "";
  position: absolute;
  inset-inline-start: 26px;
  bottom: -9px;
  width: 16px;
  height: 16px;
  background: inherit;
  border-inline-end: var(--dp-detail);
  border-bottom: var(--dp-detail);
  transform: rotate(45deg);
}

/* Sign-up offer (components/offer_banner.html): violet strip above the masthead with an amber button. */
.dp-offer {
  position: sticky; /* stays on top while scrolling, desktop and mobile */
  top: 0;
  z-index: 50;
  background: var(--dp-color-accent);
  color: var(--dp-color-panel);
  border-bottom: var(--dp-outline);
}
.dp-offer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 22px;
  padding-block: 12px;
}
.dp-offer__mascot {
  width: auto;
  height: 44px;
  margin-block: -4px; /* fills the strip without making it taller */
  flex: none;
}
.dp-offer__text {
  margin: 0;
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-lead);
  font-weight: var(--dp-weight-heading);
  line-height: 1.25;
}
.dp-offer .dp-offer__cta {
  background: var(--dp-color-accent-warm);
  color: var(--dp-color-ink);
  animation: dp-offer-pulse 2.4s ease-in-out infinite;
}
.dp-offer .dp-offer__cta:hover {
  animation: none;
}
@keyframes dp-offer-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@media (max-width: 760px) {
  /* Compact on phones: it is sticky, so it must leave the page room.  */
  .dp-offer__inner { gap: 6px 12px; padding-block: 8px; }
  .dp-offer__mascot { height: 34px; margin-block: -2px; }
  .dp-offer__text { font-size: 14px; flex-basis: 100%; text-align: center; }
  .dp-offer .dp-offer__cta { min-height: 36px; padding: 5px 12px; }
}

/* Exit-intent pop-up (components/exit_offer.html): native <dialog> opened by dp.js; panda on the left, sign-up pitch on the right. */
.dp-exit {
  width: min(680px, calc(100vw - 32px));
  padding: 28px;
  border: var(--dp-outline);
  border-radius: var(--dp-radius-book);
  background: var(--dp-color-panel);
  color: var(--dp-color-ink);
  box-shadow: var(--dp-offset-control) var(--dp-offset-control) 0 0 var(--dp-color-outline);
  overflow: visible;
}
.dp-exit[open] {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  align-items: center;
}
.dp-exit::backdrop {
  background: rgba(37, 48, 68, 0.6);
}
.dp-exit__panda {
  width: 100%;
  height: auto;
}
.dp-exit__title {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
}
.dp-exit__close {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 14px;
  margin: 0;
}
.dp-exit__close .dp-link-button {
  font-size: 20px;
  padding: 6px 10px;
}
@media (max-width: 760px) {
  .dp-exit { padding: 20px; }
  .dp-exit[open] { grid-template-columns: 1fr; gap: 12px; }
  .dp-exit__panda { width: 120px; justify-self: center; }
}

/* 6. Masthead, cover & footer ------------------------------------------------------------------- */
.dp-masthead {
  padding-top: 16px;
}
.dp-masthead__inner {
  align-items: center;
  margin-inline: var(--dp-spacing-gutter);
  padding: 10px 14px 10px 20px;
  background: var(--dp-color-panel);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-corner);
  box-shadow: var(--dp-offset-control) var(--dp-offset-control) 0 0 var(--dp-color-outline);
}
.dp-brand {
  grid-column: 1 / span 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-item-title);
  font-weight: var(--dp-weight-display);
  letter-spacing: -0.03em;
  line-height: 1;
  text-decoration: none;
  justify-self: start;
}
.dp-brand::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border: var(--dp-outline);
  border-radius: 50%;
  background: var(--dp-color-accent);
  box-shadow: 3px 3px 0 0 var(--dp-color-accent-warm);
}
.dp-nav {
  grid-column: 4 / -1;
}
.dp-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.dp-nav__push {
  margin-inline-start: auto;
}
.dp-navlink {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 14px;
  border: var(--dp-border-detail-width) solid transparent;
  border-radius: var(--dp-radius-round);
  background: none;
  color: inherit;
  font: inherit;
  font-size: 15px;
  font-weight: var(--dp-weight-strong);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dp-motion-interaction), border-color var(--dp-motion-interaction);
}
.dp-navlink:hover {
  background: var(--dp-color-selection);
  text-decoration: none;
}
.dp-navlink[aria-current="page"] {
  background: var(--dp-color-selection);
  border-color: var(--dp-color-outline);
  box-shadow: 3px 3px 0 0 var(--dp-color-accent);
}

/* Back cover: mint shape at the end of every page; holds the closing statement (home) and the footer */
.dp-cover {
  position: relative;
  margin: var(--dp-space-section) var(--dp-spacing-gutter) 0; /* same side margins as the books above */
  padding-top: 28px;
  background: var(--dp-color-accent-fresh);
  border: var(--dp-outline);
  border-bottom: 0;
  border-radius: calc(var(--dp-radius-book) * 1.5) calc(var(--dp-radius-book) * 1.5) 0 0;
}
.dp-closing {
  position: relative;
  padding-block: calc(var(--dp-space-section) * 1.1) calc(var(--dp-space-section) * 1.3);
  align-items: end;
}
.dp-closing > :not(.dp-confetti) {
  position: relative;
}

/* Dark slate footer inset into the cover, broad curved top, pale text */
.dp-footer {
  --dp-fg: var(--dp-color-ground);
  --dp-bg: var(--dp-color-ink);
  --dp-focus: var(--dp-color-accent-warm);
  margin-inline: calc(var(--dp-spacing-gutter) * 0.5);
  padding-top: clamp(40px, 5cqw, 72px);
  background: var(--dp-color-ink);
  color: var(--dp-color-ground);
  border: var(--dp-outline);
  border-bottom: 0;
  border-radius: 50% 50% 0 0 / clamp(36px, 5cqw, 72px) clamp(36px, 5cqw, 72px) 0 0;
  font-size: var(--dp-typography-metadata);
}
.dp-footer a:hover {
  text-decoration-color: var(--dp-color-accent-warm);
}
.dp-footer__grid {
  row-gap: var(--dp-space-block);
}
.dp-footer__group {
  grid-column: span 3;
  display: grid;
  gap: 8px;
  align-content: start;
}
.dp-footer__group .dp-label {
  color: var(--dp-color-accent-fresh);
}
.dp-footer__group .dp-strong {
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-lead);
  font-weight: var(--dp-weight-display);
}
.dp-footer__group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.dp-footer__base {
  grid-column: 1 / -1;
  border-top: var(--dp-rule);
  padding-block: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

/* 7. Controls ----------------------------------------------------------------------------------- */
.dp-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 50px;
  padding: 11px 20px;
  border: var(--dp-outline);
  border-radius: var(--dp-radius-corner);
  background: var(--dp-color-accent);
  color: var(--dp-color-panel);
  box-shadow: var(--dp-offset-control) var(--dp-offset-control) 0 0 var(--dp-color-outline);
  font: inherit;
  font-weight: var(--dp-weight-strong);
  line-height: 1.2;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--dp-motion-interaction),
    box-shadow var(--dp-motion-interaction);
}
.dp-button:hover {
  transform: translate(-2px, -2px);
  box-shadow: calc(var(--dp-offset-control) + 2px) calc(var(--dp-offset-control) + 2px) 0 0 var(--dp-color-outline);
  text-decoration: none;
}
.dp-button:active {
  transform: translate(2px, 2px);
  box-shadow: calc(var(--dp-offset-control) - 2px) calc(var(--dp-offset-control) - 2px) 0 0 var(--dp-color-outline);
}
.dp-button:focus-visible {
  outline-offset: calc(var(--dp-offset-control) + 4px); /* visible beyond the shadow */
}
.dp-button--secondary {
  background: var(--dp-color-panel);
  color: var(--dp-color-ink);
}
.dp-button--block {
  display: flex;
  width: 100%;
}
.dp-button--small {
  min-height: 40px;
  padding: 7px 14px;
  font-size: var(--dp-typography-label);
  border-width: var(--dp-border-detail-width);
}
.dp-button[disabled],
.dp-button[aria-disabled="true"] {
  background: var(--dp-color-ground);
  color: var(--dp-color-ink);
  border-style: dashed;
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}
.dp-button__arrow {
  font-family: var(--dp-typography-display);
  font-weight: var(--dp-weight-display);
}
.dp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
}
.dp-actions--stack {
  display: grid;
  gap: 14px;
}
.dp-link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: var(--dp-weight-strong);
  text-decoration: underline;
  text-decoration-thickness: var(--dp-border-detail-width);
  text-underline-offset: 0.22em;
  cursor: pointer;
}
.dp-link-button.dp-meta {
  font-size: var(--dp-typography-metadata);
}
.dp-link-button:hover {
  text-decoration-color: var(--dp-color-accent);
  text-decoration-thickness: var(--dp-border-outline-width);
}
.dp-inline-form {
  display: inline;
}

/* 8. Forms & choices ---------------------------------------------------------------------------- */
.dp-form {
  display: grid;
  gap: 22px;
  max-width: 640px;
}
.dp-form--wide {
  max-width: none;
}
.dp-form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 22px var(--dp-spacing-column);
}
.dp-field {
  display: grid;
  gap: 8px;
  align-content: start;
}
.dp-field__label {
  font-size: var(--dp-typography-label);
  font-weight: var(--dp-weight-strong);
}
.dp-field__help {
  font-size: var(--dp-typography-metadata);
}
.dp-input,
.dp-field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.dp-field select,
.dp-field textarea,
.dp-select {
  width: 100%;
  min-height: 50px;
  padding: 11px 15px;
  border: var(--dp-detail);
  border-radius: var(--dp-radius-corner);
  background: var(--dp-color-panel);
  color: var(--dp-color-ink);
  font: inherit;
  font-size: var(--dp-typography-reading-compact); /* prevents zoom on iOS */
  transition: box-shadow var(--dp-motion-interaction);
}
.dp-input:focus,
.dp-field input:focus,
.dp-field select:focus,
.dp-field textarea:focus,
.dp-select:focus {
  box-shadow: var(--dp-offset-control) var(--dp-offset-control) 0 0 var(--dp-color-accent);
}
.dp-field select,
.dp-select {
  appearance: none;
  padding-inline-end: 44px;
  /* plain chevron: functional indicator, not ornament */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1.5 1.5l5.5 5.5 5.5-5.5' fill='none' stroke='%23252b3a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 16px center;
  background-size: 14px 9px;
  background-repeat: no-repeat;
}
.dp-field textarea,
textarea.dp-input {
  min-height: 160px;
  line-height: var(--dp-typography-reading-leading);
  resize: vertical;
}
.dp-field input[type="file"],
input[type="file"].dp-meta {
  font: inherit;
  font-size: var(--dp-typography-metadata);
}
input[type="file"]::file-selector-button {
  margin-inline-end: 12px;
  padding: 8px 14px;
  border: var(--dp-detail);
  border-radius: var(--dp-radius-corner);
  background: var(--dp-color-selection);
  color: var(--dp-color-ink);
  font: inherit;
  font-weight: var(--dp-weight-strong);
  cursor: pointer;
}
/* Invalid: pink offset in addition to the error text */
.dp-field--invalid input,
.dp-field--invalid select,
.dp-field--invalid textarea,
.dp-input[aria-invalid="true"] {
  box-shadow: var(--dp-offset-control) var(--dp-offset-control) 0 0 var(--dp-color-accent-secondary);
}
.dp-errors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: var(--dp-typography-metadata);
  font-weight: var(--dp-weight-strong);
}
.dp-errors li,
.dp-marked {
  display: flex;
  gap: 10px;
  align-items: baseline;
}
/* Priority marker: pink circle with an outline (always paired with text) */
.dp-errors li::before,
.dp-marked::before,
.dp-marker {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border: var(--dp-detail);
  border-radius: 50%;
  background: var(--dp-color-accent-secondary);
  transform: translateY(1px);
}
.dp-checkbox {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  font-weight: var(--dp-weight-strong);
  cursor: pointer;
}

/* Inputs used by checkboxes, radios and option rows: rounded square (checkbox) / circle (radio) */
.dp-checkbox input,
.dp-option input {
  appearance: none;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  padding: 4px;
  border: var(--dp-detail);
  border-radius: 7px;
  background-clip: content-box;
  background-color: var(--dp-color-panel);
  color: inherit;
  cursor: pointer;
}
.dp-option input[type="radio"] {
  border-radius: 50%;
}
.dp-checkbox input:checked,
.dp-option input:checked {
  background-color: var(--dp-color-accent);
}
.dp-checkbox input[type="checkbox"]:checked,
.dp-option input[type="checkbox"]:checked {
  border-radius: 7px;
}
.dp-option input[type="radio"]:checked {
  border-radius: 50%;
}

/* Option rows: selection = pale-violet fill + violet offset AND "Selected" text, never colour alone */
.dp-options {
  display: grid;
  gap: 10px;
}
.dp-option {
  display: grid;
  grid-template-columns: auto 2.2em minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
  padding: 13px 16px;
  border: var(--dp-detail);
  border-radius: var(--dp-radius-corner);
  background: var(--dp-color-panel);
  cursor: pointer;
  transition:
    transform var(--dp-motion-interaction),
    box-shadow var(--dp-motion-interaction),
    background-color var(--dp-motion-interaction);
}
.dp-option:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 0 var(--dp-color-outline);
}
.dp-option:has(input:checked) {
  background: var(--dp-color-selection);
  box-shadow: 5px 5px 0 0 var(--dp-color-accent);
}
.dp-option:has(input:focus-visible) {
  outline: var(--dp-border-outline-width) solid var(--dp-focus);
  outline-offset: 7px;
}
.dp-option:has(input:focus-visible) input {
  outline: none;
}
.dp-option__key {
  font-family: var(--dp-typography-display);
  font-weight: var(--dp-weight-display);
}
.dp-option__state {
  font-size: var(--dp-typography-metadata);
  font-weight: var(--dp-weight-strong);
  align-self: center;
  color: var(--dp-color-accent);
}
.dp-option:has(input:checked) .dp-option__state::after {
  content: "Selected";
}
.dp-option img {
  margin-top: 8px;
  max-height: 220px;
  border-radius: var(--dp-radius-small);
}
/* Picture options ("choose the matching picture"): two pictures per row, as on the exam screen */
.dp-options:has(.dp-option img) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.dp-options:has(.dp-option img) .dp-option {
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px 12px;
}
/* radio + number on the first row, the picture below across the whole card */
.dp-options:has(.dp-option img) .dp-option__key + span,
.dp-options:has(.dp-option img) .dp-option__state {
  grid-column: 1 / -1;
}
.dp-options:has(.dp-option img) .dp-option img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
}
.dp-options--inline {
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}
.dp-options--inline .dp-option {
  grid-template-columns: auto minmax(0, 1fr);
}
.dp-options--inline .dp-option__state {
  grid-column: 1 / -1;
}

/* 9. Components --------------------------------------------------------------------------------- */
/* Messages: speech-like notice under the masthead */
.dp-messages {
  list-style: none;
  margin: 18px 0 0;
  padding: 6px 20px;
  background: var(--dp-color-panel);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-corner);
  box-shadow: var(--dp-offset-control) var(--dp-offset-control) 0 0 var(--dp-color-accent-warm);
}
.dp-messages li {
  padding: 10px 0;
  font-weight: var(--dp-weight-strong);
}
.dp-messages li + li {
  border-top: var(--dp-rule);
}

/* Facts: figures on a mint strip with an outlined base layer; label/value rows in a panel when stacked */
.dp-facts {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  background: var(--dp-color-accent-fresh);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-book);
  box-shadow:
    var(--dp-offset-panel) var(--dp-offset-panel) 0 0 var(--dp-color-ground),
    var(--dp-offset-panel) var(--dp-offset-panel) 0 var(--dp-border-outline-width) var(--dp-color-outline);
}
.dp-facts > div {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 18px 22px;
  min-width: 0;
}
.dp-facts > div + div {
  border-inline-start: var(--dp-perforation);
}
.dp-facts dt {
  font-size: var(--dp-typography-label);
  font-weight: var(--dp-weight-strong);
}
.dp-facts dd {
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-figure);
  font-weight: var(--dp-weight-display);
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}
.dp-facts dd.dp-item-title {
  font-size: var(--dp-size-item-title);
  letter-spacing: -0.012em;
}
.dp-facts--stacked {
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  background: var(--dp-color-panel);
  border-radius: var(--dp-radius-corner);
  box-shadow: var(--dp-offset-panel) var(--dp-offset-panel) 0 0 var(--dp-color-outline);
}
.dp-facts--stacked > div {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  padding: 12px 18px;
}
.dp-facts--stacked > div + div {
  border-inline-start: 0;
  border-top: var(--dp-rule);
}
.dp-facts--stacked dd {
  font-size: 20px;
  letter-spacing: -0.01em;
  text-align: end;
}

/* Book grid: features and catalogue entries share the book; linked entries are outlined tiles */
.dp-matrix {
  display: grid;
  grid-template-columns: repeat(var(--dp-matrix-columns, 3), minmax(0, 1fr));
  gap: var(--dp-space-block) var(--dp-spacing-column);
}
.dp-matrix--2 {
  --dp-matrix-columns: 2;
}
.dp-matrix--4 {
  --dp-matrix-columns: 4;
}
.dp-cell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.dp-matrix > .dp-cell {
  padding-top: 16px;
  border-top: var(--dp-rule);
}
.dp-matrix__link {
  display: flex;
  min-width: 0;
}
a.dp-cell {
  flex: 1;
  min-height: 200px;
  padding: 20px 22px;
  background: var(--dp-color-panel);
  border: var(--dp-detail);
  border-radius: var(--dp-radius-corner);
  text-decoration: none;
  transition:
    transform var(--dp-motion-interaction),
    box-shadow var(--dp-motion-interaction),
    background-color var(--dp-motion-interaction);
}
a.dp-cell:hover {
  transform: translate(-2px, -2px);
  background: var(--dp-color-selection);
  box-shadow: 6px 6px 0 0 var(--dp-color-accent);
}
a.dp-cell:active {
  transform: translate(1px, 1px);
  box-shadow: 2px 2px 0 0 var(--dp-color-accent);
}
a.dp-cell:focus-visible {
  outline-offset: 5px;
}
/* Exam-family card (news pages): name, short description (max 4 lines), available levels */
.dp-family .dp-item-title {
  font-size: var(--dp-size-lead);
}
.dp-family__about {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  overflow: hidden;
  line-height: 1.5;
}
.dp-family__levels {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dp-cell__foot {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 12px;
  font-size: var(--dp-typography-metadata);
  font-weight: var(--dp-weight-strong);
}
a.dp-cell .dp-cell__foot {
  padding-top: 12px;
  border-top: var(--dp-rule);
}
/* Marked features: one small outlined shape per entry (decorative) */
.dp-matrix--marked > .dp-cell::before {
  content: "";
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  border: var(--dp-outline);
  border-radius: 50%;
  background: var(--dp-color-accent-secondary);
  box-shadow: 3px 3px 0 0 var(--dp-color-outline);
}
.dp-matrix--marked > .dp-cell:nth-child(3n + 2)::before {
  width: 24px;
  height: 24px;
  margin: 2px 0 6px 2px;
  border-radius: 5px;
  background: var(--dp-color-accent-warm);
  transform: rotate(45deg);
}
.dp-matrix--marked > .dp-cell:nth-child(3n)::before {
  width: 32px;
  border-radius: 16px 16px 4px 4px;
  background: var(--dp-color-accent-fresh);
}

/* Overview tiles (home): linked tiles with one coloured badge shape each; the badge changes shape and colour like the steps */
.dp-matrix--tiles .dp-cell::before {
  content: "";
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border: var(--dp-outline);
  border-radius: 50%;
  background: var(--dp-color-accent-secondary);
  box-shadow: var(--dp-offset-control) var(--dp-offset-control) 0 0 var(--dp-color-outline);
}
.dp-matrix--tiles > :nth-child(4n + 2) .dp-cell::before {
  border-radius: var(--dp-radius-corner);
  background: var(--dp-color-accent-warm);
}
.dp-matrix--tiles > :nth-child(4n + 3) .dp-cell::before {
  border-radius: 22px 22px 8px 8px;
  background: var(--dp-color-accent-fresh);
}
.dp-matrix--tiles > :nth-child(4n + 4) .dp-cell::before {
  border-radius: 22px 8px 22px 8px;
  background: var(--dp-color-accent);
}
.dp-matrix--tiles .dp-cell__foot {
  color: var(--dp-color-accent);
}

/* Numbered steps along a connecting strip; badges change shape */
.dp-steps {
  display: grid;
  grid-template-columns: repeat(var(--dp-steps, 4), minmax(0, 1fr));
  gap: var(--dp-space-block) var(--dp-spacing-column);
  list-style: none;
  margin: 0;
  padding: 0;
  --dp-badge: 64px;
}
.dp-step {
  position: relative;
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
}
.dp-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(var(--dp-badge) / 2 - 8px);
  inset-inline-start: calc(var(--dp-badge) + 6px);
  inset-inline-end: calc(var(--dp-spacing-column) * -1 + 6px);
  height: 16px;
  background: var(--dp-color-panel);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-round);
}
.dp-step > form,
.dp-step > .dp-button {
  justify-self: start;
  margin-top: 4px;
}
.dp-step__number {
  display: grid;
  place-items: center;
  width: var(--dp-badge);
  height: var(--dp-badge);
  margin-bottom: 8px;
  border: var(--dp-outline);
  border-radius: 50%;
  background: var(--dp-color-accent-secondary);
  box-shadow: var(--dp-offset-control) var(--dp-offset-control) 0 0 var(--dp-color-outline);
  font-family: var(--dp-typography-display);
  font-size: 24px;
  font-weight: var(--dp-weight-display);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.dp-step:nth-child(4n + 2) .dp-step__number {
  border-radius: var(--dp-radius-corner);
  background: var(--dp-color-accent-warm);
}
.dp-step:nth-child(4n + 3) .dp-step__number {
  border-radius: calc(var(--dp-badge) / 2) calc(var(--dp-badge) / 2) 8px 8px;
  background: var(--dp-color-accent-fresh);
}
.dp-step:nth-child(4n + 4) .dp-step__number {
  border-radius: calc(var(--dp-badge) / 2) 8px calc(var(--dp-badge) / 2) 8px;
  background: var(--dp-color-accent);
  color: var(--dp-color-panel);
}

/* Comparison tickets: choice | details | (action), separated by perforations */
.dp-compare {
  display: grid;
  gap: 18px;
}
.dp-compare__column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.6fr);
  background: var(--dp-color-panel);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-corner);
  box-shadow: var(--dp-offset-panel) var(--dp-offset-panel) 0 0 var(--dp-color-outline);
}
.dp-compare__head {
  display: grid;
  gap: 8px;
  align-content: center;
  justify-items: start;
  padding: 20px 22px;
  border-inline-end: var(--dp-perforation);
}
.dp-compare__rows {
  display: grid;
  margin: 0;
}
.dp-compare__rows > div {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 10px 0;
}
.dp-compare__rows > div + div {
  border-top: var(--dp-rule);
}
.dp-compare__rows dt {
  font-size: var(--dp-typography-label);
  font-weight: var(--dp-weight-strong);
}
.dp-compare__column > .dp-compare__rows {
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}
.dp-compare__column > .dp-compare__rows > div {
  padding: 20px 22px;
}
.dp-compare__column > .dp-compare__rows > div + div {
  border-top: 0;
  border-inline-start: var(--dp-rule);
}
.dp-flag {
  display: inline-block;
  padding: 3px 12px;
  border: var(--dp-detail);
  border-radius: var(--dp-radius-round);
  background: var(--dp-color-accent-secondary);
  color: var(--dp-color-ink);
  font-size: var(--dp-typography-metadata);
  font-weight: var(--dp-weight-strong);
  line-height: 1.35;
}
.dp-tag {
  display: inline-block;
  padding: 2px 12px;
  border: var(--dp-detail);
  border-radius: var(--dp-radius-round);
  background: var(--dp-color-ground);
  font-size: var(--dp-typography-metadata);
  font-weight: var(--dp-weight-strong);
  line-height: 1.5;
}
.dp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Disclosure: outlined rows with an open/close mark */
.dp-disclosure {
  --dp-disclosure-inset: 22px;
  padding-inline: var(--dp-disclosure-inset); /* contents fit inside the outline; the summary spans it */
  background: var(--dp-color-panel);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-corner);
}
.dp-disclosure + .dp-disclosure {
  margin-top: var(--dp-spacing-gap-compact);
}
.dp-disclosure > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-inline: calc(var(--dp-disclosure-inset) * -1);
  padding: 16px 18px 16px var(--dp-disclosure-inset);
  border-radius: calc(var(--dp-radius-corner) - var(--dp-border-outline-width));
  list-style: none;
  cursor: pointer;
  transition: background-color var(--dp-motion-interaction);
}
.dp-disclosure > summary::-webkit-details-marker {
  display: none;
}
.dp-disclosure > summary:hover {
  background: var(--dp-color-selection);
}
.dp-disclosure[open] > summary {
  border-bottom: var(--dp-rule);
  border-radius: calc(var(--dp-radius-corner) - var(--dp-border-outline-width))
    calc(var(--dp-radius-corner) - var(--dp-border-outline-width)) 0 0;
}
.dp-disclosure > summary:focus-visible {
  outline-offset: 6px;
}
.dp-disclosure__title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 18px;
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-item-title);
  font-weight: var(--dp-weight-heading);
  line-height: 1.2;
}
.dp-disclosure__title .dp-meta {
  font-family: var(--dp-typography-reading);
  font-weight: var(--dp-weight-regular);
}
.dp-disclosure__marker {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: var(--dp-detail);
  border-radius: 50%;
  background: var(--dp-color-accent-warm);
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-item-title);
  font-weight: var(--dp-weight-display);
  line-height: 1;
}
.dp-disclosure__marker::before {
  content: "+";
}
.dp-disclosure[open] > summary .dp-disclosure__marker {
  background: var(--dp-color-selection);
}
.dp-disclosure[open] > summary .dp-disclosure__marker::before {
  content: "–";
}
.dp-disclosure__body {
  padding-block: 18px 22px;
}
.dp-disclosure > :not(summary):not(.dp-disclosure__body):first-of-type {
  margin-top: 14px;
}
.dp-disclosure > :not(summary):last-child {
  margin-bottom: 18px;
}
.dp-disclosure--small {
  --dp-disclosure-inset: 14px;
  border-width: var(--dp-border-detail-width);
  border-radius: calc(var(--dp-radius-corner) * 0.75);
}
.dp-disclosure--small > summary {
  padding: 9px 10px 9px var(--dp-disclosure-inset);
}
.dp-disclosure--small .dp-disclosure__title {
  font-family: var(--dp-typography-reading);
  font-size: var(--dp-typography-reading-compact);
  font-weight: var(--dp-weight-strong);
}
.dp-disclosure--small .dp-disclosure__marker {
  width: 28px;
  height: 28px;
  font-size: var(--dp-size-lead);
}
.dp-disclosure--small > .dp-disclosure__body {
  padding-block: 12px 16px;
}

/* Table: outlined header rule, muted row rules; stacks into labelled rows on small screens */
.dp-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.dp-table th {
  text-align: start;
  vertical-align: bottom;
  padding: 0 14px 10px 0;
  border-bottom: var(--dp-outline);
  font-size: var(--dp-typography-label);
  font-weight: var(--dp-weight-strong);
}
.dp-table td {
  padding: 13px 14px 13px 0;
  border-bottom: var(--dp-rule);
  vertical-align: top;
}
.dp-table th:last-child,
.dp-table td:last-child {
  padding-inline-end: 0;
}
.dp-table .dp-num {
  text-align: end;
}
.dp-table caption {
  text-align: start;
  padding-bottom: 12px;
}

/* Rows (lessons, attempts, goals); tickets for choices with actions (mock tests) */
.dp-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dp-row {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) auto;
  gap: 8px var(--dp-spacing-column);
  align-items: start;
  padding: 18px 0;
  border-bottom: var(--dp-rule);
}
.dp-row:first-child {
  padding-top: 0;
}
.dp-row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.dp-row__main {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.dp-row__aside {
  display: grid;
  gap: 4px;
  font-size: var(--dp-typography-metadata);
}
.dp-rows--tickets {
  display: grid;
  gap: 18px;
}
.dp-rows--tickets > .dp-row {
  grid-template-columns: minmax(0, 2.4fr) minmax(0, 1.5fr) minmax(250px, 1.2fr);
  gap: 0;
  padding: 0;
  background: var(--dp-color-panel);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-corner);
  box-shadow: var(--dp-offset-panel) var(--dp-offset-panel) 0 0 var(--dp-color-outline);
}
.dp-rows--tickets > .dp-row > * {
  align-self: stretch;
  padding: 20px 22px;
}
.dp-rows--tickets > .dp-row > * + * {
  border-inline-start: var(--dp-perforation);
}
.dp-rows--tickets .dp-row__main,
.dp-rows--tickets .dp-row__aside {
  align-content: start;
}
.dp-rows--tickets .dp-actions--stack {
  align-content: center;
}

/* Status label: the text is the state; the pink marker only adds priority */
.dp-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--dp-typography-metadata);
  font-weight: var(--dp-weight-strong);
}
.dp-status--priority::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border: var(--dp-detail);
  border-radius: 50%;
  background: var(--dp-color-accent-secondary);
}
.dp-status--inverse {
  padding: 3px 12px;
  border: var(--dp-detail);
  border-radius: var(--dp-radius-round);
  background: var(--dp-color-accent-fresh);
  color: var(--dp-color-ink);
}

/* Empty state */
.dp-empty {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: var(--dp-space-block);
  background: var(--dp-color-ground);
  border: var(--dp-border-detail-width) dashed var(--dp-color-outline);
  border-radius: var(--dp-radius-corner);
}

/* Editorial figures: natural colour, varied rounded/arched silhouettes, coloured hard shadows.
   Exam stimuli use .dp-stimulus-figure and are never cropped. */
.dp-figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--dp-space-block) var(--dp-spacing-column);
  align-items: start;
}
.dp-figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border: var(--dp-outline);
  border-radius: calc(var(--dp-radius-book) * 3) calc(var(--dp-radius-book) * 3) var(--dp-radius-corner)
    var(--dp-radius-corner);
  box-shadow: var(--dp-offset-panel) var(--dp-offset-panel) 0 0 var(--dp-color-accent-secondary);
}
.dp-figure:nth-child(3n + 2) {
  margin-top: var(--dp-space-block);
}
.dp-figure:nth-child(3n + 2) img {
  border-radius: var(--dp-radius-book);
  box-shadow: var(--dp-offset-panel) var(--dp-offset-panel) 0 0 var(--dp-color-accent-warm);
}
.dp-figure:nth-child(3n) img {
  border-radius: var(--dp-radius-corner) var(--dp-radius-book) var(--dp-radius-corner) var(--dp-radius-book);
  box-shadow: var(--dp-offset-panel) var(--dp-offset-panel) 0 0 var(--dp-color-accent-fresh);
}
.dp-figure figcaption,
.dp-stimulus-figure figcaption {
  padding-top: 10px;
  font-size: var(--dp-typography-metadata);
}
.dp-stimulus-figure img {
  border: var(--dp-detail);
  border-radius: var(--dp-radius-small);
  background: var(--dp-color-panel);
}
/* A picture that belongs to one question (EPS-TOPIK "look at the picture"): never cropped, capped in height */
.dp-question .dp-stimulus-figure img {
  width: auto;
  max-width: 100%;
  max-height: 320px;
}

/* Score poster */
h1 > .dp-label {
  display: block;
  margin-bottom: 12px;
}
.dp-score {
  display: block;
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-display);
  font-weight: var(--dp-weight-display);
  line-height: 0.9;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

/* 10. Shapes (decorative, aria-hidden) ---------------------------------------------------------- */
.dp-shapes {
  width: 100%;
  max-height: 520px;
  overflow: visible;
}
.dp-shapes--small {
  max-width: 340px;
  max-height: 250px;
  margin-inline-start: auto;
}
.dp-shapes * {
  stroke: var(--dp-color-outline);
  stroke-width: var(--dp-border-outline-width);
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.dp-shapes .dp-shape--shadow {
  fill: var(--dp-color-outline);
}
.dp-shape--accent {
  fill: var(--dp-color-accent);
}
.dp-shape--secondary {
  fill: var(--dp-color-accent-secondary);
}
.dp-shape--warm {
  fill: var(--dp-color-accent-warm);
}
.dp-shape--fresh {
  fill: var(--dp-color-accent-fresh);
}
.dp-shape--panel {
  fill: var(--dp-color-panel);
}
.dp-shape--ink {
  fill: var(--dp-color-outline);
}
/* Home mascot (traveller panda) in place of the large shape assembly — decorative */
.dp-mascot {
  display: block;
  width: 100%;
  max-width: 460px;
  max-height: 520px;
  height: auto;
  margin-inline: auto;
  object-fit: contain;
}
/* Sparse confetti around the edges of the closing cover — static */
.dp-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.dp-confetti svg {
  position: absolute;
  width: 26px;
  height: 26px;
  overflow: visible;
}
.dp-confetti * {
  stroke: var(--dp-color-outline);
  stroke-width: var(--dp-border-outline-width);
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
/* pieces stay in the padding bands above and below the statement, never over text or controls */
.dp-confetti__piece--1 {
  top: 26px;
  inset-inline-start: 4%;
}
.dp-confetti__piece--2 {
  top: 44px;
  inset-inline-start: 44%;
}
.dp-confetti__piece--3 {
  top: 28px;
  inset-inline-end: 6%;
}
.dp-confetti__piece--4 {
  bottom: 34px;
  inset-inline-start: 10%;
}
.dp-confetti__piece--5 {
  bottom: 22px;
  inset-inline-start: 52%;
}
.dp-confetti__piece--6 {
  bottom: 44px;
  inset-inline-end: 4%;
}

/* 11. Exam player ------------------------------------------------------------------------------- */
.dp-player {
  padding-block: var(--dp-space-block) var(--dp-space-section);
  align-items: start;
}
.dp-player__rail .dp-rail__inner {
  top: 16px;
  gap: 16px;
}
.dp-player__rail .dp-rail__title {
  font-size: clamp(22px, 1.9cqw, 30px);
}
/* The answer sheet is the player's book */
.dp-player > .dp-content {
  padding: var(--dp-book-inset);
  background: var(--dp-color-panel);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-book);
  box-shadow:
    var(--dp-offset-book) var(--dp-offset-book) 0 0 var(--dp-color-accent),
    var(--dp-offset-book) var(--dp-offset-book) 0 var(--dp-border-outline-width) var(--dp-color-outline);
}
.dp-timer {
  display: grid;
  gap: 2px;
  padding: 14px 18px;
  background: var(--dp-color-accent-warm);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-corner);
  box-shadow: var(--dp-offset-control) var(--dp-offset-control) 0 0 var(--dp-color-outline);
}
.dp-timer.is-low {
  background: var(--dp-color-accent-secondary);
}
.dp-timer__value {
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-figure);
  font-weight: var(--dp-weight-display);
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.dp-timer__warning {
  display: none;
}
.dp-timer.is-low .dp-timer__warning {
  display: flex;
}
.dp-section-steps {
  list-style: none;
  margin: 0;
  padding: 4px;
  background: var(--dp-color-panel);
  border: var(--dp-detail);
  border-radius: var(--dp-radius-corner);
}
.dp-section-steps li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 7px 12px;
  border-radius: calc(var(--dp-radius-corner) - 6px);
  font-size: var(--dp-typography-metadata);
}
.dp-section-steps [aria-current="step"] {
  background: var(--dp-color-selection);
  font-weight: var(--dp-weight-strong);
}
.dp-section-steps [aria-current="step"] .dp-label {
  color: var(--dp-color-accent);
}
.dp-section-steps .dp-label {
  font-size: var(--dp-typography-metadata);
}
.dp-navigator {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 6px;
}
.dp-navigator a {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 38px;
  background: var(--dp-color-panel);
  border: var(--dp-detail);
  border-radius: var(--dp-radius-small);
  font-size: var(--dp-typography-metadata);
  font-weight: var(--dp-weight-strong);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: background-color var(--dp-motion-interaction);
}
.dp-navigator a:hover {
  background: var(--dp-color-selection);
}
.dp-navigator a.is-answered {
  background: var(--dp-color-accent);
  color: var(--dp-color-panel);
}
.dp-navigator a.is-flagged::after {
  content: "";
  position: absolute;
  top: -5px;
  inset-inline-end: -5px;
  width: 12px;
  height: 12px;
  border: var(--dp-detail);
  border-radius: 50%;
  background: var(--dp-color-accent-secondary);
}
.dp-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: var(--dp-typography-metadata);
}
.dp-legend li {
  display: flex;
  gap: 8px;
  align-items: center;
}
.dp-swatch {
  flex: none;
  width: 16px;
  height: 16px;
  border: var(--dp-detail);
  border-radius: 5px;
  background: var(--dp-color-panel);
}
.dp-swatch--answered {
  background: var(--dp-color-accent);
}
.dp-swatch--flagged {
  width: 12px;
  height: 12px;
  margin-inline: 2px;
  border-radius: 50%;
  background: var(--dp-color-accent-secondary);
}

.dp-group {
  padding-top: var(--dp-space-block);
  border-top: var(--dp-perforation);
}
.dp-group + .dp-group {
  margin-top: var(--dp-space-section);
}
.dp-group__head {
  display: grid;
  gap: 10px;
  justify-items: start;
  margin-bottom: var(--dp-space-block);
}
.dp-instructions {
  padding: 14px 18px;
  max-width: 68ch;
  background: var(--dp-color-field-soft);
  border: var(--dp-detail);
  border-radius: var(--dp-radius-corner);
  font-weight: var(--dp-weight-strong);
}
.dp-stimulus {
  margin-bottom: var(--dp-space-block);
  padding-bottom: var(--dp-space-block);
  border-bottom: var(--dp-rule);
}
.dp-stimulus audio {
  width: 100%;
  max-width: 560px;
}
.dp-bank {
  margin-bottom: var(--dp-space-block);
  max-width: 68ch;
  padding: 6px 18px;
  background: var(--dp-color-ground);
  border: var(--dp-detail);
  border-radius: var(--dp-radius-corner);
}
.dp-bank li {
  display: grid;
  grid-template-columns: 3em minmax(0, 1fr);
  padding: 8px 0;
}
.dp-bank li + li {
  border-top: var(--dp-rule);
}
.dp-gapped {
  max-width: 72ch;
  line-height: 2.5;
  margin-bottom: var(--dp-space-block);
}
.dp-gap {
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
  line-height: 1.2;
}
.dp-gap__number {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  min-height: 38px;
  padding: 0 8px;
  background: var(--dp-color-accent);
  color: var(--dp-color-panel);
  border: var(--dp-detail);
  border-radius: var(--dp-radius-small) 0 0 var(--dp-radius-small);
  font-size: var(--dp-typography-metadata);
  font-weight: var(--dp-weight-strong);
  font-variant-numeric: tabular-nums;
}
.dp-gap input,
.dp-gap select {
  width: 15ch;
  min-height: 38px;
  padding: 4px 10px;
  border: var(--dp-detail);
  border-inline-start: 0;
  border-radius: 0 var(--dp-radius-small) var(--dp-radius-small) 0;
  background: var(--dp-color-panel);
  color: var(--dp-color-ink);
  font: inherit;
  font-size: var(--dp-typography-reading-compact);
}
.dp-gap select {
  width: auto;
  max-width: 22ch;
}
.dp-question {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 12px 16px;
  padding: 22px 0;
  border-top: var(--dp-rule);
  scroll-margin-top: 16px;
}
.dp-stimulus + .dp-question {
  border-top: 0;
}
.dp-rows > .dp-question:first-child {
  border-top: 0;
  padding-top: 0;
}
.dp-question__number {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: var(--dp-detail);
  border-radius: 50%;
  background: var(--dp-color-ground);
  font-family: var(--dp-typography-display);
  font-size: var(--dp-size-lead);
  font-weight: var(--dp-weight-display);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.dp-question__number:empty {
  visibility: hidden;
}
.dp-question__body {
  display: grid;
  gap: 14px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.dp-question__body > legend {
  padding: 0;
  margin-bottom: 14px;
}
.dp-question__prompt {
  font-weight: var(--dp-weight-strong);
  max-width: 68ch;
}
.dp-question__tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  font-size: var(--dp-typography-metadata);
}
.dp-counter {
  font-size: var(--dp-typography-metadata);
  font-weight: var(--dp-weight-strong);
  font-variant-numeric: tabular-nums;
}
.dp-order {
  list-style: none;
  margin: 0;
  padding: 0;
}
.dp-order li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7em;
  gap: 14px;
  align-items: center;
  padding: 10px 0;
}
.dp-order li + li {
  border-top: var(--dp-rule);
}
.dp-actionbar {
  position: sticky;
  bottom: 12px;
  z-index: 2;
  margin-top: var(--dp-space-section);
  padding: 12px 14px 12px 20px;
  background: var(--dp-color-ground);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-corner);
  box-shadow: var(--dp-offset-control) var(--dp-offset-control) 0 0 var(--dp-color-outline);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.dp-actionbar__time {
  display: none;
  font-variant-numeric: tabular-nums;
}

/* Review marks: text states with a shaped marker, never colour alone */
.dp-mark {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: var(--dp-typography-metadata);
  font-weight: var(--dp-weight-strong);
  white-space: nowrap;
}
.dp-mark::before {
  flex: none;
  display: grid;
  place-items: center;
  border: var(--dp-detail);
  font-size: 12px;
  font-weight: var(--dp-weight-strong);
  line-height: 1;
}
.dp-mark--correct::before {
  content: "✓";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dp-color-accent-fresh);
}
.dp-mark--incorrect::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--dp-color-accent-secondary);
}
.dp-mark--pending::before {
  content: "…";
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dp-color-accent-warm);
}

/* 12. Responsive -------------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  :root {
    --dp-offset-book: 10px;
    --dp-offset-panel: 6px;
  }
  .dp-col-wide {
    grid-column: 1 / span 7;
  }
  .dp-col-narrow,
  .dp-opening__art {
    grid-column: 8 / -1;
  }
  .dp-matrix,
  .dp-matrix--4 {
    --dp-matrix-columns: 2;
  }
  .dp-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dp-step:not(:last-child):nth-child(even)::after {
    display: none;
  }
  .dp-content--reading,
  .dp-content--aside {
    grid-column: 4 / -1;
  }
  .dp-compare__column {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  }
  .dp-compare__column > .dp-compare__rows {
    grid-auto-flow: row;
  }
  .dp-compare__column > .dp-compare__rows > div {
    padding: 12px 22px;
  }
  .dp-compare__column > .dp-compare__rows > div + div {
    border-inline-start: 0;
    border-top: var(--dp-rule);
  }
  .dp-rows--tickets > .dp-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .dp-rows--tickets > .dp-row > :last-child {
    grid-column: 1 / -1;
    border-inline-start: 0;
    border-top: var(--dp-perforation);
  }
}

@media (max-width: 760px) {
  .dp-rail__art {
    max-width: 180px;
  }
  :root {
    --dp-size-display: clamp(40px, 11cqw, 62px);
    --dp-size-title: clamp(36px, 9.5cqw, 52px);
    --dp-size-heading: clamp(26px, 7cqw, 32px);
    --dp-offset-book: 8px;
    --dp-offset-panel: 5px;
  }
  .dp-col-wide,
  .dp-col-narrow,
  .dp-opening__art,
  .dp-rail,
  .dp-content,
  .dp-content--reading,
  .dp-content--aside,
  .dp-brand,
  .dp-nav {
    grid-column: 1 / -1;
  }
  .dp-opening {
    align-items: start;
  }
  .dp-shapes {
    max-height: 260px;
  }
  .dp-mascot {
    max-width: 260px;
    max-height: 280px;
  }
  .dp-shapes--small {
    max-height: 150px;
    margin-inline: 0 auto;
  }
  .dp-rail__inner {
    position: static;
  }
  .dp-masthead__inner {
    row-gap: 8px;
    padding: 12px;
  }
  .dp-nav__list {
    gap: 4px;
  }
  .dp-navlink {
    padding-inline: 10px;
  }
  .dp-nav__push {
    margin-inline-start: 0;
  }
  .dp-matrix,
  .dp-matrix--2,
  .dp-matrix--4 {
    --dp-matrix-columns: 1;
  }
  a.dp-cell {
    min-height: 0;
  }
  /* Steps: vertical sequence, the strip runs down the badges */
  .dp-steps {
    grid-template-columns: 1fr;
    --dp-badge: 54px;
  }
  .dp-step {
    grid-template-columns: var(--dp-badge) minmax(0, 1fr);
    column-gap: 18px;
  }
  .dp-step > :not(.dp-step__number) {
    grid-column: 2;
  }
  .dp-step__number {
    grid-row: 1 / span 3;
    margin-bottom: 0;
    font-size: 20px;
  }
  .dp-step:not(:last-child)::after,
  .dp-step:not(:last-child):nth-child(even)::after {
    display: block;
    top: calc(var(--dp-badge) + 8px);
    bottom: calc(var(--dp-space-block) * -1 + 6px);
    inset-inline-start: calc(var(--dp-badge) / 2 - 8px);
    inset-inline-end: auto;
    width: 16px;
    height: auto;
  }
  /* Tickets: choice, details and action stack */
  .dp-compare__column,
  .dp-rows--tickets > .dp-row {
    grid-template-columns: 1fr;
  }
  .dp-compare__head {
    border-inline-end: 0;
    border-bottom: var(--dp-perforation);
  }
  .dp-compare__column > .dp-compare__rows {
    grid-auto-flow: row;
  }
  .dp-compare__column > .dp-compare__rows > div {
    padding: 12px 20px;
  }
  .dp-compare__column > .dp-compare__rows > div + div {
    border-inline-start: 0;
    border-top: var(--dp-rule);
  }
  .dp-rows--tickets > .dp-row > * + * {
    border-inline-start: 0;
    border-top: var(--dp-perforation);
  }
  /* Facts keep two columns */
  .dp-facts:not(.dp-facts--stacked) {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dp-facts:not(.dp-facts--stacked) > div {
    padding: 14px 16px;
  }
  .dp-facts:not(.dp-facts--stacked) > div + div {
    border-inline-start: 0;
  }
  .dp-facts:not(.dp-facts--stacked) > div:nth-child(even) {
    border-inline-start: var(--dp-perforation);
  }
  .dp-facts:not(.dp-facts--stacked) > div:nth-child(n + 3) {
    border-top: var(--dp-perforation);
  }
  .dp-facts:not(.dp-facts--stacked) > div:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .dp-facts dd {
    font-size: 30px;
  }
  .dp-row {
    grid-template-columns: 1fr;
  }
  /* Footer: the first group spans the row, then two-column groups */
  .dp-footer__group {
    grid-column: span 6;
  }
  .dp-footer__group:first-child,
  .dp-footer__group:nth-child(4) {
    grid-column: 1 / -1;
  }
  .dp-options--inline {
    grid-auto-flow: row;
  }
  .dp-options--inline .dp-option__state {
    grid-column: auto;
  }
  .dp-question {
    grid-template-columns: 1fr;
  }
  .dp-question__number:empty {
    display: none;
  }
  .dp-order li {
    grid-template-columns: 1fr;
  }
  .dp-table--stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .dp-table--stack tr {
    display: grid;
    grid-template-columns: 1fr;
    padding: 10px 0;
    border-bottom: var(--dp-rule);
  }
  .dp-table--stack tbody tr:first-child {
    border-top: var(--dp-outline);
  }
  .dp-table--stack td {
    display: grid;
    grid-template-columns: 8.5em minmax(0, 1fr);
    gap: 10px;
    padding: 4px 0;
    border: 0;
    text-align: start !important;
  }
  .dp-table--stack td > * {
    grid-column: 2;
    justify-self: start;
  }
  .dp-table--stack td::before {
    content: attr(data-label);
    font-size: var(--dp-typography-label);
    font-weight: var(--dp-weight-strong);
  }
  .dp-actionbar {
    justify-content: stretch;
  }
  .dp-actionbar__time {
    display: inline;
  }
  .dp-actionbar > *,
  .dp-actionbar .dp-actions > * {
    flex: 1 1 auto;
  }
  .dp-player > .dp-content {
    padding: var(--dp-book-inset);
  }
  .dp-closing {
    padding-block: 76px 72px;
  }
  .dp-confetti svg {
    width: 20px;
    height: 20px;
  }
  .dp-confetti__piece--2 {
    top: 30px;
  }
  .dp-confetti__piece--4,
  .dp-confetti__piece--6 {
    bottom: 24px;
  }
}

@media (max-width: 480px) {
  .dp-button {
    min-height: 46px;
    padding: 10px 16px;
  }
  .dp-section {
    padding-top: calc(var(--dp-book-inset) + 14px);
  }
  .dp-disclosure__title {
    font-size: 19px;
  }
  .dp-disclosure:not(.dp-disclosure--small) {
    --dp-disclosure-inset: 16px;
  }
  .dp-disclosure:not(.dp-disclosure--small) > summary {
    padding-block: 13px;
    padding-inline-end: 12px;
  }
  .dp-compare__head,
  .dp-rows--tickets > .dp-row > * {
    padding: 16px 18px;
  }
  .dp-option {
    gap: 10px;
    padding: 12px 14px;
  }
  .dp-option {
    grid-template-columns: auto 1.6em minmax(0, 1fr);
  }
  .dp-option__state {
    grid-column: 3;
  }
  .dp-item-title {
    font-size: 20px;
  }
}

/* 13. Reduced motion: no transitions, no lifts (shadows still show hover/press) ------------------ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    transition: none !important;
  }
  .dp-offer .dp-offer__cta {
    animation: none;
  }
  .dp-button:hover,
  .dp-button:active,
  a.dp-cell:hover,
  a.dp-cell:active,
  .dp-option:hover {
    transform: none;
  }
}

/* 14. Interface languages: switcher, right-to-left, Arabic type --------------------------------- */
/* Switcher: a <details> menu in the masthead and a plain list in the footer (both are POST forms). */
.dp-lang {
  position: relative;
}
.dp-lang__summary {
  list-style: none;
  cursor: pointer;
  font-weight: var(--dp-weight-strong);
}
.dp-lang__summary::-webkit-details-marker {
  display: none;
}
.dp-lang[open] > .dp-lang__summary {
  background: var(--dp-color-selection);
}
.dp-lang__menu {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-end: 0;
  z-index: 20;
  min-width: 180px;
  padding: 6px;
  background: var(--dp-color-panel);
  border: var(--dp-outline);
  border-radius: var(--dp-radius-corner);
  box-shadow: var(--dp-offset-panel) var(--dp-offset-panel) 0 var(--dp-color-outline);
}
.dp-lang__option {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: 6px 12px;
  border: 0;
  border-radius: var(--dp-radius-small);
  background: none;
  color: var(--dp-color-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
.dp-lang__option:hover,
.dp-lang__option[aria-current="true"] {
  background: var(--dp-color-selection);
}
.dp-lang__option[aria-current="true"] {
  font-weight: var(--dp-weight-strong);
}
.dp-lang--list ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}
.dp-lang--list + .dp-label {
  margin-block-start: 20px;
}
.dp-lang--list [aria-current="true"] {
  text-decoration-color: var(--dp-color-accent-fresh);
}

/* Right-to-left (Arabic). Layout uses logical properties; only direction-bound details are mirrored here. */
[dir="rtl"] .dp-field select,
[dir="rtl"] .dp-select {
  background-position: left 16px center;
}
[dir="rtl"] .dp-button__arrow {
  display: inline-block;
  transform: scaleX(-1);
}
/* Numbers, codes and Latin names stay left-to-right inside right-to-left text */
[dir="rtl"] input[type="email"],
[dir="rtl"] input[type="url"],
[dir="rtl"] input[type="number"],
[dir="rtl"] input[name="username"],
[dir="rtl"] code,
[dir="rtl"] .dp-num {
  direction: ltr;
  text-align: end;
}

/* Arabic: letters join, so no tracking or case changes; system Arabic fonts after the bundled Latin ones.
   (Cyrillic uses the system sans-serif the same way: the bundled fonts carry latin + latin-ext only.) */
:root:lang(ar) {
  --dp-typography-display: "PlayfulGeometricDisplay", "Geeza Pro", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
  --dp-typography-reading: "PlayfulGeometricReading", "Geeza Pro", "Segoe UI", "Noto Sans Arabic", Tahoma, sans-serif;
}
:lang(ar) *,
:lang(ar) *::before,
:lang(ar) *::after {
  letter-spacing: 0 !important;
  text-transform: none !important;
}
:lang(ar) {
  --dp-typography-reading-leading: 1.8;
}

/* Thai: no spaces between words, so lines break at word boundaries chosen by the browser (lang="th" dictionary);
   system Thai fonts after the bundled Latin ones; no tracking or case changes (Thai has no case). */
:root:lang(th) {
  --dp-typography-display: "PlayfulGeometricDisplay", "Thonburi", "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
  --dp-typography-reading: "PlayfulGeometricReading", "Thonburi", "Leelawadee UI", "Noto Sans Thai", Tahoma, sans-serif;
}
:lang(th) *,
:lang(th) *::before,
:lang(th) *::after {
  letter-spacing: 0 !important;
  text-transform: none !important;
}
:lang(th) {
  --dp-typography-reading-leading: 1.75;
  line-break: strict;
  overflow-wrap: break-word;
}

/* Vietnamese: the bundled fonts lack the Latin Extended Additional block (ạ ế ờ …), so the whole language uses the system
   sans-serif for even letterforms; no tracking (stacked diacritics) and a taller line height so marks never collide. */
:root:lang(vi) {
  --dp-typography-display: -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --dp-typography-reading: -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}
:lang(vi) *,
:lang(vi) *::before,
:lang(vi) *::after {
  letter-spacing: 0 !important;
}
:lang(vi) {
  --dp-typography-reading-leading: 1.7;
}

/* Greek: the bundled fonts carry latin + latin-ext only, so the whole language uses the system sans-serif (tonos and
   dialytika sit correctly on every letter); no tracking, and uppercase headings keep the browser's accent rules. */
:root:lang(el) {
  --dp-typography-display: -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
  --dp-typography-reading: -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}
:lang(el) *,
:lang(el) *::before,
:lang(el) *::after {
  letter-spacing: 0 !important;
}
:lang(el) {
  --dp-typography-reading-leading: 1.7;
}

/* Chinese (Simplified): no spaces between words, so the browser breaks lines between characters; the bundled fonts have no
   Han glyphs, so the whole language uses system CJK sans-serifs; no tracking, no italics (synthetic slant looks wrong). */
:root:lang(zh) {
  --dp-typography-display: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
  --dp-typography-reading: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", sans-serif;
}
:lang(zh) *,
:lang(zh) *::before,
:lang(zh) *::after {
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-style: normal !important;
}
:lang(zh) {
  --dp-typography-reading-leading: 1.8;
  line-break: strict;
  overflow-wrap: break-word;
}

/* Korean (Hangul): words are separated by spaces, but lines should break between words, not inside them (keep-all); the bundled
   fonts have no Hangul glyphs, so the whole language uses system Korean sans-serifs; no tracking, no synthetic italics. */
:root:lang(ko) {
  --dp-typography-display: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif;
  --dp-typography-reading: -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", "Noto Sans CJK KR", sans-serif;
}

/* Japanese (kanji and kana): no spaces between words; the bundled fonts have no Japanese glyphs, so the whole language uses
   system Japanese sans-serifs; no tracking, no case change, no synthetic italics, strict line breaking. */
:root:lang(ja) {
  --dp-typography-display: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  --dp-typography-reading: -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
}
:lang(ja) *,
:lang(ja) *::before,
:lang(ja) *::after {
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-style: normal !important;
}
:lang(ja) {
  --dp-typography-reading-leading: 1.8;
  line-break: strict;
  overflow-wrap: break-word;
}
:lang(ko) *,
:lang(ko) *::before,
:lang(ko) *::after {
  letter-spacing: 0 !important;
  text-transform: none !important;
  font-style: normal !important;
}
:lang(ko) {
  --dp-typography-reading-leading: 1.75;
  word-break: keep-all;
  line-break: strict;
  overflow-wrap: break-word;
}

/* Language flags (templates/components/language_flag.html): inline SVG beside the language name */
.dp-lang-flag {
  flex: none;
  width: 22px;
  height: 15px;
  vertical-align: -2px;
  border-radius: 2px;
}
.dp-lang__summary {
  gap: 8px;
}
.dp-lang__option,
.dp-lang--list .dp-link-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.dp-lang__option {
  display: flex;
}
.dp-lang--list .dp-link-button {
  gap: 8px;
}

/* Exam-language selector (apps/exams/templates/exams/_language_bar.html): flags with names, one horizontal row that wraps */
.dp-langbar__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.dp-langbar__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: var(--dp-border-detail-width) solid var(--dp-color-outline);
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  transition: background var(--dp-motion-interaction);
}
.dp-langbar__link:hover,
.dp-langbar__link[aria-current="page"] {
  background: var(--dp-color-selection);
}

/* Country flag emoji before a country name (guide cards, news pills); not the pink `.dp-flag` pill */
.dp-country-flag {
  font-size: 1.25em;
  line-height: 1;
  margin-inline-end: 0.35em;
  vertical-align: -0.1em;
}
