:root {
    --color-bg: #F5F5F5;
    --color-bg-desktop: #212121;
    --color-surface: #ffffff;
    --color-text: #171A1D;
    --color-muted: #6F7581;
    --color-primary: #3761EE;
    --color-primary-dark: #244fb0;
    --color-accent: #E8458B;
    --color-accent-dark: #c9226b;
    --color-border: #E3E6EB;
    --color-field-bg: #F1F4F8;
    --color-error-bg: #fdecea;
    --color-error-text: #a4272c;
    --radius: 16px;
    --radius-btn: 12px;
    --radius-field: 12px;
    --shadow-card: 0 1px 2px rgba(23, 26, 29, 0.04), 0 8px 24px rgba(23, 26, 29, 0.06);
    --shell-width: 480px;
    --topbar-height: 56px;
    --bottomnav-height: 64px;
    --motion-fast: 180ms ease;
}

@media (prefers-reduced-motion: reduce) {
    :root {
        --motion-fast: 0ms;
    }
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--color-bg-desktop);
    color: var(--color-text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.5;
    overflow-wrap: break-word;
}

/* ---------- App shell (mobile-app frame) ---------- */

.app-bg {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background: var(--color-bg-desktop);
}

.app-shell {
    position: relative;
    width: 100%;
    max-width: var(--shell-width);
    min-height: 100vh;
    background: var(--color-bg);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

@media (min-width: 481px) {
    .app-shell {
        border-radius: 24px;
        margin: 24px 0;
        min-height: calc(100vh - 48px);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
        overflow: hidden;
    }
}

.app-shell > .page {
    flex: 1 0 auto;
}

/* ---------- Top bar ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    padding-top: calc(10px + env(safe-area-inset-top, 0px));
    min-height: var(--topbar-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    min-width: 0;
}

.topbar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    flex: none;
    border-radius: 9px;
    background: var(--color-primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

.topbar-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.menu {
    position: relative;
}

.menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    cursor: pointer;
    list-style: none;
    font-size: 1.1rem;
    user-select: none;
}

.menu-toggle::-webkit-details-marker {
    display: none;
}

.menu-toggle:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.menu[open] .menu-toggle {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(23, 26, 29, 0.14);
    padding: 8px;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.menu-panel a {
    padding: 10px 12px;
    border-radius: 8px;
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.menu-panel a:hover {
    background: var(--color-field-bg);
}

.menu-panel hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 6px 4px;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.78rem;
    background: var(--color-field-bg);
    border-radius: 999px;
    padding: 3px;
    flex: none;
}

.lang-switch a {
    color: var(--color-muted);
    text-decoration: none;
    padding: 5px 9px;
    border-radius: 999px;
    font-weight: 600;
}

.lang-switch a.active {
    color: #fff;
    background: var(--color-primary);
}

/* Transparent overlay top bar on the full-bleed home hero */
body.home .topbar {
    position: absolute;
    left: 0;
    right: 0;
    background: transparent;
    border-bottom: none;
    z-index: 5;
}

body.home .topbar-name {
    color: #fff;
}

body.home .menu-toggle {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

body.home .lang-switch {
    background: rgba(255, 255, 255, 0.16);
}

body.home .lang-switch a {
    color: rgba(255, 255, 255, 0.85);
}

body.home .lang-switch a.active {
    background: #fff;
    color: var(--color-text);
}

.page {
    max-width: 720px;
    margin: 0 auto;
    padding: 20px 16px 48px;
    width: 100%;
}

body.home .page {
    max-width: none;
    padding: 0;
}

/* ---------- Bottom navigation ---------- */

.bottom-nav {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.bottom-nav-item {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 4px;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 600;
    border-radius: 10px;
}

.bottom-nav-item .icon {
    font-size: 1.15rem;
    line-height: 1;
}

.bottom-nav-item.active {
    color: var(--color-primary);
}

.bottom-nav-item:hover {
    background: var(--color-field-bg);
}

/* ---------- Home hero ---------- */

.hero-full {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px 20px calc(28px + env(safe-area-inset-bottom, 0px));
    background:
        linear-gradient(rgba(20, 22, 30, 0.35), rgba(15, 16, 24, 0.65)),
        radial-gradient(circle at 30% 18%, #4a67f0 0%, transparent 45%),
        radial-gradient(circle at 80% 75%, #e8458b 0%, transparent 50%),
        linear-gradient(160deg, #1b2140 0%, #212a52 45%, #33206b 100%);
    background-size: cover;
    background-position: center;
    color: #fff;
    isolation: isolate;
}

@media (min-width: 481px) {
    .hero-full {
        min-height: calc(100vh - 48px);
    }
}

.hero-full::before {
    /* Drop a portrait photo (~1080x1920, students/professions, subject
       kept out of the bottom-third so it doesn't collide with the hero
       text/buttons) at static/img/hero-cover.jpg to replace the gradient
       below - no CSS change needed once the file exists. */
    content: "";
    position: absolute;
    inset: 0;
    background-image: url('/static/img/hero-cover.png');
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.hero-full::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 16, 0.32);
    z-index: -1;
}

.hero-tagline {
    align-self: flex-start;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.16);
    padding: 5px 12px;
    border-radius: 999px;
    margin: 0 0 auto;
}

.hero-title {
    font-size: 1.9rem;
    line-height: 1.2;
    font-weight: 800;
    margin: 0 0 12px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.hero-subtitle {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 24px;
    max-width: 40ch;
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Back link ---------- */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--color-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.back-link:hover {
    color: var(--color-primary);
}

/* ---------- Auth screens (login / register) ---------- */

.auth-screen {
    max-width: 360px;
    margin: 24px auto 0;
    padding: 0 4px;
}

.auth-logo {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--color-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 16px;
}

.auth-screen h1 {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.auth-sub {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin: 0 0 22px;
}

.auth-form {
    gap: 4px;
}

.auth-form button[type="submit"] {
    width: 100%;
    align-self: stretch;
    margin-top: 22px;
}

.auth-switch {
    text-align: center;
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-top: 18px;
}

.auth-switch a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

/* ---------- Stage indicator (intake -> test) ---------- */

.stage-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
}

.stage-dot {
    flex: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--color-field-bg);
    color: var(--color-muted);
    border: 2px solid var(--color-border);
}

.stage-dot.is-active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: #fff;
}

.stage-dot.is-done {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.stage-line {
    flex: 1;
    height: 2px;
    background: var(--color-border);
}

.stage-label {
    font-size: 0.75rem;
    color: var(--color-muted);
    font-weight: 600;
}

.stage-label.is-active {
    color: var(--color-primary);
}

/* ---------- RIASEC per-dimension colors ---------- */

.riasec-R { --riasec-color: #3761EE; }
.riasec-I { --riasec-color: #7C3AED; }
.riasec-A { --riasec-color: #E8458B; }
.riasec-S { --riasec-color: #16A34A; }
.riasec-E { --riasec-color: #F59E0B; }
.riasec-C { --riasec-color: #14B8A6; }

.chart-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--riasec-color, var(--color-primary));
    margin-right: 6px;
}

.chart-fill {
    background: var(--riasec-color, var(--color-primary)) !important;
}

.type-card {
    border-left: 4px solid var(--riasec-color, var(--color-primary));
}

.type-card h3 {
    color: var(--riasec-color, var(--color-primary-dark)) !important;
}

.result-congrats {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(55, 97, 238, 0.08);
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 12px;
}

.radar-chart {
    display: block;
    width: 100%;
    max-width: 280px;
    height: auto;
    margin: 4px auto 8px;
}

.radar-grid-ring {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 1;
}

.radar-spoke {
    stroke: var(--color-border);
    stroke-width: 1;
}

.radar-shape {
    fill: rgba(55, 97, 238, 0.18);
    stroke: var(--color-primary);
    stroke-width: 2;
    stroke-linejoin: round;
}

.radar-label {
    font-size: 9px;
    font-weight: 700;
    fill: var(--riasec-color, var(--color-muted));
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

/* ---------- Test flow ---------- */

.test-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.scale-option {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Big Five per-trait colors ---------- */

.trait-O { --riasec-color: #7C3AED; }
.trait-C { --riasec-color: #3761EE; }
.trait-E { --riasec-color: #F59E0B; }
.trait-A { --riasec-color: #16A34A; }
.trait-N { --riasec-color: #E8458B; }

.trait-detail-card {
    border-left: 4px solid var(--riasec-color, var(--color-primary));
}

.trait-detail-card h2 {
    color: var(--riasec-color, var(--color-primary-dark));
}

/* ---------- Advisor / chat ---------- */

.advisor-compose {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.advisor-compose textarea {
    min-height: 64px;
    resize: vertical;
}

.advisor-history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}

.advisor-history-item .arrow {
    color: var(--color-muted);
    flex: none;
}

.chat-page {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - var(--topbar-height));
}

.chat-thread-wrap {
    flex: 1 1 auto;
}

.chat-composer {
    position: sticky;
    bottom: 0;
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    margin: 16px -16px -20px;
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.chat-composer textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    resize: none;
}

.chat-composer button {
    flex: none;
    height: 44px;
    padding: 0 18px;
    margin: 0;
}

/* ---------- Grant calculator result cards ---------- */

.calc-result-card {
    background: var(--color-field-bg);
    border-radius: var(--radius-field);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.calc-result-info h3 {
    margin: 0 0 4px;
    font-size: 0.95rem;
}

.calc-result-meta {
    color: var(--color-muted);
    font-size: 0.82rem;
    margin: 0;
}

/* ---------- Catalog filter bar (universities / professions) ---------- */

.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

@media (min-width: 420px) {
    .filter-bar {
        flex-direction: row;
    }

    .filter-bar select {
        flex: none;
        width: 40%;
    }
}

/* ---------- Grant-calculator wizard ---------- */

.wizard-step h2 {
    font-size: 1.05rem;
}

.wizard-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0 20px;
    max-height: 50vh;
    overflow-y: auto;
}

.wizard-option {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-field-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-field);
    padding: 12px 14px;
    cursor: pointer;
    font-size: 0.9rem;
}

.wizard-option input {
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
}

.wizard-option:has(input:checked) {
    border-color: var(--color-primary);
    background: rgba(55, 97, 238, 0.08);
    font-weight: 600;
}

/* ---------- Probability ring ---------- */

.probability-ring-wrap {
    position: relative;
    width: 46px;
    height: 46px;
    flex: none;
}

.probability-ring {
    width: 46px;
    height: 46px;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 4;
}

.ring-fg {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
}

.ring-very_high { stroke: #1e6b30; }
.ring-high { stroke: var(--color-primary); }
.ring-medium { stroke: #8a5a00; }
.ring-low { stroke: var(--color-error-text); }

.probability-ring-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
}

/* ---------- Famous-figure trait alignment rows ---------- */

.famous-row {
    background: var(--color-field-bg);
    border-radius: var(--radius-field);
    padding: 12px 14px;
    margin-bottom: 10px;
}

.famous-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.famous-name {
    font-weight: 600;
    font-size: 0.92rem;
}

.famous-percent {
    font-weight: 700;
    font-size: 0.92rem;
    flex: none;
}

.famous-meta {
    margin: 6px 0 0;
    font-size: 0.75rem;
    color: var(--color-muted);
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chip-form {
    display: contents;
}

.chip-btn {
    background: var(--color-field-bg);
    color: var(--color-text);
    border: none;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--motion-fast), color var(--motion-fast);
}

.chip-btn:hover {
    background: var(--color-primary);
    color: #fff;
}

.chip-btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.empty-state {
    text-align: center;
    color: var(--color-muted);
    padding: 24px 12px;
    font-size: 0.9rem;
}

/* ---------- Per-university score cards (program detail) ---------- */

.uni-score-card {
    background: var(--color-field-bg);
    border-radius: var(--radius-field);
    padding: 14px 16px;
    margin-bottom: 10px;
}

.uni-score-card h3 {
    margin: 0 0 2px;
    font-size: 0.95rem;
}

.uni-score-competition {
    color: var(--color-muted);
    font-size: 0.82rem;
    margin: 0 0 10px;
}

.uni-score-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
}

.uni-score-grid div {
    text-align: center;
}

.uni-score-grid dt {
    font-size: 0.68rem;
    color: var(--color-muted);
    margin: 0 0 2px;
}

.uni-score-grid dd {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.card {
    background: var(--color-surface);
    border: none;
    box-shadow: var(--shadow-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
}

h1 {
    font-size: 1.5rem;
    margin: 0 0 12px;
}

h2 {
    font-size: 1.3rem;
    margin: 0 0 16px;
}

.lead {
    color: var(--color-muted);
    margin-bottom: 24px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    min-height: 46px;
    border-radius: var(--radius-btn);
    text-decoration: none;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn:active {
    transform: scale(0.98);
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

/* Mobile-app style block buttons used on the home screen and forms */
.btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 46px;
    border-radius: var(--radius-btn);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: none;
    transition: filter var(--motion-fast), transform var(--motion-fast);
}

.btn-block .icon {
    font-size: 1.05rem;
    line-height: 1;
}

.btn-block:hover {
    filter: brightness(1.06);
}

.btn-block:active {
    transform: scale(0.98);
}

.btn-block:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}

.btn-block-accent {
    background: var(--color-accent);
}

.btn-block-primary {
    background: var(--color-primary);
}

.btn-block-spaced {
    margin-bottom: 14px;
}

.btn-block-secondary {
    background: var(--color-field-bg);
    color: var(--color-text);
}

form {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

label {
    font-weight: 600;
    margin-top: 12px;
    font-size: 0.9rem;
}

input[type="text"], input[type="email"], input[type="password"], select, textarea {
    padding: 12px;
    background: var(--color-field-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-field);
    font-size: 1rem;
    min-height: 46px;
    width: 100%;
    font-family: inherit;
    transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}

input[type="text"]:focus-visible, input[type="email"]:focus-visible,
input[type="password"]:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(55, 97, 238, 0.15);
}

button[type="submit"] {
    margin-top: 20px;
    align-self: flex-start;
}

.alert {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert p {
    margin: 0;
}

.alert-success {
    background: #e8f5e9;
    color: #1e6b30;
}

.progress-wrap {
    margin-bottom: 8px;
}

.progress-label {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-bottom: 6px;
}

.progress-bar {
    background: var(--color-border);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.progress-fill {
    background: var(--color-primary);
    height: 100%;
    transition: width 0.2s ease;
}

.hint {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin: 12px 0 20px;
}

.question {
    background: var(--color-field-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-field);
    padding: 16px;
    margin-bottom: 16px;
}

.question-error {
    background: var(--color-error-bg);
    border-color: var(--color-error-text);
}

.question legend {
    font-weight: 600;
    padding: 0 4px;
}

.scale {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.scale-option {
    flex: 1 1 auto;
    min-width: 90px;
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-field);
    padding: 10px 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-muted);
    transition: border-color var(--motion-fast), background var(--motion-fast);
}

.scale-option input {
    display: block;
    margin: 0 auto 6px;
}

.scale-option:has(input:checked) {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(47, 111, 235, 0.06);
    font-weight: 600;
}

/* ---------- Slider-look answer scale (still discrete radios underneath -
   no default value is ever selected, so an unanswered question can never
   silently submit a value) ---------- */

.scale-slider {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-top: 18px;
    padding: 0 2px;
}

.scale-track {
    position: absolute;
    top: 9px;
    left: 12px;
    right: 12px;
    height: 3px;
    background: var(--color-border);
    border-radius: 999px;
}

.scale-track-fill {
    position: absolute;
    top: 9px;
    left: 12px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 999px;
    max-width: calc(100% - 24px);
}

.scale-dot {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.scale-dot input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-surface);
    margin: 0;
    cursor: pointer;
    transition: border-color var(--motion-fast), background var(--motion-fast), transform var(--motion-fast), box-shadow var(--motion-fast);
}

.scale-dot input[type="radio"]:checked {
    border-color: var(--color-primary);
    background: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(55, 97, 238, 0.15);
    transform: scale(1.15);
}

.scale-dot input[type="radio"]:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

.scale-dot-label {
    font-size: 0.7rem;
    color: var(--color-muted);
    text-align: center;
    line-height: 1.25;
}

.scale-dot:first-child .scale-dot-label {
    text-align: left;
}

.scale-dot:last-child .scale-dot-label {
    text-align: right;
}

.scale-dot-label.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.result-subject {
    color: var(--color-muted);
    margin: 0 0 8px;
}

.holland-code {
    font-size: 1.1rem;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    margin-bottom: 14px;
}

.chart-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.chart-track {
    background: var(--color-border);
    border-radius: 999px;
    height: 14px;
    overflow: hidden;
}

.chart-fill {
    background: var(--color-primary);
    height: 100%;
}

.chart-percent {
    font-size: 0.85rem;
    color: var(--color-muted);
    text-align: right;
}

.top3 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.type-card {
    background: var(--color-field-bg);
    border-radius: var(--radius-field);
    padding: 16px;
}

.type-card h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--color-primary-dark);
}

.type-card p {
    margin: 0;
    color: var(--color-text);
}

@media (min-width: 480px) {
    .scale-option {
        min-width: 0;
    }
}

.program-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.program-card {
    background: var(--color-field-bg);
    border-radius: var(--radius-field);
    padding: 16px;
}

.program-card h3 {
    margin: 0 0 8px;
    font-size: 1.05rem;
    color: var(--color-primary-dark);
}

.program-code {
    color: var(--color-muted);
    font-weight: 400;
    font-size: 0.9rem;
}

.program-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0 0 8px;
}

.program-stats dt {
    font-size: 0.8rem;
    color: var(--color-muted);
}

.program-stats dd {
    margin: 0;
    font-weight: 600;
}

.program-universities {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin: 0 0 8px;
}

.link-more {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.table-scroll {
    overflow-x: auto;
}

.cutoff-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.cutoff-table th,
.cutoff-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.cutoff-table th {
    color: var(--color-muted);
    font-weight: 600;
}

.consent-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    margin: 8px 0 4px;
}

.consent-check input {
    margin-top: 4px;
}

.badge {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 8px;
    vertical-align: middle;
}

.trait-detail {
    margin: 0;
}

.trait-detail dt {
    font-weight: 600;
    margin-top: 12px;
    font-size: 0.9rem;
}

.trait-detail dt:first-child {
    margin-top: 0;
}

.trait-detail dd {
    margin: 4px 0 0;
    color: var(--color-text);
}

.advisor-history {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.advisor-history-item {
    display: block;
    padding: 12px 14px;
    background: var(--color-field-bg);
    border: 1px solid transparent;
    border-radius: var(--radius-field);
    color: var(--color-text);
    text-decoration: none;
}

.advisor-history-item:hover {
    border-color: var(--color-primary);
}

.advisor-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.advisor-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 10px;
}

.advisor-message-user {
    align-self: flex-end;
    background: rgba(47, 111, 235, 0.08);
}

.advisor-message-assistant {
    align-self: flex-start;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
}

.advisor-message-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-muted);
    margin-bottom: 4px;
}

.advisor-message-content {
    white-space: pre-wrap;
}

.admin-filter-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.admin-filter-form label {
    margin-top: 0;
    white-space: nowrap;
}

.admin-filter-form select {
    width: auto;
}

.admin-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.kpi-card {
    text-align: center;
    padding: 16px;
    background: var(--color-field-bg);
    border-radius: var(--radius-field);
}

.kpi-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.kpi-label {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin-top: 4px;
}

.admin-top-list {
    padding-left: 20px;
    margin: 0;
}

.admin-top-list li {
    margin-bottom: 8px;
}

.probability-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

.probability-very_high {
    background: #e8f5e9;
    color: #1e6b30;
}

.probability-high {
    background: rgba(47, 111, 235, 0.12);
    color: var(--color-primary-dark);
}

.probability-medium {
    background: #fff4e0;
    color: #8a5a00;
}

.probability-low {
    background: var(--color-error-bg);
    color: var(--color-error-text);
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.qr-card {
    text-align: center;
}

.qr-image {
    width: 100%;
    max-width: 180px;
    height: auto;
    image-rendering: pixelated;
    margin: 0 auto 12px;
}

/* §3.3 content-page additions: tabs, foreign-university cards, universal-skill tiles */

.tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.tab-btn {
    padding: 10px 20px;
    border-radius: 999px;
    border: none;
    background: var(--color-field-bg);
    color: var(--color-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.uni-grid {
    display: grid;
    gap: 16px;
}

.uni-card h3 {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.uni-meta {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 0 0 10px;
}

#kz-university-search {
    margin-bottom: 16px;
}

/* ---------- «Дағдылар» беті (/skills) ----------
   Қою көк хаб: 3 санат → белгішелі карточкалар → түсіндірме модалі.
   Бет кең: app-shell-дің 480px шегі тек осы бетте үлкейтіледі, әйтпесе
   компьютерде 4 баған мен 600px модаль сыймайды. Фон — тек CSS градиент,
   сурет жүктелмесе де бет өзгермейді. */

body.hub-page {
    --shell-width: 1240px;
    --sk-bg: #0b1424;
    --sk-panel: #12203a;
    --sk-card: rgba(20, 35, 62, 0.88);
    --sk-card-hover: #1b2f52;
    --sk-line: rgba(214, 226, 247, 0.42);
    --sk-line-strong: rgba(240, 245, 255, 0.92);
    --sk-text: #f5f8fd;
    --sk-muted: #bdc9de;
    --sk-focus: #9ab8ff;
}

:root:has(body.hub-page) {
    scrollbar-gutter: stable;
}

html.pt-modal-open {
    overflow: hidden;
}

body.hub-page .app-shell {
    background:
        radial-gradient(1200px 520px at 15% -10%, rgba(55, 97, 238, 0.28), transparent 60%),
        radial-gradient(900px 480px at 100% 0%, rgba(120, 160, 255, 0.14), transparent 55%),
        var(--sk-bg);
}

body.hub-page .page {
    max-width: 1100px;
}

.sr-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.sk-icon {
    width: 24px;
    height: 24px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sk-icon-sm {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.skills-hub {
    color: var(--sk-text);
    padding: 4px 0 28px;
}

.skills-hub .back-link {
    color: var(--sk-muted);
}

.skills-hub .back-link:hover {
    color: #fff;
}

.skills-hub :focus-visible,
.pt-dialog :focus-visible,
.profession-skill-card:focus-visible {
    outline: 3px solid var(--sk-focus);
    outline-offset: 3px;
}

.skills-title,
.skills-category-title,
.pt-dialog-title,
.skills-hub [tabindex="-1"]:focus-visible,
.pt-dialog [tabindex="-1"]:focus-visible {
    /* Тақырыптарға фокус тек экран оқитын бағдарлама үшін бағдарламалық түрде
       қойылады; интерактивті элементтердің фокус жиегі өзгеріссіз. */
    outline: none;
}

.skills-title {
    font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem);
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin: 0 0 10px;
    color: #fff;
}

.skills-lead {
    max-width: 640px;
    margin: 0 0 24px;
    color: var(--sk-muted);
    font-size: 1.02rem;
}

/* Санат ауыстырғыш */
.skills-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.skills-switch[hidden] {
    display: none;
}

.skills-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px 0 12px;
    border-radius: 999px;
    border: 1px solid var(--sk-line);
    color: var(--sk-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    transition: background var(--motion-fast), border-color var(--motion-fast);
}



.skills-tabs {
    list-style: none;
    margin: 0;
    padding: 4px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    flex: 1 1 360px;
    max-width: 560px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(214, 226, 247, 0.18);
}

.skills-tab {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    height: 100%;
    padding: 6px 8px;
    border-radius: 10px;
    text-align: center;
    line-height: 1.2;
    color: var(--sk-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: background var(--motion-fast), color var(--motion-fast);
}



.skills-tab[aria-current="page"] {
    background: #fff;
    color: #0b1424;
}

/* Бастапқы экран: 3 санат */
.category-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.category-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
        "icon title"
        "icon tagline"
        "icon foot";
    column-gap: 16px;
    row-gap: 4px;
    height: 100%;
    padding: 20px;
    border-radius: 20px;
    border: 1.5px solid var(--sk-line);
    background: var(--sk-card);
    color: var(--sk-text);
    text-decoration: none;
    transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}



.category-card-icon {
    grid-area: icon;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    border: 1.5px solid var(--sk-line);
    background: rgba(255, 255, 255, 0.05);
}

.category-card-icon .sk-icon {
    width: 30px;
    height: 30px;
}

.category-card-title {
    grid-area: title;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.25;
}

.category-card-tagline {
    grid-area: tagline;
    color: var(--sk-muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.category-card-foot {
    grid-area: foot;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

/* Санат ішіндегі дағды карточкалары */
.skills-category[hidden],
.skills-overview[hidden] {
    display: none;
}

.skills-category-title {
    font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem);
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
}

.skills-category-desc {
    max-width: 680px;
    margin: 0 0 20px;
    color: var(--sk-muted);
}

.skill-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.skill-cards > li {
    display: flex;
}

.skill-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    min-height: 136px;
    padding: 20px 10px 16px;
    border-radius: 18px;
    border: 1.5px solid var(--sk-line);
    background: var(--sk-card);
    color: var(--sk-text);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}



.skill-card:active {
    transform: translateY(0);
}

.skill-card-icon {
    width: 44px;
    height: 44px;
    stroke-width: 1.4;
}

.skill-card-title {
    max-width: 100%;
    overflow-wrap: break-word;
    hyphens: auto;
}

.skills-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    margin-top: 22px;
    color: var(--sk-muted);
    font-weight: 600;
    text-decoration: none;
}



@media (min-width: 480px) {
    .skill-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 720px) {
    .category-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 18px;
    }

    .category-card {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "icon" "title" "tagline" "foot";
        row-gap: 6px;
        padding: 24px;
        min-height: 230px;
    }

    .category-card-icon {
        margin-bottom: 10px;
    }

    .category-card-foot {
        margin-top: auto;
        padding-top: 12px;
    }

    .skill-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 16px;
    }

    .skill-card {
        min-height: 156px;
        padding: 24px 14px 20px;
        font-size: 0.95rem;
    }

    .skill-card-icon {
        width: 52px;
        height: 52px;
    }
}

@media (hover: hover) {
    .skills-all:hover {
        background: var(--sk-card-hover);
        border-color: var(--sk-line-strong);
    }

    .skills-tab:hover {
        color: #fff;
        background: rgba(255, 255, 255, 0.08);
    }

    .category-card:hover {
        background: var(--sk-card-hover);
        border-color: var(--sk-line-strong);
        transform: translateY(-2px);
    }

    .skill-card:hover {
        background: var(--sk-card-hover);
        border-color: var(--sk-line-strong);
        transform: translateY(-2px);
    }

    .skills-jump:hover {
        color: #fff;
    }

    .pt-dialog-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
    }

    .pt-dialog-professions a:hover {
        background: rgba(154, 184, 255, 0.26);
    }
}

/* Түсіндірме терезесі */
.pt-dialog {
    --sk-dialog-gap: 16px;
    width: min(600px, calc(100vw - 2 * var(--sk-dialog-gap)));
    max-width: none;
    max-height: calc(100vh - 2 * var(--sk-dialog-gap));
    max-height: calc(100dvh - 2 * var(--sk-dialog-gap) - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    margin: auto;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--sk-text);
    overflow: visible;
}

.pt-dialog[open] {
    display: flex;
    animation: pt-dialog-in 160ms ease-out;
}

.pt-dialog::backdrop {
    background: rgba(4, 9, 20, 0.66);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

@keyframes pt-dialog-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
}

.pt-dialog-panel {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 100%;
    border-radius: 22px;
    border: 1px solid rgba(214, 226, 247, 0.26);
    background: var(--sk-panel);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.pt-dialog-head {
    flex: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px 12px 14px 20px;
    border-bottom: 1px solid rgba(214, 226, 247, 0.14);
}

.pt-dialog-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff;
    color: #0b1424;
}

.pt-dialog-icon .sk-icon {
    width: 30px;
    height: 30px;
    stroke-width: 1.7;
}

.pt-dialog-title {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
    font-weight: 800;
    color: #fff;
    overflow-wrap: break-word;
}

.pt-dialog-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--sk-muted);
    cursor: pointer;
    transition: background var(--motion-fast), color var(--motion-fast);
}



.pt-dialog-close .sk-icon {
    width: 26px;
    height: 26px;
    stroke-width: 2;
}

.pt-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 24px;
    line-height: 1.55;
}

.pt-dialog-body h3 {
    margin: 20px 0 8px;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
}

.pt-dialog-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
    padding: 0;
}

.pt-dialog-tags li {
    padding: 3px 10px;
    border-radius: 999px;
    border: 1px solid rgba(214, 226, 247, 0.3);
    color: var(--sk-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.pt-dialog-def {
    margin: 0;
    font-size: 1.02rem;
    color: var(--sk-text);
}

.pt-dialog-list,
.pt-dialog-steps {
    margin: 0;
    padding-left: 1.3em;
    color: var(--sk-text);
}

.pt-dialog-list li + li,
.pt-dialog-steps li + li {
    margin-top: 6px;
}

.pt-dialog-steps li::marker {
    font-weight: 800;
    color: var(--sk-focus);
}

.pt-dialog-professions {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.pt-dialog-professions a {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 14px;
    border-radius: 12px;
    background: rgba(154, 184, 255, 0.14);
    border: 1px solid rgba(154, 184, 255, 0.35);
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
}



.pt-dialog-note {
    margin: 12px 0 0;
    font-size: 0.82rem;
    color: var(--sk-muted);
}

@media (max-width: 479px) {
    .pt-dialog-head {
        gap: 10px;
        padding: 12px 8px 12px 14px;
    }

    .pt-dialog-icon {
        width: 42px;
        height: 42px;
    }

    .pt-dialog-title {
        font-size: 1.1rem;
    }

    .pt-dialog-body {
        padding: 14px 16px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pt-dialog[open] {
        animation: none;
    }

    .skill-card:hover,
    .category-card:hover {
        transform: none;
    }
}

/* «Мамандық бойынша дағдылар» — бұрынғы анықтамалық, ақ карточкалар */
.profession-skill-card {
    scroll-margin-top: calc(var(--topbar-height) + 16px);
}

.profession-skill-card:focus {
    outline: none;
}

.profession-skill-card:focus-visible,
.profession-skill-card.is-target {
    box-shadow: 0 0 0 3px var(--sk-focus), var(--shadow-card);
}

body.hub-page .empty-state {
    color: var(--sk-muted);
}

/* ---------- «Мамандықтар атласы» (/professions) ----------
   /skills хабымен ортақ: қою көк фон (body.hub-page), .skills-hub,
   .skills-all батырмасы, .pt-dialog модалі. Суреттер — сала түсіндегі
   градиент + SVG белгіше: өлшемі aspect-ratio арқылы алдын ала белгілі,
   жүктелетін файл жоқ, сондықтан бет секірмейді. */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.atlas-filters {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 22px;
    color-scheme: dark;
}

.atlas-search {
    grid-column: 1 / -1;
    position: relative;
    display: flex;
    align-items: center;
}

.atlas-search .sk-icon {
    position: absolute;
    left: 14px;
    color: var(--sk-muted);
    pointer-events: none;
}

.atlas-search input,
.atlas-select select,
.atlas-submit {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid rgba(214, 226, 247, 0.32);
    background: rgba(255, 255, 255, 0.06);
    color: var(--sk-text);
    font: inherit;
    font-size: 1rem;
    padding: 0 14px;
}

.atlas-search input {
    padding-left: 46px;
}

.atlas-search input::placeholder {
    color: rgba(189, 201, 222, 0.8);
}

.atlas-select {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sk-muted);
}

.atlas-select select {
    font-size: 0.95rem;
    text-overflow: ellipsis;
}

.atlas-select option {
    background: #12203a;
    color: #f5f8fd;
}

.atlas-submit {
    grid-column: 1 / -1;
    background: #fff;
    color: #0b1424;
    font-weight: 700;
    cursor: pointer;
}

.atlas-submit[hidden] {
    display: none;
}

.sector-cards,
.atlas-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.sector-cards > li,
.atlas-card-item {
    display: flex;
    min-width: 0;
}

.atlas-card-item[hidden] {
    display: none;
}

.sector-card,
.atlas-card {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    border: 1.5px solid var(--sk-line);
    background: var(--sk-card);
    color: var(--sk-text);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--motion-fast), border-color var(--motion-fast), transform var(--motion-fast);
}

.sector-card-media,
.atlas-card-media,
.atlas-sector-icon {
    background:
        radial-gradient(circle at 78% 18%, hsl(var(--hue) 75% 60% / 0.45), transparent 58%),
        linear-gradient(140deg, hsl(var(--hue) 45% 30%), hsl(calc(var(--hue) + 30) 55% 13%));
    color: #fff;
}

.sector-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.sector-card-main {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36%;
    height: auto;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    stroke-width: 1.2;
}

.sector-card-deco {
    position: absolute;
    width: 20%;
    height: auto;
    aspect-ratio: 1;
    color: rgba(255, 255, 255, 0.38);
    stroke-width: 1.4;
}

.sector-card-deco-1 {
    left: 7%;
    bottom: 9%;
}

.sector-card-deco-2 {
    right: 7%;
    top: 9%;
}

.sector-card-body,
.atlas-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 12px 14px;
}

.sector-card-title {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: break-word;
    hyphens: auto;
}

.sector-card-desc {
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--sk-muted);
}

.sector-card-count {
    margin-top: auto;
    padding-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 700;
}

.atlas-card-media {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16 / 11;
}

.atlas-card-media .sk-icon {
    width: 34%;
    height: auto;
    aspect-ratio: 1;
    stroke-width: 1.3;
}

.atlas-card-title {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
    overflow-wrap: break-word;
    hyphens: auto;
}

.atlas-card-meta {
    font-size: 0.76rem;
    line-height: 1.35;
    color: var(--sk-muted);
}

.atlas-card-more {
    margin-top: auto;
    padding-top: 4px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--sk-muted);
}

.atlas-badge {
    padding: 1px 8px;
    border-radius: 999px;
    border: 1px solid rgba(154, 184, 255, 0.55);
    color: #d3e1ff;
    font-size: 0.72rem;
    font-weight: 700;
}

.atlas-sector-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.atlas-sector-icon {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
}

.atlas-sector-icon .sk-icon {
    width: 30px;
    height: 30px;
}

.atlas-group {
    margin-top: 22px;
}

.atlas-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.atlas-group-title span {
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--sk-muted);
}

.atlas-group-note {
    margin: -6px 0 14px;
    font-size: 0.86rem;
    color: var(--sk-muted);
}

.atlas-results-count {
    margin: -8px 0 14px;
    color: var(--sk-muted);
}

.atlas-empty {
    padding: 28px 16px;
    border: 1px dashed var(--sk-line);
    border-radius: 18px;
    text-align: center;
    color: var(--sk-muted);
}

.atlas-empty[hidden] {
    display: none;
}

.atlas-empty p {
    margin: 0 0 14px;
}

.atlas-full-link {
    margin: 20px 0 0;
}

.atlas-full-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    color: #fff;
    font-weight: 700;
}

.atlas-catalog summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    list-style: none;
}

.atlas-catalog summary::-webkit-details-marker {
    display: none;
}

.atlas-catalog-title {
    font-size: 1.15rem;
    font-weight: 800;
}

.atlas-catalog-title::after {
    content: " ▾";
    color: var(--color-muted);
}

.atlas-catalog[open] .atlas-catalog-title::after {
    content: " ▴";
}

.atlas-catalog .hint {
    margin: 0;
}

.atlas-catalog .program-card {
    scroll-margin-top: calc(var(--topbar-height) + 16px);
}

/* Мамандықтың толық беті */
.profession-page {
    max-width: 760px;
    margin: 0 auto;
}

.atlas-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
    font-size: 0.9rem;
    color: var(--sk-muted);
}

.atlas-breadcrumbs a {
    color: var(--sk-muted);
    font-weight: 600;
}

.profession-page-head {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 4px;
}

.profession-page-head .skills-title {
    margin: 0;
}

.profession-page-media {
    flex: none;
    width: 72px;
    aspect-ratio: 1;
    border-radius: 18px;
}

.profession-page-body {
    overflow: visible;
    padding: 4px 0 0;
}

.profession-page-back {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 28px 0 0;
}

@media (hover: hover) {
    .sector-card:hover,
    .atlas-card:hover {
        background: var(--sk-card-hover);
        border-color: var(--sk-line-strong);
        transform: translateY(-2px);
    }
}

@media (min-width: 600px) {
    .sector-cards,
    .atlas-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .atlas-filters {
        grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
        align-items: end;
    }

    .atlas-search {
        grid-column: auto;
    }

    .atlas-card-title {
        font-size: 0.98rem;
    }
}

@media (min-width: 1000px) {
    .sector-cards,
    .atlas-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .sector-card:hover,
    .atlas-card:hover {
        transform: none;
    }
}

/* ---------- «Жұмысшы мамандықтар» (/working-professions) ----------
   Атластың карточкалары мен модалін қолданады; бұл жерде тек hero,
   кәсіп түрі белгісі, қысқа сипаттама және оқу жолы блогы. Hero фоны —
   CSS градиент пен SVG беріліс тістері: сурет жүктелмесе де бұзылмайды,
   мәтін фон үстінде анық оқылады. */

.wp-hero {
    position: relative;
    overflow: hidden;
    margin: 0 0 22px;
    padding: 18px 18px 22px;
    border-radius: 22px;
    border: 1px solid rgba(214, 226, 247, 0.18);
    background:
        radial-gradient(520px 260px at 85% 10%, rgba(120, 160, 255, 0.28), transparent 60%),
        linear-gradient(150deg, #16294a, #0b1424 70%);
}

.wp-hero-art {
    position: absolute;
    inset: 0;
    pointer-events: none;
    color: rgba(190, 210, 255, 0.13);
}

.wp-hero-art .sk-icon {
    position: absolute;
    height: auto;
    aspect-ratio: 1;
    stroke-width: 1;
}

.wp-hero-gear-1 { width: 180px; right: -40px; top: -40px; }
.wp-hero-gear-2 { width: 96px; right: 110px; bottom: -30px; }
.wp-hero-hat { width: 90px; right: 26px; bottom: 18px; color: rgba(190, 210, 255, 0.18); }
.wp-hero-tool { width: 70px; left: -14px; bottom: -14px; }

.wp-hero-text {
    position: relative;
    max-width: 640px;
}

.wp-hero .skills-title {
    margin-bottom: 8px;
}

.wp-hero .skills-lead {
    margin-bottom: 18px;
}

.wp-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 14px;
    background: #fff;
    color: #0b1424;
    font-weight: 800;
    text-decoration: none;
}

.wp-cta:hover {
    background: #e7eeff;
}

.wp-browse {
    scroll-margin-top: calc(var(--topbar-height) + 12px);
}

.atlas-type {
    align-self: flex-start;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.5;
    border: 1px solid transparent;
}

.atlas-type-worker {
    background: rgba(120, 200, 150, 0.16);
    border-color: rgba(120, 200, 150, 0.45);
    color: #c8f0d6;
}

.atlas-type-technician {
    background: rgba(240, 190, 90, 0.16);
    border-color: rgba(240, 190, 90, 0.45);
    color: #f6dfb0;
}

.atlas-type-engineer {
    background: rgba(154, 184, 255, 0.16);
    border-color: rgba(154, 184, 255, 0.5);
    color: #d3e1ff;
}

.atlas-card-short {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--sk-muted);
}

.pt-dialog-subtitle {
    margin: 10px 0 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--sk-muted);
}

.atlas-skills-cta {
    margin: 14px 0 0;
}

.atlas-education {
    list-style: none;
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.atlas-education li {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(214, 226, 247, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.atlas-education-kind {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--sk-focus);
}

.atlas-education-name {
    font-weight: 700;
    color: #fff;
}

.atlas-education-meta {
    font-size: 0.82rem;
    color: var(--sk-muted);
}

.pt-dialog-note a,
.atlas-education a {
    color: #d3e1ff;
}

@media (min-width: 600px) {
    .wp-hero {
        padding: 26px 28px 30px;
    }

    .wp-hero-gear-1 { width: 260px; }
    .wp-hero-hat { width: 120px; right: 60px; }
}

/* ---------- «ЖОО анықтамалығы» (/universities) ----------
   Хаб дизайн жүйесі (қою көк, .skills-hub, .atlas-filters). Фото 16:10,
   өлшемі алдын ала белгіленген, lazy; жүктелмесе — бас әріптер fallback. */

.uni-tabs {
    max-width: 520px;
    margin-bottom: 16px;
}

.uni-tabs .skills-tab {
    min-height: 52px;
    flex-direction: column;
    gap: 0;
}

.uni-tab-label {
    hyphens: none;
}

.uni-tabs .skills-tab[aria-selected="true"] {
    background: #fff;
    color: #0b1424;
}

.uni-tab-count {
    font-size: 0.74rem;
    font-weight: 600;
    opacity: 0.75;
}

.uni-cards {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.uni-card-item {
    display: flex;
    min-width: 0;
}

.uni-card-item[hidden],
.uni-panel[hidden],
.atlas-select[hidden] {
    display: none;
}

.uni-card {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    overflow: hidden;
    border: 1.5px solid var(--sk-line);
    background: var(--sk-card);
    color: var(--sk-text);
    cursor: pointer;
    transition: border-color var(--motion-fast), background var(--motion-fast);
}

.uni-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(140deg, hsl(var(--hue) 45% 30%), hsl(calc(var(--hue) + 30) 55% 13%));
}

.uni-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uni-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.85);
}

.uni-media img + .uni-fallback {
    display: none;
}

.uni-media.is-fallback .uni-fallback {
    display: flex;
}

.uni-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 14px 12px;
}

.uni-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: break-word;
    hyphens: auto;
}

.uni-card-sub,
.uni-card-meta {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.4;
    color: var(--sk-muted);
}

.uni-card-tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 2px 0 0;
    padding: 0;
}

.uni-card-tags li {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(214, 226, 247, 0.28);
    font-size: 0.74rem;
    color: var(--sk-muted);
}

.uni-card-actions {
    margin-top: auto;
    padding-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.uni-more,
.uni-site {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 700;
    text-decoration: none;
}

.uni-more {
    background: #fff;
    color: #0b1424;
}

.uni-site {
    border: 1px solid var(--sk-line);
    color: var(--sk-text);
}

.uni-site.is-unverified,
.uni-site.is-missing {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--sk-muted);
    border-style: dashed;
}

.uni-site.is-missing {
    cursor: default;
}

.uni-detail {
    max-width: 820px;
    margin: 0 auto;
}

.uni-hero .uni-media {
    border-radius: 20px;
    margin-bottom: 18px;
}

.uni-detail .skills-title {
    margin-bottom: 4px;
}

.uni-detail-sub {
    margin: 0 0 14px;
    color: var(--sk-muted);
}

.uni-detail-actions {
    margin: 0 0 18px;
}

.uni-site-btn.is-unverified,
.uni-site-btn.is-missing {
    background: transparent;
    color: var(--sk-muted);
    border: 1px dashed var(--sk-line);
}

.uni-detail-body {
    overflow: visible;
    padding: 0;
}

.uni-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 0 0 14px;
}

.uni-facts div {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(214, 226, 247, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.uni-facts dt {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--sk-focus);
}

.uni-facts dd {
    margin: 2px 0 0;
    font-weight: 700;
    color: #fff;
}

.uni-h {
    margin: 26px 0 10px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

.uni-muted {
    color: var(--sk-muted);
    font-size: 0.86rem;
}

.uni-sources a,
.uni-detail-body a:not(.skills-all) {
    color: #d3e1ff;
    overflow-wrap: anywhere;
}

body.hub-page .uni-editorial dt {
    color: var(--sk-focus);
}

body.hub-page .uni-editorial dd {
    color: var(--sk-text);
}

@media (hover: hover) {
    .uni-card:hover {
        border-color: var(--sk-line-strong);
        background: var(--sk-card-hover);
    }
}

@media (min-width: 560px) {
    .uni-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .uni-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1200px) {
    .uni-cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ---------- Грант ықтималдығы шебері (/grant-calculator) ----------
   5 қадам: ақ карточка, ортада сұрақ, «1 / 5 сұрақ» белгісі, жұмыр
   опция жолдары, нәтижеде пайыздық сақина. */

body.gw-page .page {
    padding-top: 12px;
}

.gw {
    max-width: 560px;
    margin: 0 auto;
    padding-bottom: 96px;
}

.gw-head {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.gw-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    color: var(--color-text);
}

.gw-icon-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.gw-icon-btn:hover {
    background: var(--color-field-bg);
}

.gw-spacer {
    visibility: hidden;
}

.gw-brand {
    text-align: center;
    font-weight: 800;
    font-size: 1rem;
}

.gw-restart {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 10px;
    color: var(--color-muted);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
}

.gw-pill {
    width: fit-content;
    margin: 0 auto 22px;
    padding: 8px 14px;
    border-radius: 10px;
    background: #171a1d;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.gw-fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}

.gw-q {
    display: block;
    width: 100%;
    margin: 0 0 22px;
    padding: 0;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.3;
}

.gw-hint {
    margin: -12px 0 18px;
    text-align: center;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.gw-options {
    display: grid;
    gap: 8px;
}

.gw-option {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 60px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--color-field-bg);
    border: 2px solid transparent;
    font-weight: 600;
    cursor: pointer;
    transition: border-color var(--motion-fast), background var(--motion-fast);
}

.gw-option:hover {
    border-color: var(--color-border);
}

.gw-option:has(input:checked) {
    background: #e8eefc;
    border-color: var(--color-primary);
}

.gw-option:focus-within {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

.gw-option input {
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0;
    accent-color: #171a1d;
}

.gw-count {
    font-weight: 500;
    color: var(--color-muted);
    font-size: 0.88rem;
}

.gw-all {
    background: #fff;
    border-color: var(--color-border);
}

.gw-input {
    width: 100%;
    min-height: 56px;
    padding: 0 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font: inherit;
    font-size: 1.15rem;
}

.gw-error {
    margin: 8px 0 0;
    color: var(--color-error-text);
    font-weight: 600;
}

.gw-next {
    position: sticky;
    bottom: calc(var(--bottomnav-height) + 12px + env(safe-area-inset-bottom, 0px));
    display: block;
    width: 100%;
    min-height: 54px;
    margin-top: 20px;
    border: 0;
    border-radius: 14px;
    background: #171a1d;
    color: #fff;
    font: inherit;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(23, 26, 29, 0.18);
}

.gw-next:disabled {
    background: #9aa1ab;
    cursor: not-allowed;
    box-shadow: none;
}

.gw-summary {
    margin: 0 0 14px;
    color: var(--color-muted);
}

.gw-results {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.gw-result {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: #fff;
}

.gw-result-text {
    flex: 1;
    min-width: 0;
}

.gw-result-title {
    margin: 0 0 4px;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: break-word;
}

.gw-result-uni {
    margin: 0 0 4px;
    color: #4d5562;
    line-height: 1.35;
}

.gw-result-meta {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.gw-result-meta abbr {
    text-decoration: none;
}

.gw-ring {
    position: relative;
    flex: none;
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

.gw-ring svg {
    position: absolute;
    inset: 0;
    transform: rotate(-90deg);
}

.gw-ring circle {
    fill: none;
    stroke-width: 4;
}

.gw-ring-bg {
    stroke: #e7e9f3;
}

.gw-ring-fg {
    stroke: #5b4cf0;
    stroke-linecap: round;
    stroke-dasharray: calc(var(--pct) * 1) 100;
}

.gw-ring-medium .gw-ring-fg {
    stroke: #e3a008;
}

.gw-ring-low .gw-ring-fg {
    stroke: #d64545;
}

.gw-ring-none {
    border: 4px dashed #e7e9f3;
    border-radius: 50%;
    color: var(--color-muted);
}

.gw-note-top {
    margin: 0 0 14px;
}

.gw-empty {
    padding: 20px;
    border-radius: 14px;
    background: var(--color-field-bg);
}

.gw-note {
    margin: 14px 0 0;
    color: var(--color-muted);
    font-size: 0.82rem;
}

/* Тест беттері: кәсіби бағдар (5 сұрақ/бет, слайдер) және тұлғалық тест
   (1 сұрақ/экран) — грант шеберімен бірдей ақ карточка стилі. */
.quiz-progress {
    height: 4px;
    margin: -10px 0 22px;
    border-radius: 999px;
    background: #e7e9f3;
    overflow: hidden;
}

.quiz-progress span {
    display: block;
    height: 100%;
    background: #3761ee;
}

.quiz-q {
    border: 0;
    margin: 0 0 26px;
    padding: 0;
    min-width: 0;
}

.quiz-q legend {
    padding: 0;
    margin-bottom: 14px;
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.35;
}

.quiz-q.question-error legend {
    color: var(--color-error-text);
}

.quiz-scale {
    --sel: 0;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 44px;
}

.quiz-track,
.quiz-fill {
    position: absolute;
    left: 11px;
    right: 11px;
    top: 50%;
    height: 4px;
    margin-top: -2px;
    border-radius: 999px;
    background: #e7e9f3;
}

.quiz-fill {
    right: auto;
    width: calc((100% - 22px) * var(--sel));
    background: #3761ee;
    opacity: 0;
}

.quiz-scale.has-value .quiz-fill {
    opacity: 1;
}

.quiz-dot {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 -11px;
    cursor: pointer;
}

.quiz-dot input {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    border-radius: 50%;
    border: 2px solid #c9cedb;
    background: #fff;
    cursor: pointer;
    transition: transform var(--motion-fast), background var(--motion-fast);
}

.quiz-dot.is-on input {
    border-color: #3761ee;
}

.quiz-dot input:checked {
    width: 30px;
    height: 30px;
    border: 0;
    background: #3761ee;
    box-shadow: 0 0 0 4px rgba(55, 97, 238, 0.18);
}

.quiz-dot input:focus-visible {
    outline: 3px solid #3761ee;
    outline-offset: 3px;
}

.quiz-ends {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 2px;
    color: var(--color-muted);
    font-size: 0.8rem;
}

.quiz-ends span:last-child {
    text-align: right;
}

.quiz-next {
    display: block;
    min-width: 160px;
    min-height: 52px;
    margin: 8px auto 0;
    padding: 0 32px;
    border: 0;
    border-radius: 999px;
    background: #3761ee;
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.quiz-edit {
    margin: 18px 0 0;
    text-align: center;
    font-size: 0.85rem;
}

.quiz-edit a {
    color: var(--color-muted);
}

.pq-text {
    min-height: 3.2em;
}

/* Нәтиже беттеріндегі «Қайта өту» */
.retake-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: -8px 0 8px -4px;
    padding: 0 6px;
    border-radius: 10px;
    color: var(--color-muted);
    font-weight: 600;
    text-decoration: none;
}

.retake-link svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.retake-link:hover {
    color: var(--color-primary);
    background: var(--color-field-bg);
}

/* Калькулятордағы ЖОО тізімі (көп таңдау) — fieldset-тің әдепкі жақтауы
   картаның ішінде артық көрінеді. */
.wizard-fieldset {
    border: none;
    margin: 0;
    padding: 0;
}

.wizard-fieldset legend {
    padding: 0;
    font-weight: 600;
}

/* Нәтиже бетіндегі мамандық дағдылары (§4.4.3) */
.profession-skills {
    margin-top: 10px;
}

.profession-skills dt {
    opacity: 0.75;
}

/* Грант калькуляторының пән/қала сүзгілері (§9.2) */
.subject-filter-form,
.city-filter-form {
    margin: 14px 0 18px;
}

.subject-filter-form select,
.city-filter-form select {
    width: 100%;
}

.subject-pair-box {
    margin: 10px 0 16px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(127, 127, 127, 0.08);
}

/* Админ: қатысушылар тізімі (§8.2) */
.privacy-note {
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(214, 158, 46, 0.14);
}

.participant-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.participant-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px;
    border-radius: 12px;
    background: rgba(127, 127, 127, 0.07);
}

.participant-row h3 {
    margin: 0 0 4px;
    font-size: 1rem;
}

.participant-meta {
    margin: 2px 0;
    font-size: 0.85rem;
    opacity: 0.8;
}

.participant-result {
    text-align: right;
    min-width: 120px;
}

.holland-code {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 1px;
    background: rgba(90, 120, 255, 0.16);
}

.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
}

.badge-done { background: rgba(56, 161, 105, 0.18); }
.badge-pending { background: rgba(160, 160, 160, 0.2); }

.pager {
    align-items: center;
    justify-content: center;
    gap: 12px;
}

/* Аналитика бөлімі (§8) */
.analytics-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.analytics-tabs .tab-btn {
    text-decoration: none;
}

.analytics-filters .filter-pair {
    display: flex;
    gap: 10px;
}

.analytics-filters .filter-pair > div {
    flex: 1;
}

.note-form {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 6px;
}

.btn-link {
    background: none;
    border: none;
    padding: 2px 4px;
    font: inherit;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    color: inherit;
    opacity: 0.85;
}

.alert-success {
    background: rgba(56, 161, 105, 0.16);
}

/* Баспаға дайын есеп: браузердің «PDF ретінде сақтау» мүмкіндігі */
.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0 18px;
    font-size: 0.9rem;
}

.report-table th,
.report-table td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(127, 127, 127, 0.25);
}

.report-subject {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0 0 4px;
}

.report-limits {
    margin: 8px 0 0 18px;
    font-size: 0.88rem;
    opacity: 0.85;
}

@media print {
    .no-print,
    .topbar,
    .bottom-nav {
        display: none !important;
    }

    body,
    .app-bg,
    .app-shell,
    .card.report-sheet {
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
        margin: 0;
        padding: 0;
    }

    .report-sheet {
        padding: 0 8mm !important;
    }

    .chart-fill {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }

    h2 {
        page-break-after: avoid;
    }

    .report-table {
        page-break-inside: avoid;
    }
}
