/* Topic page layout (templates/resources/topic_materials.html).
   Colours come from main.css tokens so dark mode follows [data-theme]. */
.topic-test-link {
    text-align: center;
    margin: 0 0 1.25rem;
}
.topic-test-link a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 4px 12px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-navy);
    background: var(--surface);
    border: 1px solid var(--color-border-accent);
    border-radius: var(--radius-sm);
    text-decoration: none;
}
.topic-test-link a:hover,
.topic-test-link a:focus-visible {
    background: var(--surface-alt);
    color: var(--color-navy);
}
.topic-test-link a:focus-visible {
    outline: 2px solid var(--color-border-accent);
    outline-offset: 2px;
}

.topic-page {
    --topic-accent: var(--color-bootstrap-primary);
    --topic-shadow: rgba(15, 23, 42, .14);
    max-width: 1072px;
    margin: 0 auto;
    padding: 32px 16px 64px;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
}
:root[data-theme="dark"] .topic-page { --topic-accent: #3d8ef5; --topic-shadow: rgba(0, 0, 0, .45); }

/* Bloom's levels, lowest to highest (Эстеп калуу ... Жаратуу). Muted so the
   thumbnails stay the brightest thing in each row. Darkened from the first
   pass to clear 4.5:1 against white text (these colours are also used as
   .bloom-tag's own text colour on the page background, so the same ratio
   covers both directions). */
.topic-page {
    --bloom-1: #6d778b;
    --bloom-2: #397ab8;
    --bloom-3: #27835c;
    --bloom-4: #9d6c0d;
    --bloom-5: #c05529;
    --bloom-6: #7f55b8;
}
:root[data-theme="dark"] .topic-page {
    --bloom-1: #8893a8;
    --bloom-2: #4c8ecb;
    --bloom-3: #3a9e74;
    --bloom-4: #c08c28;
    --bloom-5: #d26a40;
    --bloom-6: #9770cc;
}
.lv-1 { --lv: var(--bloom-1); }
.lv-2 { --lv: var(--bloom-2); }
.lv-3 { --lv: var(--bloom-3); }
.lv-4 { --lv: var(--bloom-4); }
.lv-5 { --lv: var(--bloom-5); }
.lv-6 { --lv: var(--bloom-6); }

/* main.css draws blue bars around every h1; this page's title doesn't use them */
.topic-page__title {
    display: block;
    font-size: clamp(28px, 4.4vw, 44px);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.12;
    margin: 8px auto 0;
    text-wrap: balance;
}
.topic-page__title::before,
.topic-page__title::after { content: none; }

.topic-page__notice {
    margin: 20px 0 0;
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    color: var(--text-muted);
    font-size: 14px;
}
.topic-page__notice a { color: var(--topic-accent); font-weight: 600; }

/* Top of the page is centred; sections stay left-aligned */
.topic-page__title,
.topic-page__notice { text-align: center; }
.topic-page__notice { max-width: 640px; margin-inline: auto; }

.topic-section__head { margin: 44px 0 14px; display: grid; gap: 6px; justify-items: start; }
.stage-tag {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--color-border-accent);
    border: 1px solid var(--color-border-accent);
    border-radius: 999px;
    padding: 2px 10px;
}
/* Section titles match the home page («Презентациялар» with a blue bar on
   each side), so materials on every page are split the same way. */
.topic-section__title {
    justify-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    text-align: center;
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 500;
    line-height: 1.2;
    margin: 0;
}
.topic-section__title::before,
.topic-section__title::after {
    content: '';
    flex: 1 0 28px;
    height: 6px;
    background-color: rgb(13, 167, 255);
}
.topic-section__summary { justify-self: center; text-align: center; }
/* The lesson stage (Изилдөө, Түшүндүрүү…) as small text under the heading,
   so teachers can see which part of the lesson the materials are for. */
.topic-section__stage {
    justify-self: center;
    margin: 0;
    padding: 2px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: center;
}
.topic-section__stage .topic-section__en { margin-left: 2px; font-size: 13px; }
@media (max-width: 575.98px) {
    .topic-section__title { gap: .75rem; }
    .topic-section__title::before,
    .topic-section__title::after { flex-basis: 20px; height: 5px; }
}
.topic-section__en { font-weight: 500; color: var(--text-muted); font-size: 15px; margin-left: 6px; }
.topic-section__summary { margin: 0; color: var(--text-muted); font-size: 15px; }
.bloom-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bloom-row__label { font-size: 13px; color: var(--text-muted); }
.bloom-chip {
    font-size: 13px;
    font-weight: 500;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--color-menu-active);
    color: var(--text);
}

.topic-list {
    /* Rows are separated by space, not a divider line - each gets its own
       full radius, so no first/last/only-child radius overrides are needed. */
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.topic-row {
    display: grid;
    /* Three equal columns like the older topic pages: picture, text, buttons */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 28px;
    position: relative;
    padding: 24px 28px;
    background: var(--surface);
    border-radius: var(--radius-md);
    transition: background-color var(--transition-base);
}
/* No overflow:hidden here: the hover zoom has to spill over the page. */
.topic-row:hover { background: var(--surface-alt); z-index: 5; }

.topic-row__thumb {
    width: 100%;
    aspect-ratio: 160 / 104;
    padding: 3px;
    background: var(--surface);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px var(--topic-shadow), 0 6px 14px var(--topic-shadow);
    transform: rotate(-2deg);
    transform-origin: left center;
    transition: transform .3s, box-shadow .3s;
}
.topic-row__thumb svg,
.topic-row__thumb img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* Same zoom as the site's older pages (.zoom + .mainshadow): 2x with a blue glow.
   A thumb that holds .mk-zoom must not keep its own rotate(): that transform
   clips the child, so the 1.3x scale never shows. The tilt sits on the image. */
.topic-row__thumb:has(> .mk-zoom) {
    transform: none;
    overflow: visible;
}
.topic-row__thumb:hover {
    transform: rotate(0) scale(2);
    box-shadow: 0 0 20px var(--color-heading-accent);
    position: relative;
    z-index: 10;
}
.topic-row__thumb:has(> .mk-zoom):hover {
    transform: none;
    box-shadow: 0 1px 2px var(--topic-shadow), 0 6px 14px var(--topic-shadow);
}
@media (hover: hover) {
    .topic-row__thumb img.mk-zoom {
        transform: rotate(-2deg);
        transform-origin: left center;
    }
    .topic-row__thumb img.mk-zoom:hover,
    .topic-row__thumb img.mk-zoom:focus-visible {
        transform: rotate(-2deg) scale(1.3);
    }
    .topic-row__thumb img.mk-zoom--read:hover,
    .topic-row__thumb img.mk-zoom--read:focus-visible {
        transform: rotate(-2deg) scale(2.6);
    }
}

.topic-row__text {
    text-align: center;
    justify-self: center;
    max-width: 32ch;
    overflow-wrap: anywhere;
    text-wrap: balance;
}
.topic-row__title { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.topic-row__note { margin: 0; color: var(--text-muted); font-size: 15px; }

.topic-row__files { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.topic-row__gate {
    margin: 0;
    max-width: 24ch;
    text-align: center;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}
.topic-row__files .file-pill { display: block; box-sizing: border-box; width: 136px; min-width: 0; text-align: center; }
/* Longer labels («Жазылууну жаңыртуу») grow the button instead of spilling
   out of it; they wrap only if even the column is too narrow. */
.topic-row__files > .file-pill { width: auto; min-width: 136px; max-width: 100%; white-space: normal; }
/* Every button in the column has the same width and lines up; the «Акысыз»
   tag hangs to the right of its button instead of pushing it aside. */
.topic-row__files .free-download { position: relative; display: block; }
.topic-row__files .free-badge {
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
}
.file-pill {
    font-size: 14px;
    font-weight: 500;
    padding: 9px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    text-align: center;
    transition: border-color var(--transition-fast);
}
.file-pill:hover { border-color: var(--text-muted); color: var(--text); }
.file-pill--main,
.file-pill--main:hover { background: var(--topic-accent); border-color: var(--topic-accent); color: #fff; }
.file-pill:focus-visible { outline: 2px solid var(--topic-accent); outline-offset: 2px; }
.topic-row__soon { color: var(--text-muted); font-size: 13px; }

@media (max-width: 680px) {
    /* Phones: picture, text and buttons stack in one column */
    .topic-row { grid-template-columns: minmax(0, 1fr); padding: 18px 16px; gap: 14px; }
    .topic-row__thumb { max-width: 320px; margin: 0 auto; transform-origin: center; }
    .topic-row__thumb:hover { transform: rotate(0) scale(1.1); }
    .topic-row__thumb:has(> .mk-zoom),
    .topic-row__thumb:has(> .mk-zoom):hover { transform: none; }
    .topic-row__thumb img.mk-zoom,
    .topic-row__thumb img.mk-zoom:hover,
    .topic-row__thumb img.mk-zoom:focus-visible { transform: none; }
}

.topic-page [hidden] { display: none !important; }

/* Control under the title: 5E + 3C / Bloom switch */
.topic-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 20px;
    margin-top: 24px;
}
.model-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background: none;
    border: 0;
    padding: 4px;
    cursor: pointer;
}
.model-switch__track {
    position: relative;
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--border-subtle);
    transition: background-color var(--transition-fast);
}
.model-switch__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 2px var(--topic-shadow);
    transition: transform var(--transition-fast);
}
.model-switch[aria-pressed="true"] .model-switch__track { background: var(--topic-accent); }
.model-switch[aria-pressed="true"] .model-switch__track::after { transform: translateX(16px); }
.model-switch:focus-visible { outline: 2px solid var(--topic-accent); outline-offset: 2px; border-radius: 6px; }
.topic-page.model-off .lesson-meta { display: none !important; }

/* Teacher guide: stage timing, Bloom levels, link to the national programme */
.teacher-guide {
    margin: 20px auto 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
}
.teacher-guide summary {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.teacher-guide__body { padding: 0 20px 20px; font-size: 15px; }
.teacher-guide h2 { font-size: 15px; font-weight: 700; margin: 16px 0 8px; }
.teacher-guide__std {
    padding: 4px 14px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}
.teacher-guide__std ul { margin: 0; padding-left: 18px; color: var(--text-muted); }
.teacher-guide__std li + li { margin-top: 4px; }
.teacher-guide__cols { display: grid; grid-template-columns: 3fr 2fr; gap: 28px; }
.guide-list { margin: 0; }
.guide-list dt { font-weight: 600; margin-top: 10px; }
.guide-list dt .stage-tag { display: inline-block; font-size: 13px; padding: 0 7px; margin-right: 4px; }
.guide-list dd { margin: 2px 0 0; color: var(--text-muted); }
.topic-section__when { margin: 0; font-size: 14px; color: var(--text); }
@media (max-width: 680px) { .teacher-guide__cols { grid-template-columns: 1fr; gap: 0; } }

.teacher-guide__extra { margin-top: 18px; }
.teacher-guide__extra-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}
.teacher-guide__extra-title { margin: 0; font-weight: 600; font-size: 14px; }
.teacher-guide__extra-note { margin: 2px 0 0; color: var(--text-muted); font-size: 13.5px; max-width: 52ch; }
.teacher-guide__extra-links { display: flex; gap: 8px; flex-shrink: 0; }
.teacher-guide__extra-links .file-pill { padding: 6px 12px; font-size: 13px; }

/* Option C: Bloom staircase, lesson timeline and a Bloom colour per row */
.bloom-steps {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: end;
    gap: 6px;
    margin: 28px 0 8px;
    padding: 0;
}
.bloom-step {
    display: grid;
    align-content: start;
    gap: 2px;
    padding: 8px 6px;
    border-radius: 6px 6px 0 0;
    background: var(--lv);
    color: #fff;
    text-align: center;
}
.bloom-step__name { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.bloom-step__count { font-size: 13px; }
.bloom-step.lv-1 { min-height: 48px; }
.bloom-step.lv-2 { min-height: 58px; }
.bloom-step.lv-3 { min-height: 68px; }
.bloom-step.lv-4 { min-height: 78px; }
.bloom-step.lv-5 { min-height: 88px; }
.bloom-step.lv-6 { min-height: 98px; }

.topic-sections { position: relative; padding-left: 40px; }
.topic-sections::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 52px;
    bottom: 40px;
    width: 2px;
    background: var(--border-subtle);
}
.topic-section { position: relative; }
.timeline-dot {
    position: absolute;
    left: -36px;
    top: 4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--color-border-accent);
    background: var(--surface);
}
.topic-page.model-off .topic-sections { padding-left: 0; }
.topic-page.model-off .topic-sections::before { display: none; }

.bloom-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--lv);
}
.bloom-ladder { display: inline-flex; align-items: flex-end; gap: 3px; height: 24px; }
.bloom-ladder i { width: 8px; border-radius: 2px; background: var(--border-subtle); }
.bloom-ladder i:nth-child(1) { height: 8px; }
.bloom-ladder i:nth-child(2) { height: 11px; }
.bloom-ladder i:nth-child(3) { height: 14px; }
.bloom-ladder i:nth-child(4) { height: 17px; }
.bloom-ladder i:nth-child(5) { height: 20px; }
.bloom-ladder i:nth-child(6) { height: 23px; }
.bloom-ladder i.on { background: var(--lv); }

@media (max-width: 680px) {
    .bloom-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .bloom-step { border-radius: 6px; min-height: 0 !important; }
    .topic-sections { padding-left: 26px; }
    .topic-sections::before { left: 6px; }
    .timeline-dot { left: -28px; width: 16px; height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .topic-row, .topic-row__thumb { transition: none; }
    .topic-row__thumb:hover { transform: scale(2); }
    .topic-row__thumb:has(> .mk-zoom),
    .topic-row__thumb:has(> .mk-zoom):hover { transform: none; }
}

/* Entrance: each section's head and rows rise in as they reach the
   viewport (IntersectionObserver in topic_materials.html toggles
   .is-in). Transform + opacity only, and the content is already fully
   present without JS - .is-in is simply never removed if it doesn't run. */
@media (prefers-reduced-motion: no-preference) {
    .topic-section__head,
    .topic-row {
        opacity: 0;
        transform: translateY(18px);
        transition: opacity .5s ease, transform .5s ease;
    }
    .topic-section__head.is-in,
    .topic-row.is-in { opacity: 1; transform: none; }
    .topic-row:nth-child(2) { transition-delay: .06s; }
    .topic-row:nth-child(3) { transition-delay: .12s; }
    .topic-row:nth-child(4) { transition-delay: .18s; }
}

/* Prev/next topic links (snippets/related_topics.html) as plain text links
   on this page only. `body` raises specificity over related-topics.css,
   which loads later in the page. */
body .related-topics .related-topics-link {
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 4px 0;
    transform: none;
}
body .related-topics .related-topics-link:hover .related-topics-title,
body .related-topics .related-topics-link:focus-visible .related-topics-title {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Menu path above the title and the grade badge under it */
.topic-page__crumb { margin: 0 0 6px; text-align: center; font-size: 14px; color: var(--text-muted); }
.topic-page__grade { display: flex; justify-content: center; margin: 12px 0 0; }
/* Linked path (pack pages, data/pack_links.py): home › class › main page › here */
.crumb-trail {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.crumb-trail li + li::before { content: '›'; margin: 0 6px; color: var(--text-muted); }
.crumb-trail a { color: var(--text-muted); text-decoration: underline; text-decoration-color: var(--border-subtle); text-underline-offset: 3px; }
.crumb-trail a:hover { color: var(--topic-accent); text-decoration-color: currentColor; }
.crumb-trail a:focus-visible { outline: 2px solid var(--topic-accent); outline-offset: 2px; border-radius: 2px; }
.crumb-trail [aria-current] { color: var(--text); }
.topic-page__grade a,
.topic-page__grade span {
    padding: 3px 12px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
}
.topic-page__grade a { text-decoration: none; transition: border-color var(--transition-fast), color var(--transition-fast); }
.topic-page__grade a:hover { border-color: var(--topic-accent); color: var(--topic-accent); }
.topic-page__grade a:focus-visible { outline: 2px solid var(--topic-accent); outline-offset: 2px; }

/* Grade tabs (pages whose materials carry a grade, e.g. «Төрт амал»):
   one segmented control in the page's card style (border, surface, radius),
   the selected grade filled with the topic accent like .file-pill--main. */
.grade-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    margin: 20px auto 0;
    padding: 4px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 1px 2px var(--topic-shadow);
}
.grade-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 7px 14px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--text-muted);
    background: transparent;
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}
.grade-tab:hover { color: var(--text); background: var(--surface-alt); }
.grade-tab:focus-visible { outline: 2px solid var(--topic-accent); outline-offset: 2px; }
.grade-tab[aria-selected="true"] { color: #fff; background: var(--topic-accent); }
.grade-tab__count {
    min-width: 22px;
    padding: 1px 6px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--text-muted);
}
.grade-tab[aria-selected="true"] .grade-tab__count { background: rgba(255, 255, 255, .22); color: #fff; }
@media (max-width: 680px) {
    .grade-tabs { width: auto; }
    .grade-tab { padding: 6px 10px; font-size: 14px; }
}
.subtopic-chip {
    display: inline-block;
    margin: 0 0 6px;
    padding: 2px 8px;
    font-size: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    color: var(--text-muted);
}
/* Inside-page previews: the card takes the page's own shape, so the
   preview fills the white card edge to edge, and zooms far enough to
   read the tasks. Portrait sheets ship as a landscape crop of their top. */
.topic-row__thumb:has(> .mk-zoom--read) { aspect-ratio: auto; padding: 0; background: #fff; }
.topic-row__thumb img.mk-zoom--read {
    height: auto;
    object-fit: fill;
    border-radius: inherit;
    --mk-zoom-scale: 2.6;
}

/* «Бул тема класстан класска»: the same idea in the grades before and
   after this page (data/spiral.py). One card, steps in grade order; the
   current page is outlined in the topic accent instead of linked. */
.spiral {
    margin: 20px 0 0;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 1px 2px var(--topic-shadow);
}
.spiral + .spiral { margin-top: 8px; }
.spiral__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
}
.spiral__head::-webkit-details-marker { display: none; }
.spiral__head::after {
    content: '';
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform var(--transition-fast);
}
.spiral[open] > .spiral__head::after { transform: rotate(225deg); }
.spiral__head:focus-visible { outline: 2px solid var(--topic-accent); outline-offset: 2px; border-radius: var(--radius-md); }
.spiral__label { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.spiral__title { font-size: 16px; font-weight: 700; color: var(--text); }
.spiral__steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0 16px 16px;
    list-style: none;
    counter-reset: spiral;
}
.spiral__step {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
}
.spiral__step.is-current { border: 2px solid var(--topic-accent); background: var(--surface); padding: 9px 11px; }
.spiral__grade {
    align-self: flex-start;
    padding: 1px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: var(--surface);
}
.spiral__name { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--text); }
a.spiral__name { color: var(--topic-accent); text-decoration: none; }
a.spiral__name:hover { text-decoration: underline; }
a.spiral__name:focus-visible { outline: 2px solid var(--topic-accent); outline-offset: 2px; border-radius: 2px; }
.spiral__here { font-size: 12px; font-weight: 600; color: var(--topic-accent); }
.spiral__change { font-size: 13px; line-height: 1.35; color: var(--text-muted); }
@media (max-width: 680px) {
    .spiral__steps { grid-template-columns: 1fr; }
}

/* Older topic pages (topic_page.html): same blue-bar section titles. */
.section-title h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    text-align: center;
    font-size: clamp(1.35rem, 3vw, 2rem);
    font-weight: 500;
    line-height: 1.2;
    margin: 2rem 0 1rem;
}
.section-title h2::before,
.section-title h2::after {
    content: '';
    flex: 1 0 28px;
    height: 6px;
    background-color: rgb(13, 167, 255);
}
@media (max-width: 575.98px) {
    .section-title h2 { gap: .75rem; }
    .section-title h2::before,
    .section-title h2::after { flex-basis: 20px; height: 5px; }
}
/* Small learning-goal line under a home-page section name (older pages). */
.section-title__stage {
    display: inline-block;
    margin: 0;
    padding: 2px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}
/* A second part of the same home-page section: no new heading, less space. */
.topic-section--cont .topic-section__head { margin-top: 28px; }
