@font-face {
    font-family: "Noto Sans KZ";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("fonts/noto-sans-cyrillic-ext.woff2") format("woff2");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: "Noto Sans KZ";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("fonts/noto-sans-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Noto Sans KZ";
    font-style: normal;
    font-weight: 400 900;
    font-display: swap;
    src: url("fonts/noto-sans-latin.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;
}
@font-face {
    font-family: "Unbounded Local";
    font-style: normal;
    font-weight: 500 900;
    font-display: swap;
    src: url("fonts/unbounded-cyrillic-ext.woff2") format("woff2");
    unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
    font-family: "Unbounded Local";
    font-style: normal;
    font-weight: 500 900;
    font-display: swap;
    src: url("fonts/unbounded-cyrillic.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Unbounded Local";
    font-style: normal;
    font-weight: 500 900;
    font-display: swap;
    src: url("fonts/unbounded-latin.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;
}

:root {
    --night: #06091f;
    --ink: #0b1032;
    --indigo: #151747;
    --violet: #2b185a;
    --cyan: #4ee1ff;
    --pink: #ff5fa2;
    --gold: #ffcf3f;
    --orange: #ff9838;
    --text: #f7f8ff;
    --muted: #aeb8dc;
    --line: rgba(194, 207, 255, .16);
    --glass: rgba(25, 27, 73, .72);
    --panel-width: clamp(430px, 35vw, 610px);
    color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body.achievement-map-page {
    overflow: hidden;
    color: var(--text);
    background: var(--night);
    font-family: "Noto Sans KZ", "Segoe UI", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, a { font: inherit; }
button { color: inherit; touch-action: manipulation; }

.layout {
    display: flex;
    width: 100%;
    height: 100dvh;
    min-height: 100%;
    background:
        radial-gradient(circle at 18% 10%, rgba(59, 94, 255, .2), transparent 28%),
        linear-gradient(145deg, var(--night), var(--ink));
}

.map-stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    isolation: isolate;
    background: #0b1235;
}

.map {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #0b1235;
}

.map canvas {
    filter: saturate(.76) contrast(.96) brightness(.78) hue-rotate(7deg);
}

.map-fallback {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: #0b1235;
    transition: opacity .35s ease, visibility 0s linear .35s;
}

.map-fallback.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

.map-fallback__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: saturate(.96) contrast(1.08) brightness(.97);
}

.fallback-markers {
    position: absolute;
    inset: 0;
}

.fallback-marker {
    position: absolute;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(78, 225, 255, .78);
    border-radius: 15px 15px 15px 6px;
    transform: translate(-50%, -50%) rotate(-5deg);
    color: var(--cyan);
    background: linear-gradient(145deg, rgba(19, 36, 86, .97), rgba(16, 18, 58, .97));
    box-shadow: inset 0 1px rgba(255, 255, 255, .16), 0 0 19px rgba(78, 225, 255, .38), 0 8px 18px rgba(4, 6, 22, .38);
    cursor: pointer;
    touch-action: manipulation;
}

.fallback-marker::before {
    content: "";
    position: absolute;
    inset: -9px;
    z-index: -1;
    border: 1px solid rgba(78, 225, 255, .3);
    border-radius: 19px;
    animation: marker-pulse 2.8s ease-out infinite;
}

.fallback-marker svg {
    width: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linejoin: round;
}

.fallback-marker b {
    position: absolute;
    top: -8px;
    right: -8px;
    display: grid;
    place-items: center;
    min-width: 25px;
    height: 25px;
    padding: 0 5px;
    border: 2px solid #111641;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--pink), #ff8a69);
    color: #fff;
    font-family: "Unbounded Local", sans-serif;
    font-size: 9px;
}

.fallback-marker__label {
    position: absolute;
    bottom: calc(100% + 7px);
    left: 50%;
    max-width: 150px;
    padding: 5px 8px;
    overflow: hidden;
    border: 1px solid rgba(78, 225, 255, .18);
    border-radius: 8px;
    transform: translateX(-50%) rotate(5deg);
    background: rgba(8, 11, 37, .84);
    color: #f8f9ff;
    font-size: 9px;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-atmosphere {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    transition: opacity .5s ease;
    background:
        linear-gradient(90deg, rgba(6, 9, 31, .78) 0%, rgba(6, 9, 31, .26) 38%, transparent 64%),
        linear-gradient(180deg, rgba(9, 13, 42, .46), transparent 31%, rgba(9, 13, 42, .32));
}

.map-stage.is-fallback-map .map-atmosphere {
    opacity: .24;
}

.map-atmosphere::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .11;
    background-image: repeating-linear-gradient(0deg, transparent 0 6px, rgba(78, 225, 255, .16) 7px);
    mask-image: linear-gradient(90deg, #000, transparent 68%);
}

.map-hero {
    position: absolute;
    z-index: 3;
    top: clamp(24px, 4.4vh, 54px);
    left: clamp(24px, 3.6vw, 64px);
    width: min(450px, 48vw);
    pointer-events: none;
    animation: hero-in .65s cubic-bezier(.2, .7, .2, 1) both;
}

.brand-lockup {
    display: block;
    width: 205px;
    height: 73px;
    margin-bottom: clamp(17px, 2.5vh, 26px);
    overflow: hidden;
    filter: drop-shadow(0 10px 24px rgba(3, 5, 19, .35));
    transition: transform .45s cubic-bezier(.2, .7, .2, 1);
}

.brand-logo {
    display: block;
    width: 205px;
    height: auto;
    transform: translateY(-25px);
}

.map-hero__context {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity .35s ease,
        transform .45s cubic-bezier(.2, .7, .2, 1),
        visibility 0s linear 0s;
}

.map-stage.has-selection .map-hero__context {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-34px);
    transition-delay: 0s, 0s, .45s;
}

.map-stage.has-selection .brand-lockup { transform: translateY(-7px) scale(.94); transform-origin: left top; }
.map-stage.has-selection .map-atmosphere { opacity: .62; }

.live-kicker,
.section-kicker {
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--cyan);
}

.live-kicker { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }

.live-kicker i,
.panel__status i {
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #47f2a0;
    box-shadow: 0 0 0 5px rgba(71, 242, 160, .12), 0 0 16px rgba(71, 242, 160, .8);
}

.map-hero__copy {
    max-width: 440px;
    margin-top: 0;
    font-size: clamp(15px, 1.4vw, 20px);
    line-height: 1.55;
    color: rgba(232, 236, 255, .76);
}

.city-stats {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.city-stat {
    display: flex;
    align-items: baseline;
    gap: 9px;
    min-width: 155px;
    padding: 13px 16px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(17, 20, 62, .62);
    box-shadow: inset 0 1px rgba(255, 255, 255, .05), 0 12px 30px rgba(5, 7, 25, .14);
    backdrop-filter: blur(12px);
}

.city-stat strong {
    font-family: "Unbounded Local", sans-serif;
    font-size: 21px;
    line-height: 1;
    color: var(--gold);
}

.city-stat span { font-size: 12px; color: var(--muted); }

.map-legend {
    position: absolute;
    z-index: 3;
    left: clamp(24px, 3.6vw, 64px);
    bottom: clamp(22px, 3.7vh, 44px);
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    border: 1px solid rgba(78, 225, 255, .2);
    border-radius: 999px;
    background: rgba(9, 13, 42, .68);
    backdrop-filter: blur(12px);
    font-size: 11px;
    letter-spacing: .04em;
    color: rgba(237, 240, 255, .78);
    pointer-events: none;
}

.legend-signal {
    width: 9px;
    height: 9px;
    border: 2px solid var(--cyan);
    border-radius: 50%;
    box-shadow: 0 0 13px var(--cyan);
}

.panel {
    position: relative;
    z-index: 5;
    flex: 0 0 var(--panel-width);
    width: var(--panel-width);
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    padding: clamp(23px, 3vw, 44px);
    background:
        radial-gradient(circle at 98% 0%, rgba(87, 59, 180, .3), transparent 30%),
        radial-gradient(circle at 10% 90%, rgba(255, 95, 162, .08), transparent 28%),
        linear-gradient(165deg, rgba(18, 21, 65, .98), rgba(8, 11, 35, .99));
    border-left: 1px solid rgba(194, 207, 255, .12);
    box-shadow: -24px 0 70px rgba(2, 4, 18, .4);
    scrollbar-width: thin;
    scrollbar-color: rgba(78, 225, 255, .28) transparent;
}

.panel::-webkit-scrollbar { width: 5px; }
.panel::-webkit-scrollbar-thumb { background: rgba(78, 225, 255, .28); border-radius: 99px; }

.panel::before {
    content: "";
    position: fixed;
    z-index: -1;
    top: 0;
    width: 1px;
    height: 28%;
    margin-left: calc(clamp(23px, 3vw, 44px) * -1);
    background: linear-gradient(var(--cyan), transparent);
    box-shadow: 0 0 20px var(--cyan);
}

.panel__topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 28px;
    margin-bottom: clamp(36px, 6vh, 70px);
}

.panel__mode {
    font-family: "Unbounded Local", sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
}

.panel__mode span {
    display: inline-grid;
    place-items: center;
    width: 27px;
    height: 23px;
    margin-right: 7px;
    border-radius: 7px;
    color: #16102e;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    box-shadow: 0 0 20px rgba(255, 207, 63, .23);
}

.panel__status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: #79f7b5;
}

.panel__status i { width: 5px; height: 5px; box-shadow: 0 0 9px rgba(71, 242, 160, .9); }

.hidden { display: none !important; }

.panel__placeholder {
    min-height: calc(100% - 110px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    animation: panel-in .45s ease both;
}

.panel__placeholder .empty { width: 100%; }
.panel__placeholder.is-directory {
    min-height: 0;
    display: block;
}

.directory-head { margin-bottom: 24px; }
.directory-head .section-kicker { margin-bottom: 13px; }
.directory-head h2 {
    font-family: "Unbounded Local", "Noto Sans KZ", sans-serif;
    font-size: clamp(26px, 2.35vw, 36px);
    line-height: 1.16;
    letter-spacing: -.035em;
}
.directory-head p {
    max-width: 440px;
    margin-top: 12px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.directory-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 90px;
    padding: 20px;
    border: 1px dashed rgba(194, 207, 255, .18);
    border-radius: 18px;
    color: var(--muted);
    font-size: 13px;
}
.directory-loading i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    animation: load-dot .9s ease-in-out infinite alternate;
}
.directory-loading i:nth-child(2) { animation-delay: .15s; }
.directory-loading i:nth-child(3) { margin-right: 5px; animation-delay: .3s; }

.school-directory {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding-bottom: 22px;
}

.school-choice {
    position: relative;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto 34px;
    align-items: center;
    gap: 11px;
    width: 100%;
    min-height: 76px;
    padding: 12px 13px;
    border: 1px solid rgba(194, 207, 255, .15);
    border-radius: 17px;
    text-align: left;
    cursor: pointer;
    background:
        radial-gradient(circle at 100% 0%, rgba(78, 225, 255, .08), transparent 36%),
        linear-gradient(115deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
    box-shadow: inset 0 1px rgba(255, 255, 255, .05);
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.school-choice:active {
    transform: scale(.985);
    border-color: rgba(255, 207, 63, .65);
    background: linear-gradient(115deg, rgba(255, 207, 63, .14), rgba(78, 225, 255, .07));
}
.school-choice__index {
    font-family: "Unbounded Local", sans-serif;
    font-size: 9px;
    color: rgba(78, 225, 255, .7);
}
.school-choice__body { min-width: 0; }
.school-choice__body strong {
    display: block;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.28;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.school-choice__body small {
    display: block;
    margin-top: 5px;
    font-size: 10px;
    color: var(--muted);
}
.school-choice__count {
    display: grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid rgba(255, 207, 63, .3);
    border-radius: 12px;
    font-family: "Unbounded Local", sans-serif;
    font-size: 12px;
    color: var(--gold);
    background: rgba(255, 207, 63, .07);
}
.school-choice__arrow {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(78, 225, 255, .23);
    border-radius: 10px;
    color: var(--cyan);
}

.schools-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    margin-bottom: 18px;
    padding: 10px 15px;
    border: 1px solid rgba(78, 225, 255, .26);
    border-radius: 13px;
    background: rgba(78, 225, 255, .075);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.schools-back span { color: var(--cyan); font-size: 18px; }

.signal-orb {
    position: relative;
    display: grid;
    place-items: center;
    width: 142px;
    height: 142px;
    margin: 0 0 42px 8px;
}

.signal-orb__core {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border: 1px solid rgba(255, 207, 63, .5);
    border-radius: 24px;
    transform: rotate(12deg);
    color: var(--gold);
    background: linear-gradient(145deg, rgba(255, 207, 63, .2), rgba(255, 95, 162, .12));
    box-shadow: inset 0 1px rgba(255, 255, 255, .14), 0 0 45px rgba(255, 207, 63, .2);
    font-size: 30px;
}

.signal-orb i {
    position: absolute;
    inset: 19px;
    border: 1px solid rgba(78, 225, 255, .35);
    border-radius: 50%;
    animation: signal 3s ease-out infinite;
}
.signal-orb i:nth-child(3) { animation-delay: 1s; }
.signal-orb i:nth-child(4) { animation-delay: 2s; }

.panel__placeholder h2,
.panel__list h2,
.detail__name {
    font-family: "Unbounded Local", "Noto Sans KZ", sans-serif;
    font-weight: 750;
    letter-spacing: -.035em;
}

.panel__placeholder h2 {
    max-width: 470px;
    margin-top: 17px;
    font-size: clamp(27px, 2.55vw, 40px);
    line-height: 1.15;
}

.panel__placeholder > p {
    max-width: 440px;
    margin-top: 18px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.65;
}

.panel__tip {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    letter-spacing: .035em;
    color: rgba(212, 220, 249, .62);
}

.panel__tip span { font-family: "Unbounded Local", sans-serif; color: var(--pink); font-weight: 700; }

.panel__list,
.panel__detail { animation: panel-in .42s cubic-bezier(.2, .7, .2, 1) both; }

.panel__list .section-kicker { margin-bottom: 13px; }

.panel__list h2,
.detail__name {
    font-size: clamp(25px, 2.2vw, 35px);
    line-height: 1.2;
}

.school-meta {
    display: grid;
    gap: 9px;
    margin: 18px 0 27px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .035);
}

.school-meta:empty { display: none; }

.school-meta__item { display: grid; grid-template-columns: 24px 1fr; gap: 8px; align-items: start; }
.school-meta__item span { color: var(--gold); font-size: 14px; }
.school-meta__item p,
.school-meta__item a { color: var(--muted); font-size: 12px; line-height: 1.45; text-decoration: none; }
.school-meta__item a:hover { color: var(--cyan); }

.cards { display: grid; grid-template-columns: 1fr; gap: 11px; padding-bottom: 18px; }

.card {
    position: relative;
    display: grid;
    grid-template-columns: 60px 1fr 28px;
    align-items: center;
    gap: 13px;
    width: 100%;
    min-height: 92px;
    padding: 13px 13px 13px 15px;
    overflow: hidden;
    border: 1px solid rgba(194, 207, 255, .13);
    border-radius: 18px;
    text-align: left;
    cursor: pointer;
    background: linear-gradient(115deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
    box-shadow: inset 0 1px rgba(255, 255, 255, .045);
    transition: border-color .2s ease, transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 2px;
    opacity: 0;
    background: linear-gradient(var(--pink), var(--cyan));
    box-shadow: 0 0 16px var(--cyan);
    transition: opacity .2s ease;
}

.card:hover,
.card:focus-visible {
    outline: none;
    border-color: rgba(78, 225, 255, .48);
    transform: translateY(-2px);
    background: linear-gradient(115deg, rgba(78, 225, 255, .105), rgba(255, 95, 162, .045));
    box-shadow: 0 12px 25px rgba(2, 4, 17, .22), 0 0 24px rgba(78, 225, 255, .07);
}
.card:hover::before,
.card:focus-visible::before { opacity: 1; }

.card__index {
    position: absolute;
    top: 7px;
    left: 8px;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 21px;
    height: 18px;
    padding: 0 4px;
    border-radius: 6px;
    background: rgba(7, 10, 31, .82);
    font-family: "Unbounded Local", sans-serif;
    font-size: 7px;
    color: var(--cyan);
}

.card__photo {
    width: 60px;
    height: 66px;
    border: 1px solid rgba(194, 207, 255, .18);
    border-radius: 14px;
    object-fit: cover;
    background: #191e4d;
}

.card__body { display: block; min-width: 0; }
.card__eyebrow { display: block; margin-bottom: 5px; font-size: 8px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; color: var(--pink); }
.card__name { display: block; font-size: 14px; line-height: 1.3; font-weight: 800; color: var(--text); }
.card__preview { display: -webkit-box; margin-top: 5px; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 10px; line-height: 1.4; color: rgba(208, 216, 245, .65); }
.card__arrow { display: grid; place-items: center; width: 27px; height: 27px; border: 1px solid rgba(255, 207, 63, .22); border-radius: 9px; color: var(--gold); font-size: 14px; transition: transform .2s ease, background .2s ease; }
.card:hover .card__arrow { transform: translate(2px, -2px); background: rgba(255, 207, 63, .1); }

.loading,
.empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 230px;
    padding: 28px;
    border: 1px dashed rgba(194, 207, 255, .18);
    border-radius: 20px;
    text-align: center;
    color: var(--muted);
}

.loading { flex-direction: row; gap: 7px; font-size: 12px; }
.loading i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); animation: load-dot .9s ease-in-out infinite alternate; }
.loading i:nth-child(2) { animation-delay: .15s; }
.loading i:nth-child(3) { animation-delay: .3s; margin-right: 7px; }

.empty > span { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 16px; border-radius: 14px; background: rgba(78, 225, 255, .1); color: var(--cyan); font-size: 22px; }
.empty h3 { font-family: "Unbounded Local", sans-serif; font-size: 16px; color: var(--text); }
.empty p { max-width: 300px; margin-top: 8px; font-size: 12px; line-height: 1.5; }
.empty--error > span { color: var(--pink); background: rgba(255, 95, 162, .1); }

.back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
    color: var(--muted);
    transition: border-color .2s, color .2s, transform .2s;
}
.back span { color: var(--cyan); font-size: 15px; }
.back:hover,
.back:focus-visible { outline: none; color: var(--text); border-color: rgba(78, 225, 255, .42); transform: translateX(-2px); }

.detail__media {
    position: relative;
    width: 100%;
    margin-bottom: 25px;
    overflow: hidden;
    border: 1px solid rgba(194, 207, 255, .15);
    border-radius: 24px;
    background: linear-gradient(145deg, #1c2051, #0d1133);
    box-shadow: 0 24px 50px rgba(1, 3, 16, .28);
}

.detail__media::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 36%;
    pointer-events: none;
    background: linear-gradient(transparent, rgba(7, 10, 31, .62));
}

.detail__photo { display: block; width: 100%; max-height: min(43vh, 460px); object-fit: contain; }

.detail__badge {
    position: absolute;
    z-index: 2;
    right: 14px;
    bottom: 14px;
    padding: 8px 11px;
    border: 1px solid rgba(255, 207, 63, .32);
    border-radius: 999px;
    background: rgba(11, 14, 43, .72);
    backdrop-filter: blur(10px);
    color: var(--gold);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.panel__detail .section-kicker { margin-bottom: 11px; }
.detail__school { margin-top: 10px; font-size: 12px; line-height: 1.45; color: var(--cyan); }
.detail__label { margin: 25px 0 10px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 9px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--pink); }
.detail__achievement { font-size: 15px; line-height: 1.65; color: rgba(241, 243, 255, .9); }
.detail__achievement > :first-child { margin-top: 0; }
.detail__achievement > :last-child { margin-bottom: 0; }
.detail__achievement p { margin: 0 0 11px; }
.detail__achievement h1,
.detail__achievement h2,
.detail__achievement h3 { margin: 18px 0 8px; font-family: "Unbounded Local", sans-serif; font-size: 1.05em; line-height: 1.35; }
.detail__achievement ul,
.detail__achievement ol { margin: 0 0 12px; padding-left: 1.25em; }
.detail__achievement li { margin-bottom: 5px; }
.detail__achievement a { color: var(--cyan); }
.detail__achievement code { padding: 2px 5px; border-radius: 5px; background: rgba(78, 225, 255, .1); }
.detail__achievement blockquote { margin: 0 0 12px; padding-left: 13px; border-left: 2px solid var(--pink); color: var(--muted); }

.detail__diploma:not(:empty) { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.detail__dip-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 13px; }
.detail__dip-head span { display: block; margin-bottom: 5px; font-size: 8px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--pink); }
.detail__dip-head h3 { font-family: "Unbounded Local", sans-serif; font-size: 15px; }
.detail__dip-head > i { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid rgba(255, 207, 63, .25); border-radius: 10px; color: var(--gold); font-style: normal; }

.diploma-thumbs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 0 9px; scrollbar-width: thin; }
.dip-thumb { flex: 0 0 auto; display: block; width: 86px; height: 86px; overflow: hidden; border: 1px solid rgba(194, 207, 255, .18); border-radius: 14px; background: #151a47; transition: transform .2s, border-color .2s; }
.dip-thumb:hover { transform: translateY(-2px); border-color: rgba(78, 225, 255, .5); }
.dip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dip-thumb--pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-decoration: none; color: var(--gold); }
.dip-thumb--pdf b { font-family: "Unbounded Local", sans-serif; font-size: 16px; }
.dip-thumb--pdf span { font-size: 8px; color: var(--muted); text-transform: uppercase; }

/* До выбора показываем компактные подписи-ориентиры. После выбора они исчезают:
   название и подробности уже находятся в правой панели. */
.school-marker {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -100%);
    transform-origin: center bottom;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.school-marker:focus-visible { outline: none; }

.school-marker__label {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 5px);
    width: max-content;
    max-width: 118px;
    padding: 4px 6px;
    overflow: hidden;
    border: 1px solid rgba(78, 225, 255, .18);
    border-radius: 7px;
    opacity: .78;
    transform: translate(-50%, 0) scale(.92);
    pointer-events: none;
    background: rgba(8, 11, 37, .76);
    box-shadow: 0 5px 14px rgba(2, 4, 18, .24), inset 0 1px rgba(255, 255, 255, .06);
    backdrop-filter: blur(8px);
    color: #f8f9ff;
    font-family: "Noto Sans KZ", sans-serif;
    font-size: 7px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    transition: opacity .22s, transform .22s, max-width .22s, visibility 0s linear 0s;
}

.map-stage:not(.has-selection) .school-marker:hover .school-marker__label,
.map-stage:not(.has-selection) .school-marker:focus-visible .school-marker__label {
    max-width: 210px;
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

.map-stage.has-selection .school-marker__label,
.map-stage.has-selection .school-marker:hover .school-marker__label,
.map-stage.has-selection .school-marker:focus-visible .school-marker__label,
.map-stage.has-selection .school-marker.is-active .school-marker__label {
    visibility: hidden;
    opacity: 0;
    transform: translate(-50%, -7px) scale(.88);
    transition-delay: 0s, 0s, 0s, .22s;
}

.school-marker__signal {
    position: relative;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(78, 225, 255, .7);
    border-radius: 13px 13px 13px 4px;
    transform: rotate(-5deg);
    color: var(--cyan);
    background: linear-gradient(145deg, rgba(19, 36, 86, .96), rgba(16, 18, 58, .96));
    box-shadow: inset 0 1px rgba(255, 255, 255, .15), 0 0 18px rgba(78, 225, 255, .34), 0 8px 18px rgba(4, 6, 22, .38);
    transition: transform .2s ease, color .2s, border-color .2s, box-shadow .2s;
}

.school-marker__signal svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.school-marker__signal b { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; min-width: 21px; height: 21px; padding: 0 5px; border: 2px solid #111641; border-radius: 999px; background: linear-gradient(135deg, var(--pink), #ff8a69); box-shadow: 0 0 13px rgba(255, 95, 162, .52); color: #fff; font-family: "Unbounded Local", sans-serif; font-size: 8px; }

.school-marker__halo {
    position: absolute;
    inset: -8px;
    z-index: -1;
    border: 1px solid rgba(78, 225, 255, .3);
    border-radius: 17px;
    animation: marker-pulse 2.8s ease-out infinite;
}

.school-marker:hover .school-marker__signal,
.school-marker:focus-visible .school-marker__signal,
.school-marker.is-active .school-marker__signal {
    transform: rotate(0) translateY(-3px) scale(1.08);
    color: var(--gold);
    border-color: rgba(255, 207, 63, .82);
    box-shadow: inset 0 1px rgba(255, 255, 255, .18), 0 0 26px rgba(255, 207, 63, .4), 0 10px 22px rgba(4, 6, 22, .42);
}

@keyframes hero-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes panel-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes signal { 0% { opacity: .75; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.55); } }
@keyframes marker-pulse { 0%, 35% { opacity: .65; transform: scale(.72); } 100% { opacity: 0; transform: scale(1.45); } }
@keyframes load-dot { to { opacity: .25; transform: translateY(-4px); } }

@media (max-width: 1180px) {
    :root { --panel-width: clamp(390px, 39vw, 470px); }
    .map-hero { width: min(440px, 48vw); }
    .city-stat { min-width: 135px; }
}

@media (max-width: 900px), (max-aspect-ratio: 4 / 5) {
    body.achievement-map-page {
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: none;
    }
    .layout {
        flex-direction: column;
        height: auto;
        min-height: 100dvh;
    }
    .map-stage {
        position: sticky;
        z-index: 6;
        top: 0;
        flex: 0 0 41dvh;
        width: 100%;
        height: 41dvh;
        min-height: 330px;
    }
    .panel {
        z-index: 5;
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        min-height: 59dvh;
        overflow: visible;
        padding: 28px clamp(24px, 5vw, 54px) 42px;
        border-top: 1px solid rgba(194, 207, 255, .13);
        border-left: 0;
        border-radius: 30px 30px 0 0;
        box-shadow: 0 -24px 70px rgba(2, 4, 18, .45);
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
    }
    .panel::before { display: none; }
    .panel__topline { margin-bottom: 18px; }
    .panel__mode { font-size: 13px; }
    .panel__status { font-size: 11px; }
    .panel__placeholder { min-height: auto; justify-content: flex-start; }
    .directory-head { margin-bottom: 18px; }
    .directory-head .section-kicker { font-size: 12px; }
    .directory-head h2 { font-size: clamp(30px, 4.5vw, 42px); }
    .directory-head p { max-width: none; font-size: 17px; }
    .school-directory { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
    .school-choice { grid-template-columns: 34px minmax(0, 1fr) auto 40px; min-height: 100px; padding: 15px 16px; border-radius: 20px; }
    .school-choice__index { font-size: 11px; }
    .school-choice__body strong { font-size: 18px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .school-choice__body small { font-size: 13px; }
    .school-choice__count { min-width: 45px; height: 45px; font-size: 15px; }
    .school-choice__arrow { width: 40px; height: 40px; font-size: 18px; }
    .schools-back { min-height: 54px; padding: 12px 18px; font-size: 15px; }
    .signal-orb { position: absolute; right: 7vw; width: 102px; height: 102px; margin: 0; opacity: .75; }
    .signal-orb__core { width: 54px; height: 54px; border-radius: 18px; font-size: 23px; }
    .panel__placeholder h2 { max-width: 66%; font-size: clamp(25px, 5vw, 38px); }
    .panel__placeholder > p { max-width: 72%; font-size: 14px; }
    .panel__tip { margin-top: 20px; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    .card { grid-template-columns: 78px minmax(0, 1fr) 38px; min-height: 126px; padding: 15px; }
    .card__photo { width: 78px; height: 88px; }
    .card__name { font-size: 18px; }
    .card__preview { font-size: 13px; }
    .card__arrow { width: 36px; height: 36px; font-size: 18px; }
    .panel__list h2, .detail__name { font-size: clamp(30px, 4vw, 40px); }
    .school-meta__item p, .school-meta__item a { font-size: 15px; }
    .map-hero { top: 21px; left: 22px; width: min(450px, 72vw); }
    .brand-lockup { margin-bottom: 14px; }
    .map-hero__copy { display: none; }
    .city-stats { margin-top: 17px; }
    .city-stat { min-width: 125px; padding: 10px 13px; }
    .map-legend { right: 20px; left: auto; bottom: 20px; }
    .school-marker__signal { width: 56px; height: 56px; border-radius: 17px 17px 17px 6px; }
    .school-marker__signal svg { width: 30px; }
    .school-marker__signal b { min-width: 27px; height: 27px; font-size: 10px; }
    .school-marker__halo { inset: -11px; border-radius: 21px; }
    .school-marker__label { bottom: calc(100% + 8px); max-width: 165px; padding: 6px 9px; font-size: 10px; border-radius: 9px; }
}

@media (max-width: 620px) {
    .map-stage { flex-basis: 46dvh; height: 46dvh; min-height: 290px; }
    .panel { min-height: 54dvh; padding: 20px 18px 30px; border-radius: 22px 22px 0 0; }
    .panel__topline { margin-bottom: 20px; }
    .panel__mode { font-size: 8px; }
    .panel__status { font-size: 8px; }
    .map-hero { top: 17px; left: 17px; width: calc(100% - 34px); }
    .brand-lockup { width: 160px; height: 57px; margin-bottom: 11px; }
    .brand-logo { width: 160px; transform: translateY(-20px); }
    .live-kicker { margin-bottom: 10px; font-size: 9px; }
    .city-stats { gap: 7px; margin-top: 13px; }
    .city-stat { min-width: 0; padding: 8px 10px; border-radius: 12px; }
    .city-stat strong { font-size: 16px; }
    .city-stat span { font-size: 9px; }
    .map-legend { display: none; }
    .signal-orb { display: none; }
    .panel__placeholder h2 { max-width: 100%; margin-top: 12px; font-size: 24px; }
    .panel__placeholder > p { max-width: 100%; margin-top: 12px; font-size: 13px; line-height: 1.5; }
    .panel__tip { font-size: 9px; }
    .cards { grid-template-columns: 1fr; }
    .school-directory { grid-template-columns: 1fr; }
    .school-choice { min-height: 84px; grid-template-columns: 28px minmax(0, 1fr) auto 34px; padding: 12px; }
    .school-choice__body strong { font-size: 15px; }
    .school-choice__body small { font-size: 11px; }
    .school-choice__count { min-width: 38px; height: 38px; font-size: 13px; }
    .school-choice__arrow { width: 34px; height: 34px; }
    .panel__list h2,
    .detail__name { font-size: 24px; }
    .card { grid-template-columns: 55px 1fr 26px; min-height: 86px; padding: 11px; }
    .card__photo { width: 55px; height: 61px; }
    .detail__photo { max-height: 36vh; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
