/* Dashboard: Today's session and three layers, the journey path, streak, level, skills on one CLB
   scale, badges, weakest task types and recent work. Several of these parts are reused on other screens. */

/* ---------- Journey block ---------- */
.journey {
  background: var(--teal); color: var(--surface);
  border-radius: var(--r-l); padding: var(--s6) 40px var(--s5);
}
.journey :focus-visible { outline-color: var(--sun); }
.journey__top { display: flex; align-items: center; justify-content: space-between; gap: var(--s6); }
.journey .eyebrow { color: var(--teal-soft); }
.journey__target {
  margin-top: var(--s1);
  font-family: var(--display); font-weight: 700; letter-spacing: -0.02em;
  font-size: clamp(1.875rem, 1.3rem + 2vw, 2.75rem); line-height: 1.05;
}
.journey__meta { margin-top: var(--s2); color: var(--teal-soft); }
.journey__meta b { color: var(--surface); font-weight: 700; white-space: nowrap; }
.journey__meta a { display: inline-flex; align-items: center; min-height: 44px; color: var(--surface); font-weight: 700; }
.countdown { display: flex; align-items: center; gap: var(--s4); }
.countdown__box {
  display: grid; place-items: center; min-width: 104px; padding: var(--s3) var(--s4);
  background: var(--sun); color: var(--on-sun); border-radius: var(--r-m);
  box-shadow: var(--lip) var(--sun-deep); text-decoration: none;
}
.countdown__n {
  font-family: var(--display); font-weight: 800; font-size: 3rem; line-height: 0.95;
  font-variant-numeric: tabular-nums; letter-spacing: -0.02em;
}
.countdown__l { font-weight: 700; font-size: var(--fs-s); text-align: center; line-height: 1.2; }
.countdown__note { max-width: 22ch; color: var(--teal-soft); font-size: var(--fs-m); line-height: 1.4; }
.countdown__note b { display: block; color: var(--surface); }

.trail { position: relative; height: 144px; margin-top: var(--s5); }
.trail__svg { position: absolute; inset: 0 0 auto 0; width: 100%; height: 96px; overflow: visible; }
.trail__svg path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.trail__base { stroke: var(--veil-38); stroke-width: 4; stroke-dasharray: 1 12; }
.trail__done { stroke: var(--sun); stroke-width: 5; }
.stop {
  position: absolute; left: var(--x); top: 64px; width: 19%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: var(--s2); text-align: center;
  color: inherit; text-decoration: none;
}
.stop--hi { top: 32px; }
.stop > a { display: flex; flex-direction: inherit; align-items: inherit; gap: inherit; text-align: inherit; color: inherit; text-decoration: none; }
.stop__node {
  display: grid; place-items: center; width: 44px; height: 44px; margin-top: -22px; flex: none;
  border-radius: 50%; background: var(--teal-deep); color: var(--teal-soft);
  box-shadow: inset 0 0 0 2px var(--veil-45);
}
.stop--done .stop__node { background: var(--sun); color: var(--on-sun); box-shadow: none; }
.stop--now .stop__node {
  width: 56px; height: 56px; margin-top: -28px;
  background: var(--surface); color: var(--teal);
  box-shadow: 0 0 0 5px var(--sun);
}
.stop__text b { display: block; font-family: var(--display); font-size: var(--fs-base); line-height: 1.25; }
.stop__text span { display: block; font-size: var(--fs-s); color: var(--teal-soft); font-variant-numeric: tabular-nums; }
.stop--now .stop__text span { color: var(--sun); font-weight: 700; }
.journey__foot {
  margin-top: var(--s4); padding-top: var(--s4); border-top: 1px solid var(--veil-25);
  color: var(--teal-soft); font-size: var(--fs-m);
}
.journey__foot b { color: var(--surface); }

/* ---------- Today's three layers (Study) and "This week" (Your activity) ---------- */
/* The step-by-step runner's body (.exam-body.steps, steps.css) takes its row gap from this rule. */
.steps { display: grid; gap: var(--s3); }
/* Today's steps (views/today.js) are drawn by css/home.css (STORY-04.31). */

/* "This week" (STORY-03.34) as a list (STORY-04.17): each item one block, "[n]. [title]" on its first line with only
   the title a link (44 px tall), its pills, detail and minutes under it; a day's layer chips in one group after its heading. */
.wk, .wk__items { list-style: none; margin: 0; padding: 0; }
.wk { margin-top: var(--s3); }
.wk__day { padding: var(--s3) 0; border-top: 1px solid var(--line); }
.wk__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin: 0; }
.wk__tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.wk__items { display: grid; gap: var(--s2); margin-top: var(--s2); }
.wk__item { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s2); }
.wk__line { display: contents; }
.wk__place { grid-column: 1; margin-top: 11px; font-weight: 700; line-height: 22px; font-variant-numeric: tabular-nums; }
.wk__name { grid-column: 2; display: flex; align-items: flex-start; column-gap: var(--s2); }
.wk__go { display: inline-flex; min-height: 44px; padding-block: 11px; color: var(--ink); text-underline-offset: 3px; }
.wk__title { font-weight: 700; line-height: 22px; }
.wk__name > .wk__title { margin-block: 11px; }
.wk__done { display: inline-flex; flex: none; margin-top: 14px; color: var(--teal); }
.wk__sub { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s2); font-size: var(--fs-m); }
.wk__min { font-weight: 700; white-space: nowrap; }

/* The skill pill and the kind pill (skill-pill.js, STORY-04.17): in words, with an icon, the look of the approved mock-up. */
.spills { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.spills .spill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 1px 10px; border-radius: 13px;
  background: var(--paper-2); color: var(--ink); font-family: var(--text); font-size: var(--fs-s); font-weight: 700; line-height: 1.2; white-space: nowrap;
}
.spills .spill--skill { background: var(--teal-tint); color: var(--teal-deep); box-shadow: inset 0 0 0 1px var(--teal-soft); }
.spills .spill--basics { background: var(--sun-tint); color: var(--sun-ink); box-shadow: inset 0 0 0 1px var(--sun-deep); }
.spills .spill--plain { background: var(--paper-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.spills .spill .i { width: 14px; height: 14px; }
.tile__text .spills, .work__main .spills, .item__main .spills { display: flex; margin-block: 4px; }
/* A paper's level badge (STORY-04.36, the approved mock-up's choice 1 A): an outline with a dashed edge, never a fill, so it
   is never read as the student's own result; the levels glyph, "about CLB 7" and its own "i". The whole badge is the
   button; its tap area reaches 44 px high past the pill. Plain in a row that is one link (no "i"). */
.spills .spill--level, .spill--level {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 1px 8px 1px 9px; border: 1px dashed var(--line-strong); border-radius: 13px;
  background: transparent; box-shadow: none; color: var(--ink-2); font: 600 var(--fs-s)/1.2 var(--text); white-space: nowrap; cursor: pointer;
}
.spill--level::after { content: ""; position: absolute; inset: -10px -4px; }
.spill--level .i { width: 14px; height: 14px; flex: none; }
.lvl-face { display: contents; }
.spill--level .lvl-i { color: var(--teal); margin-left: 1px; }
.spill--level[aria-expanded="true"] { border-style: solid; border-color: var(--teal); color: var(--ink); }
.spill--level.lvl-plain { cursor: inherit; padding-right: 10px; }
.spill--level.lvl-plain::after { content: none; }
/* The lead's ruling, 2026-11-20: on the phone, Today's steps on the home (Resume, the steps, "If you have more time") show
   no paper-level badge; the home keeps its one main button above the tab bar. The level shows on the task bar and on the
   Practice and Model tests lists. */
@media (max-width: 860px) { .session-panel .spill--level { display: none; } }
.lvl-tip { z-index: 30; font-weight: 400; white-space: normal; }
.lvl-tip[hidden] { display: none; }
.lvl-line { display: block; }
.lvl-line + .lvl-line { margin-top: var(--s2); }

/* Recent work: each task's title is a link at least 44 px tall. */
.recent .task a { display: inline-flex; align-items: center; min-height: 44px; }
/* "See all" (Recent work) and "[n] of [m] earned" (Badges): 44 px tall at every width (the coordinator's ruling, 2026-11-15). */
.recent .sec-head .link--s, [aria-labelledby="badges-h"] .sec-head .link--s { min-height: 44px; }

/* ---------- Streak + level ---------- */
.streak {
  background: var(--sun); border-radius: var(--r-l); padding: var(--s5);
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--s4); row-gap: var(--s4);
  align-items: center;
}
.streak__n {
  font-family: var(--display); font-weight: 800; font-size: 4.5rem; line-height: 0.85;
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.streak__label { font-family: var(--display); font-weight: 700; font-size: var(--fs-2xl); line-height: 1.15; }
.streak__label span:not(.sr) { display: block; font-family: var(--text); font-weight: 400; font-size: var(--fs-m); line-height: 1.4; margin-top: 2px; letter-spacing: 0; }
.week { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s2); }
.week li { display: grid; justify-items: center; gap: var(--s1); font-size: var(--fs-xs); font-weight: 700; }
.week__dot {
  display: grid; place-items: center; width: min(36px, 100%); aspect-ratio: 1; border-radius: 50%;
  background: var(--veil-60); color: var(--ink);
}
.week .is-done .week__dot { background: var(--ink); color: var(--sun); }
.week .is-today .week__dot { box-shadow: 0 0 0 3px var(--sun), 0 0 0 5px var(--ink); }
.streak__foot { grid-column: 1 / -1; padding-top: var(--s3); border-top: 1px solid var(--ink-line); font-size: var(--fs-m); }

.level {
  background: var(--teal-tint); border-radius: var(--r-l); padding: var(--s5);
  display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--s4); align-items: center;
  color: inherit; text-decoration: none;
}
.level__badge { width: 64px; height: 72px; }
.level__name { font-family: var(--display); font-weight: 700; font-size: var(--fs-2xl); line-height: 1.15; letter-spacing: -0.01em; }
.level__sub { color: var(--ink-2); font-size: var(--fs-m); }
.level__bar { grid-column: 1 / -1; }
.level .bar { background: var(--surface); }
.level__figs { display: flex; justify-content: space-between; gap: var(--s4); margin-top: var(--s2); font-size: var(--fs-m); }
.level__figs b { font-variant-numeric: tabular-nums; }
.level__stats {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4);
  padding-top: var(--s4); border-top: 1px solid var(--teal-line);
}
.level__stats--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.level__stats dt { font-size: var(--fs-s); color: var(--ink-2); }
.level__stats dd { font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.3; font-variant-numeric: tabular-nums; }
.level__note { grid-column: 1 / -1; padding-top: var(--s4); border-top: 1px solid var(--teal-line); font-size: var(--fs-s); color: var(--ink-2); }

/* ---------- Progress (STORY-03.27) ---------- */
/* Where the points came from: two columns at every width, so each "[n] points" fits its cell. */
.level__stats--parts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Basics' points still open ("Skipped Basics: the points wait"); "Have a look" is 44 px tall. */
.level__basics { grid-column: 1 / -1; display: grid; gap: var(--s1); justify-items: start; padding-top: var(--s4); border-top: 1px solid var(--teal-line); }
.level__optional { font-family: var(--text); font-weight: 400; font-size: var(--fs-s); color: var(--ink-2); }
.level__basics .link--s { display: inline-flex; align-items: center; gap: var(--s1); min-height: 44px; }
/* Your levels: the overall line above the rows; each skill's newest range and target under its name; the arrows
   and "New best" marks between its results. */
.overall-result { display: grid; gap: var(--s1); margin-bottom: var(--s4); }
.history__sub { display: block; font-family: var(--text); font-weight: 400; font-size: var(--fs-s); }
.histories .history__steps { align-items: center; }
.histories .history__step { white-space: nowrap; }
.history__arrow { color: var(--ink-2); }
/* History: each task's title is a link at least 44 px tall, as on Today. */
.all-results .task a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Skills on the CLB 5–10 scale (STORY-04.4) ---------- */
/* Phone first, and by the table's own width (a container), not the window's: under 36rem each row stacks (the name
   and the range, then the scale, then the gap to the target) and the head is hidden; under 20rem (a phone of 375 px or
   less) the range goes under the name, so the name has the row's width and never breaks inside a word. From 36rem the
   head and the rows are one grid (each row a subgrid), so a column is as wide as its text in any row: the name wraps
   between words, the range keeps one line, the gap to the target wraps. No box is placed over another. The scale is
   at least 152 px: six 22 px cells (the target's mark) and five 4 px gaps. The five columns' minimums, with the French
   names and the widest range, "below NCLC 4" (40 + 132 + 152 + 120 + 66, and four 12 px gaps: 558 px), fit 36rem. */
.skills { container-type: inline-size; }
.skills__grid { display: grid; }
.skills__head { display: none; padding-bottom: var(--s2); font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); }
.skill {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; column-gap: var(--s3); row-gap: var(--s2);
  min-height: 68px; padding-block: var(--s3); border-top: 1px solid var(--line);
}
.skill .scale { grid-column: 1 / -1; grid-row: 2; }
.skill__name { font-family: var(--display); font-weight: 700; font-size: var(--fs-l); line-height: 1.25; min-width: 0; overflow-wrap: break-word; }
.skill__name span { display: block; font-family: var(--text); font-weight: 400; font-size: var(--fs-s); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.skill__now { grid-column: 3; grid-row: 1; font-family: var(--display); font-weight: 700; font-size: var(--fs-xl); font-variant-numeric: tabular-nums; white-space: nowrap; }
.skill__gap { grid-column: 1 / -1; grid-row: 3; font-size: var(--fs-m); color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.skill__gap.is-met { color: var(--teal); font-weight: 700; }
@container (max-width: 20rem) {
  .skill__now { grid-column: 2 / -1; grid-row: 2; }
  .skill .scale { grid-row: 3; }
  .skill__gap { grid-row: 4; }
}
@container (min-width: 36rem) {
  .skills__grid { grid-template-columns: 40px minmax(min-content, 1fr) minmax(152px, 1fr) max-content auto; column-gap: var(--s3); }
  .skills__head, .skill { grid-column: 1 / -1; display: grid; grid-template-columns: subgrid; align-items: center; }
  .skill { row-gap: 0; padding-block: var(--s2); }
  .skill .scale, .skill__now, .skill__gap { grid-column: auto; grid-row: auto; }
}

.scale, .scale-nums { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.scale-nums span { text-align: center; font-variant-numeric: tabular-nums; }
.scale-nums .is-target { justify-self: center; min-width: 22px; border-radius: 6px; background: var(--ink); color: var(--surface); }
.scale__cell { height: 20px; border-radius: 5px; background: var(--paper-2); }
.scale__cell.is-on { background: var(--teal); }
.scale__cell.is-below { background: var(--teal-soft); }
.scale__cell.is-togo { background: repeating-linear-gradient(135deg, var(--sun-tint) 0 5px, var(--sun) 5px 7px); }
.scale__cell.is-target { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }

/* ---------- Badges ---------- */
.badges { display: grid; }
.badge {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--s4); align-items: center;
  padding-block: var(--s3); border-top: 1px solid var(--line);
}
.badge:first-child { border-top: 0; padding-top: 0; }
.badge:last-child { padding-bottom: 0; }
.badge__art { width: 72px; height: 72px; }
.badge__name { font-family: var(--display); font-weight: 700; font-size: var(--fs-l); line-height: 1.25; }
.badge__how { font-size: var(--fs-m); color: var(--ink-2); }
.badge__how b { color: var(--ink); font-variant-numeric: tabular-nums; }
.badge__when { font-size: var(--fs-s); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- Weakest task types ---------- */
.weak { display: grid; }
.weak li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s4); row-gap: var(--s2);
  align-items: center; padding-block: var(--s3); border-top: 1px solid var(--line);
}
.weak li:first-child { border-top: 0; padding-top: 0; }
.weak li:last-child { padding-bottom: 0; }
.weak__name { font-weight: 700; line-height: 1.3; }
.weak__name span { display: block; font-weight: 400; font-size: var(--fs-s); color: var(--ink-2); }
.weak__pct { font-family: var(--display); font-weight: 700; font-size: 1.25rem; font-variant-numeric: tabular-nums; text-align: end; }
.weak__bar { height: 8px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.weak__bar span { display: block; height: 100%; border-radius: 4px; background: var(--coral); }
.weak__bar.is-ok span { background: var(--teal); }
.weak__bar.is-mid span { background: var(--sun-deep); }
.weak .link { justify-self: end; min-height: 44px; font-size: var(--fs-m); }
.panel__note { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line); font-size: var(--fs-m); color: var(--ink-2); }

/* ================= Responsive ================= */
@media (max-width: 860px) {
  .journey { padding: var(--s5) var(--s4); border-radius: 20px; }
  .journey__top { flex-direction: column; align-items: stretch; gap: var(--s4); }
  .countdown__box { min-width: 96px; }
  .countdown__n { font-size: 2.5rem; }
  .countdown__note { max-width: none; }
  .trail { height: auto; margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--veil-25); }
  .trail__svg { display: none; }
  .stops { display: grid; }
  .stop, .stop--hi {
    position: relative; left: auto; top: auto; width: auto; transform: none;
    flex-direction: row; align-items: center; gap: var(--s3); text-align: start; min-height: 56px;
  }
  .stop__node, .stop--now .stop__node { margin-top: 0; width: 36px; height: 36px; z-index: 1; }
  .stop__node .i { width: 16px; height: 16px; }
  .stop--now .stop__node { box-shadow: 0 0 0 4px var(--sun); }
  .stop + .stop::before {
    content: ""; position: absolute; inset-inline-start: 16px; top: -18px; height: 36px; width: 4px;
    border-radius: 2px; background: var(--veil-30);
  }
  .stop--done + .stop::before { background: var(--sun); }
  .stop > a { min-height: 56px; flex: 1; }
  .stop__text { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--s2); }

  .level__name { font-size: 1.1875rem; }
  .level__stats--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .level__stats { gap: var(--s3); }
  .level__stats dd { font-size: var(--fs-xl); }
  .streak__n { font-size: 4rem; }
}
