/* Screen-specific patterns: plan, learn, practice, tests, progress. ---------- */

/* ------------------------------------------------------------- hero strip ---- */
.hero {
    position: relative; overflow: hidden;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-5); align-items: center;
    padding: var(--s-6);
    border-radius: var(--r-xl);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    background:
        radial-gradient(70% 120% at 0% 0%, #ece5ff 0%, transparent 60%),
        radial-gradient(60% 120% at 100% 0%, #fde6f0 0%, transparent 60%),
        var(--surface);
}
.hero__eyebrow { display: flex; gap: var(--s-2); align-items: center; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.hero__title { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.03em; }
.hero__sub { color: var(--ink-3); margin-top: 6px; font-size: var(--fs-sm); }
.countdown { text-align: center; padding: var(--s-3) var(--s-5); border-radius: var(--r-lg); background: rgba(255, 255, 255, .8); border: 1px solid var(--line); box-shadow: var(--shadow-xs); }
.countdown b { display: block; font: 800 var(--fs-3xl) / 1 var(--font-display); letter-spacing: -0.04em; background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.countdown span { font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }

/* The weeks of the plan, as one slim strip. */
.weeks { display: grid; grid-template-columns: repeat(var(--n, 18), minmax(0, 1fr)); gap: 4px; margin-top: var(--s-4); }
.weeks a { height: 10px; border-radius: 3px; background: rgba(27, 24, 52, .08); }
.weeks a.is-done { background: #34b37e; }
.weeks a.is-part { background: linear-gradient(90deg, #34b37e 50%, rgba(27, 24, 52, .08) 50%); }
.weeks a.is-now { background: var(--accent); box-shadow: 0 0 0 2px rgba(109, 74, 255, .25); }
.weeks a.is-behind { background: #f0a06a; }
.weeks__legend { display: flex; justify-content: space-between; margin-top: 6px; font-size: var(--fs-2xs); color: var(--ink-3); }

/* ------------------------------------------------------------- next action ---- */
.next {
    display: flex; align-items: center; gap: var(--s-4);
    padding: var(--s-5);
    border-radius: var(--r-lg);
    border: 1px solid var(--violet-edge);
    background: linear-gradient(135deg, #f4f0ff 0%, #fbf8ff 100%);
    box-shadow: var(--shadow-md);
}
.next--urgent { border-color: var(--rose-edge); background: linear-gradient(135deg, #fff0f4 0%, #fffafb 100%); }
.next__eyebrow { font-size: var(--fs-xs); font-weight: 700; color: var(--violet-ink); letter-spacing: .02em; }
.next--urgent .next__eyebrow { color: var(--rose-ink); }
.next__title { font: 800 var(--fs-lg) / 1.25 var(--font-display); letter-spacing: -0.02em; margin: 3px 0; }
.next__detail { color: var(--ink-3); font-size: var(--fs-sm); }

/* ------------------------------------------------------------- plan items ---- */
.plan-item { display: flex; gap: var(--s-3); align-items: flex-start; padding: var(--s-3) 0; border-top: 1px solid var(--line-soft); }
.plan-item:first-child { border-top: 0; padding-top: 0; }
.plan-item__check {
    width: 22px; height: 22px; flex: 0 0 22px; border-radius: 7px; margin-top: 1px;
    border: 1.5px solid var(--line-strong); background: var(--surface); display: grid; place-items: center; color: #fff;
}
.plan-item.is-done .plan-item__check { background: #34b37e; border-color: #34b37e; }
.plan-item.is-skipped .plan-item__check { background: var(--ink-4); border-color: var(--ink-4); }
.plan-item.is-carried .plan-item__check { border-color: #ec8a45; }
.plan-item__title { font-weight: 600; display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.plan-item.is-done .plan-item__title { color: var(--ink-3); }
.plan-item__focus { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 2px; }
.plan-item__steps { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-2); }
.step { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 7px; background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-2); }
.step.is-met { background: var(--mint-bg); border-color: var(--mint-edge); color: var(--mint-ink); }
.step .i { width: 12px; height: 12px; }

.week-block { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); }
.week-block + .week-block { margin-top: var(--s-3); }
.week-block > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-3) var(--s-5); }
.week-block > summary::-webkit-details-marker { display: none; }
.week-block[open] > summary { border-bottom: 1px solid var(--line-soft); }
.week-block.is-now { border-color: var(--violet-edge); box-shadow: 0 0 0 3px rgba(109, 74, 255, .1), var(--shadow-sm); }
.week-block__body { padding: var(--s-4) var(--s-5); }

/* ----------------------------------------------------------------- learn ---- */
.learn { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-5); align-items: start; }
.player { position: relative; aspect-ratio: 16 / 9; width: 100%; max-width: 100%; border-radius: var(--r-lg); overflow: hidden; background: #120f24; border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.player iframe, .player img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.player__play {
    position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; border: 0; padding: 0;
    background: linear-gradient(180deg, rgba(18, 15, 36, .15), rgba(18, 15, 36, .55));
}
.player__play span { width: 68px; height: 68px; border-radius: 50%; background: rgba(255, 255, 255, .95); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); transition: transform .15s var(--ease); }
.player__play:hover span { transform: scale(1.06); }
.player__play .i { width: 26px; height: 26px; color: var(--accent); fill: var(--accent); margin-left: 4px; }

.lessons { max-height: calc(var(--vh-full) - 160px); overflow-y: auto; position: sticky; top: calc(var(--topbar-h) + 16px); }
.series + .series { border-top: 1px solid var(--line-soft); }
.series > summary { list-style: none; cursor: pointer; padding: var(--s-3) var(--s-4); display: flex; align-items: center; gap: var(--s-2); font-weight: 600; font-size: var(--fs-sm); }
.series > summary::-webkit-details-marker { display: none; }
.lesson { display: flex; align-items: center; gap: var(--s-2); padding: 7px var(--s-4) 7px var(--s-5); font-size: var(--fs-sm); color: var(--ink-2); border-left: 2px solid transparent; }
.lesson:hover { background: var(--sunken); color: var(--ink); }
.lesson.is-current { background: var(--violet-bg); color: var(--violet-ink); border-left-color: var(--accent); font-weight: 600; }
.lesson__tick { width: 16px; height: 16px; flex: 0 0 16px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.lesson.is-done .lesson__tick { background: #34b37e; border-color: #34b37e; color: #fff; }
.lesson__n { width: 22px; flex: 0 0 22px; color: var(--ink-4); font-size: var(--fs-2xs); font-variant-numeric: tabular-nums; }
.lesson__dur { margin-left: auto; font-size: var(--fs-2xs); color: var(--ink-4); }

.note { border-left: 3px solid var(--lilac-edge); padding-left: var(--s-3); }
.note + .note { margin-top: var(--s-4); }
.formula { font-family: var(--font-mono); font-size: var(--fs-sm); background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-sm); padding: var(--s-2) var(--s-3); overflow-x: auto; white-space: pre-wrap; }

/* -------------------------------------------------------------- syllabus ---- */
.sx { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
.sx + .sx { margin-top: var(--s-3); }
.sx > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto minmax(0, 1fr) 180px auto auto; gap: var(--s-4); align-items: center; padding: var(--s-4) var(--s-5); }
.sx > summary::-webkit-details-marker { display: none; }
.sx > summary:hover { background: #fdfcff; }
.sx[open] > summary { border-bottom: 1px solid var(--line-soft); background: var(--surface-2); }
.sx__chev { transition: transform .15s var(--ease); color: var(--ink-3); }
.sx[open] .sx__chev { transform: rotate(90deg); }
.sx__title { font: 700 var(--fs-base) var(--font-display); }
.sx__body { padding: var(--s-2) var(--s-5) var(--s-4); }
.sub { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; border-top: 1px solid var(--line-soft); }
.sub:first-child { border-top: 0; }
.sub__code { font-size: var(--fs-2xs); color: var(--ink-4); font-family: var(--font-mono); }
.studied-toggle { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px 0 6px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); font: 600 var(--fs-xs) var(--font-ui); color: var(--ink-2); cursor: pointer; box-shadow: var(--shadow-xs); }
.studied-toggle__box { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: #fff; }
.studied-toggle.is-on { background: var(--mint-bg); border-color: var(--mint-edge); color: var(--mint-ink); }
.studied-toggle.is-on .studied-toggle__box { background: #2fb37b; border-color: #2fb37b; }
.studied-toggle:hover { border-color: rgba(27, 24, 52, .4); }

/* --------------------------------------------------------------- questions ---- */
.q { display: flex; flex-direction: column; gap: var(--s-4); }
.q__meta { display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: center; }
.q__stem { font-size: var(--fs-md); line-height: 1.65; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.opts { display: flex; flex-direction: column; gap: var(--s-2); }
.opt { position: relative; display: block; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt__body {
    display: flex; gap: var(--s-3); align-items: flex-start;
    padding: 12px var(--s-4); border-radius: var(--r-md);
    background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-xs);
    transition: border-color .12s var(--ease), background .12s var(--ease), box-shadow .12s var(--ease);
}
.opt:hover .opt__body { border-color: rgba(27, 24, 52, .42); }
.opt__key { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 8px; display: grid; place-items: center; font: 700 var(--fs-xs) var(--font-display); background: var(--sunken); color: var(--ink-2); border: 1px solid var(--line); }
.opt__text { padding-top: 3px; white-space: pre-line; overflow-wrap: anywhere; }
.opt input:checked + .opt__body { border-color: var(--accent); background: var(--violet-bg); box-shadow: 0 0 0 3px rgba(109, 74, 255, .14); }
.opt input:checked + .opt__body .opt__key { background: var(--accent); color: #fff; border-color: var(--accent); }
.opt input:focus-visible + .opt__body { box-shadow: var(--shadow-focus); }
.opt.is-correct .opt__body { border-color: #34b37e; background: var(--mint-bg); }
.opt.is-correct .opt__key { background: #2fb37b; color: #fff; border-color: #2fb37b; }
.opt.is-wrong .opt__body { border-color: #e2547f; background: var(--rose-bg); }
.opt.is-wrong .opt__key { background: #e2547f; color: #fff; border-color: #e2547f; }
.opt.is-locked { cursor: default; }
.nat { max-width: 260px; }

.verdict { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-weight: 600; }
.verdict--ok { background: var(--mint-bg); color: var(--mint-ink); border: 1px solid var(--mint-edge); }
.verdict--bad { background: var(--rose-bg); color: var(--rose-ink); border: 1px solid var(--rose-edge); }
.solution { border-radius: var(--r-md); background: var(--lavender-bg); border: 1px solid var(--lavender-edge); padding: var(--s-4); }
.solution__title { font-weight: 700; font-size: var(--fs-sm); color: var(--lavender-ink); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.solution__text { white-space: pre-line; font-size: var(--fs-sm); color: var(--ink-2); }

.dots { display: flex; gap: 5px; flex-wrap: wrap; }
.dots a, .dots span { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: var(--fs-2xs); font-weight: 700; background: var(--surface); border: 1px solid var(--line); color: var(--ink-3); }
.dots .is-ok { background: var(--mint-bg); border-color: var(--mint-edge); color: var(--mint-ink); }
.dots .is-bad { background: var(--rose-bg); border-color: var(--rose-edge); color: var(--rose-ink); }
.dots .is-current { border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 2px rgba(109, 74, 255, .18); }

/* ------------------------------------------------------------ test runner ---- */
.runner { display: grid; grid-template-rows: auto minmax(0, 1fr); min-height: var(--vh-full); background: var(--page); }
.runner__bar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: var(--s-4);
    padding: var(--s-3) var(--s-6); background: var(--surface); border-bottom: 1px solid var(--line);
}
.runner__title { font: 700 var(--fs-base) var(--font-display); }
.timer { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--r-md); background: var(--violet-bg); border: 1px solid var(--violet-edge); color: var(--violet-ink); font: 800 var(--fs-md) / 1 var(--font-display); font-variant-numeric: tabular-nums; }
.timer.is-low { background: var(--rose-bg); border-color: var(--rose-edge); color: var(--rose-ink); }
.runner__body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-5); padding: var(--s-5) var(--s-6); max-width: 1320px; width: 100%; margin: 0 auto; align-items: start; }
.runner__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: space-between; margin-top: var(--s-4); }
.palette { position: sticky; top: 76px; }
.palette__grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.pal { height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font: 700 var(--fs-xs) var(--font-ui); color: var(--ink-3); cursor: pointer; position: relative; font-variant-numeric: tabular-nums; }
.pal.is-visited { background: var(--rose-bg); border-color: var(--rose-edge); color: var(--rose-ink); }
.pal.is-answered { background: #2fb37b; border-color: #2fb37b; color: #fff; }
.pal.is-marked { background: #8a5cf6; border-color: #8a5cf6; color: #fff; border-radius: 50%; }
.pal.is-answered.is-marked::after { content: ""; position: absolute; right: 2px; bottom: 2px; width: 8px; height: 8px; border-radius: 50%; background: #2fb37b; box-shadow: 0 0 0 1.5px #fff; }
.pal.is-current { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--s-3); font-size: var(--fs-2xs); color: var(--ink-3); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); display: inline-block; }

.calc { position: fixed; right: 24px; bottom: 24px; width: 280px; z-index: 60; }
.calc__screen { font: 600 var(--fs-lg) var(--font-mono); text-align: right; padding: var(--s-3); border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); margin-bottom: var(--s-2); min-height: 52px; overflow-x: auto; }
.calc__keys { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 5px; }
.calc__keys button { height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font: 600 var(--fs-xs) var(--font-ui); cursor: pointer; }
.calc__keys button:hover { background: var(--sunken); }
.calc__keys .op { background: var(--violet-bg); color: var(--violet-ink); border-color: var(--violet-edge); }
.calc__keys .eq { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ------------------------------------------------------------- progress ---- */
.cov { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.cov:first-child { border-top: 0; }
.cov__name { font-weight: 600; font-size: var(--fs-sm); }
.cov__head { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-bottom: 8px; border-top: 0; }

.spark { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: var(--s-2); }
.spark__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.spark__bar { width: 100%; max-width: 34px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #a78bff, #7b5cff); min-height: 3px; }
.spark__bar.is-empty { background: rgba(27, 24, 52, .07); }
.spark__lbl { font-size: var(--fs-2xs); color: var(--ink-4); white-space: nowrap; }
.spark__val { font-size: var(--fs-2xs); font-weight: 700; color: var(--ink-2); }

.score-big { font: 800 44px / 1 var(--font-display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.score-big small { font-size: var(--fs-lg); color: var(--ink-3); font-weight: 700; }

/* --------------------------------------------------------------- responsive ---- */
@media (max-width: 1100px) {
    .learn { grid-template-columns: minmax(0, 1fr); }
    .lessons { position: static; max-height: none; }
    .runner__body { grid-template-columns: minmax(0, 1fr); }
    .palette { position: static; }
}
@media (max-width: 760px) {
    .hero { grid-template-columns: minmax(0, 1fr); }
    .next { flex-direction: column; align-items: stretch; }
    .sx > summary { grid-template-columns: auto minmax(0, 1fr) auto; }
    .sx > summary .sx__meter, .sx > summary .sx__band { display: none; }
    .sub { grid-template-columns: auto minmax(0, 1fr) auto; }
    .sub .sub__qs, .sub .sub__band { display: none; }
    .cov { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .week-block > summary { grid-template-columns: minmax(0, 1fr) auto; }
    .week-block > summary .week-block__focus { display: none; }
    .runner__bar { padding: var(--s-3) var(--s-4); }
    .runner__body { padding: var(--s-4); }
}

/* question figures (served from /figures) and step-by-step hints */
.q-figure { display: block; max-width: 100%; max-height: 420px; height: auto; margin: var(--s-3) 0; border-radius: var(--r-md); border: 1px solid var(--line); background: #fff; }
.hints { display: grid; gap: var(--s-2); }
.hint { border-radius: var(--r-md); background: var(--butter-bg); border: 1px solid var(--butter-edge); padding: var(--s-2) var(--s-3); }
.hint > summary { cursor: pointer; display: flex; gap: 6px; align-items: center; color: var(--butter-ink); list-style: none; }
.hint > summary::-webkit-details-marker { display: none; }
.hint[open] > summary { margin-bottom: 6px; }
.hint > div { white-space: pre-line; color: var(--ink-2); }
