.xiema-page {
    --ink: #11254b;
    --copy: #425675;
    --ice: #e5eefc;
    --ice-light: #f0f5ff;
    --selection: #dce8fc;
    --line: #d7e5fb;
    --outline: #b8cef1;
    --card: #fcfdff;
    --card-radius: 17px;
    --card-shadow: 0 5px 18px #244e8910;
    --content-width: 1240px;
    --section-space: clamp(28px, 3vw, 40px);
    --section-title: clamp(26px, 2.5vw, 36px);
    --card-title: clamp(19px, 1.7vw, 24px);
}

main[id], main [id] { scroll-margin-top: 96px; }
body.xiema-page { color: var(--ink); }
h1, h2, h3, h4, p, figure, dl, dd, fieldset { margin: 0; }
h1, h2, h3, h4 { font-weight: 750; line-height: 1.25; }
h2 { font-size: var(--section-title); letter-spacing: -.018em; }
main h2::after {
    content: "";
    display: block;
    width: 38px;
    height: 3px;
    margin-top: 8px;
    border-radius: 2px;
    background: var(--yellow);
}
h3 { font-size: var(--card-title); }
h4 { font-size: 17px; }
[hidden], .mobile-only { display: none; }
:focus-visible { outline: 3px solid #4276ba; outline-offset: 3px; }
.frame, .xiema-hero .editorial-hero-inner {
    width: min(var(--content-width), calc(100% - 2 * var(--editorial-gutter)));
    margin-inline: auto;
}
.xiema-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
}
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 31; padding: 10px; background: white; transform: translateY(-200%); }
.skip-link:focus { transform: none; }

main .button {
    min-height: 44px;
    padding: 8px 18px;
    gap: .55em;
    border: 1px solid var(--blue);
    background: var(--blue);
    color: #fff;
    font-size: 15px;
    line-height: 1.35;
    text-align: center;
    cursor: pointer;
}
main .button.outline { background: #f9fbff99; color: var(--blue); }
main .button.outline:hover { background: var(--selection); }
.text-link { color: var(--blue); font-weight: 650; }
.text-link:hover, .underlined { text-decoration: underline; text-underline-offset: .24em; }

.xiema-hero .editorial-hero-inner {
    gap: clamp(18px, 2.7vw, 36px);
    padding-block: clamp(22px, 2.35vw, 34px) 24px;
}
.xiema-hero .editorial-hero-copy { min-height: 0; padding-left: 0; }
.xiema-hero .affiliation { margin: 0; color: var(--blue); font-size: 15px; font-weight: 650; }
.xiema-hero h1 { margin-block: 6px 10px; color: var(--ink); font-size: clamp(31px, 3.3vw, 46px); line-height: 1.15; letter-spacing: -.035em; }
.xiema-hero h1 span { display: block; }
.xiema-hero h1::after {
    display: block;
    position: static;
    width: 44px;
    height: 3px;
    margin: 8px 0 0;
    border: 0;
    border-radius: 2px;
    background: var(--yellow);
    transform: none;
}
.xiema-hero .hero-description { margin: 0; color: var(--copy); font-size: 16px; text-wrap: pretty; }
.hero-actions { margin-top: 16px; }
.xiema-hero .hero-actions .button { min-height: 44px; padding: 8px 16px; font-size: 15px; }
.xiema-hero .hero-actions .outline { border-color: var(--blue); }
.hero-links { display: flex; flex-wrap: wrap; gap: 2px 20px; margin-top: 8px; font-size: 14px; }
.hero-links a { display: inline-flex; align-items: center; gap: .35em; min-height: 32px; }
.hero-photo picture { display: block; }
.hero-photo img { aspect-ratio: 2.04; border-radius: clamp(24px, 2.5vw, 36px); object-position: center 88%; }
.hero-photo figcaption { margin-top: 6px; color: var(--copy); font-size: 13px; }

.workshop { padding-top: var(--section-space); }
.workshop-heading p, .stage-intro, .week-intro, .results-scope { color: var(--copy); margin-top: 6px; }
.workshop-grid { display: grid; grid-template-columns: minmax(0, .4fr) minmax(0, .6fr); gap: 24px; margin-top: 20px; }
.workshop-method, .workshop-examples { padding: 16px; }
.method-rows { display: grid; gap: 6px; }
.method-rows div { display: flex; align-items: baseline; gap: .65em; padding: 9px 12px; background: var(--ice); border-radius: 7px; }
.method-rows dt { flex: none; font-weight: 740; padding-right: .6em; border-right: 1px solid var(--outline); }
.method-rows dd { color: var(--copy); }
.coach { color: var(--copy); margin-block: 12px 4px; }
.o-roadmap h3 { margin-bottom: 12px; }
.o-roadmap ol { margin: 0; padding: 16px 0 0; list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; position: relative; }
.o-roadmap ol::before { content: ""; position: absolute; top: 3px; inset-inline: 12.5%; height: 2px; background: var(--outline); }
.o-roadmap li { position: relative; padding: 7px 4px; text-align: center; border: 1px solid var(--outline); border-radius: 8px; background: var(--card); color: var(--copy); font-size: 14px; }
.o-roadmap li::before { content: ""; position: absolute; top: -17px; left: calc(50% - 4px); width: 8px; height: 8px; border-radius: 50%; background: var(--blue); }
.o-roadmap strong { display: block; color: var(--blue); font-size: 18px; line-height: 1.3; }
.lesson { margin-top: 12px; border: 1px solid var(--line); border-radius: 9px; }
.lesson-content { padding: 0 12px 12px; }
.lesson-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lesson-options span { background: var(--ice-light); border-radius: 6px; padding: 7px; text-align: center; font-size: 14px; }
.lesson p { margin-top: 6px; color: var(--copy); font-size: 15px; }

.stages { padding-top: var(--section-space); }
.stage-intro { margin-bottom: 14px; }
.stage-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--outline); border-radius: 14px; }
.stage-tabs[hidden] { display: none; }
.stage-tabs button { position: relative; min-height: 48px; color: var(--ink); padding: 5px 8px; font-weight: 650; border: 0; border-radius: 13px; background: transparent; }
.stage-tabs button:not(:last-child, [aria-selected="true"])::after { content: ""; position: absolute; right: 0; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
.stage-tabs button:hover { background: var(--ice-light); }
.stage-tabs button[aria-selected="true"] { color: var(--blue); background: var(--selection); box-shadow: inset 0 0 0 2px var(--blue); font-weight: 750; }
.stage-panel { margin-top: 12px; padding: 16px 20px; }
.stage-panel-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; margin-top: 12px; }
.stage-panel dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stage-panel dl div { background: var(--ice-light); padding: 9px 12px; border-radius: 8px; }
.stage-panel dt { color: var(--blue); font-weight: 750; }
.stage-panel dd { color: var(--copy); margin-top: 3px; }
.stage-panel-body > a { display: flex; align-items: center; gap: 4px; min-height: 44px; border-left: 1px solid var(--line); padding-left: 12px; }
.stage-note { color: var(--copy); margin-top: 12px; font-size: 14px; }

.advanced { padding-block: var(--section-space) 0; }
.advanced h2 { margin-bottom: 16px; }
.noip-course, .advanced-projects article { padding: 16px 20px; }
.noip-grid { display: grid; grid-template-columns: 1.16fr 1fr 1fr; align-items: center; gap: 12px; }
.noip-grid > div { padding-left: 14px; border-left: 1px solid var(--outline); }
.noip-grid p, .noip-practice, .advanced-projects p { color: var(--copy); }
.noip-grid p { margin-top: 4px; }
.noip-practice { margin-top: 12px; padding: 6px 10px; border-radius: 8px; background: var(--ice-light); font-size: 14px; text-align: center; }
.trunk-plan { display: flex; align-items: baseline; gap: 14px; margin: 12px 0; padding: 12px 20px; border-radius: 10px; background: var(--selection); }
.trunk-plan p { color: var(--copy); }
.advanced-projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.advanced-projects article { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; }
.advanced-projects p { margin-top: 4px; }
.project-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 15px; }
.advanced-camps { text-align: center; color: var(--copy); margin-top: 10px; font-size: 14px; }

.training-week { padding-top: var(--section-space); }
.week-intro { margin-bottom: 12px; }
.week-grid { display: grid; grid-template-columns: minmax(0, .66fr) minmax(0, .34fr); gap: 14px; }
.week-schedule, .practice { padding: 16px; }
.week-schedule table, .results table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: separate; border-spacing: 0; text-align: center; font-variant-numeric: tabular-nums; }
.week-schedule :is(th, td) { padding: 8px 2px; text-align: center; font-size: 15px; font-weight: 650; border: 1px solid var(--outline); border-right: 0; }
.week-schedule :is(th, td):last-child { border-right: 1px solid var(--outline); }
.week-schedule th { background: var(--selection); }
.week-schedule td { background: var(--ice); border-top: 0; color: var(--blue); }
.week-schedule td:nth-child(2) { background: var(--ice-light); color: var(--ink); }
.week-schedule th:first-child { border-top-left-radius: 6px; }
.week-schedule th:last-child { border-top-right-radius: 6px; }
.week-schedule td:first-child { border-bottom-left-radius: 6px; }
.week-schedule td:last-child { border-bottom-right-radius: 6px; }
.week-schedule-notes { margin-block: 12px; color: var(--copy); font-size: 15px; }
.practice h3 { margin-bottom: 10px; }
.practice ol { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.practice li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-size: 15px; border-radius: 6px; background: var(--ice-light); }
.practice li span { min-width: 23px; border-radius: 4px; text-align: center; color: var(--blue); background: var(--selection); font-weight: 730; }
.practice > p { margin-top: 8px; color: var(--copy); font-size: 13px; }

.results { padding-top: var(--section-space); }
.results-grid { display: grid; grid-template-columns: minmax(0, .3fr) minmax(0, .7fr); gap: 16px; margin-top: 14px; padding: 18px; align-items: center; }
.results-detail { border-left: 1px solid var(--line); padding-left: 18px; }
.metric { display: flex; gap: 6px; align-items: baseline; color: var(--blue); font-size: 22px; line-height: 1; }
.metric strong { font-size: clamp(48px, 4.45vw, 68px); letter-spacing: -.048em; font-weight: 850; }
.medal-split { font-size: 17px; font-weight: 650; margin-top: 8px; }
.results table { border: 1px solid var(--outline); border-radius: 9px; overflow: hidden; background: #fff; }
.results th:first-child { width: 24%; }
.results :is(th, td) { padding: 5px 4px; text-align: center; font-size: 15px; border-bottom: 1px solid var(--line); }
.results tr > :is(th, td) + :is(th, td) { border-left: 1px solid var(--line); }
.results tbody tr:last-child > * { border-bottom-width: 0; }
.results thead th { background: var(--ice-light); }
.results tbody .latest { background: var(--selection); font-weight: 750; }
.results tbody .latest th { box-shadow: inset 3px 0 var(--yellow); }
.results-detail a { display: block; text-align: right; margin-top: 8px; font-size: 14px; }

.cases { padding-block: var(--section-space); }
.cases h2, .contact-grid h2 { margin-bottom: 14px; }
.faq details { border: 1px solid var(--line); border-radius: 9px; }
.cases details + details, .faq details + details { margin-top: 8px; }
.lesson summary, .cases summary, .faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7em;
    list-style: none;
    cursor: pointer;
    min-height: 44px;
    padding: 7px 12px;
    font-weight: 650;
}
.lesson summary::-webkit-details-marker, .cases summary::-webkit-details-marker, .faq summary::-webkit-details-marker { display: none; }
.lesson summary::after, .cases summary::after, .faq summary::after { content: ""; flex: 0 0 auto; width: 7px; height: 7px; margin-right: 2px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.lesson[open] summary::after, .cases details[open] summary::after, .faq details[open] summary::after { transform: rotate(225deg); }
.cases details > div, .faq details p { padding: 0 12px 12px; color: var(--copy); font-size: 15px; }
.cases details > div a { display: inline-block; margin-top: 4px; }

.schools-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 24px;
    padding: clamp(18px, 2.1vw, 30px);
    align-items: center;
    border: 1px solid #fff;
    border-radius: calc(var(--card-radius) + 5px);
    background: linear-gradient(120deg, #e4edfc, #dce8fb);
}
.schools-grid p { margin-block: 6px 12px; color: var(--copy); }
.schools-grid ul { padding: 0 0 0 24px; margin: 0; border-left: 1px solid var(--outline); list-style: none; display: grid; gap: 6px; }
.schools-grid li { background: var(--card); border-radius: 9px; padding: 7px 12px; font-weight: 650; }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding-block: 18px var(--section-space); }
.contact-grid > section { padding: 18px; }
.audience { padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--outline); border-radius: 10px; min-inline-size: 0; }
.audience label { cursor: pointer; position: relative; text-align: center; }
.audience input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.audience span { display: block; min-height: 44px; padding: 8px 6px; border-radius: 9px; font-weight: 650; color: var(--copy); pointer-events: none; }
.audience input:checked + span { color: var(--blue); background: var(--selection); }
.audience input:focus-visible + span { outline: 3px solid #4276ba; outline-offset: -3px; }
.field { display: block; margin-top: 10px; color: var(--copy); }
.field :is(input, textarea) { display: block; width: 100%; margin-top: 4px; padding: 6px 10px; border: 1px solid var(--outline); border-radius: 9px; min-height: 44px; color: var(--ink); background: #fff; }
.field textarea { resize: vertical; min-height: 62px; }
.consult form > .button { width: 100%; margin-top: 12px; }
.form-message { margin-top: 8px; color: var(--blue); font-size: 14px; }
.form-message.error { color: #8a2222; }
.xiema-page .footer { width: 100%; background: transparent; border: 0; padding-block: 0 18px; text-align: center; color: var(--copy); font-size: 14px; }
.footer a:hover { text-decoration: underline; }

@media (max-width: 850px) {
    .xiema-hero .hero-actions .button { font-size: 14px; padding-inline: 11px; }
}

@media (max-width: 800px) {
    main[id], main [id] { scroll-margin-top: 80px; }
}

@media (max-width: 760px) {
    .desktop-only { display: none; }
    .mobile-only { display: initial; }
    .xiema-page { --section-space: 20px; --section-title: 24px; }
    .workshop-heading .frame { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; }
    .workshop-heading p.mobile-only { grid-column: 1 / -1; font-size: 14px; margin: 0; }
    .workshop-mobile-link { grid-column: 2; grid-row: 1; font-size: 14px; line-height: 32px; }
    .workshop-grid, .schools-grid, .contact-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
    .workshop-grid { margin-top: 10px; }
    .workshop-grid[data-collapsed] { display: none; }
    .stage-tabs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 3px; padding: 3px; }
    .stage-tabs button { grid-column: span 2; min-height: 44px; font-size: clamp(13px, 3.55vw, 14px); padding-inline: 4px; border-radius: 9px; }
    .stage-tabs button:nth-last-child(-n+2) { grid-column: span 3; }
    .stage-tabs button::after { display: none; }
    .stage-panel { margin-top: 10px; padding: 12px; }
    .stage-panel-body { grid-template-columns: 1fr; gap: 4px; }
    .stage-panel-body > a { border-left: 0; padding-left: 0; }
    .stage-panel dl { grid-template-columns: 1fr; gap: 4px; }
    .stage-panel dl div { padding: 6px 9px; }
    .stage-panel dd { margin-top: 0; font-size: 15px; }
    .week-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .week-schedule, .practice { padding: 12px; }
    .schools-grid ul { padding: 0; border-left: 0; }
    .contact-grid > section { padding: 14px; }
}

@media (max-width: 700px) {
    .xiema-hero .editorial-hero-inner { gap: 10px; padding-block: 14px; }
    .xiema-hero h1 { font-size: clamp(26px, 7.25vw, 34px); margin-block: 4px 7px; text-wrap: balance; }
    .xiema-hero h1 span { display: inline; }
    .xiema-hero .affiliation, .xiema-hero .hero-description { font-size: 14px; }
    .hero-actions { margin-top: 10px; }
    .hero-links { margin-top: 5px; font-size: 13px; }
    .hero-photo figcaption { font-size: 12px; }
    .hero-photo img { border-radius: 20px; }
    .stage-intro { margin-bottom: 9px; font-size: 14px; }
    .o-roadmap ol { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 0; }
    .o-roadmap ol::before, .o-roadmap li::before { display: none; }
    .noip-course, .advanced-projects article { padding: 12px; }
    .noip-grid, .advanced-projects, .results-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .noip-grid > div { border-left: 0; padding-left: 0; }
    .noip-grid p { margin-top: 1px; }
    .trunk-plan { padding: 9px 12px; }
    .results-grid { padding: 11px; }
    .results-detail { border-left: 0; padding-left: 0; }
    .results-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
    .medal-split { margin-top: 0; font-size: 15px; }
    .results-detail a { text-align: left; }
    .results :is(th, td) { padding-block: 4px; font-size: 13px; }
    .week-schedule :is(th, td) { font-size: clamp(11px, 3.1vw, 14px); padding: 5px 0; }
}
