/* Topics and goals (js/explore.js): the topics and goals pages, topic, situation, interest, goal and skill pages,
   and the topic practice. Built on the design system (css/ui-kit.css, docs/design-system.md): .ds-card, .ds-tile,
   .ds-grid, .ds-head, .ds-progress, .chip, .seg and the tokens. This sheet loads before ui-kit.css, so a rule that
   reshapes one of those shared classes names both classes (.ds-card.x-hero) to win over the shared rule.
   Rules that only change looks are wrapped in :where(html:not(.a11y-contrast)), as the design system asks. */
.x-page { display: grid; gap: var(--sp-6); min-width: 0; }
.x-page h1 { margin: 0; }
.x-sec { display: grid; gap: var(--sp-3); min-width: 0; }
.x-sec > h2 { margin: 0; font-size: var(--fs-h3); }
.ds-head.x-sec-head { margin: 0; }
.x-sec-head p { margin: 2px 0 0; }
.x-bar { display: block; margin: 6px 0 4px; max-width: 320px; }

/* the hero of both ways in: the cat beside the title, everything else spans the card */
.ds-card.x-hero { position: relative; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--sp-3) var(--sp-4); overflow: hidden; }
:where(html:not(.a11y-contrast)) .ds-card.x-hero { border-radius: var(--r-xl); background: linear-gradient(150deg, var(--accent-soft), var(--surface) 58%); }
.x-hero h1 { grid-column: 1; grid-row: 1; font-size: var(--fs-display); }
.x-hero > :not(h1, .x-hero-cat) { grid-column: 1 / -1; }
.x-hero .lead { margin: 0; max-width: 62ch; }
.x-hero-cat { grid-column: 2; grid-row: 1; width: 96px; height: 96px; object-fit: cover; object-position: 50% 30%; border-radius: var(--r-lg); }
:where(html:not(.a11y-contrast)) .x-hero-cat { border: 3px solid var(--surface); box-shadow: var(--e3); background: var(--surface-2); transform: rotate(3deg); }

/* the switch between the two ways in */
.seg.x-switch { display: flex; width: max-content; max-width: 100%; }
.seg.x-switch button { min-height: 42px; padding-inline: 1.2em; font-size: .95rem; }

/* search */
.x-search { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-radius: var(--r-pill); min-height: 50px; }
:where(html:not(.a11y-contrast)) .x-search { background: var(--surface); border: 1px solid var(--hairline-strong); box-shadow: var(--e1); }
:where(html:not(.a11y-contrast)) .x-search:focus-within { border-color: var(--accent); box-shadow: var(--ring); }
.x-search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.x-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 1rem var(--font-ui); padding: 12px 0; }
.x-search input::placeholder { color: var(--faint); }
.x-results { display: grid; gap: 10px; }
.x-results:empty { display: none; }

/* "how much time do you have?" */
.ds-card.x-time { gap: var(--sp-3); }
.x-time-h { margin: 0; font-size: var(--fs-h3); }
.x-time-chips { display: flex; flex-wrap: wrap; gap: 8px; }
#x-time-box:empty { display: none; }
#x-time-box { display: grid; gap: 8px; }
#x-time-box > p { margin: 0; }
.x-acts, .x-start { display: grid; gap: 8px; }
.x-act { appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 14px; cursor: pointer; text-align: start;
  font: 600 .98rem/1.3 var(--font-ui); color: var(--ink); border-radius: var(--r); }
:where(html:not(.a11y-contrast)) .x-act { background: var(--surface-2); border: 1px solid transparent; transition: border-color var(--dur-1), background-color var(--dur-1); }
:where(html:not(.a11y-contrast)) .x-act:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.x-act > span:first-child { font-size: 1.35rem; line-height: 1; flex: none; }
.x-act > span:last-child { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.x-act small { color: var(--muted); font-weight: 400; font-size: var(--fs-sm); }

/* chips (links and choices share the design system's .chip) */
.x-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chip.x-chip { display: inline-flex; align-items: center; gap: .35em; text-decoration: none; line-height: 1.2; }
.chip.x-chip small { font-weight: 500; color: var(--muted); }
.chip.x-chip[aria-pressed="true"] small { color: inherit; opacity: .85; }
:where(html:not(.a11y-contrast)) .chip.x-chip:is(.mine, .me) { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }

/* the learner's goal, and the goal cards */
.ds-card.x-mygoal { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--sp-3) var(--sp-4); }
:where(html:not(.a11y-contrast)) .ds-card.x-mygoal { background: linear-gradient(150deg, var(--ok-soft), var(--surface) 70%); }
:where(html:not(.a11y-contrast)) .ds-card.x-mygoal.soft { background: linear-gradient(150deg, var(--accent-soft), var(--surface) 70%); }
.x-mygoal-txt { display: grid; gap: 2px; min-width: 0; }
.x-mygoal-txt p { margin: 0; }
.x-mygoal-txt strong { font-size: var(--fs-lg); font-weight: 700; }
.x-mygoal-acts { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.x-goal-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r); font-size: 1.7rem; line-height: 1; flex: none; background: var(--accent-soft); }
.x-goal-ic.big { width: 76px; height: 76px; border-radius: var(--r-lg); font-size: 2.5rem; }
.ds-grid.x-goals { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: var(--sp-3); }
.ds-card.x-goal { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
:where(html:not(.a11y-contrast)) .ds-card.x-goal.mine { border-color: color-mix(in srgb, var(--ok) 55%, transparent); }
.x-goal-txt { display: grid; gap: 4px; min-width: 0; }
.x-goal-txt strong { font-size: 1.05rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.x-goal-txt small { font-size: var(--fs-sm); line-height: 1.45; color: var(--muted); }
.x-goal-txt .x-bar { margin: 4px 0 0; }

/* topic and situation tiles: the course's own photos on design system tiles */
.ds-grid.x-tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: var(--sp-3); }
.ds-grid.x-tiles.sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); }
.ds-tile.x-tile { padding: var(--sp-3); gap: 6px; }
.ds-tile.x-tile strong { line-height: 1.25; }
.x-tile-desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.x-tile-foot { display: grid; gap: 6px; margin-top: auto; }
.x-tile-foot .x-bar { margin: 0; height: 6px; }
.ds-tile.x-tile:hover img { transform: scale(1.03); }
.ds-tile.x-tile img { height: auto; transition: transform var(--dur-3) var(--ease); } /* the height attribute is only a hint for the 16:10 box */

/* skills */
.ds-grid.x-skills { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: var(--sp-3); }
.ds-tile.x-skill { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 2px; }
.ds-tile.x-skill img { grid-row: span 2; width: 48px; height: 48px; aspect-ratio: auto; object-fit: contain; border-radius: 0; background: none; }
.ds-tile.x-skill small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* loading */
.x-loading { display: grid; justify-items: center; gap: 12px; padding: 48px 16px; text-align: center; color: var(--muted); }
.x-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: x-spin 1s linear infinite; }
@keyframes x-spin { to { transform: rotate(360deg); } }

/* a topic, situation, interest, goal or skill page */
.x-bar-top { display: flex; align-items: center; gap: 10px; }
.ds-card.x-cat-head, .ds-card.x-goal-head { display: flex; align-items: center; gap: 18px; min-width: 0; }
.ds-card.x-goal-head { align-items: flex-start; }
:where(html:not(.a11y-contrast)) .ds-card.x-goal-head { background: linear-gradient(150deg, var(--accent-soft), var(--surface) 65%); }
.x-goal-head > div { display: grid; gap: 6px; min-width: 0; flex: 1; }
.x-goal-head p, .x-cat-txt p { margin: 0; }
.x-cat-img { width: 132px; height: 132px; border-radius: var(--r-lg); object-fit: cover; flex: none; background: var(--surface-2); }
.x-skill-img { width: 72px; height: 72px; flex: none; }
.x-cat-emoji { display: grid; place-items: center; width: 96px; height: 96px; border-radius: var(--r-lg); font-size: 3rem; flex: none; background: var(--accent-soft); }
.x-cat-txt { display: grid; gap: 4px; min-width: 0; }
.x-counts { color: var(--ink); font-weight: 500; }
.x-promise { padding: 10px 12px; border-radius: var(--r-sm); background: var(--ok-soft); color: var(--ink); font-weight: 500; max-width: 62ch; }
.x-cat-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.x-lvs, .x-related { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.x-empty { padding: 24px 16px; text-align: center; border-radius: var(--r-lg); background: var(--surface); }

/* a goal's finish date and pace */
.x-finish { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--rule); }
.x-finish-l { display: grid; gap: 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.x-finish input { min-height: 44px; padding: 0 12px; font: 500 1rem var(--font-ui); color: var(--ink); }
:where(html:not(.a11y-contrast)) .x-finish input { border-radius: var(--r-sm); border: 1px solid var(--hairline-strong); background: var(--surface); box-shadow: var(--e1); }
:where(html:not(.a11y-contrast)) .x-finish input:focus-visible { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.x-pace { flex-basis: 100%; margin: 0; line-height: 1.5; }
.x-pace strong { font-weight: 600; color: var(--ink); }
/* which exam */
.ds-card.x-exam { gap: var(--sp-3); }
.x-exam h2 { margin: 0; font-size: var(--fs-h3); }
.x-exam p { margin: 0; }
/* the exam ladder: level → about which score, the learner's own level marked */
.x-ladder { display: grid; gap: var(--sp-2); }
.x-ladder h3 { margin: 0; font-size: var(--fs-body); font-weight: 650; }
.x-ladder dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 8px; }
.x-ladder dl > div { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }
.x-ladder dd { margin: 0; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
:where(html:not(.a11y-contrast)) .x-ladder dl > div { border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid transparent; }
:where(html:not(.a11y-contrast)) .x-ladder dl > div.me { border-color: var(--accent-line); background: var(--accent-soft); }
.x-official { font-weight: 600; }

/* item rows: lessons, stories, books, dialogues, grammar, videos, café tasks */
.x-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.x-row-btn { appearance: none; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 14px; cursor: pointer; text-align: start;
  font: inherit; color: var(--ink); border-radius: var(--r); border-inline-start: 4px solid var(--lv, var(--accent)); }
:where(html:not(.a11y-contrast)) .x-row-btn { background: var(--surface); border: 1px solid var(--hairline); border-inline-start: 4px solid var(--lv, var(--accent)); box-shadow: var(--e1);
  transition: border-color var(--dur-1), box-shadow var(--dur-2) var(--ease); }
:where(html:not(.a11y-contrast)) .x-row-btn:hover { border-color: var(--accent-line); border-inline-start-color: var(--lv, var(--accent)); box-shadow: var(--e2); }
.x-row-ic { font-size: 1.3rem; line-height: 1; flex: none; width: 1.6em; text-align: center; }
.x-row-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.x-row-main strong { font-weight: 600; overflow-wrap: anywhere; }
.x-row-main strong[dir="ltr"] { font-family: var(--font-target); justify-self: start; }
.x-row-main small { color: var(--ink-2); font-size: var(--fs-sm); justify-self: start; overflow-wrap: anywhere; }
.x-row-meta { color: var(--muted); font-size: var(--fs-xs); }
.x-row-state { flex: none; min-width: 1.6em; display: grid; place-items: center; }
.x-check { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ok); color: var(--surface); font-weight: 700; font-size: .9rem; }
:where(html:not(.a11y-contrast)) .x-row.done .x-row-btn { background: linear-gradient(170deg, var(--ok-soft), var(--surface) 60%); }
.x-row.locked .x-row-main { opacity: .75; }
.x-lv { border-radius: var(--r-lg); border: 1px solid var(--hairline); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.x-lv > summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; cursor: pointer; font-weight: 600; list-style: none; }
.x-lv > summary::-webkit-details-marker { display: none; }
.x-lv > summary::after { content: '▾'; margin-inline-start: auto; color: var(--muted); transition: transform var(--dur-2); }
.x-lv[open] > summary::after { transform: rotate(180deg); }
.x-lv > .x-rows { padding: 0 10px 10px; }

/* a goal's path */
.x-path { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.x-stage { display: grid; gap: 10px; padding-inline-start: 16px; border-inline-start: 4px solid color-mix(in srgb, var(--lv, var(--accent)) 55%, transparent); }
.x-stage h2 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-h3); }
.x-stage h2 small { margin-inline-start: auto; font-family: var(--font-ui); }
.x-stage.me { border-inline-start-color: var(--lv, var(--accent)); }

/* a skill: how to practise and can-do per level */
.x-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: x-step; }
.x-steps li { position: relative; display: grid; gap: 6px; justify-items: start; padding: 14px 16px; padding-inline-start: 56px; border-radius: var(--r-lg); counter-increment: x-step; }
:where(html:not(.a11y-contrast)) .x-steps li { background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--e1); }
.x-steps li::before { content: counter(x-step); position: absolute; inset-inline-start: 14px; inset-block-start: 14px; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font: 700 .95rem/1 var(--font-target); }
.x-steps strong { font-size: 1.02rem; }
.x-steps p { margin: 0; line-height: 1.55; color: var(--ink-2); }
.x-cando { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.x-cando li { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--r); }
:where(html:not(.a11y-contrast)) .x-cando li { background: var(--surface); border: 1px solid var(--hairline); }
.x-cando li p { margin: 0; }
.x-cando li .lv-chip { flex: none; margin-top: 1px; }
:where(html:not(.a11y-contrast)) .x-cando li.me { border-color: var(--lv, var(--accent)); background: color-mix(in srgb, var(--lv, var(--accent)) 8%, var(--surface)); }
.x-cando li.off { opacity: .6; }

/* topic practice */
.x-quiz .x-opts .opt-l { overflow-wrap: anywhere; }
.x-quiz .prompt.sentence .tgt { font-size: 1.25rem; line-height: 1.5; }
.x-quiz .prompt.sentence .tr { display: block; margin-top: 6px; }
.x-few, .x-result { display: grid; justify-items: center; gap: 12px; padding: 18px 8px; text-align: center; }
.x-few p, .x-result p, .x-result h2 { margin: 0; }
.x-few img, .x-result img { width: 128px; height: 128px; border-radius: var(--r-xl); object-fit: cover; box-shadow: var(--e2); }
.ds-badge.x-gems { font-size: 1rem; padding: .35em .9em; }
.x-result .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.x-qzs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.x-qz { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-lg); min-width: 0; }
:where(html:not(.a11y-contrast)) .x-qz { background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--e1); }
.x-qz img { width: 56px; height: 56px; border-radius: var(--r-sm); object-fit: cover; flex: none; }
.x-qz-txt { flex: 1; min-width: 0; display: grid; gap: 2px; }
.x-qz .btn { flex: none; }
.x-qz.off img { filter: grayscale(.7); opacity: .7; }

/* home and games cards */
.ds-card.x-home { margin-top: var(--sp-3); gap: 8px; }
.x-home p, .x-home strong { margin: 0; }
.x-home strong { font-size: 1.02rem; }
.x-home .x-bar { margin: 2px 0 0; }
.x-home .chip.x-chip { min-height: 38px; padding: .35em .8em; font-size: .88rem; min-width: 0; }
.x-home .x-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
.x-home-all { color: var(--accent); font-weight: 600; text-decoration: none; justify-self: start; }
/* small text links get a finger-sized (44px) tap area; the negative margin keeps the line where it was */
.x-home-all, .ep-ext { display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; }
.x-home-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.g-explore .x-game-art { width: 100%; height: 120px; object-fit: cover; object-position: 50% 26%; border-radius: var(--r); }

@media (max-width: 640px) {
  .x-page { gap: var(--sp-5); }
  .ds-card.x-hero { padding: var(--sp-4); }
  .x-hero h1 { font-size: var(--fs-h1); }
  .x-hero-cat { width: 72px; height: 72px; border-radius: var(--r); }
  .seg.x-switch { width: 100%; }
  .seg.x-switch button { flex: 1; }
  .ds-grid.x-goals { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ds-card.x-goal { flex-direction: column; gap: 8px; padding: 14px 12px; }
  .x-goal .x-goal-ic { width: 44px; height: 44px; font-size: 1.45rem; border-radius: var(--r-sm); }
  .x-goal-lead { display: none; } /* the goal's own page has the full text */
  .ds-grid.x-tiles, .ds-grid.x-tiles.sm { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ds-tile.x-tile { padding: 8px 8px 10px; }
  .ds-tile.x-tile img { aspect-ratio: 4 / 3; }
  .ds-tile.x-tile strong { font-size: .95rem; }
  .x-tile-desc { display: none; }
  .ds-grid.x-skills { grid-template-columns: 1fr 1fr; gap: 10px; }
  .ds-tile.x-skill { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 12px 8px; }
  .ds-tile.x-skill img { grid-row: auto; }
  .ds-card.x-cat-head, .ds-card.x-goal-head { flex-direction: column; align-items: flex-start; padding: var(--sp-4); gap: 12px; }
  .x-cat-img { width: 100%; height: 150px; }
  .x-steps li { padding-inline-start: 50px; }
}
@media (prefers-reduced-motion: reduce) {
  .x-row-btn, .x-act, .x-bar span, .ds-tile.x-tile img { transition: none; }
  .ds-tile.x-tile:hover img { transform: none; }
  .x-spin { animation-duration: 3s; }
}
.pref-calm .ds-tile.x-tile:hover img { transform: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.x-hero-cat, .x-cat-img, .x-tile img, .x-qz img, .x-few img, .x-result img, .x-game-art) { filter: brightness(.86); } }
:root[data-theme="dark"] :is(.x-hero-cat, .x-cat-img, .x-tile img, .x-qz img, .x-few img, .x-result img, .x-game-art) { filter: brightness(.86); }

/* The goal question after signing up: a modal dialog with the goals as big buttons and "coming soon" chips. */
dialog.x-ask { width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 0; border: 0;
  border-radius: var(--r-xl); background: var(--surface); color: var(--ink); box-shadow: var(--e4); }
.x-ask form { display: grid; gap: var(--sp-3); padding: var(--sp-6); }
.x-ask h2 { margin: 0; font: 700 1.4rem var(--font-display); }
.x-ask h3 { margin: var(--sp-2) 0 0; font-size: 1rem; }
.x-ask p { margin: 0; }
.x-ask-goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: var(--sp-2); }
.x-ask-goal { display: flex; align-items: center; gap: var(--sp-2); min-height: 56px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--hairline-strong);
  border-radius: var(--r); background: var(--surface-2); color: inherit; font: inherit; font-weight: 600; text-align: start; cursor: pointer; }
.x-ask-goal:hover { border-color: var(--accent); }
.x-ask-goal:focus-visible { outline: none; box-shadow: var(--ring); }
.x-ask-goal .x-goal-ic { width: 40px; height: 40px; font-size: 1.3rem; border-radius: var(--r-sm); }
.x-ask-thanks:empty { display: none; }
.x-ask-btns { display: flex; justify-content: flex-end; }
@media (max-width: 640px) {
  .x-ask form { padding: var(--sp-4); gap: var(--sp-2); }
  .x-ask-goals { grid-template-columns: 1fr; gap: 6px; }
  .x-ask-goal { min-height: 46px; padding: 6px var(--sp-3); }
  .x-ask-goal .x-goal-ic { width: 34px; height: 34px; font-size: 1.15rem; }
}

/* Listening mode (js/listen.js): the card on the goals page, the setup and the player. */
.ds-card.x-listen { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-4) 0; text-decoration: none; color: inherit; }
.ds-card.x-listen strong { display: block; }
.ds-card.x-listen:hover { border-color: var(--accent); }
.ls-head { display: flex; align-items: center; gap: var(--sp-4); }
.ls-head h1 { margin: 0 0 4px; }
.ls-ic { font-size: 2.6rem; line-height: 1; flex: none; }
.ls-setup, .ls-player, .ls-end { display: grid; gap: var(--sp-3); margin-top: var(--sp-4); }
.ls-setup h2 { margin: var(--sp-2) 0 0; font-size: 1.05rem; }
.ls-tr-opt { display: flex; align-items: center; gap: var(--sp-2); }
.ls-lv { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); }
.ls-go { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3); }
.ls-player { text-align: center; justify-items: center; }
.ls-phase { margin: 0; }
.ls-phase.say { color: var(--ok); }
.ls-text { margin: 0; font: 700 clamp(1.5rem, 5.5vw, 2.4rem)/1.25 var(--font-display); overflow-wrap: anywhere; }
.ls-tr { margin: 0; font-size: 1.1rem; min-height: 1.5em; }
.ls-bar { width: 100%; max-width: 420px; }
.ls-of { margin: 0; }
.ls-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-2); }
.ls-player .ls-btns { display: grid; grid-template-columns: 1fr 1.4fr 1fr; width: 100%; max-width: 420px; }
.ls-player .ls-btns .btn { min-width: 0; padding-inline: var(--sp-2); }
.ls-main { min-height: 52px; font-size: 1.1rem; }
.ls-end { text-align: center; justify-items: center; }

/* My hours (js/listen.js) in the personal area */
.x-hours-big { margin: 0; font-size: 1.05rem; }
.x-hours-big strong { font: 800 2.2rem/1 var(--font-display); }
.x-hours-bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 84px; margin: var(--sp-2) 0; padding: 0; list-style: none; align-items: end; }
.x-hours-bars li { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: 4px; text-align: center; }
.x-hours-bars li span { align-self: end; min-height: 3px; border-radius: 6px 6px 2px 2px; background: var(--accent); }
.x-hours-bars small { color: var(--muted); font-size: .72rem; }
.x-hours-kinds { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }

/* Listen first, then read; the series card; the reading log (js/hear.js) */
.hr { display: grid; gap: var(--sp-4); }
.hr-head { display: flex; align-items: center; gap: var(--sp-4); }
.hr-head h1 { margin: 2px 0; overflow-wrap: anywhere; }
.hr-head p { margin: 0; }
.hr-cover { flex: none; width: 88px; height: 88px; border-radius: 16px; object-fit: cover; background: var(--surface-2, #eef1f6); display: grid; place-items: center; font-size: 2.4rem; }
.hr-ready, .hr-player, .hr-rate { display: grid; gap: var(--sp-3); justify-items: center; text-align: center; }
.hr-steps { margin: 0; padding-inline-start: 1.2em; text-align: start; display: grid; gap: 4px; }
.hr-player .ls-btns { display: grid; grid-template-columns: 1fr 1.4fr 1fr; width: 100%; max-width: 420px; }
.hr-player .ls-btns .btn { min-width: 0; padding-inline: var(--sp-2); }
.hr-bar { width: 100%; max-width: 420px; }
.hr-of { margin: 0; }
.hr-wave { display: flex; align-items: center; gap: 6px; height: 56px; }
.hr-wave i { width: 8px; height: 18px; border-radius: 4px; background: var(--accent); opacity: .55; }
.hr-player.is-on .hr-wave i { animation: hr-wave 1.1s ease-in-out infinite; opacity: 1; }
.hr-wave i:nth-child(2) { animation-delay: .15s; } .hr-wave i:nth-child(3) { animation-delay: .3s; }
.hr-wave i:nth-child(4) { animation-delay: .45s; } .hr-wave i:nth-child(5) { animation-delay: .6s; }
@keyframes hr-wave { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(2.6); } }
@media (prefers-reduced-motion: reduce) { .hr-player.is-on .hr-wave i { animation: none; } }
.hr-us { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); width: 100%; max-width: 460px; }
.hr-voice { margin: 0; }
.hr-series { display: flex; gap: var(--sp-4); align-items: flex-start; margin: var(--sp-3) 0; }
.hr-series h3 { margin: 2px 0; font-size: 1.15rem; }
.hr-series p { margin: 0 0 4px; }
.hr-body { min-width: 0; flex: 1; display: grid; gap: 4px; }
.hr-acts { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }
.hr-seasons { display: flex; gap: 6px; margin-top: 4px; }
.hr-season { position: relative; flex: 1; max-width: 96px; height: 22px; border-radius: 11px; background: var(--surface-2, #eef1f6); overflow: hidden; display: grid; place-items: center; }
.hr-season i { position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--accent); opacity: .35; }
.hr-season.is-done i { opacity: .6; }
.hr-season b { position: relative; font-size: .78rem; }
.hr-booktools { display: grid; gap: 6px; justify-items: start; margin-top: var(--sp-2); }
.hr-booktools p { margin: 0; }
.hr-log h2 { margin-top: 0; }
.hr-rows { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: var(--sp-2); }
.hr-rows li { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--sp-3); align-items: center; padding: var(--sp-2) 0; border-top: 1px solid var(--line, rgba(0,0,0,.08)); }
.hr-when { color: var(--muted); font-size: .85rem; grid-row: span 2; }
.hr-what { min-width: 0; display: grid; }
.hr-what b, .hr-what small { overflow-wrap: anywhere; }
.hr-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.hr-tag { font-size: .8rem; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
@media (max-width: 480px) {
  .hr-series, .hr-head { gap: var(--sp-3); }
  .hr-cover { width: 64px; height: 64px; font-size: 1.8rem; }
}

/* Exam preparation (js/exam-prep.js): exam pages, the plan, practice and timed simulations. */
.ep { display: grid; gap: var(--sp-4); }
.ep h2 { font-size: var(--fs-h3); margin: 0 0 var(--sp-2); }
.ep h3 { font-size: var(--fs-sm); margin: var(--sp-3) 0 var(--sp-2); }
.ds-card.ep-head { display: flex; gap: var(--sp-4); align-items: flex-start; }
.ep-head h1 { margin: 0 0 var(--sp-2); }
.ep-ic { font-size: 2rem; line-height: 1; flex: none; }
/* the hero: the exam, its key numbers and today's task (the page's one primary button) */
.ep-hero-b { flex: 1; min-width: 0; display: grid; gap: var(--sp-2); }
.ep-hero-b > *, .ep-hero h1 { margin: 0; }
.ds-ico.ep-ico { width: 56px; height: 56px; border-radius: var(--r); font-size: 1.7rem; line-height: 1; }
:where(html:not(.a11y-contrast)) .ds-card.ep-hero { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 62%); border-color: var(--accent-line); }
.ep-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); margin-top: var(--sp-1); }
:where(html:not(.a11y-contrast)) .ep-kpis .ds-kpi { background: var(--surface); border: 1px solid var(--hairline); }
.ep-today { display: grid; gap: var(--sp-2); justify-items: start; padding: var(--sp-3) var(--sp-4); border-radius: var(--r); }
:where(html:not(.a11y-contrast)) .ep-today { background: var(--surface); border: 1px solid var(--accent-line); box-shadow: var(--e1); }
.ep-today p { margin: 0; }
.ep-today > p:nth-of-type(2) { font-weight: 600; color: var(--ink); }
@media (min-width: 640px) { .ep-today { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .ep-today > .eyebrow { grid-column: 1 / -1; } }
@media (max-width: 560px) {
  .ds-card.ep-head { flex-direction: column; gap: var(--sp-3); }
  .ds-ico.ep-ico { width: 48px; height: 48px; font-size: 1.45rem; }
  .ep-kpis .ds-kpi { padding: var(--sp-2) var(--sp-3); }
  .ep-kpis .ds-kpi b { font-size: 1.2rem; }
}
/* the hub: one tile per exam, badges and the countdown at its foot */
.ep-exams { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.ds-card.ep-exam { display: flex; gap: var(--sp-3); align-items: flex-start; text-decoration: none; color: inherit; }
.ds-card.ep-exam strong, .ds-card.ep-exam small { display: block; }
.ep-exam-b { flex: 1; min-width: 0; display: grid; gap: var(--sp-1); }
.ds-card.ep-exam small.ep-have { margin-top: var(--sp-1); font-size: var(--fs-xs); }
.ep-exam-f { display: flex; flex-wrap: wrap; gap: var(--sp-1); margin-top: var(--sp-1); }
.ep-exam-f:empty { display: none; }
.ep-go { align-self: center; flex: none; color: var(--faint); font-size: 1.2rem; transition: transform var(--dur-2) var(--ease), color var(--dur-2); }
/* css/english-page.css gives its own .ep-go button an 11rem minimum and full width on phones; here it is only the arrow, so it must not widen the card past the screen. */
.ds-card.ep-exam .ep-go { min-width: 0; width: auto; }
:where(html:not(.a11y-contrast)) .ds-card.ep-exam:hover { border-color: var(--accent); }
:where(html:not(.a11y-contrast)) .ds-card.ep-exam.pro { border-color: color-mix(in srgb, var(--gold) 45%, var(--hairline)); }
:where(html:not(.a11y-contrast)) .ds-card.ep-exam:focus-visible { outline: none; box-shadow: var(--ring), var(--e2); }
.ds-card.ep-exam:is(:hover, :focus-visible) .ep-go { color: var(--accent); transform: translateX(-3px); }
.ds-card.ep-exam.soon { opacity: .85; }
.ep-cd { color: var(--accent); font-weight: 700; }
.ep-date { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.ep-date input, .ep-date select { font: inherit; min-height: 40px; padding: var(--sp-1) var(--sp-2); border: 1px solid var(--hairline-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }
.xp-pace { margin-top: var(--sp-3); }
/* the plan: one part per phase, as wide as its weeks; this week is marked */
.ep-weeks { list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: flex; gap: var(--sp-1); }
.ep-wk { flex: 1 1 0; min-width: 0; display: grid; align-content: start; gap: 2px; padding: var(--sp-3) var(--sp-3) var(--sp-2); border-top: 4px solid var(--hairline-strong); font-size: var(--fs-sm); }
:where(html:not(.a11y-contrast)) .ep-wk { background: var(--surface-2); border-radius: var(--r-xs); }
.ep-wk.build { border-top-color: var(--info); }
.ep-wk.practice { border-top-color: var(--accent); }
.ep-wk.sim { border-top-color: var(--ok); }
:where(html:not(.a11y-contrast)) .ep-wk.now { box-shadow: inset 0 0 0 2px var(--accent-line); }
.ep-here { justify-self: start; margin-top: var(--sp-1); font-weight: 700; color: color-mix(in srgb, var(--accent) 78%, var(--ink)); }
@media (max-width: 560px) { .ep-weeks { flex-direction: column; } }
/* desktop: the diagnostic, calculator and word cards side by side */
.ep-dash { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); align-items: start; }
.ep-dash > .ds-card > :last-child { margin-bottom: 0; }
.ep-est { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.ep-est p { margin: 0; }
.ep-big { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 700; }
/* the caveat sits right under the number it qualifies, in readable size */
.ep-est .ep-hedge { margin: 2px 0 4px; max-width: 30ch; font-weight: 700; color: var(--ink); }
/* a key number that has no value yet says so in words */
.ep-kpis .ds-kpi b.ep-none { font: 600 var(--fs-sm)/1.3 var(--font-ui); color: var(--ink-2); overflow-wrap: anywhere; hyphens: auto; }
.ep-tgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.ep-type h3 { font-size: var(--fs-h3); margin-top: 0; }
.ds-card.ep-type { display: flex; flex-direction: column; gap: var(--sp-2); }
.ds-card.ep-type > * { margin: 0; }
.ds-card.ep-type > .btn { margin-top: auto; align-self: flex-start; } /* buttons line up across a row of cards */
.ep-bar { display: block; margin: var(--sp-1) 0; }
/* the subscription card: gold, like the Premium Plus badge */
.ds-card.ep-lock { display: flex; gap: var(--sp-3); align-items: flex-start; margin-top: var(--sp-3); }
:where(html:not(.a11y-contrast)) .ds-card.ep-lock { border-color: color-mix(in srgb, var(--gold) 50%, transparent); background: linear-gradient(135deg, var(--gold-soft), var(--surface) 70%); }
.ep-lock .ds-ico { --t: var(--gold); width: 48px; height: 48px; font-size: 1.4rem; }
.ep-lock h3 { margin: 0 0 var(--sp-1); }
.ep-lock p { margin: 0 0 var(--sp-3); }
.ep-hist, .ep-pace, .ep-wlist { padding: 0; list-style: none; display: grid; gap: var(--sp-2); }
.ep-hist li { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
.ep-wlist li { padding: var(--sp-2) 0; border-bottom: 1px solid var(--hairline); }
.ep-wrow { display: flex; justify-content: space-between; gap: var(--sp-2); }
.ep-words { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ep-words li { padding: 4px var(--sp-2); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); }
.ep-levels table { border-collapse: collapse; margin: var(--sp-2) 0; }
.ep-levels td { padding: 4px var(--sp-3); border-bottom: 1px solid var(--hairline); }
.ep-runbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); flex-wrap: wrap; padding: var(--sp-2) var(--sp-3); border-radius: var(--r); }
:where(html:not(.a11y-contrast)) .ep-runbar { background: var(--surface); border: 1px solid var(--hairline); box-shadow: var(--e1); }
.ep-runbar .ep-bar { flex-basis: 100%; margin: 0; }
/* the timer stays in view on desktop (phones and tablets have their own bar at the top) */
@media (min-width: 1180px) { .ep-runbar { position: sticky; top: var(--sp-2); z-index: 3; } }
.ep-clock { font-weight: 700; padding: 4px var(--sp-2); border-radius: var(--r-sm); background: var(--surface-2); }
.ep-clock.low { color: var(--bad); background: var(--bad-soft); }
.ep-q:focus, .ep-fb:focus { outline: none; }
.ep-q:focus-visible, .ep-fb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ep-qh { font-size: var(--fs-sm); font-weight: 700; margin: 0 0 var(--sp-3); color: var(--ink-2); }
.ep-pass summary { cursor: pointer; font-weight: 700; }
.ep-pass div { text-align: left; line-height: 1.7; }
.ep-pn { color: var(--muted); font-size: var(--fs-sm); }
.ep-stem { font-size: 1.08rem; line-height: 1.6; text-align: left; margin: 0 0 var(--sp-3); }
.ep-opts { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--sp-2); }
.ep-opt { width: 100%; min-height: 48px; display: flex; align-items: center; gap: var(--sp-3); text-align: start; font: inherit; line-height: 1.45; color: var(--ink); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--hairline-strong); border-radius: var(--r); background: var(--surface); cursor: pointer; }
:where(html:not(.a11y-contrast)) .ep-opt { transition: border-color var(--dur-1), background-color var(--dur-1), box-shadow var(--dur-2) var(--ease); }
:where(html:not(.a11y-contrast)) .ep-opt:hover:not(:disabled) { border-color: var(--accent); box-shadow: var(--e1); }
:where(html:not(.a11y-contrast)) .ep-opt:focus-visible { outline: none; box-shadow: var(--ring); border-color: var(--accent); }
.ep-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.ep-opt.ok { border-color: var(--ok); background: var(--ok-soft); box-shadow: none; }
.ep-opt.bad { border-color: var(--bad); background: var(--bad-soft); box-shadow: none; }
.ep-opt:disabled { cursor: default; color: var(--ink); }
.ep-ot { flex: 1; min-width: 0; }
/* the option's number in a small round badge; filled once chosen */
.ep-n { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); border: 1px solid var(--hairline-strong); }
.ep-opt[aria-pressed="true"] .ep-n { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.ep-opt.ok .ep-n { color: var(--ok); background: var(--surface); border-color: var(--ok); }
.ep-opt.bad .ep-n { color: var(--bad); background: var(--surface); border-color: var(--bad); }
.ep-mark { flex: none; font-weight: 700; font-size: 1.1rem; }
.ep-opt.ok .ep-mark { color: var(--ok); }
.ep-opt.bad .ep-mark { color: var(--bad); }
.ep-fb:not(:empty) { margin-top: var(--sp-3); }
.ep-verdict { font-weight: 700; }
.ep-verdict.ok { color: var(--ok); }
.ep-verdict.bad { color: var(--bad); }
.ep-nav { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.ep-dots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-3); direction: ltr; }
.ep-dot { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--hairline-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
@media (pointer: coarse) { .ep-dot { width: 44px; height: 44px; } }
.ep-dot.on { background: var(--accent-soft); border-color: var(--accent); font-weight: 700; }
.ep-dot.cur { box-shadow: 0 0 0 2px var(--accent); }
:where(html:not(.a11y-contrast)) .ep-dot:focus-visible { outline: none; box-shadow: var(--ring); }
/* results: percent correct in a ring beside the estimate */
.ep-ring { --p: 0; flex: none; display: grid; place-content: center; text-align: center; width: 112px; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, var(--surface) 78%, transparent 79%), conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); }
.ep-ring b { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1; color: var(--ink); }
.ep-ring small { font-size: var(--fs-xs); color: var(--muted); max-width: 80px; }
html.a11y-contrast .ep-ring { border: 2px solid currentColor; }
.ep-units .seg button { min-height: 40px; padding-inline: 1.1em; }
@media (pointer: coarse) { .ep-units .seg button { min-height: 44px; } }
:where(html:not(.a11y-contrast)) .ep-units .seg button:focus-visible { outline: none; box-shadow: var(--ring); }
/* calm, easy learning and reduced motion: nothing moves, nothing decorative */
@media (prefers-reduced-motion: reduce) { .ep-go, .ep-opt { transition: none; } .ds-card.ep-exam:hover .ep-go { transform: none; } }
:is(.pref-calm, .pref-easy) :is(.ep-go, .ep-opt) { transition: none; }
:is(.pref-calm, .pref-easy) .ds-card.ep-exam:is(:hover, :focus-visible) .ep-go { transform: none; }
.pref-easy :is(.ds-card.ep-hero, .ds-card.ep-lock) { background: var(--surface); }
/* high contrast: the boxes that lost their tinted look keep a strong outline */
html.a11y-contrast :is(.ep-today, .ep-wk, .ep-kpis .ds-kpi, .ep-runbar) { border: 2px solid currentColor; }
html.a11y-contrast .ep-wk.now { border-width: 4px; }
.ep-review ol { padding-inline-start: var(--sp-4); display: grid; gap: var(--sp-4); }
/* Bagrut: units picker, open answers, writing tasks and their self-check */
.ep-units { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.ep-text { width: 100%; box-sizing: border-box; font: inherit; line-height: 1.6; color: var(--ink); background: var(--surface); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--hairline-strong); border-radius: var(--r); text-align: left; resize: vertical; }
.ep-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.ep-text[readonly] { background: var(--surface-2); }
.ep-prompt, .ep-wrtext { white-space: pre-line; text-align: left; line-height: 1.6; }
.ep-prompt { font-size: 1.04rem; margin: 0 0 var(--sp-2); }
.ep-tips, .ep-modeld { margin: var(--sp-2) 0; }
.ep-tips summary, .ep-modeld summary { cursor: pointer; font-weight: 700; }
.ep-phr { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-2); text-align: left; }
.ep-phr li { padding: 4px var(--sp-2); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--fs-sm); }
.ep-model, .ep-mine { padding: var(--sp-2) var(--sp-3); border-radius: var(--r); background: var(--ok-soft); margin-bottom: var(--sp-2); }
.ep-mine { background: var(--surface-2); }
.ep-model p, .ep-mine p { margin: 0; }
.ep-model p[dir="ltr"] { text-align: left; }
.ep-self { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: var(--sp-2) 0; }
.ep-crit { border: 1px solid var(--hairline); border-radius: var(--r); padding: var(--sp-2) var(--sp-3); margin: 0 0 var(--sp-2); display: grid; gap: var(--sp-2); }
.ep-crit legend { font-weight: 700; padding: 0 var(--sp-1); }
.ep-crit label { display: flex; gap: var(--sp-2); align-items: baseline; }
.ds-card.ep-home { display: flex; gap: var(--sp-3); align-items: center; }
.ep-home strong { display: block; margin-bottom: var(--sp-2); }
@media (min-width: 900px) {
  .ep-run.has-pass { grid-template-columns: 1fr 1fr; align-items: start; }
  .ep-run.has-pass > .ep-runbar, .ep-run.has-pass > p, .ep-run.has-pass > .ep-bar { grid-column: 1 / -1; }
  .ep-run > .ep-pass { position: sticky; top: var(--sp-3); max-height: 80vh; overflow: auto; }
  .ep-run:not(.has-pass) > .ep-q { max-width: 760px; }
}
.ep-mod h3 { margin-top: 0; }
.ep-modgo { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0; }
.ep-mod .ep-hist { margin-top: var(--sp-2); }

/* ---------- international exams (js/exam-world.js) ---------- */
.ep-intl-h { margin: var(--sp-4) 0 var(--sp-2); font-size: 1.1rem; }
.ep-soon .x-chips { margin-top: var(--sp-2); }
.ep-soon .xp-thanks:empty { display: none; }
.xp-data { margin: 0 0 var(--sp-3); }
.xp-data figcaption { font-size: .9rem; color: var(--ink-2); margin-bottom: var(--sp-1); }
/* Wide tables scroll inside their box, never the page. */
.xp-tbl { overflow-x: auto; max-width: 100%; }
.xp-tbl table { border-collapse: collapse; min-width: 100%; font-variant-numeric: tabular-nums; }
.xp-tbl th, .xp-tbl td { padding: var(--sp-1) var(--sp-2); border-bottom: 1px solid var(--hairline-strong); text-align: left; white-space: nowrap; }
.xp-tbl tr:first-child td, .xp-tbl th { font-weight: 600; }
.xp-check { border: 0; padding: 0; margin: var(--sp-3) 0 0; display: grid; gap: var(--sp-2); }
.xp-check legend { font-weight: 600; margin-bottom: var(--sp-1); }
.xp-check label { display: flex; gap: var(--sp-2); align-items: flex-start; min-height: 44px; text-align: left; }
.xp-check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
/* Ten skills: two per row on a phone, so the page under them stays within reach. */
.ds-grid.xp-tgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: var(--sp-3); }
.xp-tgrid .ep-type h3 { font-size: 1rem; }
.ep-pass div p + p { margin-top: var(--sp-2); }
.xp-home h2 { font-size: 1.05rem; margin: 0 0 var(--sp-2); }
.xp-home .x-chips + p { margin-top: var(--sp-3); }
.xp-home .xp-thanks:empty { display: none; }
html.kids .xp-home { display: none !important; }
/* The timed set (js/exam-engine.js): an unfinished set on the exam page, the paused card, the keys hint. */
.ep-live { border: 1px solid var(--accent); }
.ep-paused { text-align: center; }
.ep-keys { margin-top: var(--sp-2); }
@media (hover: none) { .ep-keys { display: none; } }
/* Build a Sentence: the sentence line (words placed so far, an empty dashed box at first) above the words still to use. */
.xp-build { display: grid; gap: var(--sp-3); margin: var(--sp-2) 0; }
.xp-built, .xp-bank { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: 0; }
.xp-built { min-height: 56px; padding: var(--sp-2); border: 1px dashed var(--hairline-strong); border-radius: var(--r); align-content: flex-start; }
.xp-build .chip { max-width: 100%; white-space: normal; text-align: start; }
.xp-built .chip.on { background: var(--accent-soft); border-color: var(--accent-line); }
.xp-build .chip:disabled { cursor: default; opacity: 1; }
.ep-clip audio { width: 100%; margin: var(--sp-2) 0; }
.ep-clip h2 { font-size: 1rem; }
.ep-script summary { cursor: pointer; font-weight: 600; }
.ep-script div { text-align: left; line-height: 1.7; }
.ep-script div p + p { margin-top: var(--sp-1); }
/* Exam facts page and the ready-to-book checklist (js/exam-world.js). */
.xp-facts { margin: var(--sp-2) 0; padding-inline-start: 1.2em; display: grid; gap: var(--sp-1); }
.xp-rdlist { list-style: none; padding: 0; margin: var(--sp-2) 0 0; display: grid; gap: var(--sp-1); }
.xp-rdlist li { display: flex; gap: var(--sp-2); align-items: baseline; }
.xp-rdlist li.ok > span { color: var(--ok); font-weight: 700; }
.xp-cefr .xp-tbl th { font-weight: 600; }
.xp-prompt { white-space: pre-line; }
/* B2 First long turn: two photographs side by side, square crops, never wider than the card. */
.xp-photos { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin: var(--sp-2) 0; max-width: 560px; }
.xp-photos img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-lg); }
.xp-parts { flex-wrap: wrap; }
/* PTE Academic: the text to read aloud, and the chart to describe (drawn in SVG from the item's numbers). */
.xp-read { margin: var(--sp-2) 0; padding: var(--sp-3); border-radius: var(--r-lg); background: var(--accent-soft); }
.xp-read p { margin: var(--sp-1) 0 0; font-size: 1.1rem; line-height: 1.7; }
.xp-chart { margin: var(--sp-2) 0; max-width: 560px; }
.xp-chart svg { display: block; width: 100%; height: auto; }
.xp-ch-t { font-size: 11px; fill: var(--ink-2); }
.xp-ch-grid { stroke: var(--line); stroke-width: 1; }
.xp-ch-key { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.xp-ch-key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 4px; vertical-align: -1px; }

/* Week-by-week plan on a goal page (trackHtml): one folded card per week, the first unfinished one open. */
.x-week { padding: var(--sp-2) var(--sp-3); }
.x-week > summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); min-height: 44px; align-content: center; }
.x-week > summary .num { margin-inline-start: auto; }
.x-week[open] > summary { margin-bottom: var(--sp-2); }

/* Goal path: the levels below the learner's own, folded into one card under the path (renderGoal). */
.x-earlier { padding: var(--sp-2) var(--sp-3); }
.x-earlier > summary { cursor: pointer; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.x-earlier[open] > summary { margin-bottom: var(--sp-2); }

/* Exam strategy lessons (W05-T069): the official task names as small tags, in English, start-aligned in both directions. */
.xp-les { display: flex; flex-direction: column; gap: var(--sp-2); }
.xp-les h3 { font-size: 1rem; margin: 0; }
.xp-les ol { margin: 0; padding-inline-start: 1.25em; display: grid; gap: var(--sp-1); }
.xp-les .btn { align-self: flex-start; margin-top: auto; }
.xp-names { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--sp-1); justify-content: flex-start; }
[dir="rtl"] .xp-names { justify-content: flex-end; }
.xp-names li { background: var(--accent-soft); color: var(--ink); border-radius: var(--r-sm); padding: 2px var(--sp-2); }

/* B2 First practice (W09-T049): a typed answer box, the gap marked in the repeated sentence, the word to use or change. */
.xp-typed { display: grid; gap: var(--sp-2); margin: var(--sp-2) 0; }
.xp-typed .ep-text { min-height: 44px; resize: none; }
.xp-typed .ep-text:disabled { background: var(--surface-2); color: var(--ink); }
mark.xp-gap { background: var(--accent-soft); color: var(--ink); border-radius: var(--r-sm); padding: 0 2px; }
.xp-keyw b { letter-spacing: 0.04em; }
