/* ==========================================================================
   Citizenship Study Guide — visual & interactive learning components
   Loaded after citizenship.css on the reading pages.
   Chart colours validated with the dataviz palette validator:
     light: #008a70 / #d9a400   dark: #1f9e83 / #b98c12
   ========================================================================== */

:root {
  --c1: #008a70;          /* chart series 1 (teal) */
  --c2: #d9a400;          /* chart series 2 (gold) */
  --c1-track: #d6ece6;    /* meter track: lighter step of the same ramp */
  --c-grid: #e6e2d8;
  --ink-on-fill: #ffffff;
  --sky-1: #e9f4f1;
  --sky-2: #fbf2d6;
  --tone-teal: #e2f0ec;  --tone-teal-ink: #155b50;
  --tone-gold: #fbf2d6;  --tone-gold-ink: #7a5600;
  --tone-blue: #e3eef4;  --tone-blue-ink: #1f5d78;
  --tone-red: #fae5e2;   --tone-red-ink: #94291f;
  --tone-plum: #efe7f3;  --tone-plum-ink: #5d3a73;
  --tone-green: #e6f1df; --tone-green-ink: #36592a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c1: #1f9e83; --c2: #b98c12; --c1-track: #1b3833; --c-grid: #26342f; --ink-on-fill: #ffffff;
    --sky-1: #132a26; --sky-2: #2a2412;
    --tone-teal: #15302b;  --tone-teal-ink: #7fd8c4;
    --tone-gold: #2b2512;  --tone-gold-ink: #f0c75a;
    --tone-blue: #152a35;  --tone-blue-ink: #8cc6e3;
    --tone-red: #341815;   --tone-red-ink: #ff9384;
    --tone-plum: #2a1f31;  --tone-plum-ink: #d3b2e6;
    --tone-green: #1c2a17; --tone-green-ink: #a9d690;
  }
}
:root[data-theme="dark"] {
  --c1: #1f9e83; --c2: #b98c12; --c1-track: #1b3833; --c-grid: #26342f; --ink-on-fill: #ffffff;
  --sky-1: #132a26; --sky-2: #2a2412;
  --tone-teal: #15302b;  --tone-teal-ink: #7fd8c4;
  --tone-gold: #2b2512;  --tone-gold-ink: #f0c75a;
  --tone-blue: #152a35;  --tone-blue-ink: #8cc6e3;
  --tone-red: #341815;   --tone-red-ink: #ff9384;
  --tone-plum: #2a1f31;  --tone-plum-ink: #d3b2e6;
  --tone-green: #1c2a17; --tone-green-ink: #a9d690;
}
.t-teal { --tone: var(--tone-teal); --tone-ink: var(--tone-teal-ink); }
.t-gold { --tone: var(--tone-gold); --tone-ink: var(--tone-gold-ink); }
.t-blue { --tone: var(--tone-blue); --tone-ink: var(--tone-blue-ink); }
.t-red { --tone: var(--tone-red); --tone-ink: var(--tone-red-ink); }
.t-plum { --tone: var(--tone-plum); --tone-ink: var(--tone-plum-ink); }
.t-green { --tone: var(--tone-green); --tone-ink: var(--tone-green-ink); }

/* ---------- Part hero ---------- */
.cz-phero { display: grid; gap: 24px; align-items: center; padding: 28px 0 8px; }
@media (min-width: 900px) { .cz-phero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; padding: 40px 0 16px; } }
.cz-phero h1 { margin-bottom: .3em; }
.cz-phero__visual { position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface-2); box-shadow: var(--shadow); margin: 0; }
@media (max-width: 899px) { .cz-phero__visual { order: -1; aspect-ratio: 16 / 9; } }
.cz-phero__visual img, .cz-phero__visual svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.cz-phero__visual figcaption { position: absolute; left: 10px; bottom: 10px; right: 10px; display: flex; justify-content: space-between; gap: 8px; align-items: flex-end; pointer-events: none; }
.cz-phero__tag { pointer-events: auto; background: rgba(10, 20, 18, .72); color: #fff; font-size: .8rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(6px); }
.cz-credit { pointer-events: auto; font-size: .68rem; line-height: 1.3; color: rgba(255,255,255,.92); background: rgba(10, 20, 18, .55); padding: 3px 8px; border-radius: 6px; max-width: 60%; text-align: right; }
.cz-credit a { color: inherit; }
.cz-phero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ---------- Chapter cards ---------- */
.cz-chapters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); margin: 26px 0 8px; counter-reset: ch; }
.cz-chapter {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, transform .15s, box-shadow .15s;
}
.cz-chapter:hover { border-color: var(--primary-line); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--text); }
.cz-chapter .cz-ico { width: 40px; height: 40px; font-size: 1rem; flex-shrink: 0; }
.cz-chapter b { display: block; font-size: .93rem; line-height: 1.3; }
.cz-chapter small { display: block; color: var(--faint); font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cz-chapter.is-current { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.cz-chapter.is-heard small::after { content: " \2713"; color: var(--ok); font-weight: 800; }

/* ---------- Icon badge ---------- */
.cz-ico {
  display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 1.3rem;
  background: var(--tone, var(--tone-teal)); color: var(--tone-ink, var(--tone-teal-ink)); flex-shrink: 0;
}
.cz-ico--sm { width: 36px; height: 36px; border-radius: 10px; font-size: .95rem; }
.cz-ico--lg { width: 68px; height: 68px; border-radius: 18px; font-size: 1.7rem; }

/* ---------- Section head ---------- */
.cz-sec__head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 16px; align-items: center; margin-bottom: 18px; }
.cz-sec__head .cz-ico { grid-row: span 2; }
.cz-sec__head h2 { margin: 0; }
.cz-sec__kicker { font-size: .74rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--faint); }
.cz-sec__tools { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cz-sec__lead { font-size: 1.1rem; color: var(--muted); }

/* ---------- Play button (section audio) ---------- */
.cz-play {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px;
  border: 1px solid var(--primary-line); background: var(--primary-soft); color: var(--primary);
  font: 600 .84rem var(--font-body); cursor: pointer;
}
.cz-play__icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-size: .7rem; }
.cz-play:hover { border-color: var(--primary); }
.cz-play.is-playing { background: var(--primary); color: var(--primary-ink); }
.cz-play.is-playing .cz-play__icon { background: var(--primary-ink); color: var(--primary); }
.cz-play__dur { font-weight: 500; opacity: .75; }

/* Read-along highlight */
.cz-reading { background: var(--gold-soft); box-shadow: 0 0 0 4px var(--gold-soft); border-radius: 4px; transition: background .2s, box-shadow .2s; }
li.cz-reading, h2.cz-reading, h3.cz-reading { box-shadow: 0 0 0 6px var(--gold-soft); }

/* ---------- Sticky audio player ---------- */
.cz-player {
  position: fixed; left: 50%; bottom: 14px; transform: translate(-50%, 140%); z-index: 70;
  width: min(680px, calc(100% - 20px)); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px 14px; align-items: center;
  padding: 10px 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 18px 48px -18px rgba(0,0,0,.45);
  transition: transform .3s cubic-bezier(.2,.8,.2,1);
}
.cz-player.is-open { transform: translate(-50%, 0); }
.cz-player__btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--primary); color: var(--primary-ink); font-size: 1rem; }
.cz-player__btn--ghost { width: 36px; height: 36px; background: var(--surface-2); color: var(--muted); font-size: .85rem; }
.cz-player__meta { min-width: 0; }
.cz-player__title { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-player__sub { font-size: .76rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.cz-player__bar { position: relative; height: 6px; border-radius: 999px; background: var(--c1-track); margin-top: 6px; cursor: pointer; }
.cz-player__bar span { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px; background: var(--c1); }
.cz-player__right { display: flex; align-items: center; gap: 6px; }
.cz-player__speed { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; font: 600 .78rem var(--font-body); padding: 6px 9px; cursor: pointer; min-width: 48px; }
@media (max-width: 520px) { .cz-player { grid-template-columns: auto minmax(0, 1fr); } .cz-player__right { grid-column: 1 / -1; justify-content: space-between; } }
body.has-player { padding-bottom: 110px; }

/* ---------- KPI / stat tiles ---------- */
.cz-kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); margin: 18px 0; }
.cz-kpi { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 16px; overflow: hidden; }
.cz-kpi .cz-ico { width: 36px; height: 36px; border-radius: 10px; font-size: .95rem; margin-bottom: 10px; }
.cz-kpi__value { font-family: var(--font-body); font-weight: 650; font-size: clamp(1.6rem, 4vw, 2.1rem); line-height: 1.05; letter-spacing: -.02em; }
.cz-kpi__label { font-size: .88rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }

/* ---------- Meter ---------- */
.cz-meter { margin: 14px 0; }
.cz-meter__row { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; margin-bottom: 6px; }
.cz-meter__row b { font-variant-numeric: tabular-nums; }
.cz-meter__track { height: 12px; border-radius: 999px; background: var(--c1-track); overflow: hidden; }
.cz-meter__fill { height: 100%; border-radius: 999px; background: var(--c1); width: 0; transition: width 1s cubic-bezier(.2,.8,.2,1); }
.is-visible .cz-meter__fill { width: var(--v); }

/* ---------- Charts (shared) ---------- */
.cz-chart { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 18px 14px; margin: 20px 0; position: relative; }
.cz-chart__title { font-family: var(--font-body); font-size: 1rem; font-weight: 650; margin: 0 0 2px; }
.cz-chart__sub { font-size: .84rem; color: var(--muted); margin: 0 0 14px; }
.cz-chart__note { font-size: .76rem; color: var(--faint); margin: 10px 0 0; }
.cz-legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .84rem; color: var(--muted); margin-top: 10px; }
.cz-legend-row i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c1); }
.cz-legend-row i.c2 { background: var(--c2); }
.cz-tip-box {
  position: absolute; z-index: 5; pointer-events: none; background: var(--text); color: var(--bg); font-size: .8rem; line-height: 1.35;
  padding: 7px 10px; border-radius: 8px; white-space: nowrap; transform: translate(-50%, calc(-100% - 10px)); opacity: 0; transition: opacity .12s;
}
.cz-tip-box.is-on { opacity: 1; }
.cz-tablelink { font-size: .8rem; margin-top: 8px; }
.cz-tablelink summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.cz-tablelink table { margin-top: 8px; }

/* Time bar (65,000 years vs 1788) */
.cz-timebar { position: relative; height: 28px; border-radius: 6px; background: var(--c1); margin: 8px 0 6px; overflow: visible; }
.cz-timebar__seg { position: absolute; top: 0; bottom: 0; right: 0; width: max(4px, var(--w)); background: var(--c2); border-left: 2px solid var(--surface); border-radius: 0 6px 6px 0; }
.cz-timebar__axis { display: flex; justify-content: space-between; font-size: .76rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.cz-timebar__labels { display: flex; justify-content: space-between; gap: 12px; font-size: .86rem; margin-top: 10px; }
.cz-timebar__labels span { display: flex; align-items: center; gap: 6px; }
.cz-timebar__labels i { width: 12px; height: 12px; border-radius: 3px; background: var(--c1); display: inline-block; }
.cz-timebar__labels i.c2 { background: var(--c2); }

/* Ranked horizontal bars */
.cz-hbars { display: grid; gap: 8px; }
.cz-hbar { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 10px; align-items: center; font-size: .88rem; cursor: default; }
.cz-hbar__name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cz-hbar__track { position: relative; height: 22px; display: flex; align-items: center; gap: 8px; }
.cz-hbar__fill { height: 18px; border-radius: 0 4px 4px 0; background: var(--c1); width: 0; min-width: 3px; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.is-visible .cz-hbar__fill { width: var(--v); }
.cz-hbar__val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: .8rem; }
.cz-hbar.is-hl .cz-hbar__fill { background: var(--c2); }
@media (max-width: 520px) { .cz-hbar { grid-template-columns: 6.6em minmax(0, 1fr); font-size: .8rem; } }

/* Hemicycle */
.cz-hemi svg { display: block; width: 100%; height: auto; max-width: 560px; margin: 0 auto; }
.cz-hemi circle { transition: opacity .2s; }
.cz-hemi.is-filtering circle:not(.is-on) { opacity: .18; }
.cz-hemi__center { font-family: var(--font-body); font-weight: 650; fill: var(--text); }
.cz-hemi__centersub { fill: var(--muted); font-family: var(--font-body); }
.cz-hemi__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.cz-hemi__legend button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 11px; font: 500 .8rem var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cz-hemi__legend button i { width: 10px; height: 10px; border-radius: 50%; background: var(--c1); display: inline-block; }
.cz-hemi__legend button.t i { background: var(--c2); }
.cz-hemi__legend button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- Photos ---------- */
.cz-photo { margin: 20px 0; border-radius: 16px; overflow: hidden; background: var(--surface-2); position: relative; }
.cz-photo img { display: block; width: 100%; height: auto; aspect-ratio: var(--ar, 3 / 2); object-fit: cover; }
.cz-photo figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 9px 12px; font-size: .84rem; background: var(--surface); border: 1px solid var(--border); border-top: 0; border-radius: 0 0 16px 16px; }
.cz-photo figcaption .credit { font-size: .72rem; color: var(--faint); }
.cz-photo figcaption .credit a { color: inherit; }
.cz-photos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 20px 0; }
.cz-photos .cz-photo { margin: 0; }

/* ---------- Story timeline ---------- */
.cz-story { list-style: none; margin: 24px 0; padding: 0; position: relative; }
.cz-story::before { content: ""; position: absolute; left: 25px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: linear-gradient(var(--c1), var(--c2)); }
.cz-story > li { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 16px; margin: 0 0 22px; }
.cz-story > li:last-child { margin-bottom: 0; }
.cz-story .cz-ico { width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--bg); position: relative; z-index: 1; }
.cz-story__card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; }
.cz-story__body { padding: 14px 16px; }
.cz-story__when { display: inline-block; font: 700 .78rem var(--font-body); letter-spacing: .06em; text-transform: uppercase; color: var(--tone-ink, var(--primary)); background: var(--tone, var(--primary-soft)); padding: 3px 10px; border-radius: 999px; margin-bottom: 6px; }
.cz-story__card h3 { margin: 2px 0 6px !important; font-size: 1.15rem; }
.cz-story__card p { margin: 0 0 .5em; font-size: .96rem; }
.cz-story__card p:last-child { margin-bottom: 0; }
.cz-story__card img { display: block; width: 100%; aspect-ratio: 21 / 9; object-fit: cover; }
.cz-story__card .credit { display: block; padding: 4px 16px 0; font-size: .7rem; color: var(--faint); }
.cz-story__card .credit a { color: inherit; }

/* ---------- Australia map ---------- */
.cz-map { display: grid; gap: 16px; margin: 22px 0; }
@media (min-width: 760px) { .cz-map { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; } }
.cz-map__svg { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 10px; }
.cz-map__svg svg { display: block; width: 100%; height: auto; }
.cz-map__state { fill: var(--c1); stroke: var(--surface); stroke-width: 2.5; cursor: pointer; transition: fill .15s, opacity .15s; outline: none; }
.cz-map__state[data-k="nt"], .cz-map__state[data-k="nsw"] { fill: #0b6f5b; }
.cz-map__state[data-k="qld"], .cz-map__state[data-k="tas"] { fill: #2b7a93; }
.cz-map__state[data-k="sa"] { fill: #4f7a37; }
.cz-map__state[data-k="act"] { fill: #f2c230; stroke-width: 1.5; }
.cz-map__state:hover, .cz-map__state:focus-visible { opacity: .82; }
.cz-map__state.is-on { fill: #f2c230; }
.cz-map__state[data-k="act"].is-on { fill: #ff8a3d; }
.cz-map__city { fill: #fff; stroke: #1b2725; stroke-width: 3; pointer-events: none; }
.cz-map__city.is-capital { fill: #f2c230; }
.cz-map__label { font: 800 46px var(--font-body); fill: #fff; pointer-events: none; paint-order: stroke; stroke: rgba(0,0,0,.25); stroke-width: 3px; }
.cz-map__citylabel { font: 700 31px var(--font-body); fill: var(--text); pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: 7px; stroke-linejoin: round; }
.cz-map__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cz-map__chips button { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 999px; padding: 5px 11px; font: 600 .8rem var(--font-body); cursor: pointer; }
.cz-map__chips button[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.cz-map__panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; min-height: 100%; }
.cz-map__panel img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }
.cz-map__panel .credit { display: block; padding: 4px 16px 0; font-size: .7rem; color: var(--faint); }
.cz-map__panel .credit a { color: inherit; }
.cz-map__body { padding: 14px 18px 18px; }
.cz-map__body h3 { margin: 0 0 2px !important; font-size: 1.35rem; }
.cz-map__cap { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.cz-map__body p { font-size: .95rem; margin: 8px 0 0; }
.cz-map__icons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cz-map__icons span { font-size: .8rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.cz-statecards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); margin: 14px 0; }
.cz-statecard { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.cz-statecard .cz-abbr { display: grid; place-items: center; height: 54px; border-radius: 12px; font: 700 .95rem var(--font-body); color: #fff; background: var(--c1); }
.cz-statecard h3 { margin: 0 !important; font-size: 1.02rem; }
.cz-statecard p { margin: 2px 0 0; font-size: .88rem; color: var(--muted); }
.cz-statecard .cap { color: var(--primary); font-weight: 600; font-size: .84rem; }

/* ---------- VS comparison ---------- */
.cz-vs { position: relative; display: grid; gap: 14px; margin: 22px 0; }
@media (min-width: 640px) { .cz-vs { grid-template-columns: 1fr 1fr; gap: 22px; } }
.cz-vs__side { border-radius: 18px; padding: 18px; background: var(--tone, var(--tone-teal)); color: var(--text); }
.cz-vs__side header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.cz-vs__side header .cz-ico { background: var(--surface); }
.cz-vs__side h3 { margin: 0 !important; font-size: 1.18rem; }
.cz-vs__side header small { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--tone-ink); }
.cz-vs__side ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cz-vs__side li { margin: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; font-size: .95rem; }
.cz-vs__side li > i { color: var(--tone-ink); margin-top: 4px; }
.cz-vs__badge { display: none; }
@media (min-width: 640px) {
  .cz-vs__badge { display: grid; place-items: center; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); font: 800 .85rem var(--font-body); color: var(--muted); box-shadow: var(--shadow); z-index: 1; }
}

/* ---------- Calendar date cards ---------- */
.cz-cal { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; align-items: start; }
.cz-cal__date { border-radius: 14px; overflow: hidden; text-align: center; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.cz-cal__date b { display: block; background: var(--tone-ink, var(--primary)); color: var(--surface); font: 700 .72rem var(--font-body); letter-spacing: .1em; padding: 4px 0; }
.cz-cal__date span { display: block; font: 700 2rem/1.15 var(--font-body); padding: 6px 0 8px; }

/* ---------- Icon grid ---------- */
.cz-ig { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.cz-ig li { margin: 0; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: .92rem; line-height: 1.3; }
.cz-ig li > i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--tone, var(--tone-teal)); color: var(--tone-ink, var(--tone-teal-ink)); font-size: .85rem; }

/* Levels of government (columns) */
.cz-tiers { display: grid; gap: 14px; margin: 20px 0; }
@media (min-width: 860px) { .cz-tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cz-tier { border-radius: 18px; background: var(--tone); padding: 16px; }
.cz-tier header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cz-tier header .cz-ico { background: var(--surface); }
.cz-tier h3 { margin: 0 !important; font-size: 1.1rem; }
.cz-tier header small { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--tone-ink); }
.cz-tier .cz-ig { grid-template-columns: 1fr; margin: 0; }
.cz-tier .cz-ig li { background: var(--surface); border-color: transparent; }

/* ---------- Sorting game ---------- */
.cz-game { margin: 26px 0; border-radius: 20px; padding: 20px; background: linear-gradient(135deg, var(--sky-1), var(--sky-2)); border: 1px solid var(--border); }
.cz-game__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cz-game__head .cz-ico { background: var(--surface); }
.cz-game__head h3 { margin: 0 !important; font-size: 1.15rem; }
.cz-game__head p { margin: 0; font-size: .86rem; color: var(--muted); }
.cz-game__card { background: var(--surface); border-radius: 16px; padding: 20px; text-align: center; box-shadow: var(--shadow); }
.cz-game__count { font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.cz-game__prompt { font-family: var(--font-head); font-size: clamp(1.2rem, 3.2vw, 1.5rem); font-weight: 600; line-height: 1.3; margin: 8px 0 16px; }
.cz-game__prompt i { display: block; font-size: 1.6rem; color: var(--primary); margin-bottom: 10px; }
.cz-game__choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.cz-game__choices button { flex: 1 1 140px; max-width: 220px; border: 1.5px solid var(--border-strong); background: var(--bg); color: var(--text); border-radius: 12px; padding: 12px 10px; font: 600 .92rem var(--font-body); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cz-game__choices button i { font-size: 1.1rem; color: var(--primary); }
.cz-game__choices button:hover:not(:disabled) { border-color: var(--primary); }
.cz-game__choices button.is-right { border-color: var(--ok); background: var(--ok-soft); }
.cz-game__choices button.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.cz-game__fb { margin-top: 14px; font-size: .92rem; min-height: 1.4em; }
.cz-game__fb .ok { color: var(--ok); font-weight: 700; }
.cz-game__fb .bad { color: var(--bad); font-weight: 700; }
.cz-game__next { margin-top: 12px; }
.cz-game__bar { height: 6px; border-radius: 999px; background: rgba(127,127,127,.18); overflow: hidden; margin-top: 14px; }
.cz-game__bar span { display: block; height: 100%; background: var(--c1); width: 0; transition: width .3s; }
.cz-game__done { text-align: center; }
.cz-game__done b { display: block; font: 700 2.2rem var(--font-body); margin: 6px 0; }

/* ---------- Flip / reveal cards ---------- */
.cz-flips { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 18px 0; }
.cz-flipcard { border-radius: 14px; background: var(--surface); border: 1px dashed var(--border-strong); }
.cz-flipcard summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: .95rem; }
.cz-flipcard summary::-webkit-details-marker { display: none; }
.cz-flipcard summary::before { content: "?"; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); font-weight: 800; font-size: .8rem; }
.cz-flipcard[open] { border-style: solid; border-color: var(--ok-line); background: var(--ok-soft); }
.cz-flipcard[open] summary::before { content: "\2713"; background: var(--ok); color: var(--surface); }
.cz-flipcard > div { padding: 0 16px 14px 50px; font-size: .95rem; }
.cz-flipcard summary small { display: block; font-weight: 500; color: var(--faint); font-size: .75rem; margin-top: 2px; }

/* ---------- Venn ---------- */
.cz-venn { position: relative; display: grid; gap: 12px; margin: 22px 0; }
@media (min-width: 760px) {
  .cz-venn { grid-template-columns: 1fr .62fr 1fr; gap: 0; align-items: center; min-height: 360px; }
  .cz-venn::before, .cz-venn::after { content: ""; position: absolute; top: 0; bottom: 0; width: 63%; border-radius: 50%; z-index: 0; }
  .cz-venn::before { left: 0; background: rgba(0, 138, 112, .13); border: 2px solid rgba(0, 138, 112, .45); }
  .cz-venn::after { right: 0; background: rgba(217, 164, 0, .14); border: 2px solid rgba(217, 164, 0, .55); }
}
.cz-venn__part { position: relative; z-index: 1; padding: 16px; border-radius: 16px; }
@media (max-width: 759px) { .cz-venn__part { background: var(--tone); } }
.cz-venn__part h3 { margin: 0 0 8px !important; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.cz-venn__part ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cz-venn__part li { margin: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; font-size: .9rem; line-height: 1.35; }
.cz-venn__part li > i { color: var(--tone-ink); margin-top: 3px; }
@media (min-width: 760px) {
  .cz-venn__part--l { padding-left: 34px; padding-right: 8px; }
  .cz-venn__part--r { padding-right: 34px; padding-left: 8px; }
  .cz-venn__part--m { text-align: center; padding: 8px; }
  .cz-venn__part--m ul { justify-items: center; }
  .cz-venn__part--m li { grid-template-columns: 1fr; text-align: center; }
  .cz-venn__part--m h3 { justify-content: center; }
}
.cz-venn__both { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); font-weight: 700; }
.cz-venn__both i { font-size: 1.5rem; color: var(--primary); }

/* ---------- Pillars (separation of powers) ---------- */
.cz-temple { margin: 22px 0; }
.cz-temple__roof { position: relative; text-align: center; padding: 22px 12px 14px; color: var(--surface); font: 700 .95rem var(--font-body); letter-spacing: .06em; text-transform: uppercase; background: var(--text); clip-path: polygon(50% 0, 100% 72%, 100% 100%, 0 100%, 0 72%); }
.cz-temple__roof small { display: block; font-weight: 500; letter-spacing: 0; text-transform: none; opacity: .75; font-size: .78rem; }
.cz-temple__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 6px; background: var(--surface-2); }
.cz-pillar { border: 0; cursor: pointer; text-align: center; padding: 16px 8px; border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; box-shadow: inset 0 -6px 0 var(--tone, var(--tone-teal)); transition: transform .15s; }
.cz-pillar:hover { transform: translateY(-3px); }
.cz-pillar[aria-pressed="true"] { background: var(--tone); }
.cz-pillar .cz-ico { margin: 0 auto 8px; background: var(--tone); }
.cz-pillar[aria-pressed="true"] .cz-ico { background: var(--surface); }
.cz-pillar b { display: block; font-size: .98rem; }
.cz-pillar small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.cz-temple__base { height: 14px; background: var(--text); border-radius: 0 0 6px 6px; }
.cz-temple__info { margin-top: 12px; padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); min-height: 72px; }
.cz-temple__info h3 { margin: 0 0 4px !important; font-size: 1.05rem; }
.cz-temple__info p { margin: 0; font-size: .95rem; }
@media (max-width: 520px) { .cz-pillar small { display: none; } .cz-pillar { padding: 12px 4px; } }

/* ---------- Org chart ---------- */
.cz-org { margin: 22px 0; display: grid; justify-items: center; gap: 0; }
.cz-org__node { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); min-width: 0; }
.cz-org__node .cz-ico { width: 38px; height: 38px; border-radius: 10px; font-size: .95rem; }
.cz-org__node b { display: block; font-size: .95rem; }
.cz-org__node small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.cz-org__node--top { background: var(--tone-gold); border-color: var(--gold-line); }
.cz-org__line { width: 2px; height: 22px; background: var(--border-strong); }
.cz-org__row { display: grid; gap: 10px; width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); position: relative; padding-top: 18px; }
.cz-org__row::before { content: ""; position: absolute; top: 0; left: 16%; right: 16%; height: 2px; background: var(--border-strong); }
.cz-org__row > div { position: relative; display: grid; gap: 8px; }
.cz-org__row > div::before { content: ""; position: absolute; top: -18px; left: 50%; width: 2px; height: 18px; background: var(--border-strong); }
@media (max-width: 640px) { .cz-org__row::before, .cz-org__row > div::before { display: none; } .cz-org__row { padding-top: 10px; } }
.cz-org__sub { font-size: .8rem; color: var(--muted); text-align: center; }

/* ---------- Stepper ---------- */
.cz-stepper { margin: 22px 0; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.cz-stepper__track { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 6px; position: relative; margin-bottom: 16px; }
.cz-stepper__track::before { content: ""; position: absolute; top: 22px; left: 10%; right: 10%; height: 3px; background: var(--c1-track); border-radius: 3px; }
.cz-stepper__dot { position: relative; z-index: 1; display: grid; justify-items: center; gap: 6px; text-align: center; border: 0; background: none; cursor: pointer; color: var(--muted); font: 600 .78rem var(--font-body); padding: 0; }
.cz-stepper__dot .cz-ico { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); color: var(--faint); border: 3px solid var(--surface); transition: background .2s, color .2s, transform .2s; }
.cz-stepper__dot.is-done .cz-ico { background: var(--c1-track); color: var(--primary); }
.cz-stepper__dot.is-on .cz-ico { background: var(--primary); color: var(--primary-ink); transform: scale(1.1); }
.cz-stepper__dot.is-on { color: var(--text); }
.cz-stepper__panel { border-radius: 14px; background: var(--tone-teal); padding: 16px 18px; min-height: 96px; }
.cz-stepper__panel h3 { margin: 0 0 4px !important; font-size: 1.1rem; }
.cz-stepper__panel p { margin: 0; }
.cz-stepper__nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; }
@media (max-width: 520px) { .cz-stepper__dot span { display: none; } }
/* no-JS: show all steps as a list */
.cz-stepper__all { margin: 0; padding-left: 1.2em; }
.cz-stepper.is-live .cz-stepper__all { display: none; }
.cz-stepper:not(.is-live) .cz-stepper__track, .cz-stepper:not(.is-live) .cz-stepper__panel, .cz-stepper:not(.is-live) .cz-stepper__nav { display: none; }

/* ---------- Double-majority simulator ---------- */
.cz-dm { margin: 22px 0; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.cz-dm__states { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
@media (min-width: 640px) { .cz-dm__states { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.cz-dm__state { border: 1.5px solid var(--border-strong); background: var(--bg); border-radius: 12px; padding: 10px 6px; cursor: pointer; font: 700 .9rem var(--font-body); color: var(--text); display: grid; gap: 4px; justify-items: center; }
.cz-dm__state span { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--bad-soft); color: var(--bad); }
.cz-dm__state[aria-pressed="true"] { border-color: var(--ok); background: var(--ok-soft); }
.cz-dm__state[aria-pressed="true"] span { background: var(--ok); color: var(--surface); }
.cz-dm__nat { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; margin: 14px 0 6px; font-size: .92rem; }
.cz-dm__nat input { grid-column: 1 / -1; width: 100%; accent-color: var(--primary); }
.cz-dm__checks { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: .94rem; }
.cz-dm__checks li { margin: 0; display: flex; gap: 8px; align-items: center; }
.cz-dm__checks .fa-circle-check { color: var(--ok); }
.cz-dm__checks .fa-circle-xmark { color: var(--bad); }
.cz-dm__result { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.cz-dm__result.pass { background: var(--ok-soft); color: var(--ok); }
.cz-dm__result.fail { background: var(--bad-soft); color: var(--bad); }

/* ---------- Pipeline (process flow) ---------- */
.cz-pipe { list-style: none; padding: 0; margin: 22px 0; display: grid; gap: 10px; }
@media (min-width: 760px) { .cz-pipe { grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 0; } }
.cz-pipe li { position: relative; margin: 0; padding: 16px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; display: grid; gap: 6px; align-content: start; }
@media (min-width: 760px) {
  .cz-pipe li { border-radius: 0; border-left-width: 0; padding-left: 26px; }
  .cz-pipe li:first-child { border-radius: 16px 0 0 16px; border-left-width: 1px; padding-left: 14px; }
  .cz-pipe li:last-child { border-radius: 0 16px 16px 0; }
  .cz-pipe li:not(:last-child)::after { content: ""; position: absolute; right: -13px; top: 50%; width: 24px; height: 24px; background: var(--surface); border-top: 1px solid var(--border); border-right: 1px solid var(--border); transform: translateY(-50%) rotate(45deg); z-index: 1; }
}
.cz-pipe li .cz-ico { width: 40px; height: 40px; font-size: 1rem; border-radius: 12px; }
.cz-pipe li b { font-size: .98rem; }
.cz-pipe li span { font-size: .88rem; color: var(--muted); line-height: 1.4; }

/* ---------- Big quote / rule ---------- */
.cz-rule { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; margin: 22px 0; padding: 18px 20px; border-radius: 18px; background: var(--tone, var(--tone-gold)); }
.cz-rule p { margin: 0; font-family: var(--font-head); font-size: clamp(1.1rem, 2.6vw, 1.35rem); font-weight: 600; line-height: 1.35; }
.cz-rule .cz-ico { background: var(--surface); }

/* Concentric "within the law" diagram */
.cz-within { margin: 22px auto; max-width: 520px; }
.cz-within svg { display: block; width: 100%; height: auto; }
.cz-within text { font-family: var(--font-body); }

/* ---------- Memory box (replaces plain "remember") ---------- */
.cz-mem { margin: 22px 0; border-radius: 18px; padding: 16px 18px; background: var(--primary-soft); border: 1px solid var(--primary-line); }
.cz-mem__title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.cz-mem ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.cz-mem li { margin: 0; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; font-size: .94rem; line-height: 1.4; }
.cz-mem li::before { content: "\2713"; color: var(--primary); font-weight: 800; }

.cz-trap { margin: 22px 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; padding: 16px 18px; border-radius: 18px; background: var(--gold-soft); border: 1px solid var(--gold-line); }
.cz-trap .cz-ico { background: var(--surface); color: var(--gold); width: 42px; height: 42px; font-size: 1rem; }
.cz-trap h4 { margin: 2px 0 6px; font-family: var(--font-body); font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.cz-trap ul { margin: 0; padding-left: 1.1em; }
.cz-trap p { margin: 0; }
.cz-trap--red { background: var(--bad-soft); border-color: var(--bad-line); }
.cz-trap--red .cz-ico, .cz-trap--red h4 { color: var(--bad); }

/* ---------- Scroll reveal ---------- */
.cz-reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.cz-reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .cz-reveal { opacity: 1; transform: none; transition: none; }
  .cz-meter__fill, .cz-hbar__fill { transition: none; }
}
.no-js .cz-reveal { opacity: 1; transform: none; }

/* Misc layout helpers */
.cz-two { display: grid; gap: 18px; margin: 20px 0; }
@media (min-width: 760px) { .cz-two { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.cz-two > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.cz-note { font-size: .78rem; color: var(--faint); }
.cz-article .cz-sec { padding: 40px 0; }

@media print {
  .cz-player, .cz-play, .cz-game, .cz-stepper__nav, .cz-chapters { display: none !important; }
  .cz-reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- Interactive flags ---------- */
.cz-flagx svg [data-fp] { cursor: pointer; transition: filter .15s; outline: none; }
.cz-flagx svg [data-fp]:focus-visible, .cz-flagx svg [data-fp].is-on { filter: drop-shadow(0 0 1.2px #ffd84d) drop-shadow(0 0 1.2px #ffd84d) drop-shadow(0 0 1.2px #ffd84d); }
.cz-flagx li[data-fp] { cursor: pointer; border-radius: 10px; padding: 5px 8px; margin: 3px -8px; transition: background .15s; }
.cz-flagx li[data-fp]:hover { background: var(--surface-2); }
.cz-flagx li[data-fp].is-on { background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold-line); }
.cz-flagx__out { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); color: var(--text) !important; min-height: 2.6em; }
.cz-flagx__out .cz-swatch { flex: 0 0 14px; height: 14px; margin-top: 2px; }

/* Games with many answers (e.g. 8 states) use compact buttons */
.cz-game__choices:has(> button:nth-child(5)) button { flex: 1 1 64px; padding: 10px 6px; }
.cz-map__label.is-on { fill: #1b2725; stroke: rgba(255,255,255,.55); }
