/* Stanford product UI. Local assets, mobile first, no runtime dependencies. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('assets/fonts/inter-cyrillic-wght-normal.woff2') format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('assets/fonts/inter-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
/* Latin Extended: Uzbek Ş ş and Ğ ğ (2026 alphabet). Loaded only when such letters are on the page. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('assets/fonts/inter-latin-ext-wght-normal.woff2') format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
:root {
  color-scheme: light;
  --brand: #ffb703; --brand-hover: #ffb703db; --button-ink: #070707; --on-brand: #070707; --on-brand-muted: #3a3a3a; --rings: #0707071a;
  --paper: #fafafa; --ink: #070707; --muted: #5b5b5b;
  --surface: #ffffff; --surface-raised: #ffffff; --surface-hover: #f2f2f2; --solid: #ebebeb;
  --border: #00000014; --border-strong: #00000030; --focus: #070707;
  --tint: #ffb7030f; --marker: #ffb70359; --transparent: #00000000;
  --dark-panel: #070707; --on-dark: #fafafa; --on-dark-muted: #bdbdbd;
  --header-glass: #fafafab8; --menu-glass: #ffffffd1; --overlay-glass: #00000066; --overlay: #00000099; --shadow-color: #0000000a; --shadow-modal-color: #00000026;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --text-14: 14px; --text-16: 16px; --text-20: 20px; --text-24: 24px;
  --text-32: 32px; --text-48: 48px; --text-64: 64px;
  --space-1: 8px; --space-2: 16px; --space-3: 24px; --space-4: 32px;
  --space-5: 40px; --space-6: 48px; --space-8: 64px; --space-10: 80px; --space-12: 96px;
  --header-height: calc(48px + var(--space-4) + 1px); --anchor-offset: calc(var(--header-height) + var(--space-2));
  --radius-control: 14px; --radius-panel: 24px; --container: 1200px;
  --shadow: 0 2px 8px var(--shadow-color); --shadow-modal: 0 24px 80px var(--shadow-modal-color);
  --ease: cubic-bezier(.2,.65,.3,1); --duration: 180ms; --spring: cubic-bezier(.34,1.56,.64,1);
  --brand-a03: #ffb70308; --brand-a05: #ffb7030d; --brand-a08: #ffb70314; --brand-a10: #ffb7031a; --brand-a12: #ffb7031f; --brand-a15: #ffb70326;
  --brand-a25: #ffb70340; --brand-a30: #ffb7034d; --brand-a40: #ffb70366; --brand-a50: #ffb70380; --brand-a70: #ffb703b3; --brand-a85: #ffb703d9;
  --highlight: #ffffff4d; --shadow-soft: #0000000f; --shadow-strong: #00000026; --accent-text: var(--ink);
  --glass-bg: var(--surface); --glass-strong: var(--surface); --glass-border: var(--border); --glass-inner: var(--transparent);
  --glass-shadow: none; --glass-blur: 26px;
  --aurora-a: #ffb7035c; --aurora-b: #ffb70329; --aurora-c: #07070712;
  --map-red: #ea4335; --map-blue: #4285f4; --map-green: #34a853; --map-yellow: #fbbc04;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #070707; --ink: #f5f5f5; --muted: #a8a8a8;
  --surface: #151515; --surface-raised: #1b1b1b; --surface-hover: #222222; --solid: #282828;
  --border: #ffffff14; --border-strong: #ffffff33; --focus: #ffb703;
  --header-glass: #070707b3; --menu-glass: #1b1b1bd1; --tint: #ffb7030f; --shadow-color: #00000026; --shadow-modal-color: #00000066;
  --shadow-soft: #00000026; --shadow-strong: #00000040; --accent-text: var(--brand);
  --glass-bg: var(--surface); --glass-strong: var(--surface); --glass-border: var(--border); --glass-inner: var(--transparent);
  --glass-shadow: none; --aurora-a: #ffb7033d; --aurora-b: #ffb7031f; --aurora-c: #ffffff0a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
main, section[id], .anchor-alias, .course-card, .map-status, #discounts { scroll-margin-top: var(--anchor-offset); }
body { margin: 0; color: var(--ink); font: 400 var(--text-16)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button, a { -webkit-tap-highlight-color: var(--transparent); }
button { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3, h4 { font-weight: 600; text-wrap: balance; }
h1 { font-size: var(--text-32); font-weight: 700; line-height: 1.12; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-weight: 800; line-height: 1.15; letter-spacing: -.035em; }
h3 { font-size: var(--text-24); line-height: 1.3; letter-spacing: -.025em; }
h4 { font-size: var(--text-16); line-height: 1.5; }
em { font-style: normal; }
::selection { background: var(--brand); color: var(--button-ink); }
:is(a, button, summary, select, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.icon { display: inline-block; flex: 0 0 auto; width: 20px; height: 20px; vertical-align: middle; stroke: currentColor; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.wrap { width: min(calc(100% - var(--space-4)), var(--container)); margin-inline: auto; }
.section-top { display: flex; flex-direction: column; }
.section-top > p, .section-label { color: var(--muted); font-size: var(--text-16); }
.section-label { margin-bottom: var(--space-1); }
.skip { position: fixed; z-index: 100; top: -100px; left: var(--space-2); padding: var(--space-2); border-radius: var(--radius-control); background: var(--brand); color: var(--button-ink); }
.skip:focus { top: var(--space-2); }
.button, .course-enroll-btn, .button-outline { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-1); min-height: 48px; padding: 8px 16px; border: 1px solid var(--brand); background: var(--brand); color: var(--button-ink); font-size: var(--text-14); font-weight: 600; line-height: 1.5; transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), transform 220ms var(--spring); }
.button:hover { background: var(--brand-hover); }
.text-link, .filters button { transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease), transform 220ms var(--spring); }
:is(.button, .course-enroll-btn, .text-link, .filters button):active { transform: scale(.97); }
.course-enroll-btn, .button-outline { background: var(--surface); color: var(--ink); border-color: var(--border-strong); }
.course-enroll-btn:hover, .button-outline:hover { background: var(--surface-hover); border-color: var(--ink); }
.text-link, .link, .source-link { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 48px; font-size: var(--text-14); font-weight: 500; text-underline-offset: 4px; }
.text-link:hover, .link:hover, .source-link:hover { text-decoration: underline; }
.header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; flex-wrap: wrap; min-height: var(--header-height); padding-block: var(--space-2); background: var(--transparent); }
/* Extend the opaque surface across the viewport without widening the content grid. */
/* The header spans the window (content keeps the container's width through padding), so its frosted glass
   needs no overflow. Opaque where blur is unavailable or the visitor prefers reduced transparency. */
.header.wrap { padding-inline: max(var(--space-2), calc((100% - var(--container)) / 2)); }
.header::before { content: ''; position: absolute; z-index: -1; inset: 0; border-bottom: 1px solid var(--border); pointer-events: none; }
.brand { display: inline-flex; align-items: center; gap: var(--space-1); flex-shrink: 0; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--brand); border-radius: var(--radius-control); }
.brand-mark img { width: 32px; height: 32px; object-fit: contain; filter: brightness(0); }
.brand-name { display: block; font-size: var(--text-20); font-weight: 600; line-height: 1.2; letter-spacing: -.03em; }
.brand-name small { margin-top: 0; font-size: var(--text-14); line-height: 1.5; font-weight: 400; letter-spacing: 0; color: var(--muted); }
/* Phone menu: a drawer from the right under the header row, with a dimmed page behind it. */
#navigation { display: none; position: fixed; z-index: 2; top: 0; right: 0; bottom: 0; width: min(86vw, 360px); padding: calc(var(--header-height) + var(--space-1)) var(--space-2) var(--space-3); overflow-y: auto; overscroll-behavior: contain; background: var(--surface-raised); border-left: 1px solid var(--border); box-shadow: var(--shadow-modal); }
#navigation.open { display: flex; flex-direction: column; align-items: stretch; animation: drawer-in 260ms var(--ease); }
#navigation a + a { border-top: 1px solid var(--border); }
.nav-cta { display: none; }
[data-enhanced="true"] #navigation .nav-cta { display: inline-flex; margin-top: auto; padding-block: var(--space-2); border-top: 0; border-radius: 999px; }
#navigation .nav-cta:hover { background: var(--brand-hover); }
.nav-backdrop { display: none; }
#navigation.open ~ .nav-backdrop { display: block; position: fixed; z-index: 1; inset: 0; background: var(--overlay-glass); animation: backdrop-in 260ms var(--ease); }
.header .menu { position: relative; z-index: 3; }
html:has(#navigation.open) { overflow: hidden; }
html:has(#navigation.open) .contact-fab { display: none; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes backdrop-in { from { opacity: 0; } to { opacity: 1; } }
#navigation a { display: inline-flex; align-items: center; min-height: 56px; padding: 8px 16px; font-size: var(--text-16); font-weight: 600; border-radius: 0; transition: background var(--duration) var(--ease); }
#navigation a:hover { background: var(--surface-hover); }
.theme-toggle, .lang-toggle, .menu { display: none; place-items: center; flex-shrink: 0; padding: 0; border: 1px solid var(--border); transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease); }
.theme-toggle { margin-left: auto; }
.menu .icon-close, .theme-toggle .icon-sun { display: none; }
.menu[aria-expanded="true"] .icon-menu { display: none; }
.menu[aria-expanded="true"] .icon-close { display: inline-block; }
html[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
html[data-theme="dark"] .theme-toggle .icon-sun { display: inline-block; }
[data-enhanced="true"] :is(.theme-toggle, .lang-toggle, .menu) { display: grid; }
.lang-toggle { letter-spacing: .04em; }
.theme-toggle:hover, .lang-toggle:hover, .menu:hover { border-color: var(--border-strong); background: var(--surface-hover); }
html:not([data-enhanced]) #navigation { position: static; display: flex; flex-wrap: wrap; width: 100%; max-height: none; padding: 0; border: 0; box-shadow: none; background: var(--transparent); }
html:not([data-enhanced]) #navigation a + a { border-top: 0; }
html:not([data-enhanced]) .header { position: relative; }
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; border: 1px solid var(--border); color: var(--ink); }
.hero-rings { position: absolute; z-index: 0; top: calc(-1 * var(--space-6)); right: calc(-1 * var(--space-6)); width: 320px; height: 320px; stroke: var(--brand); opacity: .18; pointer-events: none; }
.hero-copy, .hero-visual { position: relative; z-index: 1; }
.hero-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.eyebrow { margin-bottom: var(--space-2); font-size: var(--text-14); font-weight: 500; color: var(--muted); }
.hero .eyebrow { display: inline-flex; align-items: center; gap: var(--space-1); padding: 6px 14px; border: 1px solid var(--brand-a40); border-radius: 999px; background: var(--brand-a08); color: var(--ink); font-weight: 700; font-size: var(--text-14); }
.hero h1 { color: var(--ink); line-height: 1.15; letter-spacing: -.02em; }
/* Key words in headings sit on a solid brand chip: dark text on yellow, the same in both themes. */
.hero .hero-accent, .cashback-section h2 em { display: inline; padding: 0 .18em; margin-inline: -.04em; border-radius: .16em; background: var(--brand); color: var(--on-brand); font-style: normal; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero-description { max-width: 48ch; font-size: var(--text-16); line-height: 1.55; color: var(--muted); }
.hero .hero-description { color: var(--muted); }
.hero .hero-footnote { color: var(--muted); font-size: var(--text-14); }
.hero-footnote a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.hero-footnote { margin-top: var(--space-2); font-size: var(--text-14); color: var(--muted); }
.hero-visual { display: flex; flex-direction: column; min-width: 0; margin: 0; overflow: hidden; border-radius: var(--radius-panel); background: transparent; }
.hero .hero-logo { display: flex; flex-direction: column; justify-content: center; align-items: center; }
.hero-logo img { width: min(100%, 280px); height: auto; }
.hero-reward-banner { width: 100%; border: 1px solid var(--brand-a30); display: flex; flex-direction: column; gap: var(--space-2); text-decoration: none; color: inherit; transition: border-color var(--duration) var(--ease), transform 220ms var(--spring), box-shadow 220ms var(--ease); }
.hero-reward-banner:hover { border-color: var(--brand); box-shadow: 0 8px 24px var(--brand-a15); text-decoration: none; }
.hero-reward-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-1) var(--space-2); }
.hero-reward-tag { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-14); font-weight: 700; color: var(--accent-text); }
.hero-reward-val { white-space: nowrap; font-size: var(--text-16); font-weight: 800; color: var(--ink); }
.hero-reward-pills { display: flex; flex-wrap: wrap; gap: var(--space-1); }
.hero-reward-pills span { white-space: nowrap; padding: 4px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: var(--text-14); font-weight: 600; color: var(--ink); }
.hero-reward-sub { margin: 0; font-size: var(--text-14); color: var(--muted); }
.hero .button { background: var(--brand); border-color: var(--brand); color: var(--on-brand); font-weight: 700; box-shadow: 0 4px 16px var(--brand-a25); }
.hero .button:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.hero .text-link { padding: 10px 18px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); color: var(--ink); font-weight: 600; }
.hero .text-link:hover { border-color: var(--brand); color: var(--accent-text); background: var(--tint); text-decoration: none; }
.hero :is(a, button):focus-visible { outline-color: var(--brand); }

html[data-theme="dark"] .hero { border-color: var(--border); color: var(--ink); }
html[data-theme="dark"] .hero .eyebrow { color: var(--brand); }
html[data-theme="dark"] .hero h1 { color: var(--ink); }
html[data-theme="dark"] .hero .hero-logo { background: var(--surface); border-color: var(--border); }
html[data-theme="dark"] .hero-reward-banner { background: var(--surface-raised); }
html[data-theme="dark"] .hero-reward-val { color: var(--ink); }
html[data-theme="dark"] .hero-reward-pills span { background: var(--paper); border-color: var(--border); color: var(--muted); }
html[data-theme="dark"] .hero .text-link { background: var(--surface-raised); border-color: var(--border-strong); color: var(--ink); }

/* PLAN-038: преимущества из уже опубликованных фактов; Supporter выделен как главное отличие. */
.why-list { display: grid; gap: var(--space-3); margin: 0; padding: 0; list-style: none; }
.why-list li { display: flex; align-items: flex-start; gap: var(--space-3); min-width: 0; padding: var(--space-4) var(--space-3); border: 1px solid var(--border); transition: transform 260ms var(--spring), box-shadow 260ms var(--ease), border-color var(--duration) var(--ease); }
.why-list li:hover { border-color: var(--brand-a40); }
.why-list .practice-icon { flex-shrink: 0; margin-bottom: 0; width: 48px; height: 48px; border-radius: var(--radius-control); background: var(--brand-a08); border: 1px solid var(--brand-a30); color: var(--brand); display: grid; place-items: center; }
.why-list .practice-icon .icon { width: 22px; height: 22px; }
.why-list h3 { margin: 0 0 6px; font-size: var(--text-20); font-weight: 700; color: var(--ink); }
.why-list p { margin: 0; color: var(--muted); font-size: var(--text-14); line-height: 1.5; }

.courses-section { position: relative; }
.contact-fab { position: fixed; z-index: 40; right: var(--space-2); bottom: var(--space-2); place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 24px var(--brand-a40); text-decoration: none; transition: transform 220ms var(--spring), box-shadow var(--duration) var(--ease); }
.contact-fab .icon { width: 24px; height: 24px; }
.contact-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 32px var(--brand-a50); text-decoration: none; }
.contact-fab:focus-visible { outline-color: var(--focus); }
.course-decor { position: absolute; top: var(--space-8); width: 216px; height: 264px; pointer-events: none; z-index: 0; }
.course-decor-left { left: 0; }
.course-decor-right { right: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
/* "Live" dot on label pills: three soft pulses once the page has loaded, then a still dot. */
:is(.hero .eyebrow, .cashback-pill)::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 var(--brand-a50); }
html[data-motion="on"] :is(.hero .eyebrow, .cashback-pill)::before { animation: live-dot 1.6s ease-out 600ms 3; }
@keyframes live-dot { from { box-shadow: 0 0 0 0 var(--brand-a50); } to { box-shadow: 0 0 0 8px var(--transparent); } }
/* Branded error page (assets/errors/404.html). */
.error-page { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: var(--space-2); }
.error-card { width: min(100%, 560px); padding: var(--space-5) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow); text-align: center; }
.error-visual { position: relative; display: grid; place-items: center; height: 200px; margin-bottom: var(--space-3); }
.error-rings { position: absolute; width: 240px; height: 240px; stroke: var(--brand); stroke-width: 2; opacity: .35; }
.error-page .error-mark { position: relative; --tile: 128px; --tilt: -8deg; }
.error-code { display: inline-block; margin-bottom: var(--space-2); padding: 4px 12px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: var(--text-14); font-weight: 700; }
.error-card h1 { margin-bottom: var(--space-1); font-size: var(--text-32); font-weight: 800; }
.error-text { max-width: 40ch; margin-inline: auto; color: var(--muted); }
.error-actions { justify-content: center; }
.error-card { position: relative; }
.error-lang { position: absolute; inset-block-start: var(--space-2); inset-inline-end: var(--space-2); }
html[data-motion="on"] .error-mark { animation: brand-pop 900ms var(--spring) 150ms both; }
html[data-motion="on"] .error-mark svg { animation: brand-talk 1200ms ease-in-out 1050ms 2; }
html[data-motion="on"] .error-rings { animation: error-rings 1200ms var(--ease) both; }
@keyframes error-rings { from { opacity: 0; transform: scale(.7); } to { opacity: .35; transform: scale(1); } }
@media (min-width: 768px) { .error-card { padding: var(--space-6) var(--space-5); } .error-card h1 { font-size: var(--text-48); } }
/* Brand S tiles (brandbook favicon variants). Decorative: they pop in and "speak" twice when the
   courses block is revealed (about 3.5 s, then still); without JS or with reduced motion they simply stand. */
.brand-tile { position: absolute; display: grid; place-items: center; width: var(--tile, 120px); aspect-ratio: 1; border-radius: 22%; box-shadow: var(--shadow); transform: rotate(var(--tilt, 0deg)); }
.brand-tile svg { width: 64%; height: 64%; fill: currentColor; transform-origin: 30% 85%; }
.brand-tile-round { border-radius: 50%; }
.brand-tile-yellow { background: var(--brand); color: var(--on-brand); }
.brand-tile-dark { background: var(--dark-panel); color: var(--brand); }
.brand-tile-outline { background: var(--surface); color: var(--ink); border: 3px solid var(--ink); }
html[data-theme="dark"] .brand-tile-dark { border: 1px solid var(--border-strong); }
.brand-tile-a { --tile: 112px; --tilt: -10deg; --delay: 0ms; top: 0; left: 8px; }
.brand-tile-b { --tile: 80px; --tilt: 8deg; --delay: 150ms; top: 144px; left: 112px; }
.brand-tile-c { --tile: 104px; --tilt: 10deg; --delay: 300ms; top: 16px; right: 8px; }
.brand-tile-d { --tile: 88px; --tilt: -8deg; --delay: 450ms; top: 152px; right: 104px; }
.courses-section.is-revealed .brand-tile { animation: brand-pop 900ms var(--spring) var(--delay) both; }
.courses-section.is-revealed .brand-tile svg { animation: brand-talk 1200ms ease-in-out calc(var(--delay) + 900ms) 2; }
@keyframes brand-pop { from { opacity: 0; transform: translateY(32px) scale(.6) rotate(0deg); } to { opacity: 1; transform: translateY(0) scale(1) rotate(var(--tilt, 0deg)); } }
@keyframes brand-talk { 0%, 100% { transform: scale(1); } 35% { transform: scale(1.1) rotate(-4deg); } 65% { transform: scale(.96) rotate(2deg); } }
@media (min-width: 1024px) { .courses-section { overflow: hidden; } }

.courses-section .section-top { position: relative; z-index: 1; margin-bottom: var(--space-2); }
.courses-section h2 { margin-bottom: var(--space-1); }
.courses-section .section-top p { color: var(--muted); font-size: var(--text-16); margin: 0; }

.catalog-toolbar { position: relative; z-index: 1; display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-1); }
.filters { display: none; flex-wrap: wrap; justify-content: center; gap: var(--space-1); padding: var(--space-1); background: var(--surface); border: 1px solid var(--border); }
[data-enhanced="true"] .filters { display: inline-flex; }
.filters button { min-height: 44px; padding: 0 22px; background: transparent; border: 0; font-size: var(--text-14); font-weight: 600; color: var(--muted); cursor: pointer; transition: all 200ms var(--ease); }
.filters button:hover { color: var(--ink); background: var(--surface-hover); }
.filters button.active { color: var(--on-brand); background: var(--brand); font-weight: 700; }
.filters button[data-filter="all"] { display: none !important; }
/* The category tabs partition the catalogue, so the "all courses" reset stays a separate control. */
.reset-filter { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 18px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font-size: var(--text-14); font-weight: 600; cursor: pointer; transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease); }
.reset-filter:hover { color: var(--ink); border-color: var(--brand); }
.reset-filter[hidden] { display: none; }
.filter-count { display: none; }

/* Phones: swipeable rows that snap card by card, the next card peeking in; a grid again from 768px. */
.course-grid, .cashback-grid { display: flex; gap: var(--space-2); margin-inline: calc(-1 * var(--space-2)); padding: var(--space-1) var(--space-2) var(--space-3); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: var(--space-2); scrollbar-width: none; }
:is(.course-grid, .cashback-grid)::-webkit-scrollbar { display: none; }
.course-grid > *, .cashback-grid > * { flex: 0 0 auto; scroll-snap-align: start; }
.course-grid { position: relative; z-index: 1; }
.course-card { display: flex; flex-direction: column; width: min(88%, 340px); padding: var(--space-1); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-panel); box-shadow: 0 16px 40px var(--shadow-color); overflow: hidden; transition: transform 260ms var(--spring), box-shadow 260ms var(--ease), border-color var(--duration) var(--ease); }
.course-card:hover { transform: translateY(-6px); box-shadow: 0 24px 48px var(--brand-a15); border-color: var(--brand-a50); }
.course-head { padding: 24px 22px; border-radius: var(--radius-control); background: linear-gradient(135deg, var(--brand) 0%, var(--brand-a85) 100%); color: var(--on-brand); position: relative; overflow: hidden; }
.course-head::after { content: ''; position: absolute; top: -30%; right: -20%; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, var(--highlight) 0%, var(--transparent) 70%); pointer-events: none; }
html[data-theme="dark"] .course-head { background: linear-gradient(135deg, var(--surface-raised) 0%, var(--surface) 100%); border: 1px solid var(--brand-a30); color: var(--ink); }
html[data-theme="dark"] .course-head::after { background: radial-gradient(circle, var(--brand-a15) 0%, var(--transparent) 70%); }
.course-card h3 { font-size: var(--text-20); font-weight: 800; line-height: 1.25; margin: 0; letter-spacing: -.01em; }
.course-subtitle { display: block; margin-top: 4px; font-size: var(--text-14); line-height: 1.4; font-weight: 600; opacity: 0.85; }
.course-price { margin-top: 14px; font-size: var(--text-14); font-weight: 600; opacity: 0.9; }
.course-price strong { font-size: var(--text-32); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: inherit; }
html[data-theme="dark"] .course-price strong { color: var(--brand); }
.course-description { padding: 16px 14px 4px; color: var(--muted); font-size: var(--text-14); line-height: 1.55; margin: 0; }
.course-details { display: grid; align-content: start; gap: 12px; margin: 0; padding: 12px 14px 20px; list-style: none; font-size: var(--text-14); flex: 1 1 auto; }
.course-details li { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 10px; line-height: 1.45; color: var(--ink); }
.course-details li > .icon { margin-top: 1px; color: var(--brand); filter: drop-shadow(0 2px 4px var(--brand-a25)); }
.course-card .course-enroll-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; margin: auto 8px 6px; border: 0; font-size: var(--text-16); font-weight: 700; text-decoration: none; box-shadow: 0 6px 20px var(--shadow-soft); transition: all var(--duration) var(--ease); }
.course-card .course-enroll-btn:hover { background: var(--brand); color: var(--on-brand); box-shadow: 0 8px 24px var(--brand-a30); transform: translateY(-2px); }
.course-card:target { animation: course-arrival 2s var(--ease); }
@keyframes course-arrival { 0%, 30% { background: var(--tint); border-color: var(--brand); } 100% { background: var(--surface); border-color: var(--border); } }

.study-step { z-index: 1; top: var(--space-3); left: var(--space-3); border: 0; font-variant-numeric: tabular-nums; }


.practice-list article { display: flex; flex-direction: column; min-width: 0; padding: var(--space-4) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); box-shadow: var(--shadow); transition: transform 260ms var(--spring), box-shadow 260ms var(--ease), border-color var(--duration) var(--ease); }
.practice-list article:hover { border-color: var(--brand-a40); transform: translateY(-4px); box-shadow: 0 12px 28px var(--shadow-soft); }
.practice-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: var(--space-3); border-radius: var(--radius-control); background: var(--brand-a08); border: 1px solid var(--brand-a30); color: var(--brand); }
.practice-icon .icon { width: 24px; height: 24px; }

/* PLAN-042/044: stats, teachers and results come from content.js; demo mode adds the banner and «Пример» tags. */
/* Quiet notice; each placeholder block carries its own «Пример» tag. */
.demo-banner { margin: 0; padding: 4px var(--space-2); border-bottom: 1px solid var(--border); background: var(--surface-hover); color: var(--muted); font-size: var(--text-14); text-align: center; }
.demo-tag { display: inline-block; padding: 2px 8px; border: 1px dashed var(--border-strong); border-radius: 999px; color: var(--muted); font-size: var(--text-14); font-weight: 500; letter-spacing: 0; line-height: 1.5; vertical-align: middle; }
.stats-strip > .demo-tag { display: block; width: max-content; margin: 0 0 var(--space-1) auto; }
.stats-strip dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); color: var(--ink); overflow: hidden; }
.stats-strip div { display: flex; flex-direction: column-reverse; }
.stats-strip dd { margin: 0; font-weight: 800; letter-spacing: -.02em; }
.stats-strip dt { font-size: var(--text-14); font-weight: 500; color: var(--muted); text-transform: lowercase; }
html[data-theme="dark"] .stats-strip dl { background: var(--surface); border-color: var(--border); color: var(--ink); }
html[data-theme="dark"] .stats-strip dt { color: var(--muted); }

.team-grid { display: grid; grid-auto-rows: 1fr; gap: var(--space-2); }
.teacher-card { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); }
/* Initials stand in for teacher photos until real portraits arrive. */
.teacher-photo { display: block; object-fit: cover; transition: transform 320ms var(--spring); }
.teacher-card h3 { letter-spacing: -.01em; }
.teacher-card p { color: var(--muted); font-size: var(--text-14); }
.teacher-chips { display: flex; flex-wrap: wrap; margin: var(--space-2) 0 0; padding: 0; list-style: none; }
.teacher-chips li { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--border-strong); font-size: var(--text-14); line-height: 1.4; }
.teacher-chips .icon { width: 14px; height: 14px; }
.teacher-chips .teacher-chip-key { border-color: var(--brand); background: var(--brand); color: var(--on-brand); font-weight: 600; }
.results-grid { display: grid; gap: var(--space-2); }
.result-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); }
.result-score { display: flex; align-items: center; }
.result-score strong { display: inline-grid; place-items: center; flex: none; background: var(--brand); line-height: 1; letter-spacing: -.02em; }
.result-score span { border-radius: 999px; font-weight: 600; font-size: var(--text-14); }
.result-score small { font-size: var(--text-14); }
.result-card blockquote { color: var(--muted); }
.result-name { margin-top: auto; padding-top: var(--space-2); border-top: 1px solid var(--border); font-weight: 600; font-size: var(--text-14); }

/* Cashback Section */
.cashback-headline { display: flex; flex-direction: column; gap: var(--space-1); }
.cashback-pill { display: inline-flex; align-items: center; gap: var(--space-1); padding: 4px 12px; border-radius: 999px; background: var(--brand-a12); border: 1px solid var(--brand-a40); color: var(--accent-text); font-size: var(--text-14); font-weight: 600; }

.cashback-toolbar { display: none; margin-bottom: var(--space-3); }
[data-enhanced="true"] .cashback-toolbar { display: flex; justify-content: center; }
.cashback-tabs { display: inline-flex; padding: 4px; background: var(--solid); border-radius: var(--radius-control); gap: 4px; }
.cashback-tab { min-height: 44px; padding: 8px 24px; border: 0; border-radius: calc(var(--radius-control) - 4px); background: transparent; color: var(--muted); font-size: var(--text-16); font-weight: 600; cursor: pointer; transition: background var(--duration) var(--ease), color var(--duration) var(--ease); }
.cashback-tab:hover { color: var(--ink); }
.cashback-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.cashback-grid { margin-bottom: var(--space-2); }
/* Wide enough that "1 000 000 сум" stays on one line; the next card still peeks in as the swipe cue. */
.cashback-card { width: min(56%, 200px); }
.cashback-card { position: relative; display: flex; flex-direction: column; justify-content: center; padding: var(--space-4) var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); transition: transform 260ms var(--spring), box-shadow 260ms var(--ease), border-color var(--duration) var(--ease); }
.cashback-card:hover { border-color: var(--brand-a40); }
.cashback-card-max { background: radial-gradient(circle at 100% 0%, var(--brand-a15) 0%, var(--transparent) 70%), var(--surface-raised); border: 2px solid var(--brand); box-shadow: 0 8px 32px var(--brand-a15); }
.cashback-score { font-size: var(--text-32); font-weight: 700; line-height: 1; margin-bottom: var(--space-2); display: flex; align-items: baseline; gap: 6px; }
.cashback-score strong { font-size: var(--text-32); color: var(--accent-text); }
.cashback-card-max .cashback-score strong { text-shadow: 0 0 16px var(--brand-a30); }
.cashback-score span { font-size: var(--text-14); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.cashback-amount { font-size: var(--text-20); font-weight: 700; color: var(--ink); margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: normal; }
.cashback-amount-max { font-size: var(--text-20); color: var(--accent-text); }

/* Exams */
details { min-width: 0; }
summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 44px; padding: 10px 14px; border-radius: var(--radius-control); background: var(--surface-hover); border: 1px solid var(--border); list-style: none; font-size: var(--text-14); font-weight: 600; color: var(--ink); transition: all var(--duration) var(--ease); }
summary::-webkit-details-marker { display: none; }
summary::marker { content: ''; }
summary:hover { border-color: var(--brand); color: var(--accent-text); background: var(--tint); }
summary > .icon { margin-left: auto; transition: transform var(--duration) var(--ease); color: var(--brand); }
details[open] > summary > .icon { transform: rotate(45deg); }
.exam-more-content { padding-top: var(--space-3); color: var(--muted); font-size: var(--text-14); line-height: 1.55; }
.exam-more-content p { margin-bottom: var(--space-2); }
.exam-more-content ul { padding-left: var(--space-3); margin-block: var(--space-2); }
.exam-metrics { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-bottom: var(--space-3); padding-block: var(--space-2); border-block: 1px solid var(--border); }
.exam-metrics span { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; background: var(--brand-a10); border: 1px solid var(--brand-a30); color: var(--accent-text); font-weight: 700; font-size: var(--text-14); }
.exam-sources { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.source-link { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--surface-hover); border: 1px solid var(--border); color: var(--ink); font-size: var(--text-14); font-weight: 500; text-decoration: none; transition: all var(--duration) var(--ease); }
.source-link:hover { border-color: var(--brand); color: var(--accent-text); background: var(--tint); }
.source-link .icon { width: 14px; height: 14px; color: var(--muted); }
.source-link:hover .icon { color: var(--brand); }
.table-scroll { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--border); border-radius: var(--radius-control); margin-block: var(--space-2); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: var(--text-14); }
.data-table :is(th, td) { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.data-table th { font-weight: 700; color: var(--ink); }
.data-table thead { background: var(--surface-hover); }
.data-table caption { padding: 10px 14px; text-align: left; font-weight: 600; font-size: var(--text-14); color: var(--muted); }
/* Inline so the arrow follows the last word of a wrapped name instead of the column edge. */
.faq { display: grid; gap: var(--space-3); }
.faq > div:first-child > p { max-width: 44ch; margin-top: var(--space-2); color: var(--muted); font-size: var(--text-16); }
.faq-list { display: grid; gap: var(--space-1); counter-reset: faq; }
.faq-num::before { counter-increment: faq; content: counter(faq, decimal-leading-zero); }
.faq-list details { border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); transition: border-color var(--duration) var(--ease); }
.faq-list details[open] { border-color: var(--border-strong); }
.faq-list details[open] summary { box-shadow: inset 0 -3px 0 0 var(--brand); }
.faq-list summary { padding: var(--space-2); font-size: var(--text-16); }
.faq-list summary > .faq-num { flex-shrink: 0; color: var(--muted); font-size: var(--text-14); font-variant-numeric: tabular-nums; }
.faq-list details > p { padding: 0 var(--space-2) var(--space-3); font-size: var(--text-16); color: var(--muted); }
/* Exam details moved into the FAQ: keep the answer body aligned with the other answers. */
.faq-exam { min-width: 0; }
.faq-exam .exam-more-content { padding: 0 var(--space-2) var(--space-3); }
.contact-jump { margin: var(--space-2) 0 0; }
.contact-section { position: relative; }
.anchor-alias { position: absolute; top: 0; }
.contact-layout { display: grid; gap: var(--space-3); }
.contact-layout > p { max-width: 64ch; color: var(--muted); font-size: var(--text-16); }
.contact-layout > [data-contact-slot] { border-radius: var(--radius-panel); }
.contact-channels { grid-template-columns: minmax(0, 1fr); }
.contact-group { display: flex; flex-direction: column; border-radius: var(--radius-control); }
.contact-label { margin: 0; font-size: var(--text-14); line-height: 1.4; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.contact-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.contact-channel { display: inline-flex; align-items: center; gap: 10px; width: 100%; border: 1px solid var(--border); color: var(--ink); font-size: var(--text-16); font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease), transform var(--duration) var(--ease), color var(--duration) var(--ease); }
.contact-channel:hover { border-color: var(--brand); background: var(--tint); color: var(--accent-text); text-decoration: none; transform: translateY(-1px); }
.contact-channel .icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--brand); }
.contact-channel .icon-external { width: 14px; height: 14px; margin-left: auto; color: var(--muted); opacity: 0.7; }
.contact-channel:hover .icon-external { color: var(--brand); opacity: 1; }
.contact-extras { display: flex; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--border); }
.contact-extras a { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-14); font-weight: 500; color: var(--ink); text-decoration: none; transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease), color var(--duration) var(--ease); }
.contact-extras a:hover { border-color: var(--brand); color: var(--accent-text); background: var(--tint); text-decoration: none; }
.contact-extras a .icon { width: 16px; height: 16px; color: var(--brand); flex-shrink: 0; }
.contact-extras a .icon-external { width: 12px; height: 12px; color: var(--muted); }
.contact-extras a:hover .icon-external { color: var(--brand); }
.contact-extra { display: inline-flex; align-items: center; flex-wrap: wrap; gap: var(--space-1); color: var(--muted); font-size: var(--text-14); }
.contact-locations { margin-top: var(--space-5); }
.contact-locations > h3 { margin-bottom: var(--space-3); font-size: var(--text-24); }
.location-map-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.location-grid { display: flex; flex-direction: column; gap: var(--space-2); border-radius: var(--radius-panel); }

/* Option 2: Interactive Tabs & Active Branch Showcase */
.location-card {
  position: relative;
  display: flex;
  flex-direction: column;
  
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface-hover);
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

/* Inactive tabs */
.location-card:not(:has([aria-pressed="true"])) {
  min-height: 48px;
  justify-content: center;
}
.location-card:not(:has([aria-pressed="true"])):hover {
  border-color: var(--brand-a40);
  background: var(--brand-a05);
}
.location-card:not(:has([aria-pressed="true"])) h4 {
  margin: 0;
  font-size: var(--text-16);
  font-weight: 600;
  color: var(--muted);
  transition: color var(--duration) var(--ease);
}
.location-card:not(:has([aria-pressed="true"])):hover h4 {
  color: var(--ink);
}
.location-card:has(.location-select):not(:has([aria-pressed="true"])) > :is(p, .map-links, .location-photo, .location-photo-link) {
  display: none;
}

/* Active tab */
.location-card:has([aria-pressed="true"]) {
  background: var(--surface);
  border: 2px solid var(--brand);
  box-shadow: 0 4px 20px var(--brand-a10);
  padding: var(--space-3);
}
.location-card:has([aria-pressed="true"]) h4 {
  margin: 0 0 6px;
  font-size: var(--text-20);
  font-weight: 700;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.location-card:has([aria-pressed="true"]) h4::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand-a70);
  display: inline-block;
  flex-shrink: 0;
}
.location-card:has([aria-pressed="true"]) > p {
  margin: 0 0 var(--space-2);
  color: var(--muted);
  font-size: var(--text-14);
  line-height: 1.5;
}

/* Hide demo placeholder photo so no grey wireframe box is visible */
.location-photo-demo { display: none !important; }
.location-photo:not(.location-photo-demo) {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-control);
  object-fit: cover;
  margin-bottom: var(--space-2);
}

/* Route buttons */
.map-links {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.map-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  
  
  
  
  
  color: var(--ink);
  font-size: var(--text-14);
  font-weight: 600;
  text-decoration: none;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.map-links a:hover {
  border-color: var(--brand);
  color: var(--accent-text);
  background: var(--tint);
  text-decoration: none;
}
.map-links a .icon {
  width: 14px;
  height: 14px;
  color: var(--muted);
  transition: color var(--duration) var(--ease);
}
.map-links a:hover .icon {
  color: var(--brand);
}

/* Clickable overlay button for tab switching */
.location-select {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  height: 100%;
  padding-right: var(--space-3);
  border: 0;
  border-radius: 0;
  background: var(--transparent);
  cursor: pointer;
}
[data-enhanced="true"] .location-select { display: flex; }
.location-select:focus-visible { outline-offset: -4px; }
.location-select .icon {
  color: var(--muted);
  transition: transform var(--duration) var(--ease), color var(--duration) var(--ease);
}
.location-card:hover .location-select .icon {
  color: var(--brand);
}
.location-card:has([aria-pressed="true"]) .location-select {
  pointer-events: none;
}
/* The open branch needs no arrow: it already shows its address, photo and routes. */
.location-card:has([aria-pressed="true"]) .location-select .icon {
  display: none;
}

/* Map panel */
.branch-map-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  
  overflow: hidden;
}
.map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px var(--space-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.map-toolbar::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 8px var(--brand-a70);
  flex-shrink: 0;
}
.map-status {
  margin: 0;
  max-width: 60ch;
  font-size: var(--text-14);
  font-weight: 600;
  color: var(--ink);
}
.map-status:focus-visible { outline-offset: 0; }
.branch-map {
  display: block;
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 220px;
  min-height: 220px;
  border: 0;
  background: var(--solid);
}
.contact-unavailable { font-size: var(--text-14); color: var(--muted); }
.contact-unavailable strong { color: var(--ink); }
footer { margin-top: var(--space-4); padding-block: var(--space-4) calc(56px + var(--space-4)); border-top: 1px solid var(--border); background: var(--surface); color: var(--ink); }
.footer-main { display: flex; align-items: flex-start; flex-direction: column; }
.footer-name { font-size: var(--text-14); font-weight: 500; }
.footer-brand { display: inline-flex; align-items: center; gap: var(--space-2); }
.brand-mark-footer { width: 32px; height: 32px; }
.brand-mark-footer img { width: 24px; height: 24px; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--space-3); font-size: var(--text-14); color: var(--muted); }
.footer-links a { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 48px; }
.footer-links a:hover { color: var(--ink); }
.modal-backdrop { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: var(--space-1); border: 0; background: var(--transparent); color: var(--ink); }
.modal-backdrop:not([open]) { display: none; }
.modal-backdrop[open] { display: grid; place-items: center; }
.modal-card { display: flex; flex-direction: column; width: min(640px, 100%); max-height: calc(100dvh - 16px); overflow: hidden; border: 1px solid var(--border-strong); box-shadow: var(--shadow-modal); }
.modal-topbar { display: flex; flex-shrink: 0; align-items: flex-start; gap: var(--space-2); border-bottom: 1px solid var(--border); }
.modal-header { min-width: 0; }
.modal-header h2 { font-size: var(--text-24); }
.modal-header p { margin-top: var(--space-1); color: var(--muted); font-size: var(--text-16); }
.modal-close { display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 48px; margin-left: auto; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); }
.modal-close:hover { background: var(--surface-hover); }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.modal-card label { display: block; margin-bottom: var(--space-1); font-size: var(--text-14); font-weight: 600; }
.modal-card select { width: 100%; min-height: 48px; padding: 8px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface); font-size: var(--text-16); }
.selected-course { margin-block: var(--space-3); }
.selected-course h3 { margin-bottom: var(--space-2); font-size: var(--text-24); }
.selected-course p, .selected-course ul { color: var(--muted); font-size: var(--text-16); }
.selected-course ul { padding-left: var(--space-3); margin-block: var(--space-2); }
.selected-course li { margin-block: var(--space-1); }
.dialog-prices { display: grid; gap: var(--space-2); margin-block: var(--space-3) var(--space-2); }
.dialog-prices > div { padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); }
.dialog-prices dt { font-size: var(--text-14); color: var(--muted); }
.dialog-prices dd { margin: var(--space-1) 0 0; font-size: var(--text-24); font-weight: 600; font-variant-numeric: tabular-nums; }
.dialog-prices dd span { display: block; font-size: var(--text-14); font-weight: 400; color: var(--muted); }
.dialog-catalog-link, .dialog-exam-link { margin: var(--space-1) var(--space-2) 0 0; }
.modal-backdrop[open] .modal-card { animation: panel-enter 200ms var(--ease); }
/* PLAN-050: the phone menu and the page behind the course dialog are frosted too; the dialog card itself stays solid. */
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  #navigation { background: var(--menu-glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); }
}
details[open] > :not(summary) { animation: content-enter 180ms var(--ease); }
[data-reveal].is-revealed { animation: content-enter 200ms var(--ease) both; }
[data-reveal]:is(:target, :focus-within) { animation: none; }
/* PLAN-047: grids appear item by item. Only setupMotion adds .stagger, so without JS everything is visible;
   items also show at once for keyboard focus or a link target inside. "backwards" keeps hover transitions intact. */
.stagger > * { opacity: 1; }
/* PLAN-048: the first screen enters in sequence; data-motion is set in <head> only when motion is allowed. */
/* The hero text is visible from the first frame (fast LCP) and only slides in; the picture still fades. */
[data-motion="on"] .hero-copy > * { animation: hero-slide 600ms var(--ease) backwards; }
[data-motion="on"] .hero-visual { animation: hero-in 700ms var(--ease) backwards; }
[data-motion="on"] .hero-copy > :nth-child(2) { animation-delay: 80ms; }
[data-motion="on"] .hero-copy > :nth-child(3) { animation-delay: 160ms; }
[data-motion="on"] .hero-copy > :nth-child(4) { animation-delay: 240ms; }
[data-motion="on"] .hero-copy > :nth-child(5) { animation-delay: 320ms; }
[data-motion="on"] .hero-visual { animation-delay: 200ms; }
@keyframes hero-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes hero-slide { from { transform: translateY(12px); } to { transform: none; } }
#navigation a[aria-current="location"] { color: var(--ink); background: var(--surface-hover); box-shadow: inset 0 -2px 0 var(--brand); }
.stats-strip dd { font-variant-numeric: tabular-nums; }
/* Smooth disclosure where the browser can animate to height: auto; elsewhere it opens instantly as before. */
@supports (interpolate-size: allow-keywords) {
  html { interpolate-size: allow-keywords; }
  details::details-content { block-size: 0; overflow: clip; transition: block-size 300ms var(--ease), content-visibility 300ms allow-discrete; }
  details[open]::details-content { block-size: auto; }
}
@media print { .stagger > * { opacity: 1 !important; transform: none !important; } }
@keyframes panel-enter { from { opacity: .7; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes content-enter { from { opacity: .65; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (min-width: 768px) {
  .course-grid, .cashback-grid { margin-inline: 0; padding: 0; overflow: visible; scroll-snap-type: none; }
  .course-grid { flex-wrap: wrap; justify-content: center; }
  .course-card { flex: 0 1 360px; width: 100%; max-width: 380px; min-width: 290px; }
  .cashback-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: var(--space-3); }
  .cashback-card { width: auto; }
  footer { padding-block: var(--space-4); }
  .wrap { width: min(calc(100% - var(--space-8)), var(--container)); }
  .header.wrap { padding-inline: max(var(--space-4), calc((100% - var(--container)) / 2)); }
  h1 { font-size: var(--text-48); }
  .hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-strip dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-strip div + div { border-left: 1px solid var(--border); }
  .team-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-3); }
  .results-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: var(--space-3); }
  .why-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
  .why-list li { padding: var(--space-3); }
  .hero-description { font-size: var(--text-20); }
  .data-table :is(th, td) { padding-inline: var(--space-2); }
  .contact-channels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .branch-map { height: 250px; min-height: 250px; }
  .footer-main { flex-direction: row; align-items: center; justify-content: space-between; }
  .modal-backdrop { padding: var(--space-3); }
  .modal-card { max-height: calc(100dvh - 48px); }
}
@media (min-width: 1024px) {
  .hero-copy { justify-content: center; }
  .hero .actions :is(.button, .text-link) { min-height: 56px; padding-inline: var(--space-3); font-size: var(--text-16); }
  .why-list { grid-auto-rows: 1fr; }
  .why-list li { flex-direction: column; }
  .why-list .practice-icon { margin-bottom: var(--space-1); }
  .team-grid { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
  .faq { grid-template-columns: minmax(0, .7fr) minmax(0, 1.3fr); gap: var(--space-8); }
  .location-map-layout { align-items: stretch; }
  .location-grid { align-content: start; }
  .branch-map { height: 100%; min-height: 250px; }
}
/* Keep the existing JavaScript navigation breakpoint (1050px). */
@media (min-width: 1051px) {
  .header { flex-wrap: nowrap; }
  #navigation, html:not([data-enhanced]) #navigation { position: static; display: flex; align-items: center; flex-direction: row; width: auto; max-height: none; padding: 0; margin-left: auto; background: var(--transparent); border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none }
  #navigation a { min-height: 48px; padding-inline: var(--space-1); font-size: var(--text-14); font-weight: 500; border-radius: var(--radius-control); }
  #navigation a + a { border-top: 0; }
  #navigation, #navigation.open { width: auto; overflow: visible; animation: none; }
  [data-enhanced="true"] #navigation .nav-cta { display: none; }
  .theme-toggle { margin-left: 0; }
  [data-enhanced="true"] .menu { display: none; }
}
@media (min-width: 1280px) {
  .why-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  h1 { font-size: var(--text-64); }
  #navigation a { padding-inline: var(--space-2); }
}
@media (hover: hover) { .course-card:hover, .course-card:focus-within { border-color: var(--border-strong); } }
/* PLAN-048: a light spring lift on pointer devices; cards settle back with a small overshoot. */
:is(.why-list li, .teacher-card, .result-card, .cashback-card) { transition: transform 260ms var(--spring), box-shadow 260ms var(--ease); }
@media (hover: hover) {
  :is(.button, .course-enroll-btn, .text-link, .filters button, .hero-cashback-link):hover { transform: translateY(-2px); }
  :is(.course-card, .why-list li, .teacher-card, .result-card, .cashback-card):hover { transform: translateY(-4px); box-shadow: var(--shadow); }
  .teacher-card:hover .teacher-photo { transform: scale(1.05); }
}
@media (prefers-reduced-transparency: reduce) {
  #navigation { background: var(--surface-raised); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  :is(.button, .course-enroll-btn, .text-link, .filters button, .hero-cashback-link, .course-card, .why-list li, .teacher-card, .result-card, .cashback-card, .teacher-photo) { transform: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   Lively content sections: photo-led practice cards, a new
   "how to start" timeline, partners and the results page.
   All motion is finite and switches off with reduced motion.
   ============================================================ */

/* Practice: large illustrated cards that later take real photos. */
.practice-section .section-top { margin-bottom: var(--space-3); }
.practice-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--space-3); }
.practice-list .practice-card {
  
  
  
  
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-inner);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  transition: transform 320ms var(--spring), border-color var(--duration) var(--ease);
}
.practice-list .practice-card:hover { transform: translateY(-5px); border-color: var(--brand-a40); }
.practice-media { overflow: hidden; background: var(--surface-hover); }
.practice-media img { transition: transform 700ms var(--ease); }
.practice-list .practice-card:hover .practice-media img { transform: scale(1.05); }
.practice-body { display: flex; flex-direction: column; gap: 6px; }
.practice-kicker {
  font-size: var(--text-14);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent-text);
}
.practice-body p { color: var(--muted); font-size: var(--text-16); line-height: 1.5; }

/* "How to start": the level test comes first, then the trial lesson, then the group. */
.study-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.study-steps li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  
  
  border-radius: 24px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-inner);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  transition: transform 280ms var(--spring), border-color var(--duration) var(--ease);
}
.study-steps li:hover { transform: translateY(-4px); border-color: var(--brand-a40); }
.study-step {
  position: static;
  display: grid;
  place-items: center;
  
  
  border-radius: 50%;
  
  color: var(--on-brand);
  
  font-weight: 800;
  letter-spacing: -.02em;
  
}
.study-step-body h3 { margin-bottom: 4px; }
.study-step-body p { max-width: 62ch; color: var(--muted); font-size: var(--text-16); line-height: 1.55; }
@media (min-width: 1024px) {
  .study-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .study-steps li { grid-template-columns: minmax(0, 1fr); }
  .study-step { margin-bottom: var(--space-1); }
}

/* Partner and exam resources from the owner. */
.partners-grid { display: grid; gap: var(--space-2); }
.partner-card {
  display: flex;
  
  
  
  border-radius: 22px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-inner);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  transition: transform 280ms var(--spring), border-color var(--duration) var(--ease);
}
.partner-card:hover { transform: translateY(-4px); border-color: var(--brand-a40); }
.partner-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.partner-body strong { font-size: var(--text-16); }
.partner-body span { color: var(--muted); font-size: var(--text-14); line-height: 1.4; }
.partner-card .icon-external { margin-left: auto; color: var(--muted); }

.results-more { margin-top: var(--space-3); }

/* Phones: card rows scroll and rotate one by one (set up in script.js / results.js). */
@media (max-width: 767px) {
  :is(.team-grid, .practice-list, .results-grid) {
    display: flex;
    gap: var(--space-2);
    margin-inline: calc(-1 * var(--space-2));
    padding: var(--space-1) var(--space-2) var(--space-3);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--space-2);
    scrollbar-width: none;
  }
  :is(.team-grid, .practice-list, .results-grid)::-webkit-scrollbar { display: none; }
  :is(.team-grid, .practice-list, .results-grid) > * { flex: 0 0 auto; scroll-snap-align: start; }
  .team-grid .teacher-card { width: min(80vw, 320px); }
  .practice-list .practice-card { width: min(84vw, 360px); }
  .results-grid .result-card { width: min(84vw, 360px); }
}

/* Full results page. */
/* Full directories use a readable catalogue, independently of home carousels. */
.directory-nav a { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.directory-nav a[aria-current=page] { border-color: var(--brand); }
.directory-nav a:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.directory-page :is(.team-grid, .results-grid-page) { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); margin-inline: 0; padding: 0; overflow: visible; scroll-snap-type: none; }
.directory-page :is(.teacher-card, .result-card) { width: 100%; min-width: 0; border-radius: 24px; overflow: hidden; }
.directory-page .teacher-card { flex-direction: column; }
.directory-page :is(.teacher-photo, .teacher-initials) { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.directory-page .teacher-body { flex: 1; }
.directory-page .result-card { display: flex; flex-direction: column; }
.directory-page .result-score { border-radius: 20px; }
.directory-page .result-score :is(strong, span, small) { color: inherit; }
.directory-page .result-name { padding-top: var(--space-2); border-top: 1px solid var(--border); }
@media (min-width: 700px) {
  .directory-page :is(.team-grid, .results-grid-page) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1100px) {
  .directory-page :is(.team-grid, .results-grid-page) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.results-grid-page .result-card { animation: card-rise 520ms var(--ease) both; }
.results-grid-page .result-card:nth-child(2) { animation-delay: 60ms; }
.results-grid-page .result-card:nth-child(3) { animation-delay: 120ms; }
.results-grid-page .result-card:nth-child(4) { animation-delay: 180ms; }
@keyframes card-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.results-page-note { display: flex; }
.results-back { margin-left: auto; }
.results-header .theme-toggle { margin-left: 0; }
.results-back-label { white-space: nowrap; }
@media (max-width: 560px) {
  .results-back { padding-inline: 12px; }
  .results-back-label { display: none; }
}

/* The new surfaces follow the same reduced-transparency rule as the glass layer. */
@media (prefers-reduced-transparency: reduce) {
  html[data-theme] :is(.practice-list .practice-card, .study-steps li, .partner-card) {
    background: var(--surface) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
  }
  html[data-theme] body::before { display: none; }
}

/* Official partner logos sit on a white plate so every brand keeps its own colours. */
.partners-grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 768px) { .partners-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .partners-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.partner-card { position: relative; }
.partner-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  
  
  
  
  
  
}
.partner-logo img { width: auto; height: auto; object-fit: contain; }
.partner-card .icon-external { position: absolute; }

/* Dark-theme polish: brand-coloured course headers read better than nested dark panels,
   and the partner cards keep their official logos compact instead of a full-width white bar. */
html[data-theme] .header::before { background: var(--glass-strong); }

html[data-theme] .course-head {
  border: 0;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-a85) 100%);
  color: var(--on-brand);
}
html[data-theme] .course-head::after { background: radial-gradient(circle, var(--highlight) 0%, transparent 70%); }
html[data-theme] .course-head .course-price strong { color: var(--on-brand); }

.partner-logo {
  flex: 0 0 auto;
  width: auto;
  min-height: 0;
  
  
  background: #ffffff;
  
}
.partner-body { flex: 1 1 auto; }
.partner-card .icon-external { top: 14px; right: 14px; }

/* Corner polish: the stats glass lives on the rounded dl, not on an unrounded wrapper. */
.faq-list summary { border-radius: calc(var(--radius-control) - 2px); }

/* Phones: courses are a centred vertical list; only the practice/teacher/result rows rotate. */
@media (max-width: 767px) {
  .course-grid {
    
    flex-direction: column;
    
    
    
    
    
  }
  .course-grid > * { width: 100%; max-width: none; scroll-snap-align: none; }
  html[data-theme] .contact-fab { display: none; }
  html[data-theme] footer { padding-bottom: calc(56px + var(--space-4)); }
}

/* ============================================================
   Career application form.
   ============================================================ */
.career-page { max-width: 980px; margin-inline: auto; }
.career-head p a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.career-form,
.career-result {
  max-width: 880px;
  margin-inline: auto;
  
  border: 1px solid var(--glass-border);
  
  
  
  
  
}
.career-form { display: grid; }
.career-block { min-width: 0; margin: 0; padding: 0; border: 0; display: grid; gap: var(--space-3); }
.career-block legend {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0;
  margin-bottom: var(--space-1);
  font-size: var(--text-20);
  font-weight: 700;
}
.career-step {
  display: grid;
  place-items: center;
  
  
  border-radius: 50%;
  
  color: var(--on-brand);
  font-size: var(--text-14);
  font-weight: 800;
  
}
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.form-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.form-field label { font-size: var(--text-14); font-weight: 600; color: var(--ink); }
.required { color: var(--accent-text); }
.form-field :is(input, select, textarea) {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--glass-bg);
  color: var(--ink);
  font: inherit;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease);
}
.form-field textarea { min-height: 140px; resize: vertical; line-height: 1.55; }
.form-field :is(input, select, textarea)::placeholder { color: var(--muted); }
.form-field :is(input, select, textarea):hover { border-color: var(--border-strong); }
.form-field :is(input, select, textarea):focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  
  
  border-radius: 14px;
  
  font-size: var(--text-16);
  line-height: 1.5;
}
.checkbox-field input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: 0 0 auto; }
.field-hint { margin: 0; font-size: var(--text-14); color: var(--muted); text-align: right; }
.career-actions { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-2); }
.form-note { margin: 0; max-width: 56ch; color: var(--muted); font-size: var(--text-14); line-height: 1.5; }
.form-note a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.career-result { display: grid; gap: var(--space-3); }
.career-result .section-top { margin-bottom: 0; }
.career-home { justify-self: start; }
.career-phone { display: flex; align-items: center; border: 1px solid var(--glass-border); border-radius: 14px; background: var(--glass-bg); overflow: hidden; }
.career-phone > span { padding-left: var(--space-2); font-weight: 600; color: var(--ink); }
.form-field .career-phone input { min-width: 0; border: 0; border-radius: 0; background: transparent; }
.career-phone:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.form-field .career-phone input:focus-visible { outline: none; }
@media (min-width: 768px) {
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Career form extras: file input, preview, honeypot and sending states. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.photo-preview { display: flex; align-items: flex-end; gap: var(--space-2); margin-top: 4px; }
.photo-preview img {
  width: 120px;
  height: 150px;
  object-fit: cover;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: var(--surface);
}
#career-status { min-height: 1.5em; }
#career-status[data-kind="error"] { color: var(--accent-text); font-weight: 600; }
.button[disabled] { opacity: .65; cursor: progress; }

/* Profile photo card at the top of the career form. */
.career-photo-card {
  display: flex;
  align-items: center;
  
  
  
  
  
  
}
.career-photo-frame {
  display: grid;
  place-items: center;
  
  
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  
  background: var(--surface);
  color: var(--muted);
}
.career-photo-frame img { width: 100%; height: 100%; object-fit: cover; }
.career-photo-empty { display: grid; place-items: center; width: 100%; height: 100%; background: var(--surface-hover); }
.career-photo-body { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.career-photo-label { font-size: var(--text-14); font-weight: 600; }
.career-photo-body .field-hint { text-align: left; }
.career-photo-actions { display: flex; flex-wrap: wrap; align-items: center; }

/* Compact profile photo: a small portrait tile and one row of actions. */
.career-photo-card { gap: var(--space-3); }
.career-photo-frame { width: 84px; height: 105px; border-radius: 12px; }
.career-photo-frame .icon { width: 32px; height: 32px; }
.career-photo-frame img { border-radius: 12px; }
.career-photo-body { gap: 2px; }
.career-photo-actions { gap: var(--space-1); }
.career-photo-choose {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: var(--text-14);
  font-weight: 600;
  cursor: pointer;
}
#cf-photo:focus-visible ~ .career-photo-choose { outline: 3px solid var(--focus); outline-offset: 2px; }
.career-photo-card .text-link { min-height: 44px; }
@media (max-width: 519px) {
  .career-photo-card { flex-direction: row; align-items: center; }
  .career-photo-frame { width: 72px; height: 90px; }
}

/* ===== Reusable showcase parts (assets/ui.js): pill navigation, text loop, rolling counters, profile cards,
   lanyard badge and scroll band. Patterns after React Bits, rebuilt in plain CSS; all motion is decoration. ===== */

/* Pill navigation: a dark circle rises from below the pill under the pointer. */
.directory-nav { display: flex; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%; border: 1px solid var(--border); background: var(--surface); }
.directory-nav a { position: relative; isolation: isolate; overflow: hidden; min-height: 44px; border: 0; background: var(--transparent); font-size: var(--text-14); font-weight: 600; transition: color var(--duration) var(--ease); }
.directory-nav a::before { content: ''; position: absolute; z-index: -1; left: 50%; bottom: 0; width: 130%; aspect-ratio: 1; border-radius: 50%; background: var(--dark-panel); transform: translate(-50%, 105%); transition: transform 420ms var(--ease); }
.directory-nav a[aria-current=page] { background: var(--brand); color: var(--on-brand); }
.directory-nav a[aria-current=page]::before { display: none; }
@media (hover: hover) {
  .directory-nav a:not([aria-current]):hover { color: var(--on-dark); text-decoration: none; }
  .directory-nav a:not([aria-current]):hover::before { transform: translate(-50%, 38%); }
}
html[data-theme="dark"] .directory-nav a::before { background: var(--on-dark); }
@media (hover: hover) { html[data-theme="dark"] .directory-nav a:not([aria-current]):hover { color: var(--dark-panel); } }

/* Results hero */
.directory-page :is(.teacher-body, .result-card, .results-hero-copy) { overflow-wrap: anywhere; }
.directory-page :is(.teacher-chips, .result-score) { max-width: 100%; flex-wrap: wrap; }
.directory-page .text-loop { max-width: 100%; }
.directory-page .text-loop > span { white-space: normal; }
.results-hero { position: relative; gap: var(--space-4); overflow: hidden; }
.results-hero-copy { display: grid; justify-items: start; min-width: 0; }
.results-hero h1 { line-height: 1.1; letter-spacing: -.04em; }
.results-hero-copy > p:not(.text-loop) { max-width: 52ch; color: var(--muted); line-height: 1.65; }

/* Text loop: the active word sits in the chip, the previous one leaves upwards. */
.text-loop { display: inline-grid; align-items: center; min-height: 48px; padding: 0 var(--space-2); border-radius: var(--radius-control); background: var(--brand); color: var(--on-brand); font-size: var(--text-20); font-weight: 800; letter-spacing: -.02em; overflow: hidden; }
.text-loop > span { grid-area: 1 / 1; white-space: nowrap; transition: transform 450ms var(--spring), opacity 300ms var(--ease); }
.text-loop > span:not(.is-active) { opacity: 0; transform: translateY(110%); }
.text-loop > span.is-leaving { transform: translateY(-110%); }

/* Rolling counters */
.score-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin: var(--space-1) 0 0; }
.score-tiles > div { display: flex; flex-direction: column-reverse; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-raised); }
.score-tiles dt { color: var(--muted); font-size: var(--text-14); font-weight: 600; }
.score-tiles dd { margin: 0; font-size: var(--text-32); font-weight: 800; line-height: 1.1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.roll { display: inline-flex; height: 1.1em; overflow: hidden; }
.roll-digit { display: inline-block; height: 1.1em; }
.roll-strip { display: flex; flex-direction: column; transition: transform 1100ms var(--ease); }
.roll-strip > span { height: 1.1em; line-height: 1.1; }

/* Lanyard badge: desktop decoration that settles after a short swing. */
.lanyard { display: none; }
.lanyard-strap { width: 16px; height: 132px; border-inline: 4px solid var(--brand); background: var(--dark-panel); }
.lanyard-clip { width: 30px; height: 18px; margin-top: -2px; border: 3px solid var(--muted); border-radius: 6px; background: var(--surface); }
.lanyard-card { position: relative; display: grid; justify-items: center; gap: 4px; width: 220px; margin-top: -4px; padding: var(--space-5) var(--space-3) var(--space-3); border: 1px solid var(--border-strong); border-radius: 24px; background: var(--dark-panel); color: var(--on-dark); box-shadow: var(--shadow-modal); text-align: center; }
.lanyard-hole { position: absolute; top: 12px; width: 44px; height: 8px; border-radius: 999px; background: var(--on-dark-muted); opacity: .5; }
.lanyard-logo { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: var(--space-1); border-radius: 22%; background: var(--brand); }
.lanyard-logo img { width: 48px; height: 48px; filter: brightness(0); }
.lanyard-card strong { font-size: var(--text-24); letter-spacing: -.03em; }
.lanyard-card small { color: var(--on-dark-muted); font-size: var(--text-14); }
.lanyard-score { margin-top: var(--space-2); padding: 6px 16px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-weight: 800; }
@keyframes lanyard-swing { 0% { transform: rotate(14deg); } 25% { transform: rotate(-9deg); } 50% { transform: rotate(5deg); } 75% { transform: rotate(-2deg); } 100% { transform: rotate(0deg); } }

/* Profile cards of the full results list */
:is(.results-grid-page .result-card, .directory-page .teacher-card[data-tilt]) { position: relative; isolation: isolate; animation-fill-mode: backwards; transform: perspective(900px) translateY(var(--lift, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform 280ms var(--ease), box-shadow 280ms var(--ease), border-color 280ms var(--ease); }
:is(.results-grid-page .result-card, .directory-page .teacher-card[data-tilt]).is-tilting { transition-duration: 80ms, 280ms, 280ms; border-color: var(--brand-a50); }
@media (hover: hover) { :is(.results-grid-page .result-card, .directory-page .teacher-card[data-tilt]):hover { --lift: -4px; transform: perspective(900px) translateY(var(--lift, 0px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); } }
.result-shine { position: absolute; z-index: -1; inset: 0; border-radius: inherit; background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), var(--brand-a25), var(--transparent) 55%); opacity: 0; pointer-events: none; transition: opacity 280ms var(--ease); }
:is(.result-card, .teacher-card).is-tilting .result-shine { opacity: 1; }
.teacher-card .result-shine { z-index: 1; mix-blend-mode: soft-light; }
.result-person { display: flex; align-items: center; margin-top: auto; }
.result-avatar { display: grid; place-items: center; flex: none; border-radius: 50%; font-weight: 800; }
.directory-page .result-person .result-name { margin: 0; padding: 0; border: 0; min-width: 0; }

/* Scroll band: full-width rows; assets/ui.js moves them with the scroll position only. */
.scroll-band { display: grid; gap: var(--space-2); padding-block: var(--space-4) var(--space-2); overflow: hidden; }
.scroll-row { overflow: hidden; }
.scroll-track { display: flex; align-items: center; gap: var(--space-4); width: max-content; transform: translate3d(var(--shift, 0px), 0, 0); will-change: transform; }
.scroll-track > span { white-space: nowrap; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.scroll-track-scores > span { font-size: var(--text-48); color: var(--ink); }
.scroll-track-scores > span:nth-child(even) { color: var(--brand); }
.scroll-track-marks > span { font-size: var(--text-24); color: var(--muted); }
.scroll-track-marks .band-mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 22%; background: var(--dark-panel); }
html[data-theme="dark"] .scroll-track-marks .band-mark { border: 1px solid var(--border-strong); }

@media (min-width: 768px) {
  .directory-nav a { font-size: var(--text-16); }
  .scroll-track-scores > span { font-size: var(--text-64); }
}
@media (min-width: 1024px) {
  .lanyard { display: flex; flex-direction: column; align-items: center; align-self: start; margin-top: calc(-1 * var(--space-6)); transform-origin: 50% 0; transform: rotate(var(--swing, 0deg)); transition: transform 700ms var(--spring); }
  html[data-motion="on"] .lanyard { animation: lanyard-swing 2400ms var(--ease); }
}

/* Shared layout: calm surfaces, one card level and predictable spacing on every page. */
body { background: var(--paper); }
.section, .cashback-section { padding-block: var(--space-4); }
.section-top { align-items: flex-start; max-width: none; margin: 0 0 var(--space-3); text-align: left; gap: var(--space-1); }
.section-top > p { max-width: 68ch; line-height: 1.55; }
h2, .cashback-title { font-size: var(--text-32); }
.header.wrap { width: 100%; margin: 0; padding-block: var(--space-1); top: 0; border-radius: 0; }
.header::before { background: var(--surface); border-radius: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.brand, .theme-toggle, .lang-toggle, .menu { min-height: 44px; }
.brand-name small { display: none; }
.theme-toggle, .lang-toggle, .menu { width: 40px; height: 40px; border-radius: 12px; background: var(--surface); }
.lang-toggle { width: 64px; min-height: 44px; padding: 0 8px; font: inherit; font-size: var(--text-14); font-weight: 700; color: var(--ink); background: var(--surface); cursor: pointer; }
.lang-toggle option { color: var(--ink); background: var(--surface); }
.header { gap: 4px; }
.hero { margin-top: var(--space-3); border-radius: var(--radius-panel); padding: var(--space-3); gap: var(--space-3); background: var(--surface); box-shadow: none; text-align: left; }
html[data-theme="dark"] .hero { background: var(--surface); box-shadow: none; }
.hero-rings, .course-decor { display: none; }
.hero-copy { align-items: flex-start; gap: var(--space-2); }
.hero h1, .hero-description, .hero .eyebrow { margin: 0; }
.hero h1 { font-size: var(--text-32); }
.hero .actions { margin-top: var(--space-1); justify-content: flex-start; gap: var(--space-1); }
.hero .hero-logo { min-height: 0; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.hero-logo picture { display: none; }
.hero-reward-banner { margin-top: 0; padding: var(--space-3); box-shadow: none; border-radius: var(--radius-control); background: var(--surface-hover); }
.hero-reward-banner:hover { transform: none; }
.hero .hero-footnote { margin-top: 0; }
.button, .button-outline, .text-link, .course-enroll-btn { border-radius: 12px; }
.hero .text-link { background: var(--surface); }
.stats-strip { margin-top: var(--space-3); margin-bottom: var(--space-2); }
.stats-strip div { padding: var(--space-2); gap: 4px; }
.stats-strip dd { font-size: var(--text-32); color: var(--ink); }
.stats-strip dl { box-shadow: none; }
:is(.team-grid, .results-grid, .practice-list, .directory-page .team-grid, .directory-page .results-grid-page) { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: var(--space-2); margin-inline: 0; padding: 0; overflow: visible; scroll-snap-type: none; }
:is(.team-grid .teacher-card, .results-grid .result-card, .practice-list .practice-card) { width: 100%; max-width: none; min-width: 0; }
:is(.teacher-card, .result-card, .course-card, .practice-list .practice-card, .study-steps li, .partner-card, .location-card) { border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.why-list li { box-shadow: none; background: var(--surface); border-radius: var(--radius-panel); }
.catalog-toolbar { justify-content: flex-start; margin-bottom: var(--space-3); }
.filters { box-shadow: none; border-radius: 16px; }
.filters button, .reset-filter { border-radius: 12px; }
.filters button.active { box-shadow: none; }
.course-card .course-enroll-btn { border-radius: 12px; background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
:is(.teacher-card, .result-card)[data-tilt], :is(.teacher-card, .result-card)[data-tilt]:hover { transform: none; }
.result-shine { display: none; }
.teacher-card, .directory-page .teacher-card { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-content: start; align-items: start; padding: var(--space-3); gap: var(--space-2); }
.teacher-photo, .directory-page :is(.teacher-initials, .teacher-photo) { width: 64px; height: 64px; aspect-ratio: 1; border-radius: 12px; background: var(--surface-hover); color: var(--ink); font-size: var(--text-24); text-shadow: none; }
.teacher-body, .directory-page .teacher-body { padding: 0; min-width: 0; }
.teacher-card h3, .directory-page .teacher-body h3 { font-size: var(--text-20); line-height: 1.3; }
.teacher-card p { margin-top: 4px; }
.teacher-chips, .directory-page .teacher-chips { margin-top: var(--space-2); gap: 6px; }
.teacher-chips li { padding: 4px 8px; border-radius: 8px; }
.result-card, .directory-page .result-card { padding: var(--space-3); gap: var(--space-2); }
.result-score, .directory-page .result-score { align-self: auto; gap: var(--space-1); padding: 0; border: 0; background: none; color: var(--ink); }
.result-score strong { width: 64px; height: 64px; padding: 0; border-radius: 12px; box-shadow: none; font-size: var(--text-20); }
.result-score span, .directory-page .result-score span { background: none; border: 0; padding: 0; color: var(--ink); }
.result-score small, .directory-page .result-score small { color: var(--muted); }
.result-score strong, .directory-page .result-score strong { color: var(--on-brand); }
.result-card blockquote, .directory-page .result-card blockquote { flex: 0 1 auto; margin: 0; border: 0; padding: 0; line-height: 1.6; }
.result-person { padding: var(--space-2) 0 0; gap: var(--space-1); background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.result-avatar { width: 32px; height: 32px; font-size: var(--text-14); background: var(--surface-hover); color: var(--ink); }
.results-hero { display: block; padding: 0 0 var(--space-3); border: 0; border-radius: 0; background: none; box-shadow: none; }
.results-hero-copy { gap: var(--space-2); }
.results-hero h1, .results-page h1 { max-width: 24ch; font-size: var(--text-32); }
.score-tiles { max-width: 360px; gap: var(--space-1); }
.score-tiles > div { padding: var(--space-2); }
.directory-nav { margin: 0 0 var(--space-3); padding: 4px; box-shadow: none; border-radius: 16px; }
.directory-nav a { padding: 10px 12px; border-radius: 12px; }
.results-page, .career-page { padding-top: var(--space-4); }
.results-grid-page { margin-top: 0; }
.results-page-note { justify-content: flex-start; margin-top: var(--space-3); }
.practice-list .practice-card { grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
.practice-body h3 { font-size: var(--text-20); }
.practice-kicker { display: none; }
.study-steps li { padding: var(--space-3); gap: var(--space-2); }
.study-steps li { align-content: start; }
.study-step { width: 40px; height: 40px; font-size: var(--text-16); background: var(--brand); box-shadow: none; }
.study-step-body h3 { font-size: var(--text-20); }
.partner-card { padding: var(--space-3); gap: var(--space-2); flex-direction: row; align-items: center; }
.partner-logo { padding: 8px; border-radius: 8px; box-shadow: none; }
.partner-logo img { max-width: 104px; max-height: 32px; }
.contact-layout > [data-contact-slot], .contact-group, .location-grid { box-shadow: none; background: none; border: 0; padding: 0; backdrop-filter: none; }
.contact-layout > p { margin: 0; text-align: left; }
.courses-section .section-top { max-width: 68ch; margin-inline: 0; text-align: left; }
.courses-section .section-top { align-items: flex-start; }
.course-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); margin: 0; padding: 0; overflow: visible; scroll-snap-type: none; }
.course-grid .course-card { width: 100%; min-width: 0; max-width: none; }
.cashback-headline { align-items: flex-start; }
.cashback-toolbar { justify-content: flex-start; }
.contact-group { gap: var(--space-1); }
.contact-group h3 { font-size: var(--text-14); }
.contact-channel { background: var(--surface); min-height: 48px; padding: 12px; box-shadow: none; border-radius: 12px; }
.contact-extras { padding-top: var(--space-2); margin-top: var(--space-2); gap: var(--space-1); }
.contact-extras a, .map-links a { min-height: 44px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.location-card { padding: var(--space-2); }
.branch-map-panel { box-shadow: none; border-radius: var(--radius-panel); }
.modal-card { background: var(--surface); border-radius: var(--radius-panel); backdrop-filter: none; -webkit-backdrop-filter: none; }
.modal-topbar, .modal-body { padding: var(--space-3); }
.modal-backdrop::backdrop { background: var(--overlay); backdrop-filter: none; -webkit-backdrop-filter: none; }
.career-head { margin-bottom: var(--space-3); }
.career-form, .career-result { padding: var(--space-3); background: var(--surface); border-color: var(--border); border-radius: var(--radius-panel); box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.career-form { gap: var(--space-3); }
.career-photo-card { padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none; }
.career-step { width: 32px; height: 32px; box-shadow: none; background: var(--brand); }
.checkbox-field { padding: 0; border: 0; background: none; }
.career-result .section-top { align-items: flex-start; text-align: left; }
.career-home { margin-top: 0; }
html[data-theme] footer { padding-block: var(--space-3); background: var(--surface); backdrop-filter: none; }
.footer-main { gap: var(--space-2); }
.contact-fab { display: none; }
@media (max-width: 1050px) {
  #navigation { top: calc(var(--header-height) + 8px); right: 16px; bottom: auto; width: min(calc(100% - 32px), 360px); max-height: calc(100dvh - var(--header-height) - 24px); padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
  #navigation a { min-height: 48px; border-radius: 8px; }
  [data-enhanced="true"] #navigation .nav-cta { margin-top: var(--space-2); border-radius: 12px; }
}
@media (max-width: 767px) {
  .cashback-grid { display: grid; grid-template-columns: minmax(0, 1fr); margin-inline: 0; padding: 0; overflow: visible; scroll-snap-type: none; gap: var(--space-1); }
  .cashback-card { width: 100%; flex-direction: row; align-items: center; justify-content: space-between; gap: var(--space-1); padding: var(--space-2); border-radius: var(--radius-control); }
  .cashback-score { gap: 4px; }
  .cashback-score strong { font-size: var(--text-24); }
  .cashback-card-max { background: var(--tint); box-shadow: none; }
}
@media (min-width: 700px) {
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :is(.team-grid, .directory-page .team-grid, .results-grid, .directory-page .results-grid-page) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .practice-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: var(--space-4); }
}
@media (min-width: 1024px) {
  .hero h1 { font-size: var(--text-48); }
  .course-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section, .cashback-section { padding-block: var(--space-5); }
  .hero { padding: var(--space-5); grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); }
  .hero .hero-logo { justify-content: center; }
  :is(.results-hero h1, .results-page h1) { font-size: var(--text-48); }
  :is(.practice-list, .results-grid, .directory-page .results-grid-page) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-description { font-size: var(--text-20); }
}

/* Optional event cards: the date is the source of truth; JS only enhances the countdown. */
.event-card { border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); min-width: 0; }
.event-card h3 { font-size: var(--text-24); }
.event-card p, .event-card time { color: var(--muted); }
.event-countdown { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-1); max-width: 400px; }
.event-countdown > div { display: grid; justify-items: center; gap: 4px; min-width: 0; }
.event-countdown [data-unit] { display: block; width: 100%; padding: 8px 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-hover); text-align: center; font-size: var(--text-24); font-weight: 700; font-variant-numeric: tabular-nums; }
.event-countdown small { color: var(--muted); font-size: var(--text-14); }
.event-countdown .is-changing { animation: event-digit 240ms var(--ease); }
@keyframes event-digit { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Compact contact channels: each group fits its content instead of a stretched empty panel. */
.contact-channels { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-start; gap: var(--space-3) var(--space-5); width: fit-content; max-width: 100%; }
.contact-channels .contact-group { flex: 0 1 auto; width: max-content; max-width: 100%; min-width: 0; }
.contact-channels .contact-list { width: 100%; }
.contact-channels .contact-channel { width: 100%; min-width: 0; gap: var(--space-1); padding: 12px 16px; }
.contact-channel > span { min-width: 0; overflow-wrap: anywhere; }
.contact-channels .contact-channel .icon-external { margin-left: var(--space-1); }
.contact-extras { width: fit-content; max-width: 100%; }
.map-links .icon-map-pin { color: var(--brand); }
.map-links a.map-icon-link { display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 8px; }
.map-links a.map-icon-link .icon { width: 24px; height: 28px; }
.map-brand-red { stop-color: var(--map-red); }
.map-brand-blue { stop-color: var(--map-blue); }
.map-brand-green { stop-color: var(--map-green); }
.map-brand-yellow { stop-color: var(--map-yellow); }
@media (max-width: 767px) {
  .contact-channels { width: 100%; gap: var(--space-3); }
  .contact-channels .contact-group { flex: 1 1 100%; width: 100%; max-width: 360px; }
}

/* Optional directory views share one set of data and the course-card interaction. */
.directory-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.directory-tools :is(.directory-nav, .directory-view-controls) { margin: 0; }
.profile-card { min-width: 0; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); }
.profile-card .course-face { min-height: 0; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink); gap: var(--space-2); }
.profile-card .course-front { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; }
.profile-card .course-back { padding: var(--space-2) 0 0 80px; margin: 0; }
.profile-card .course-back-title, .profile-card .profile-more, .profile-card .profile-back-role { display: none; }
.profile-identity { min-width: 0; }
.profile-identity h3 { font-size: var(--text-20); line-height: 1.3; overflow-wrap: anywhere; }
.profile-identity p, .profile-back-role { margin-top: 4px; color: var(--muted); font-size: var(--text-14); }
.profile-cover { min-width: 0; }
.profile-initials { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 12px; background: var(--surface-hover); color: var(--ink); font-size: var(--text-24); font-weight: 700; }
.profile-photo { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; }
.profile-facts { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; }
.profile-facts > div { min-width: 0; }
.profile-facts dt { color: var(--muted); font-size: var(--text-14); }
.profile-facts dd { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.profile-result-score { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.profile-result-score strong { display: grid; place-items: center; width: 64px; height: 64px; padding: 0; border-radius: 12px; background: var(--brand); color: var(--on-brand); font-size: var(--text-20); font-weight: 700; }
.profile-result-score span { color: var(--muted); font-size: var(--text-14); }
.profile-details blockquote { margin: 0; color: var(--muted); line-height: 1.65; }
.profile-card-result .course-back { padding-left: 0; }
.profile-card.is-flip-ready { padding: 0; border: 0; background: none; perspective: 1400px; }
.profile-card.is-flip-ready .course-face { display: flex; min-height: 360px; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-panel); background: var(--surface); }
.profile-card.is-flip-ready .course-front { align-items: stretch; }
.profile-card.is-flip-ready .profile-cover { display: grid; align-items: stretch; flex: none; aspect-ratio: 3 / 4; min-height: 0; overflow: hidden; border-radius: 16px; }
.profile-card.is-flip-ready .profile-initials { width: 100%; height: 100%; min-height: 0; background: var(--brand); color: var(--on-brand); font-size: var(--text-64); border-radius: 16px; }
.profile-card.is-flip-ready .profile-photo { width: 100%; height: 100%; border-radius: 16px; }
.profile-card.is-flip-ready .profile-more { display: inline-flex; margin-top: auto; }
.profile-card.is-flip-ready .course-back-title { display: block; }
.profile-card.is-flip-ready .profile-back-role { display: block; margin: 0 0 var(--space-3); }
.profile-card.is-flip-ready .profile-facts { flex-direction: column; gap: var(--space-3); }
.profile-card.is-flip-ready .profile-details { flex: 1; }
.profile-card.is-flip-ready.profile-card-result .profile-cover { align-items: center; background: var(--brand); border-radius: 16px; padding: var(--space-2); }
.profile-card.is-flip-ready .profile-result-score { gap: 4px; }
.profile-card.is-flip-ready .profile-result-score strong { line-height: 1.1; }

/* Real portraits remain; the Stanford mark replaces generated placeholder initials and scores. */
.profile-initials:has(.profile-brand) { background: var(--brand); }
.profile-brand { width: 40px; height: 40px; filter: brightness(0); }
.profile-card.is-flip-ready .profile-brand { width: 96px; height: 96px; }
.profile-card.is-flip-ready .profile-cover:has(.profile-brand) { aspect-ratio: 16 / 9; }
.profile-card-result .course-front { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; }
.profile-card-result .profile-details { display: grid; align-content: start; gap: var(--space-2); }
.profile-card.is-flip-ready .profile-result-score { display: flex; justify-items: normal; }
.profile-card.is-flip-ready .profile-result-score strong { width: auto; min-width: 64px; height: 64px; padding: 8px; font-size: var(--text-32); }
.profile-card.is-flip-ready .profile-result-score span { color: var(--muted); }

/* Practice illustrations are content, not tiny icons. */
.practice-section .practice-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.practice-list .practice-card { display: flex; flex-direction: column; padding: 0; gap: 0; overflow: hidden; }
.practice-media { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 0; }
.practice-media img { width: 100%; height: 100%; object-fit: contain; }
.practice-media--photo img { object-fit: cover; }
.practice-media--brand { background: var(--brand); }
.practice-media--brand img { padding: var(--space-6); }
.directory-empty { grid-column: 1 / -1; margin: 0; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-panel); color: var(--muted); background: var(--surface); }

/* One gallery for centre life, practices, teachers and student results. */
.media-gallery { display: flex; flex-direction: column; width: 100%; min-width: 0; overflow: hidden; border-radius: 16px; background: var(--dark-panel); color: var(--on-dark); }
.media-gallery-track { display: flex; min-width: 0; width: 100%; aspect-ratio: 16 / 10; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.media-gallery-track::-webkit-scrollbar { display: none; }
.media-gallery-track:focus-visible { outline: 3px solid var(--brand); outline-offset: -3px; }
.media-gallery-slide { position: relative; flex: 0 0 100%; min-width: 0; height: 100%; margin: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.media-gallery-slide > :is(img, video) { display: block; width: 100%; height: 100%; max-width: 100%; object-fit: cover; border-radius: 0; }
.media-gallery-slide > video { object-fit: contain; background: var(--dark-panel); }
.media-gallery-controls { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); min-height: 48px; padding: 4px 8px; background: var(--dark-panel); color: var(--on-dark); }
.media-gallery-controls button { display: inline-grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid var(--on-dark-muted); border-radius: 12px; background: var(--dark-panel); color: var(--on-dark); }
.media-gallery-controls button:hover { background: var(--on-dark); color: var(--dark-panel); }
.media-gallery-controls button:focus-visible { outline-color: var(--brand); }
.media-gallery-controls [role="status"] { font-size: var(--text-14); font-variant-numeric: tabular-nums; }
.hero-visual:has([data-media-gallery]) { display: flex; flex-direction: column; gap: var(--space-2); align-self: center; }
.hero-visual > .media-gallery { width: 100%; }
.hero-visual:has([data-media-gallery]) > picture { display: none; }
.practice-media--gallery { aspect-ratio: auto; height: auto; }
.practice-media--gallery .media-gallery { border-radius: 0; }
.practice-list .practice-card:hover .media-gallery img { transform: none; }
.practice-media--gallery .media-gallery-slide > img { object-fit: cover; }
.teacher-card > .media-gallery { flex: none; width: 100%; border-radius: 16px; }
.teacher-card:has(> .media-gallery) { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
.result-card > .media-gallery { margin-bottom: var(--space-2); }
.profile-card .profile-cover--gallery { grid-column: 1 / -1; display: flex; width: 100%; min-width: 0; }
.profile-card:has(.profile-cover--gallery) .profile-identity { grid-column: 1 / -1; }
.profile-card:has(.profile-cover--gallery) .course-back { padding-left: 0; }
.profile-card.is-flip-ready .profile-cover--gallery,
.profile-card.is-flip-ready.profile-card-result .profile-cover--gallery { display: flex; aspect-ratio: auto; padding: 0; border-radius: 16px; background: var(--dark-panel); }
.results-hero:not(:has(.lanyard)) { grid-template-columns: minmax(0, 1fr); }
.practice-body { padding: var(--space-3); }
.planned-events { margin-top: var(--space-4); }
.planned-events > .section-top { margin-bottom: var(--space-2); }
.planned-events h3, .event-card :is(h3, h4) { font-size: var(--text-24); line-height: 1.3; }

/* Keep branch names compact while the map gets the useful horizontal space. */
.location-grid { min-width: 0; width: 100%; }
.location-card h4 { padding-right: var(--space-3); overflow-wrap: anywhere; }
@media (min-width: 1024px) {
  .location-map-layout { grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); }
  .location-map-layout:not(:has(.branch-map-panel)) { grid-template-columns: minmax(0, 360px); }
}
@media (min-width: 1024px) { .directory-page .team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Two-sided course cards. The unenhanced layout keeps the programme in normal flow. */
.course-card[data-course-flip] { padding: 0; border: 0; background: none; overflow: visible; perspective: 1400px; box-shadow: none; }
.course-card[data-course-flip]:hover { transform: none; box-shadow: none; }
.course-flip-inner { min-width: 0; }
.course-face { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-panel); }
.course-front { background: var(--brand); color: var(--on-brand); }
.course-back { margin-top: var(--space-2); background: var(--surface); color: var(--ink); scroll-margin-top: var(--anchor-offset); }
.course-front-brand { display: flex; align-items: center; gap: var(--space-1); font-size: var(--text-16); font-weight: 600; }
.course-front-brand img { filter: brightness(0); }
.course-front .course-head { display: grid; grid-template-rows: minmax(0, 1fr) auto; flex: 1; align-items: start; gap: var(--space-3); margin: 0; padding: 0; border: 0; background: none; border-radius: 0; color: var(--on-brand); }
.course-front .course-head::after { display: none; }
.course-front .course-head h3 { margin: var(--space-3) 0 auto; font-size: var(--text-32); line-height: 1.15; color: var(--on-brand); }
.course-front .course-subtitle { font-size: var(--text-16); margin-top: var(--space-1); }
.course-front .course-price { grid-row: 2; color: var(--on-brand); }
.course-front .course-price strong { font-size: var(--text-32); color: var(--on-brand); }
.course-front .course-flip-toggle { margin-top: var(--space-1); min-height: 48px; background: var(--dark-panel); border-color: var(--dark-panel); color: var(--on-dark); border-radius: 12px; }
.course-front .course-flip-toggle:hover { background: var(--dark-panel); color: var(--on-dark); }
.course-front .course-flip-toggle:focus-visible { outline-color: var(--on-brand); }
.course-back-title { font-size: var(--text-24); line-height: 1.3; margin: 0; }
.course-back .course-description { margin: 0; color: var(--muted); padding: 0; }
.course-back .course-details { margin: 0; padding: 0; flex: 1; }
.course-flip-back { display: none; align-self: flex-start; margin-top: auto; min-height: 44px; }
.course-flip-back .icon { transform: rotate(180deg); order: -1; }
.is-flip-ready .course-flip-inner { display: grid; transform-style: preserve-3d; transition: transform 650ms var(--ease); }
.is-flip-ready .course-face { grid-area: 1 / 1; min-height: 440px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.is-flip-ready .course-back { margin: 0; transform: rotateY(180deg); }
.is-flip-ready .course-flip-back { display: inline-flex; }
.is-flip-ready.is-flipped .course-flip-inner { transform: rotateY(180deg); }
@media (max-width: 479px) { .is-flip-ready .course-face { min-height: 400px; } }
@media (prefers-reduced-motion: reduce) { .is-flip-ready .course-flip-inner { transition: none; } }

/* Yellow Stanford badge: a compact accent beside the directory introduction. */
.lanyard-yellow { display: none; }
.lanyard-yellow .lanyard-card { width: 180px; padding: 24px 16px; background: var(--brand); color: var(--on-brand); border: 0; border-radius: 24px; box-shadow: var(--shadow); gap: 4px; }
.lanyard-yellow .lanyard-card small { color: var(--on-brand-muted); }
.lanyard-yellow .lanyard-hole { background: var(--dark-panel); }
.lanyard-yellow .lanyard-logo { width: 64px; height: 64px; margin: 0 0 8px; background: none; }
.lanyard-yellow .lanyard-logo img { filter: brightness(0); }
.lanyard-yellow .lanyard-strap { height: 56px; }
@media (min-width: 1024px) {
  .results-hero { display: grid; grid-template-columns: minmax(0, 1fr) 240px; align-items: start; gap: var(--space-4); }
  .lanyard-yellow { display: flex; align-items: center; margin-top: -40px; }
}

/* ===== Family price, compact events, overlay teacher cards ===== */
.discount-note { max-width: 64ch; margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3); border-left: 4px solid var(--brand); border-radius: var(--radius-control); background: var(--surface); color: var(--muted); font-size: var(--text-14); line-height: 1.55; }
.course-special { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--space-1); margin-top: var(--space-1); padding: 6px 12px; border-radius: 999px; background: var(--dark-panel); color: var(--on-dark); font-size: var(--text-14); }
.course-special span { color: var(--on-dark-muted); }
.course-special strong { color: var(--brand); font-weight: 800; font-variant-numeric: tabular-nums; }
.course-front .course-special { grid-row: 3; justify-self: start; }

.events-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
.event-card { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
.event-media .media-gallery { border-radius: 0; }
.event-media :is(img, video) { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; }
.event-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2); }
.event-body .event-countdown { margin-top: auto; }
.event-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--space-2); }
.event-date { display: grid; place-items: center; align-content: center; width: 64px; height: 64px; border-radius: 12px; background: var(--brand); color: var(--on-brand); line-height: 1.1; }
.event-date strong { font-size: var(--text-24); font-weight: 800; }
.event-date span { font-size: var(--text-14); font-weight: 600; }
.event-heading { display: grid; gap: 4px; min-width: 0; }
.planned-events .event-card .event-heading h4 { font-size: var(--text-16); line-height: 1.35; overflow-wrap: break-word; }
/* Phones: date and Telegram on one row, the title below at full width instead of a narrow column. */
@media (max-width: 599px) {
  .event-head { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "date . link" "heading heading heading"; }
  .event-date { grid-area: date; }
  .event-heading { grid-area: heading; }
  .event-link { grid-area: link; }
}
.event-heading time { color: var(--muted); font-size: var(--text-14); }
.event-link { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 12px; color: var(--ink); transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease); }
.event-link:hover { border-color: var(--brand); background: var(--surface-hover); text-decoration: none; }
.event-description { color: var(--muted); font-size: var(--text-14); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.event-body .event-countdown { max-width: none; gap: 4px; }
.event-body .event-countdown [data-unit] { padding: 4px; font-size: var(--text-20); }
.event-body .event-countdown small { font-size: var(--text-14); }
.event-body [data-countdown-status]:empty { display: none; }
@media (min-width: 768px) { .events-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .events-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Teacher cards (directory, card view): name and role over the bottom of the portrait. */
.profile-card-teacher.is-flip-ready .course-front:not(:has(.media-gallery)) { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; align-content: start; gap: var(--space-2); }
.profile-card-teacher.is-flip-ready .course-front:not(:has(.media-gallery)) > :is(.profile-cover, .profile-identity) { grid-area: 1 / 1; }
.profile-card-teacher.is-flip-ready .course-front:not(:has(.media-gallery)) .profile-identity { align-self: end; z-index: 1; padding: var(--space-5) var(--space-2) var(--space-2); border-radius: 0 0 16px 16px; background: linear-gradient(var(--transparent), var(--overlay)); }
.profile-card-teacher.is-flip-ready .course-front:not(:has(.media-gallery)) .profile-identity h3 { color: var(--on-dark); font-size: var(--text-24); }
.profile-card-teacher.is-flip-ready .course-front:not(:has(.media-gallery)) .profile-identity p { color: var(--on-dark-muted); }
.profile-card-teacher.is-flip-ready .course-front:not(:has(.media-gallery)) .profile-more { grid-row: 2; }
.profile-card-teacher.is-flip-ready .course-front:not(:has(.media-gallery)) .profile-cover { width: 100%; }
.profile-card-teacher.is-flip-ready .course-front:not(:has(.media-gallery)) .profile-more { justify-self: stretch; justify-content: center; }
/* Flip cards keep their inner padding on the back face, with or without a gallery. */
.profile-card.is-flip-ready .course-face.course-back { padding: var(--space-3); }


/* «Показать ещё» under long directories. */
.directory-more { display: flex; justify-content: center; margin-top: var(--space-4); }
.directory-more[hidden] { display: none; }
.directory-more button { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 48px; padding: 0 var(--space-3); }
/* A teacher without a photo gets the logo in the same portrait frame as a photo, so the grid stays even. */
.profile-card-teacher.is-flip-ready .profile-cover:has(.profile-brand) { aspect-ratio: 3 / 4; }
/* Teacher galleries: a square frame, so with the arrows and name below the card matches a portrait card. */
.profile-card-teacher.is-flip-ready .profile-cover--gallery .media-gallery-track { aspect-ratio: 1 / 1; }
/* Student logo placeholder: the same 16:10 frame as a certificate photo gallery. */
.profile-card-result.is-flip-ready .profile-cover:has(.profile-brand) { aspect-ratio: 16 / 10; }

/* Official logo on a brand panel wherever a card has no photo or video yet (teachers, results, events). */
.brand-cover { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 10; border-radius: 16px; background: var(--brand); }
.brand-cover img { width: 72px; height: 72px; filter: brightness(0); }
/* The logo file is wider than tall: never crop or stretch it to a square box. */
.event-media .brand-cover img { width: 72px; height: 72px; aspect-ratio: auto; }
img[src$="stanford-icon.svg"] { object-fit: contain; }
.event-media .brand-cover { border-radius: 0; }
.event-media :is(.brand-cover, .media-gallery-track) { aspect-ratio: 16 / 9; }

/* Home teacher cards: one column with the cover on top, so photo, gallery and logo cards line up. */
.team-grid .teacher-card { grid-template-columns: minmax(0, 1fr); align-content: start; }
.team-grid .teacher-card > .teacher-photo { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 16px; }

/* Planned events: one row that scrolls sideways, with arrows and dots under it. */
.events-grid.carousel-track { display: flex; gap: var(--space-2); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.events-grid.carousel-track::-webkit-scrollbar { display: none; }
.events-grid.carousel-track:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
/* Phones: one whole event at a time, the next one only after a swipe or an arrow. */
.carousel-track > .event-card { flex: 0 0 100%; scroll-snap-align: start; scroll-snap-stop: always; }
@media (min-width: 768px) { .carousel-track > .event-card { flex-basis: calc((100% - var(--space-2)) / 2); } }
@media (min-width: 1024px) { .carousel-track > .event-card { flex-basis: calc((100% - 2 * var(--space-2)) / 3); } }
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: var(--space-1); margin-top: var(--space-2); }
.carousel-nav[hidden] { display: none; }
.carousel-arrow { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface-hover); color: var(--ink); }
.carousel-arrow:hover:not(:disabled) { border-color: var(--brand); }
.carousel-arrow:disabled { opacity: .4; cursor: default; }
.carousel-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; min-width: 0; }
.carousel-dot { display: grid; place-items: center; width: 22px; height: 24px; padding: 0; border: 0; background: none; }
.carousel-dot::before { content: ''; width: 8px; height: 8px; border-radius: 4px; background: var(--border-strong); transition: width var(--duration) var(--ease), background var(--duration) var(--ease); }
.carousel-dot[aria-current="true"]::before { width: 20px; background: var(--brand); }

/* Branch entrance photo: a tile the size of the map buttons, in the same row; a click opens it large. */
.map-links a.location-photo-link { padding: 0; overflow: hidden; cursor: zoom-in; }
.map-links a.location-photo-link .location-photo { width: 100%; height: 100%; max-width: none; aspect-ratio: 1; margin: 0; border-radius: 0; object-fit: cover; }
.photo-dialog { width: min(100% - var(--space-4), 1100px); max-width: none; padding: 0; border: 0; border-radius: var(--radius-panel); background: var(--dark-panel); overflow: hidden; }
.photo-dialog::backdrop { background: var(--overlay); }
.photo-dialog img { display: block; width: 100%; height: auto; max-height: 85vh; object-fit: contain; }
.photo-dialog-close { position: absolute; top: var(--space-1); right: var(--space-1); display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--on-dark-muted); border-radius: 12px; background: var(--dark-panel); color: var(--on-dark); }
@media (min-width: 1024px) { :is(.team-grid, .directory-page .team-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
