/* kazakhstan.html. The flag's two colours carry the page: sky blue for the land and independence, gold for the khans;
   the losses under foreign rule are shown in a dark red. Everything else is the site's quiet dark. */
.kzp { --sky: #00afca; --gold: #f5c518; --loss: #b2453f; --r: 8px; color: var(--n-fg); font-family: var(--n-display); }
.kzp * { box-sizing: border-box; }
.kz-in { max-width: 1200px; margin: 0 auto; padding: 0 max(20px, env(safe-area-inset-left, 0px)); }
.kzp h1, .kzp h2, .kzp h3 { margin: 0; font-family: var(--n-display); font-weight: 600; letter-spacing: 0; text-wrap: balance; }
html[lang="zh"] .kzp h1, html[lang="zh"] .kzp h2, html[lang="zh"] .kzp h3 { font-weight: 700; }
.kzp p { margin: 0; }

/* hero */
.kz-hero { position: relative; min-height: min(92vh, 860px); display: flex; align-items: flex-end; isolation: isolate; overflow: hidden; padding: 120px 0 56px; }
.kz-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.kz-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(3,5,10,.5) 0%, rgba(3,5,10,0) 30%, rgba(3,5,10,.25) 55%, var(--n-ink) 100%), linear-gradient(90deg, rgba(3,5,10,.78), rgba(3,5,10,.2) 70%); }
.kz-hero .kz-in { width: 100%; }
.kz-hero h1 { font-size: clamp(52px, 9vw, 128px); line-height: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; }
.kz-hero h1 small { font-size: .32em; font-weight: 400; color: var(--n-soft); }
.kz-lede { margin-top: 20px !important; max-width: 40em; font-size: clamp(17px, 1.5vw, 20px); font-weight: 300; line-height: 1.7; color: #e6e7ea; }
.kz-facts { margin-top: 40px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px 28px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.25); }
.kz-facts div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.kz-facts b { font-weight: 400; font-size: clamp(24px, 2.4vw, 34px); line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.kz-facts span { font-size: 14px; color: var(--n-soft); }

/* sections */
.kz-sec { padding: clamp(72px, 9vw, 128px) 0 0; }
.kz-head { margin-bottom: clamp(26px, 3vw, 40px); max-width: 46em; }
.kz-head h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.12; }
.kz-head p { margin-top: 12px !important; font-size: 17px; line-height: 1.7; color: var(--n-soft); }
.kz-note { margin-top: 26px !important; max-width: 46em; font-size: 16px; line-height: 1.7; color: var(--n-soft); }

/* symbols */
.sym3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.sym3 article { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sym-pic { aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; display: grid; place-items: center; background: #0b1220; margin-bottom: 8px; }
.sym-pic.flag img { width: 84%; aspect-ratio: 2 / 1; object-fit: cover; }
.sym-pic.emb img { width: 64%; height: 64%; object-fit: contain; }
.sym-pic.anth { position: relative; place-items: initial; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px 20px; color: #04151b; background: radial-gradient(120% 90% at 50% 34%, #2fd3ea 0%, #00afca 42%, #00809a 100%); }
.sym3 h3 { font-size: 22px; }
.sym3 p { font-size: 15.5px; line-height: 1.7; color: var(--n-soft); }

/* history: map + card + slider */
.tl-stage { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); align-items: stretch; }
.tl-map { margin: 0; position: relative; border-radius: var(--r); background: #070b14; border: 1px solid var(--n-line); overflow: hidden; }
.tl-map svg { display: block; width: 100%; height: auto; }
.tl-map figcaption { position: absolute; left: 14px; bottom: 10px; font-size: 12.5px; color: var(--n-mute); }
#kzMap { background: #0a1220; }
#kzMap .hm-land { fill: #101725; stroke: rgba(255,255,255,.08); stroke-width: .6; }
#kzMap .hm-water { fill: #0a1220; stroke: rgba(120,170,220,.25); stroke-width: .6; }
#kzMap .hm-an { fill: #3a3320; stroke: rgba(245,197,24,.45); stroke-width: .9; }
#kzMap .hm-kc { fill: rgba(106,85,18,.55); stroke: rgba(245,197,24,.7); stroke-width: 1; stroke-dasharray: 4 3; }
#kzMap .hm-o { fill: #1a2233; stroke: rgba(255,255,255,.12); stroke-width: .8; }
#kzMap .hm-st { fill: #3a3320; stroke: rgba(245,197,24,.45); stroke-width: .8; }
#kzMap .hm-ru { fill: #4a1c1a; stroke: rgba(224,122,114,.6); stroke-width: .8; }
#kzMap .hm-kz { fill: #6a5512; stroke: var(--gold); stroke-width: 1.4; }
#kzMap[data-era="free"] .hm-kz { fill: #0b5563; stroke: #3fd0e6; }
#kzMap .hm-now { fill: none; stroke: #fff; stroke-width: 1.6; stroke-dasharray: 6 5; opacity: .85; }
#kzMap[data-tone="all"] .hm-now { fill: rgba(178,69,63,.45); }
#kzMap .hm-lab { font: 600 22px var(--n-display); fill: #fff; paint-order: stroke; stroke: rgba(0,0,0,.6); stroke-width: 4px; text-anchor: middle; pointer-events: none; }
#kzMap .hm-lab-ru { fill: #f3b2ab; }
#kzMap .pt-old { fill: rgba(255,255,255,.35); }
#kzMap .pt-now { fill: #fff; }
#kzMap .pt-ring { fill: none; stroke: #fff; stroke-width: 2; opacity: .55; }
@media (prefers-reduced-motion: no-preference) { #kzMap .pt-ring { animation: ptPulse 2s ease-out infinite; transform-box: fill-box; transform-origin: center; } }
@keyframes ptPulse { from { transform: scale(.5); opacity: .8; } to { transform: scale(1.4); opacity: 0; } }

.tl-card { display: flex; flex-direction: column; gap: 10px; padding: clamp(20px, 2.4vw, 32px); border-radius: var(--r); background: var(--n-panel); border-top: 3px solid var(--gold); min-height: 100%; transition: opacity .3s ease, transform .3s ease; }
.tl-card.tone-dark { border-top-color: var(--loss); }
.tl-card.tone-free { border-top-color: var(--sky); }
.tl-card.swap { opacity: 0; transform: translateY(6px); transition: none; }
.tl-era-now { font-size: 14px; color: var(--n-mute); }
.tl-year { font-weight: 300; font-size: clamp(36px, 4vw, 54px); line-height: 1; color: var(--gold); font-variant-numeric: tabular-nums; }
.tl-card.tone-dark .tl-year { color: #e07a72; }
.tl-card.tone-free .tl-year { color: #3fd0e6; }
.tl-card h3 { font-size: clamp(22px, 2.2vw, 28px); line-height: 1.25; }
.tl-card p { font-size: 16.5px; line-height: 1.75; color: #d9dbe0; }
.tl-where { font-size: 14px; color: var(--n-mute); }
.tl-where:empty { display: none; }
.tl-nav { margin-top: auto; padding-top: 14px; display: flex; gap: 10px; }
.tl-nav button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 14px; border: 1px solid var(--n-line); border-radius: 6px; background: none; color: var(--n-fg); font: 500 15px/1 var(--n-display); cursor: pointer; }
.tl-nav button svg { width: 14px; height: 14px; }
.tl-nav button:hover:not(:disabled) { border-color: rgba(255,255,255,.5); }
.tl-nav button:disabled { opacity: .35; cursor: default; }

.tl-bar { position: relative; margin-top: 26px; padding-top: 30px; }
.tl-eras { position: absolute; left: 0; right: 0; top: 0; height: 24px; }
.tl-era { position: absolute; top: 0; min-width: 8px; height: 24px; padding: 0 2px; border: 0; background: none; color: var(--n-mute); font: 400 13px/24px var(--n-display); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; border-left: 1px solid var(--n-line); padding-left: 6px; }
.tl-era.on, .tl-era:hover { color: var(--n-fg); }
.tl-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,.12); overflow: hidden; }
.tl-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold) 0%, var(--gold) 35%, var(--loss) 40%, var(--loss) 86%, var(--sky) 90%); background-size: calc(100vw - 40px) 100%; transition: width .25s ease; }
#tlRange { -webkit-appearance: none; appearance: none; position: absolute; left: 0; right: 0; bottom: -12px; width: 100%; height: 28px; margin: 0; background: none; cursor: pointer; }
#tlRange::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 4px solid var(--n-ink); box-shadow: 0 0 0 1px rgba(255,255,255,.5); }
#tlRange::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 4px solid var(--n-ink); }
#tlRange:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }

.tl-all { margin-top: 34px; display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--n-fg); font: 500 16px/1.4 var(--n-display); text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; cursor: pointer; }
.tl-all svg { width: 14px; height: 14px; transition: transform .2s; }
.tl-all[aria-expanded="true"] svg { transform: rotate(180deg); }
.tl-list { list-style: none; margin: 20px 0 0; padding: 0; border-top: 1px solid var(--n-line); max-width: 52em; }
.tl-list li { padding: 18px 0 18px 18px; border-bottom: 1px solid var(--n-line); position: relative; }
.tl-list li::before { content: ""; position: absolute; left: 0; top: 26px; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.tl-list li.tone-dark::before { background: var(--loss); }
.tl-list li.tone-free::before { background: var(--sky); }
.tl-li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 0; border: 0; background: none; color: var(--n-fg); text-align: left; cursor: pointer; font-family: var(--n-display); }
.tl-li-y { font-size: 15px; color: var(--n-mute); font-variant-numeric: tabular-nums; min-width: 7.5em; }
.tl-li-t { font-size: 18px; font-weight: 600; }
.tl-li:hover .tl-li-t { text-decoration: underline; text-underline-offset: 4px; }
.tl-list p { margin-top: 6px !important; font-size: 15.5px; line-height: 1.7; color: var(--n-soft); }

/* heroes */
.hgroups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px clamp(28px, 4vw, 64px); }
.hg h3 { font-size: 15px; font-weight: 500; color: var(--n-mute); padding-bottom: 10px; border-bottom: 1px solid var(--n-line); }
.hg ul { list-style: none; margin: 0; padding: 0; }
.hg li { padding: 14px 0; border-bottom: 1px solid var(--n-line); }
.hr-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hr-top b { font-size: 18px; font-weight: 600; }
.hr-y { font-size: 14px; color: var(--n-mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hg li p { margin-top: 4px !important; font-size: 15px; line-height: 1.6; color: var(--n-soft); }

/* army */
.army4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--n-line); }
.ab { padding: 22px 22px 22px 0; border-bottom: 1px solid var(--n-line); }
.ab + .ab { padding-left: 22px; border-left: 1px solid var(--n-line); }
.ab h3 { font-size: 19px; margin-bottom: 8px; }
.ab p { font-size: 15px; line-height: 1.65; color: var(--n-soft); }

/* cities */
.cities { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 28px; }
.city { padding: 20px 0 22px; border-top: 1px solid var(--n-line); display: flex; flex-direction: column; gap: 6px; }
.city-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.city h3 { font-size: 22px; }
.city-kz { font-size: 14px; color: var(--n-mute); }
.city-pop { font-weight: 400; font-size: 15px; color: var(--sky); }
.city p { font-size: 15px; line-height: 1.65; color: var(--n-soft); }

/* culture */
.culs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 28px; }
.cul-pic { margin: 0 0 14px; position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: #0b1220; }
.cul-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cul-pic.fit img { object-fit: contain; padding: 10px; }
.cul-pic figcaption { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(3,5,10,.7); font-size: 10.5px; color: rgba(255,255,255,.75); }
.cul h3 { font-size: 20px; margin-bottom: 8px; }
.cul p { font-size: 15px; line-height: 1.65; color: var(--n-soft); }

/* places */
.pl4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pl4 a { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; color: #fff; text-decoration: none; isolation: isolate; }
.pl4 img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.pl4 a::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.75)); }
.pl4 span { position: absolute; left: 16px; right: 16px; bottom: 14px; font-size: 18px; font-weight: 600; }
.pl4 a:hover span { text-decoration: underline; text-underline-offset: 5px; }
.kz-links { margin-top: 28px !important; display: flex; flex-wrap: wrap; gap: 14px 28px; padding-bottom: clamp(80px, 10vw, 140px); }
.kz-links a { color: var(--n-fg); font-size: 17px; font-weight: 500; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* tablets and phones */
@media (max-width: 1000px) {
  .kz-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tl-stage { grid-template-columns: 1fr; }
  .army4, .cities, .culs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ab:nth-child(3) { padding-left: 0; border-left: 0; }
  .pl4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .kz-hero { min-height: 88svh; padding-bottom: 36px; }
  .kz-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kz-facts div:last-child { grid-column: 1 / -1; }
  .sym3 { grid-template-columns: 1fr; gap: 36px; }
  .hgroups { grid-template-columns: 1fr; }
  .army4 { grid-template-columns: 1fr; }
  .ab, .ab + .ab { padding: 18px 0; border-left: 0; }
  .cities { grid-template-columns: 1fr; gap: 0; }
  .culs { grid-template-columns: 1fr; gap: 30px; }
  .tl-era { font-size: 0; }
  .tl-era.on { font-size: 12.5px; overflow: visible; }
  .tl-card { min-height: 0; }
}
.tl-map{display:flex;align-items:center;justify-content:center;padding-bottom:24px}

/* map: year and legend */
.tl-map { flex-direction: column; align-items: stretch; padding: 0 0 12px; }
.tl-map svg { flex: none; }
.tl-mapyear { position: absolute; left: 14px; top: 12px; z-index: 2; padding: 4px 10px; border-radius: 6px; background: rgba(3,5,10,.75); font-size: 14px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.tl-legend { list-style: none; margin: 10px 14px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--n-soft); }
.tl-legend li { display: inline-flex; align-items: center; gap: 7px; }
.tl-legend i { width: 14px; height: 10px; border-radius: 2px; }
.lg-kz { background: #6a5512; box-shadow: inset 0 0 0 1px var(--gold); } .lg-st { background: #3a3320; } .lg-ru { background: #4a1c1a; box-shadow: inset 0 0 0 1px rgba(224,122,114,.6); } .lg-o { background: #141b29; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.lg-now { background: none !important; border-top: 2px dashed #fff; height: 0 !important; }
.tl-map figcaption { position: static; margin: 6px 14px 0; }

/* Khanate and Alash features */
.feat2 { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.feat-pics { display: grid; gap: 16px; }
.feat-pics figure { margin: 0; }
.feat-pics img { display: block; width: 100%; border-radius: var(--r); background: #0b1220; }
.feat-pics .flagfig img { aspect-ratio: 2 / 1; object-fit: cover; }
.feat-pics .photo img { aspect-ratio: 4 / 3; object-fit: cover; }
.feat-pics figcaption { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--n-mute); }
.feat-tx h2 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.15; margin-bottom: 18px !important; }
.feat-p p { font-size: 17px; line-height: 1.8; color: #dadce1; margin-bottom: 14px !important; }
.feat-sub { font-size: 15px !important; font-weight: 500 !important; color: var(--n-mute); margin-top: 22px !important; padding-bottom: 8px; border-bottom: 1px solid var(--n-line); }
.khans { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.khans li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--n-line); }
.khans b { font-weight: 600; } .khans span { color: var(--n-mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kz-alash .feat2 { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
.kz-alash .feat-pics { order: 2; }

/* Under two empires */
.kz-terror { margin-top: clamp(72px, 9vw, 128px); padding-bottom: clamp(56px, 7vw, 96px); background: linear-gradient(180deg, #120808 0%, #0b0606 100%); border-top: 3px solid var(--loss); }
.tr-head h2 { font-size: clamp(36px, 5vw, 64px); }
.tr-sub { margin-top: 6px !important; font-size: 20px !important; color: #e8a49d !important; }
.tr-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 28px; }
.tr-item { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tr-pic { margin: 0; }
.tr-pic img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r); background: #1a0f0f; filter: grayscale(.25); }
.tr-pic figcaption { margin-top: 6px; font-size: 12.5px; line-height: 1.45; color: #9b8c8a; }
.tr-num { display: block; font-weight: 300; font-size: clamp(28px, 2.6vw, 38px); line-height: 1.05; color: #f08a80; font-variant-numeric: tabular-nums; }
.tr-tx h3 { font-size: 21px; margin: 6px 0 8px !important; }
.tr-tx p { font-size: 15.5px; line-height: 1.7; color: #d4c9c7; }
.tr-end { margin-top: 40px !important; padding-top: 22px; border-top: 1px solid rgba(240,138,128,.3); font-size: 18px; color: #f3d2ce; max-width: 46em; }

/* heroes with pictures */
.hg li.has-pic { display: grid; grid-template-columns: 64px minmax(0, 1fr); column-gap: 14px; align-items: start; }
.hg li .hr-pic { grid-row: 1 / span 2; width: 64px; height: 80px; border-radius: 6px; object-fit: cover; object-position: 50% 20%; background: #0b1220; }
.hg li .hr-cap { grid-column: 2; font-size: 12px; color: var(--n-mute); margin-top: 2px; }

/* army with pictures */
.ab-pic { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--r); margin-bottom: 14px; background: #0b1220; }
.ab-cap { display: block; margin-top: 6px; font-size: 12px; color: var(--n-mute); }

@media (max-width: 1000px) { .feat2, .kz-alash .feat2 { grid-template-columns: 1fr; } .kz-alash .feat-pics { order: 0; } .tr-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tr-list { grid-template-columns: 1fr; } .khans { grid-template-columns: 1fr; } .tl-legend { font-size: 12px; } .tl-mapyear { font-size: 12.5px; } #kzMap .hm-lab { font-size: 30px; } }

/* heroes as cards with a picture */
.hgroups { display: block; }
.hg + .hg { margin-top: 44px; }
.hcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 26px 20px; margin-top: 18px; }
.hcard { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hc-pic { aspect-ratio: 4 / 5; border-radius: var(--r); overflow: hidden; background: #0b1220; margin-bottom: 10px; }
.hc-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; display: block; }
.hc-pic.none { display: grid; place-items: center; background: linear-gradient(160deg, #142033, #0b1220); border: 1px solid var(--n-line); }
.hc-pic.none span { font-size: 64px; font-weight: 300; color: rgba(245,197,24,.55); }
.hc-name { font-size: 17px; font-weight: 600; line-height: 1.3; }
.hc-y { font-size: 13.5px; color: var(--n-mute); font-variant-numeric: tabular-nums; }
.hcard p { margin-top: 4px !important; font-size: 14.5px; line-height: 1.6; color: var(--n-soft); }
.hc-cap { margin-top: 4px; font-size: 11.5px; color: #7d828b; }
@media (max-width: 640px) { .hcards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; } .hcard p { font-size: 14px; } }
.kz-alash .photo img{aspect-ratio:auto}

/* map: era stepper */
.mp-info { margin: 12px 14px 0; display: grid; gap: 6px; }
.mp-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mp-label { font-size: 13px; font-weight: 600; color: var(--n-soft); }
.mp-nav { display: flex; gap: 6px; }
.mp-nav button { width: 34px; height: 30px; display: grid; place-items: center; border-radius: 6px; border: 1px solid var(--n-line); background: none; color: var(--n-fg); cursor: pointer; }
.mp-nav button svg { width: 14px; height: 14px; }
.mp-nav button:disabled { opacity: .35; cursor: default; }
.mp-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 4px; scroll-snap-type: x proximity; }
.mp-chips::-webkit-scrollbar { display: none; }
.mp-chips button { flex: none; scroll-snap-align: center; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--n-line); background: none; color: var(--n-soft); font: 500 12.5px var(--n-display, inherit); font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.mp-chips button.on { background: var(--gold); border-color: var(--gold); color: #111; }
.mp-y { font-size: 13px; color: var(--gold); font-weight: 600; margin-top: 4px; }
.mp-h { margin: 0; font-size: 18px; line-height: 1.3; color: var(--n-fg); }
.mp-p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--n-soft); max-width: 70ch; }
.lg-an { background: #3a3320; box-shadow: inset 0 0 0 1px rgba(245,197,24,.45); } .lg-kc { background: rgba(106,85,18,.55); outline: 1px dashed rgba(245,197,24,.7); outline-offset: -1px; }
@media (max-width: 640px) { .mp-h { font-size: 16.5px; } .mp-p { font-size: 14px; } }
@media (min-width: 761px) { .culs > .cul:nth-child(2) { grid-column: span 2; } .culs > .cul:nth-child(2) .cul-pic { aspect-ratio: 8 / 3; } .culs > .cul:nth-child(2) .cul-pic img { object-position: 50% 65%; } }
#kzMap .hm-mx { fill: none; stroke: #ffd84d; stroke-width: 2.2; stroke-dasharray: 9 6; opacity: .95; }
#kzMap .hm-lab-mx { font-size: 17px; font-weight: 500; fill: #ffd84d; }
.lg-mx { background: none !important; border-top: 2px dashed #ffd84d; height: 0 !important; }
@media (max-width: 640px) { #kzMap .hm-lab-mx { font-size: 24px; } }
.ab-pic { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; }
.cul-pic.fit { background: #000; }
/* phones: show each culture and army photo whole, in its own shape, instead of cropping it to 4:3 */
@media (max-width: 760px) {
  .cul-pic, .culs > .cul:nth-child(2) .cul-pic { aspect-ratio: auto; }
  .cul-pic img { height: auto; max-height: 78vh; object-fit: contain; }
  .cul-pic.fit img { padding: 14px; }
  .ab-pic { aspect-ratio: auto; height: auto; }
}

/* no source lines on the pictures: authors and licences are listed once, on credits.html */
.cul-pic figcaption, .hc-cap, .ab-cap, .tr-pic figcaption, #khPhotoCap, #alPhotoCap { display: none !important; }
.kz-credit { margin-top: 28px; font-size: 13px; color: var(--n-mute); }
.kz-credit a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
/* seven treasures */
.trs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.trs .cul-pic { aspect-ratio: 3 / 4; }
.trs-kz { display: block; font-size: 13px; color: var(--gold); margin-bottom: 4px; letter-spacing: .02em; }
@media (min-width: 761px) { .trs > .cul:nth-child(2) { grid-column: auto; } .trs > .cul:nth-child(2) .cul-pic { aspect-ratio: 3 / 4; } }
@media (max-width: 1100px) { .trs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .trs { grid-template-columns: 1fr; } }
@media (min-width: 1101px) { .trs > .cul:nth-child(3) { grid-column: span 2; } .trs > .cul:nth-child(3) .cul-pic { aspect-ratio: 3 / 2; } }
@media (max-width: 760px) { .trs .cul-pic, .trs > .cul:nth-child(2) .cul-pic { aspect-ratio: auto; } }

/* anthem player: the flag's sun turns while the anthem plays */
.an-sun { position: absolute; left: 50%; top: 36%; width: 46%; max-width: 200px; aspect-ratio: 1; transform: translate(-50%, -50%); fill: #ffd23f; filter: drop-shadow(0 6px 18px rgba(120, 80, 0, .25)); animation: anSpin 60s linear infinite; animation-play-state: paused; }
.anth.on .an-sun { animation-play-state: running; }
@keyframes anSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.an-play { position: absolute; left: 50%; top: 36%; transform: translate(-50%, -50%); width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #04151b; color: #ffd23f; cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); transition: transform .2s ease, background .2s ease; border-radius: 50% !important; padding: 0 !important; }
.an-play svg { width: 22px; height: 22px; margin-left: 2px; }
.anth.on .an-play svg { margin-left: 0; }
.an-play:hover { transform: translate(-50%, -50%) scale(1.06); background: #000; }
.an-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.anth.on .an-play::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(4, 21, 27, .45); animation: anRing 1.8s ease-out infinite; }
@keyframes anRing { from { transform: scale(.9); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.an-info { position: relative; display: grid; gap: 10px; }
.an-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.an-name { display: block; font: 700 19px/1.2 var(--n-display); color: #04151b; }
.an-by { display: block; margin-top: 3px; font-size: 12.5px; color: rgba(4, 21, 27, .72); }
.an-eq { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.an-eq i { width: 3px; height: 30%; border-radius: 2px; background: #04151b; opacity: .55; }
.anth.on .an-eq i { animation: anEq .9s ease-in-out infinite alternate; opacity: .9; }
.anth.on .an-eq i:nth-child(2) { animation-delay: -.3s; } .anth.on .an-eq i:nth-child(3) { animation-delay: -.6s; } .anth.on .an-eq i:nth-child(4) { animation-delay: -.15s; }
@keyframes anEq { from { height: 20%; } to { height: 100%; } }
.an-row { display: flex; align-items: center; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; color: rgba(4, 21, 27, .8); }
.an-track { position: relative; flex: 1; height: 4px; border-radius: 4px; background: rgba(4, 21, 27, .22); cursor: pointer; }
.an-track::before { content: ''; position: absolute; inset: -10px 0; }
.an-track i { display: block; height: 100%; width: 0; border-radius: 4px; background: #04151b; }
@media (prefers-reduced-motion: reduce) { .an-sun, .anth.on .an-play::after, .anth.on .an-eq i { animation: none; } }

/* census chart in "Under two empires" */
.tr-chart { background: #170d0d; border-radius: var(--r); padding: 10px 8px 6px; }
.census { display: block; width: 100%; height: auto; font-family: var(--n-display, inherit); }
.census .c-grid { stroke: rgba(255,255,255,.08); }
.census .c-ax, .census .c-yr { font-size: 14px; fill: #9b8c8a; font-variant-numeric: tabular-nums; }
.census .c-fam { fill: rgba(178,69,63,.28); }
.census .c-famt { font-size: 14px; fill: #e07a72; font-weight: 600; }
.census .c-kz { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linejoin: round; }
.census .c-ru { fill: none; stroke: #8a6b68; stroke-width: 2; stroke-dasharray: 5 4; }
.census .c-kz-p { fill: var(--gold); } .census .c-ru-p { fill: #8a6b68; }
.census .c-kz-k { fill: var(--gold); } .census .c-ru-k { fill: #8a6b68; }
.census .c-lg { font-size: 15px; fill: #e6dcdb; }
.census .c-drop { font-size: 16px; fill: #ff9b92; font-weight: 700; }
.census .c-sh-h { font-size: 14.5px; fill: #c9bcba; font-weight: 600; }
.census .c-sh { fill: none; stroke: var(--gold); stroke-width: 2; opacity: .8; }
.census .c-sh-v { font-size: 14px; fill: var(--gold); font-weight: 700; }
.census .c-src { font-size: 12.5px; fill: #7d6e6c; }

/* city photos */
.city-pic { margin: 0 0 10px; aspect-ratio: 16 / 10; border-radius: var(--r); overflow: hidden; background: #0b1220; }
.city-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cities { gap: 8px 28px; }
.city-pic.none { display: grid; place-items: center; background: linear-gradient(150deg, #0f2a3a, #0b1220 70%); border: 1px solid var(--n-line); }
.city-pic.none span { font: 600 26px var(--n-display); color: rgba(0,175,202,.55); letter-spacing: .04em; }
