:root {
    --ink: #172338;
    --muted: #5c6a7d;
    --paper: #ffffff;
    --soft: #f3f7fb;
    --soft-blue: #eaf3fb;
    --line: #d9e3ed;
    --brand: #0f5277;
    --brand-dark: #0a3550;
    --brand-light: #2b80a8;
    --accent: #d88a2c;
    --accent-soft: #fff4e5;
    --success: #28765b;
    --danger: #9a4038;
    --shadow: 0 12px 32px rgba(17, 50, 74, 0.11);
    --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.average-iq-page {
    margin: 0;
    color: var(--ink);
    background: #edf2f7;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.68;
}
body.average-iq-page img { max-width: 100%; height: auto; }
body.average-iq-page a { color: var(--brand); }
body.average-iq-page a:hover { color: var(--brand-dark); }
body.average-iq-page .container {
    width: min(1180px, calc(100% - 26px));
    margin: 16px auto 38px;
    background: #dee3ef;
    box-shadow: var(--shadow);
    border-radius: 22px;
    overflow: hidden;
}

.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--line);
    background: #dee3ef;
}
.site-logo { display: block; object-fit: contain; width: auto; max-height: 60px;}
.contact-info { display: flex; align-items: center; gap: 14px; color: var(--muted); }
.contact-info .label { font-size: .86rem; letter-spacing: .03em; }
body.average-iq-page .directory-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 16px;
    border: 0;
    border-radius: 999px;

    color: var(--paper);
    background: var(--brand);

    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        color 0.15s ease;
}

body.average-iq-page .directory-link:hover {
    color: #f9b81b;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
}

.breadcrumb {
    padding: 11px 28px;
    font-size: .9rem;
    color: var(--muted);
    background: #dee3ef;
    border-bottom: 1px solid var(--line);
}
.breadcrumb a { text-decoration: none; }

.country-hero {
    position: relative;
    min-height: 530px;
    display: grid;
    align-items: center;
    overflow: hidden;
    background: var(--brand-dark);
}
.country-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.country-hero-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(5, 31, 49, .94) 0%, rgba(7, 48, 72, .83) 47%, rgba(7, 48, 72, .28) 100%);
}
.country-hero-content { position: relative; z-index: 2; padding: 64px 54px; }
.country-hero-content-inner { max-width: 720px; }
.country-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 15px;
    color: #d9efff;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .8rem;
}
.country-hero h1 {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(2.25rem, 5vw, 4.75rem);
    line-height: 1.04;
    letter-spacing: -.035em;
}
.country-hero-subtitle {
    max-width: 680px;
    margin: 0;
    color: #e7f3fa;
    font-size: clamp(1.05rem, 2vw, 1.34rem);
    line-height: 1.55;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.primary-button, .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 48px;
    padding: 12px 18px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 800;
}
.primary-button { color: #fff !important; background: var(--accent); box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.primary-button:hover { background: #bc711b; }
.secondary-button { color: #fff !important; border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.09); }
.badge-line { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.badge-line span {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: #eef8ff;
    background: rgba(255,255,255,.11);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 999px;
    padding: 8px 11px;
    font-size: .88rem;
}

.topic-nav-wrap {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255,255,255,.97);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 18px rgba(13, 52, 77, .07);
}
.topic-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 24px;
    scrollbar-width: thin;
}
.topic-nav a {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    font-size: .88rem;
    font-weight: 800;
    color: var(--brand-dark);
    background: var(--soft-blue);
}
.topic-nav a:hover, .topic-nav a:focus { background: #d6eaf7; }

main { padding: 34px 42px 54px; }
main > section { scroll-margin-top: 80px; }
main h2 {
    margin: 48px 0 14px;
    color: var(--brand-dark);
    font-size: clamp(1.65rem, 3vw, 2.3rem);
    line-height: 1.2;
    letter-spacing: -.02em;
}
main h3 {
    margin: 30px 0 9px;
    color: var(--brand-dark);
    font-size: 1.28rem;
    line-height: 1.28;
}
main p { margin: 0 0 16px; }
main ul, main ol { padding-left: 24px; }
main li { margin-bottom: 8px; }

.info-panel {
    margin: 0 0 24px;
    padding: 28px;
    background: linear-gradient(135deg, #eef7fc, #fbfdff);
    border: 1px solid #cfe3ef;
    border-left: 6px solid var(--brand-light);
    border-radius: var(--radius);
}
.info-panel h2 { margin-top: 0; }
.page-summary, .last-updated {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    color: var(--muted);
}
.page-summary { font-weight: 700; color: var(--brand-dark); }
.last-updated { font-size: .9rem; }

.quick-facts, .scale-grid, .domain-grid, .use-grid, .report-grid, .glossary-grid {
    display: grid;
    gap: 16px;
}
.quick-facts { grid-template-columns: repeat(4, 1fr); margin: 26px 0; }
.fact-card, .scale-card, .domain-card, .use-card, .report-card, .glossary-card {
    position: relative;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(17, 50, 74, .055);
}
.fact-card .value {
    display: block;
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--brand);
    line-height: 1.1;
}
.fact-card .label { display: block; margin-top: 8px; font-weight: 800; }
.fact-card small { display: block; margin-top: 6px; color: var(--muted); }

.scale-grid { grid-template-columns: repeat(3, 1fr); margin: 22px 0; }
.scale-card { overflow: hidden; padding: 0; }
.scale-card-head { padding: 22px; color: #fff; background: linear-gradient(135deg, var(--brand-dark), var(--brand-light)); }
.scale-card-head h3 { color: #fff; margin: 0 0 5px; font-size: 1.45rem; }
.scale-card-head p { margin: 0; color: #dff2ff; }
.scale-card-body { padding: 20px 22px 22px; }
.scale-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.scale-meta div { padding: 11px; background: var(--soft); border-radius: 10px; }
.scale-meta strong { display: block; color: var(--brand-dark); }
.scale-card ul { padding-left: 20px; }
.scale-card .official-link { font-weight: 800; }

.domain-grid { grid-template-columns: repeat(5, 1fr); margin-top: 22px; }
.domain-card { padding-top: 58px; min-height: 260px; }
.domain-card .domain-icon {
    position: absolute;
    top: 18px;
    left: 20px;
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--brand);
    border-radius: 10px;
}
.domain-card h3 { margin: 0 0 7px; font-size: 1.05rem; }
.domain-card p { color: var(--muted); font-size: .94rem; }
.domain-card small { display: block; margin-top: 12px; color: var(--brand-dark); font-weight: 700; }

.callout {
    margin: 22px 0;
    padding: 19px 21px;
    border-radius: 14px;
    border-left: 5px solid var(--accent);
    background: var(--accent-soft);
}
.callout.danger { border-left-color: var(--danger); background: #fff0ee; }
.callout.success { border-left-color: var(--success); background: #edf9f4; }
.callout strong { color: var(--brand-dark); }

.visual-panel {
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    gap: 28px;
    align-items: center;
    margin: 24px 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}
.visual-panel figure { margin: 0; }
.visual-panel img { display: block; width: 100%; border-radius: 14px; }
.visual-panel figcaption { margin-top: 9px; color: var(--muted); font-size: .84rem; }

.score-table-wrap, .comparison-table-wrap { overflow-x: auto; margin: 20px 0; border: 1px solid var(--line); border-radius: 14px; }
.score-table, .comparison-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.score-table th, .score-table td, .comparison-table th, .comparison-table td {
    padding: 14px 15px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.score-table th, .comparison-table th { color: #fff; background: var(--brand-dark); }
.score-table tr:last-child td, .comparison-table tr:last-child td { border-bottom: 0; }
.score-table tbody tr:nth-child(even), .comparison-table tbody tr:nth-child(even) { background: var(--soft); }

.report-grid { grid-template-columns: repeat(3, 1fr); margin: 20px 0; }
.report-card h3 { margin-top: 0; }
.report-card .mini-label {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--soft-blue);
    color: var(--brand-dark);
    font-weight: 800;
    font-size: .8rem;
}

.use-grid { grid-template-columns: repeat(3, 1fr); margin: 20px 0; }
.use-card h3 { margin-top: 0; font-size: 1.12rem; }
.use-card p { color: var(--muted); }

.process-list {
    counter-reset: process;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 0;
    list-style: none;
}
.process-list li {
    counter-increment: process;
    position: relative;
    min-height: 180px;
    padding: 54px 20px 20px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}
.process-list li::before {
    content: counter(process);
    position: absolute;
    top: 16px;
    left: 18px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--accent);
    font-weight: 900;
}

.history-layout {
    display: grid;
    grid-template-columns: 330px 1fr;
    gap: 30px;
    align-items: start;
}
.history-photo {
    position: sticky;
    top: 92px;
    margin: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--soft);
}
.history-photo img { display: block; border-radius: 12px; filter: grayscale(100%); }
.history-photo figcaption { margin-top: 10px; color: var(--muted); font-size: .82rem; }
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; top: 4px; bottom: 8px; left: 8px; width: 3px; background: #cbdce8; }
.timeline-item { position: relative; padding: 0 0 22px 18px; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 6px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--brand-light);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--brand-light);
}
.timeline-year { display: inline-block; color: var(--accent); font-weight: 900; font-size: 1.08rem; }
.timeline-item h3 { margin: 2px 0 6px; }

.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.checklist, .avoid-list {
    padding: 22px;
    border-radius: 15px;
    border: 1px solid var(--line);
}
.checklist { background: #f0faf6; }
.avoid-list { background: #fff5f3; }
.checklist h3, .avoid-list h3 { margin-top: 0; }
.checklist li::marker { color: var(--success); }
.avoid-list li::marker { color: var(--danger); }

.faq-item {
    margin: 0 0 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
    background: #fff;
}
.faq-item details { padding: 0; }
.faq-item summary {
    cursor: pointer;
    padding: 16px 18px;
    font-weight: 800;
    color: var(--brand-dark);
    list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; font-size: 1.35rem; }
.faq-item details[open] summary::after { content: '–'; }
.faq-answer { padding: 0 18px 17px; color: var(--muted); }
.faq-answer p:last-child { margin-bottom: 0; }

.glossary-grid { grid-template-columns: repeat(3, 1fr); }
.glossary-card h3 { margin: 0 0 6px; font-size: 1rem; }
.glossary-card p { margin: 0; color: var(--muted); font-size: .92rem; }

.sources {
    padding: 22px;
    border-radius: 15px;
    background: var(--soft);
    border: 1px solid var(--line);
}
.sources a { overflow-wrap: anywhere; }
.source-note { color: var(--muted); font-size: .88rem; }

.badge-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 26px 0;
    padding: 18px;
    border-radius: 15px;
    background: var(--brand-dark);
}
.badge-strip span { display: inline-flex; align-items: center; gap: 7px; color: #fff; font-size: .9rem; }
.badge-strip i { color: #9fe4c9; }

.cta-footer {
    padding: 48px 42px;
    text-align: center;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
}
.cta-footer h2 { margin: 0 0 10px; font-size: 2rem; }
.cta-footer p { max-width: 760px; margin: 0 auto 22px; color: #dceef8; }
.footer-note {
    padding: 20px 28px;
    text-align: center;
    color: var(--muted);
    font-size: .84rem;
    background: #f5f7fa;
}
.footer-note p { margin: 5px 0; }

.back-to-top {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff !important;
    background: var(--brand);
    text-decoration: none;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: .2s ease;
}
.back-to-top.visible { opacity: 1; transform: none; pointer-events: auto; }

@media (max-width: 980px) {
    .quick-facts { grid-template-columns: repeat(2, 1fr); }
    .scale-grid, .report-grid, .use-grid, .process-list, .glossary-grid { grid-template-columns: repeat(2, 1fr); }
    .domain-grid { grid-template-columns: repeat(2, 1fr); }
    .visual-panel, .history-layout { grid-template-columns: 1fr; }
    .history-photo { position: static; max-width: 420px; }
}

@media (max-width: 700px) {
    body.average-iq-page .container { width: 100%; margin: 0; border-radius: 0; }
    .top-nav { align-items: flex-start; padding: 12px 16px; }
    .contact-info .label { display: none; }
    .breadcrumb { padding: 10px 16px; }
    .country-hero { min-height: 590px; }
    .country-hero-shade { background: linear-gradient(180deg, rgba(5,31,49,.70), rgba(5,31,49,.96)); }
    .country-hero-content { padding: 46px 22px; align-self: end; }
    .country-hero h1 { font-size: 2.45rem; }
    .hero-actions { flex-direction: column; align-items: stretch; }
    .primary-button, .secondary-button { width: 100%; }
    main { padding: 28px 18px 42px; }
    .quick-facts, .scale-grid, .domain-grid, .report-grid, .use-grid, .process-list, .two-column, .glossary-grid { grid-template-columns: 1fr; }
    .visual-panel { padding: 18px; }
    .cta-footer { padding: 40px 20px; }
}

@media print {
    body.average-iq-page { background: #fff; }
    body.average-iq-page .container { width: 100%; margin: 0; box-shadow: none; }
    .top-nav, .topic-nav-wrap, .hero-actions, .back-to-top, .cta-footer { display: none !important; }
    .country-hero { min-height: 300px; }
    .country-hero-content { padding: 38px; }
    .country-hero h1 { font-size: 2.5rem; }
    main { padding: 28px; }
    .history-photo { position: static; }
    a { color: inherit !important; text-decoration: none !important; }
}

/* Average adult IQ guide additions */
body.average-iq-page .container { background: #eef2f6; }
main > section:first-child h2 { margin-top: 0; }
.lead { font-size: 1.08rem; color: #33445a; }
.small-note { color: var(--muted); font-size: .9rem; }
.nowrap { white-space: nowrap; }

.calculator-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, .95fr);
    gap: 22px;
    margin: 24px 0;
    padding: 24px;
    border: 1px solid #cfe3ef;
    border-radius: var(--radius);
    background: linear-gradient(145deg, #eef8fc, #fff);
    box-shadow: 0 10px 24px rgba(17, 50, 74, .07);
}
.calculator-form, .calculator-result {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.calculator-form h3, .calculator-result h3 { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field label { display: block; margin-bottom: 7px; color: var(--brand-dark); font-weight: 800; }
.form-field input, .form-field select {
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #b9cbd8;
    border-radius: 10px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}
.form-field input:focus, .form-field select:focus { outline: 3px solid rgba(43, 128, 168, .18); border-color: var(--brand-light); }
.calc-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 50px;
    margin-top: 14px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--brand);
    font-weight: 900;
    cursor: pointer;
}
.calc-button:hover { background: var(--brand-dark); }
.result-score {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin: 4px 0 18px;
}
.result-score .big { font-size: clamp(3rem, 7vw, 5.4rem); line-height: .9; color: var(--brand); font-weight: 950; }
.result-score .result-band { padding-bottom: 7px; color: var(--muted); font-weight: 800; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.result-cell { padding: 12px; border-radius: 11px; background: var(--soft); }
.result-cell strong { display: block; color: var(--brand-dark); }
.result-cell span { display: block; margin-top: 3px; color: var(--muted); }
.result-disclaimer { margin: 15px 0 0; color: var(--muted); font-size: .83rem; }

.score-ruler {
    position: relative;
    margin: 24px 0 8px;
    padding: 44px 18px 28px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}
.score-ruler-track { display: grid; grid-template-columns: repeat(6, 1fr); min-width: 720px; border-radius: 12px; overflow: hidden; }
.score-ruler-track span { min-height: 56px; display: grid; place-items: center; text-align: center; padding: 8px; color: #fff; font-size: .8rem; font-weight: 800; }
.score-ruler-track span:nth-child(1) { background: #82433d; }
.score-ruler-track span:nth-child(2) { background: #a75c43; }
.score-ruler-track span:nth-child(3) { background: #b78a3e; }
.score-ruler-track span:nth-child(4) { background: #4f8190; }
.score-ruler-track span:nth-child(5) { background: #2b6f83; }
.score-ruler-track span:nth-child(6) { background: #174d6b; }
.score-ruler-labels { display: grid; grid-template-columns: repeat(7, 1fr); min-width: 720px; margin-top: 10px; color: var(--muted); font-size: .82rem; font-weight: 800; text-align: center; }
.score-ruler-wrap { overflow-x: auto; }

.formula-card {
    display: grid;
    grid-template-columns: minmax(240px, .75fr) 1.25fr;
    gap: 22px;
    align-items: center;
    margin: 22px 0;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--soft);
}
.formula {
    display: grid;
    place-items: center;
    min-height: 150px;
    padding: 20px;
    border-radius: 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    text-align: center;
    font-size: clamp(1.2rem, 3vw, 1.75rem);
    font-weight: 900;
}
.formula small { display: block; margin-top: 10px; color: #d8edf8; font-size: .72em; font-weight: 600; }

.scale-system-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 22px 0; }
.scale-system-card { padding: 21px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 6px 16px rgba(17, 50, 74, .055); }
.scale-system-card .system-value { display: inline-grid; place-items: center; min-width: 74px; min-height: 46px; padding: 8px 12px; border-radius: 12px; color: #fff; background: var(--brand); font-size: 1.22rem; font-weight: 900; }
.scale-system-card h3 { margin: 14px 0 7px; font-size: 1.08rem; }
.scale-system-card p { color: var(--muted); font-size: .92rem; }
.scale-system-card small { color: var(--brand-dark); font-weight: 700; }

.percentile-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin: 20px 0; }
.percentile-tile { padding: 16px 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: center; }
.percentile-tile strong { display: block; color: var(--brand); font-size: 1.35rem; }
.percentile-tile span { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; }

.test-family-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 22px 0; }
.test-family-card { display: flex; flex-direction: column; min-height: 100%; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 6px 16px rgba(17, 50, 74, .055); }
.test-family-card .test-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--brand); }
.test-family-card h3 { margin: 15px 0 7px; }
.test-family-card p { color: var(--muted); }
.test-family-card .test-meta { margin-top: auto; padding-top: 10px; color: var(--brand-dark); font-size: .87rem; font-weight: 800; }

.profile-example {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 22px 0;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.profile-bars { display: grid; gap: 11px; }
.profile-row { display: grid; grid-template-columns: 175px 1fr 48px; gap: 10px; align-items: center; }
.profile-label { color: var(--brand-dark); font-weight: 800; font-size: .88rem; }
.profile-bar { height: 14px; border-radius: 999px; background: #e3ebf1; overflow: hidden; }
.profile-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-light), var(--brand)); }
.profile-value { text-align: right; color: var(--brand); font-weight: 900; }

.history-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 22px 0 30px; }
.history-gallery figure { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--soft); }
.history-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 11px; filter: grayscale(100%); }
.history-gallery figure:first-child img { object-position: 50% 22%; }
.history-gallery figcaption { margin-top: 9px; color: var(--muted); font-size: .78rem; line-height: 1.45; }

.factor-grid, .myth-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0; }
.factor-card, .myth-card { padding: 21px; border: 1px solid var(--line); border-radius: 15px; background: #fff; }
.factor-card h3, .myth-card h3 { margin-top: 0; font-size: 1.07rem; }
.factor-card p, .myth-card p { color: var(--muted); font-size: .93rem; }
.myth-card { border-top: 5px solid var(--accent); }
.myth-card .verdict { display: inline-block; margin-bottom: 9px; padding: 4px 9px; border-radius: 999px; color: #fff; background: var(--danger); font-size: .76rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }

.definition-list { display: grid; grid-template-columns: 240px 1fr; gap: 0; margin: 20px 0; border: 1px solid var(--line); border-radius: 15px; overflow: hidden; }
.definition-list dt, .definition-list dd { margin: 0; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.definition-list dt { color: var(--brand-dark); background: var(--soft); font-weight: 900; }
.definition-list dd { background: #fff; }
.definition-list dt:last-of-type, .definition-list dd:last-of-type { border-bottom: 0; }

.print-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 26px 0; padding: 23px; border-radius: 16px; color: #fff; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); }
.print-card h3 { margin: 0 0 6px; color: #fff; }
.print-card p { margin: 0; color: #dceef8; }
.print-button { flex: 0 0 auto; min-height: 46px; padding: 11px 17px; border: 1px solid rgba(255,255,255,.5); border-radius: 11px; color: #fff; background: rgba(255,255,255,.08); font: inherit; font-weight: 900; cursor: pointer; }
.print-button:hover { background: rgba(255,255,255,.16); }

.source-list li { margin-bottom: 11px; }
.source-list span { display: block; color: var(--muted); font-size: .86rem; }
.license-note { padding: 14px 16px; border-radius: 12px; background: #eef7fc; color: var(--muted); font-size: .84rem; }

@media (max-width: 980px) {
    .calculator-shell, .formula-card, .profile-example { grid-template-columns: 1fr; }
    .scale-system-grid, .test-family-grid, .factor-grid, .myth-grid, .history-gallery { grid-template-columns: repeat(2, 1fr); }
    .percentile-tiles { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
    .calculator-shell { padding: 14px; }
    .calculator-form, .calculator-result { padding: 17px; }
    .form-grid, .result-grid, .scale-system-grid, .test-family-grid, .factor-grid, .myth-grid, .history-gallery { grid-template-columns: 1fr; }
    .percentile-tiles { grid-template-columns: repeat(2, 1fr); }
    .profile-row { grid-template-columns: 118px 1fr 42px; }
    .definition-list { grid-template-columns: 1fr; }
    .definition-list dt { border-bottom: 0; }
    .print-card { align-items: stretch; flex-direction: column; }
    .print-button { width: 100%; }
}

@media print {
    .calculator-shell, .print-card, #sources, .footer-note .web-only { display: none !important; }
    .score-table, .comparison-table { min-width: 0; font-size: 9pt; }
    .history-gallery { grid-template-columns: repeat(3, 1fr); }
    main h2 { break-after: avoid; }
    .fact-card, .scale-system-card, .test-family-card, .factor-card, .myth-card, .glossary-card { break-inside: avoid; }
}

/* Average adult IQ page-specific components */
.age-table-wrap { max-height: 900px; overflow: auto; }
.age-table { min-width: 980px; }
.age-table thead th { position: sticky; top: 0; z-index: 2; }
.outlier-grid { grid-template-columns: repeat(3, 1fr); }
.gene-grid { grid-template-columns: repeat(3, 1fr); }
.gene-grid small { display: block; margin-top: 12px; color: var(--brand-dark); font-weight: 700; }
.support-grid { grid-template-columns: repeat(3, 1fr); }
.factor-card { position: relative; }
.evidence-tag {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--soft-blue);
    color: var(--brand-dark);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .02em;
}
.stage-plan li { min-height: 215px; }
.history-gallery img { aspect-ratio: 4 / 4.2; object-fit: cover; }
.history-gallery figure:nth-child(2) img { object-position: center; }
.country-hero-content-inner { max-width: 780px; }
.country-hero h1 { max-width: 820px; }
.calculator-result {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}
.calculator-result h3 { margin-top: 0; }

@media (max-width: 980px) {
    .outlier-grid, .gene-grid, .support-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
    .outlier-grid, .gene-grid, .support-grid { grid-template-columns: 1fr; }
    .age-table-wrap { max-height: 720px; }
    .stage-plan li { min-height: 0; }
}
