/* Culture Compass - styles. No external fonts or libraries. */
:root {
  --ink: #1b2333;
  --ink-2: #46506a;
  --muted: #6b7388;
  --paper: #fbf8f2;
  --card: #ffffff;
  --line: #e4dfd3;
  --accent: #d9480f;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(27, 35, 51, .18);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --head-h: 56px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--paper); line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: #0b5cad; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #1c6fc2; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- header ---------- */
.top { height: var(--head-h); background: var(--ink); color: #fff; display: flex; align-items: center; gap: 18px; padding: 0 16px; position: relative; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--serif); font-size: 1.25rem; font-weight: 700; letter-spacing: .2px; }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand small { font-family: var(--sans); font-weight: 400; font-size: .72rem; opacity: .75; display: block; letter-spacing: 0; margin-top: -3px; }
.nav { margin-left: auto; display: flex; gap: 4px; }
.nav a { color: #e8ecf5; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: .92rem; }
.nav a:hover, .nav a[aria-current="page"] { background: rgba(255, 255, 255, .14); color: #fff; }

/* ---------- map page layout ---------- */
.stage { display: flex; height: calc(100vh - var(--head-h)); height: calc(100dvh - var(--head-h)); position: relative; overflow: hidden; }
.panel { width: 372px; flex: none; background: var(--paper); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; z-index: 12; }
.drawer-handle { display: none; }
.ptabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 12px 14px 4px; flex: none; }
.ptabs button { --tc: var(--ink); display: flex; align-items: center; gap: 9px; text-align: left; border: 1.5px solid color-mix(in srgb, var(--tc) 35%, #fff); background: color-mix(in srgb, var(--tc) 8%, #fff); padding: 9px 10px; border-radius: 14px; font-weight: 700; font-size: .88rem; line-height: 1.15; color: var(--tc); transition: transform .12s, box-shadow .12s, background .12s; }
.ptabs button .ti { width: 30px; height: 30px; flex: none; padding: 6px; border-radius: 50%; background: var(--tc); color: #fff; }
.ptabs button .tl { display: flex; flex-direction: column; min-width: 0; }
.ptabs button .tl small { font-weight: 500; font-size: .7rem; color: var(--muted); margin-top: 2px; }
.ptabs button:hover { transform: translateY(-1px); box-shadow: 0 4px 12px color-mix(in srgb, var(--tc) 28%, transparent); background: color-mix(in srgb, var(--tc) 14%, #fff); }
.ptabs button.on { background: var(--tc); color: #fff; border-color: var(--tc); box-shadow: 0 5px 14px color-mix(in srgb, var(--tc) 40%, transparent); }
.ptabs button.on .ti { background: #fff; color: var(--tc); }
.ptabs button.on .tl small { color: rgba(255, 255, 255, .85); }
.ptabs button:focus-visible { outline: 3px solid var(--tc); outline-offset: 2px; }
.pane { padding: 12px 14px 14px; overflow: auto; flex: 1; min-height: 0; }
.pane[hidden] { display: none; }
#potd { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 10px; }
.potd-k { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 6px 2px; }
.potd-b, .li { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 10px; align-items: center; }
.potd-b { background: color-mix(in srgb, var(--c) 9%, #fff); }
.potd-b:hover, .li:hover { background: #f1ece0; }
.li.sel { background: #efe7d6; }
.li-ic { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.li-t { display: flex; flex-direction: column; min-width: 0; }
.li-t b { font-size: .95rem; line-height: 1.25; }
.li-t small { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quick { margin: 10px 0 4px; width: 100%; border: 1px dashed #d9480f; background: #fff4ec; color: #8f2f06; border-radius: 10px; padding: 8px 10px; font-weight: 600; font-size: .9rem; }
.quick:hover { background: #ffe9db; }
.list-head { display: flex; align-items: center; justify-content: space-between; margin: 12px 2px 4px; font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
#list, #trails, .plist { list-style: none; margin: 0; padding: 0; }
#list .empty { color: var(--muted); font-size: .9rem; padding: 10px 6px; }
#trails button { width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 2px; }
#trails button:hover { border-color: var(--ink-2); }
#trails small { color: var(--muted); }
.gl { display: block; }
.num { font-weight: 800; font-size: .8rem; color: #fff; line-height: 1; }

.mapwrap { position: relative; flex: 1; min-width: 0; }
#map { position: absolute; inset: 0; }
.overlay-top { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 10; pointer-events: none; display: flex; flex-direction: column; gap: 10px; }
.overlay-top > * { pointer-events: auto; }
.search { position: relative; max-width: 440px; }
.search input { width: 100%; font: inherit; padding: 12px 40px 12px 42px; border-radius: 999px; border: 1px solid #cfc8b8; background: #fff; box-shadow: var(--shadow); color: var(--ink); }
.search .mag { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-2); pointer-events: none; }
.search .clr { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0; background: #eee8da; font-size: 1.1rem; line-height: 1; }
.search .clr[hidden] { display: none; }
#sug { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border-radius: 14px; box-shadow: var(--shadow); list-style: none; margin: 0; padding: 6px; z-index: 20; }
#sug[hidden] { display: none; }
#sug button { display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 8px; border-radius: 10px; }
#sug button:hover, #sug button:focus-visible { background: #f1ece0; }
#sug small { display: block; color: var(--muted); font-size: .78rem; }
#sug .none { padding: 10px; color: var(--muted); font-size: .9rem; }
#sug .more button { color: #0b5cad; font-weight: 600; justify-content: center; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 2px 4px; }
.tab { --c: #333; flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: #fff; border: 2px solid var(--c); color: var(--c); font-weight: 700; font-size: .88rem; box-shadow: 0 2px 8px rgba(27, 35, 51, .14); white-space: nowrap; }
.tab .gl { background: var(--c); border-radius: 50%; padding: 2px; width: 18px; height: 18px; }
.tab i { font-style: normal; font-weight: 600; font-size: .75rem; opacity: .75; }
.tab.on { background: var(--c); color: #fff; }
.tab.on .gl { background: rgba(255, 255, 255, .25); }
.tab.all .gl { display: none; }
.tab:hover { filter: brightness(.96); }

.ctrls { position: absolute; right: 12px; bottom: 34px; z-index: 10; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.ctrls button { border: 0; background: #fff; box-shadow: var(--shadow); width: 42px; height: 42px; border-radius: 12px; font-size: 1.4rem; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.ctrls button:hover { background: #f1ece0; }
.ctrls .surprise { width: auto; padding: 0 16px; font-size: .95rem; font-weight: 700; background: var(--ink); color: #fff; gap: 8px; }
.ctrls .surprise:hover { background: #2b3650; }
.ctrls .world { width: auto; padding: 0 14px; gap: 8px; font-size: .92rem; font-weight: 700; color: var(--ink); }
.ctrls .world.hot { background: #1D5FBF; color: #fff; animation: worldpulse 1.8s ease-out 3; }
.ctrls .world.hot:hover { background: #164a96; }
@keyframes worldpulse { 0% { box-shadow: 0 0 0 0 rgba(29, 95, 191, .55), var(--shadow); } 100% { box-shadow: 0 0 0 14px rgba(29, 95, 191, 0), var(--shadow); } }
.ctrls .tour { background: #fff; color: var(--ink); }
.ctrls .tour.on { background: #C23E0B; color: #fff; }
.ctrls .tour:hover { background: #f1ece0; }
.ctrls .tour.on:hover { background: #a33409; }
.attrib { position: absolute; left: 0; bottom: 0; z-index: 8; background: rgba(255, 255, 255, .8); font-size: .72rem; padding: 2px 8px; border-top-right-radius: 8px; color: #333; }
.attrib a { color: #333; }
#boot { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #cfe5ee; z-index: 50; font-family: var(--serif); font-size: 1.2rem; color: var(--ink-2); }

/* ---------- markers ---------- */
.mk-wrap { width: 0; height: 0; position: relative; }
.mk { position: absolute; left: -17px; top: -44px; width: 34px; height: 44px; padding: 0; border: 0; background: transparent; color: #333; transform-origin: 50% 100%; transition: transform .12s; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); }
.mk .tear { position: absolute; left: 0; top: 0; }
.mk .gw, .mk .num { position: absolute; left: 0; right: 0; top: 7px; height: 20px; display: flex; align-items: center; justify-content: center; }
.mk .num { font-size: .85rem; }
.mk:hover { transform: scale(1.16); }
.mk.sel { transform: scale(1.32); filter: drop-shadow(0 0 0 #fff) drop-shadow(0 3px 6px rgba(0, 0, 0, .5)); }
.mk.comm .tear path { stroke-dasharray: 3.5 2.5; }
.mk.saved .tear path { stroke: #ffd43b; }
.mk .vis { position: absolute; right: -4px; top: -2px; width: 16px; height: 16px; border-radius: 50%; background: #2B7A3D; color: #fff; font-size: .68rem; line-height: 16px; text-align: center; font-weight: 800; border: 1.5px solid #fff; }
.mk-label { position: absolute; left: 20px; top: -34px; white-space: nowrap; font-size: .76rem; font-weight: 700; color: #1b2333; text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 5px #fff, 0 0 5px #fff; pointer-events: none; }
.tip { position: absolute; left: 0; bottom: 52px; transform: translateX(-50%); display: none; flex-direction: column; gap: 1px; background: #1b2333; color: #fff; padding: 6px 10px; border-radius: 9px; white-space: nowrap; max-width: 260px; z-index: 30; pointer-events: none; font-size: .82rem; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.tip b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.tip small { color: #cfd6e6; font-size: .74rem; overflow: hidden; text-overflow: ellipsis; }
.mk:hover ~ .tip, .mk:focus-visible ~ .tip, .cl:hover ~ .tip, .cl:focus-visible ~ .tip { display: flex; }
.cl ~ .tip { bottom: 28px; }
.mk-wrap:has(.mk:hover), .mk-wrap:has(.cl:hover) { z-index: 25 !important; }
.cl { position: absolute; border-radius: 50%; border: 2px solid #fff; padding: 0; transform: translate(-50%, -50%); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); display: flex; align-items: center; justify-content: center; }
.cl span { background: #fff; color: var(--ink); font-weight: 800; border-radius: 50%; width: calc(100% - 9px); height: calc(100% - 9px); display: flex; align-items: center; justify-content: center; font-size: .82rem; }
.cl:hover { transform: translate(-50%, -50%) scale(1.1); }
.spider { z-index: 8; }
.spider .legs { position: absolute; left: 0; top: 0; pointer-events: none; }
.spider .legs line { stroke: #1b2333; stroke-width: 1.5; opacity: .55; }
.spider .legs circle { fill: #1b2333; }
.qmark { position: absolute; transform: translate(-50%, -100%); margin-top: -4px; padding: 4px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; color: #fff; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.qmark::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; border-top-color: inherit; }
.qmark.guess { background: #1C6FC2; border-top-color: #1C6FC2; }
.qmark.answer { background: #C23E0B; border-top-color: #C23E0B; }
.badge { display: inline-block; vertical-align: middle; font-size: .68rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; letter-spacing: .02em; font-family: var(--sans); }
.badge.gi { background: #fff3d6; color: #7a4a00; border: 1px solid #e6c36a; }
.badge.comm { background: #e8ecf7; color: #2b3a62; border: 1px solid #b9c4e4; }

/* ---------- card / popup ---------- */
.popup { width: 0; height: 0; }
.popup .card { position: absolute; left: 0; bottom: 54px; transform: translateX(-50%); width: 330px; max-width: 86vw; }
.popup .card::after { content: ""; position: absolute; left: 50%; bottom: -8px; width: 16px; height: 16px; background: #fff; transform: translateX(-50%) rotate(45deg); box-shadow: 3px 3px 6px rgba(0, 0, 0, .12); }
.card { background: #fff; border-radius: 16px; box-shadow: 0 10px 34px rgba(27, 35, 51, .32); }
.card-head { display: flex; align-items: center; gap: 8px; color: #fff; padding: 9px 12px; font-weight: 700; font-size: .85rem; letter-spacing: .03em; border-radius: 16px 16px 0 0; }
.card-x { margin-left: auto; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .22); color: #fff; font-size: 1.3rem; line-height: 1; }
.card-x:hover { background: rgba(255, 255, 255, .38); }
.card-body { padding: 12px 16px 16px; position: relative; background: #fff; border-radius: 0 0 16px 16px; max-height: min(52vh, 420px); overflow: auto; }
.card h3 { margin: 0; font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; }
.card .where { margin: 2px 0 10px; color: var(--muted); font-size: .86rem; }
.meta { margin: 0 0 10px; display: grid; gap: 3px; }
.meta div { display: flex; gap: 8px; font-size: .84rem; }
.meta dt { color: var(--muted); min-width: 76px; }
.meta dd { margin: 0; font-weight: 600; }
.sum { margin: 0 0 12px; font-size: .92rem; }
.actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.btn { color: #fff; text-decoration: none; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
.btn:hover { filter: brightness(.92); }
.lnk { background: none; border: 0; padding: 4px 0; color: #0b5cad; font-weight: 600; font-size: .85rem; text-decoration: underline; }
.sheet { display: none; }

/* ---------- trail bar ---------- */
#trail-bar { position: absolute; z-index: 11; left: 12px; right: 12px; bottom: 28px; max-width: 560px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; }
#trail-bar[hidden] { display: none; }
#trail-bar h2 { margin: 0; font-family: var(--serif); font-size: 1.1rem; }
#trail-bar p { margin: 4px 0 10px; color: var(--ink-2); font-size: .88rem; }
#trail-bar .row { display: flex; gap: 8px; flex-wrap: wrap; }
#trail-bar button { border: 1px solid var(--line); background: #fff; padding: 7px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
#trail-bar #trail-next { background: var(--ink); color: #fff; border-color: var(--ink); }
#trail-bar #trail-exit { margin-left: auto; }
.in-trail .ctrls .surprise:not(.tour), .in-quiz .ctrls .surprise { display: none; }

/* ---------- content below the map ---------- */
.below { max-width: 1100px; margin: 0 auto; padding: 44px 20px 24px; }
.below h2 { font-family: var(--serif); font-size: 1.6rem; margin: 0 0 6px; }
.below p.lead { color: var(--ink-2); max-width: 70ch; margin-top: 0; }
.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 18px 0 34px; }
.catcard { border-radius: 14px; padding: 14px 16px; color: #fff; }
.catcard h3 { margin: 0 0 4px; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; }
.catcard p { margin: 0; font-size: .88rem; opacity: .96; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 30px; padding: 0; list-style: none; }
.chips a { display: inline-block; padding: 6px 12px; background: #fff; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .9rem; }
.chips a:hover { border-color: var(--ink-2); }
.chips small { color: var(--muted); }

/* ---------- article-style pages ---------- */
.page { max-width: 880px; margin: 0 auto; padding: 36px 20px 48px; }
.page h1 { font-family: var(--serif); font-size: 2.1rem; line-height: 1.15; margin: 0 0 8px; }
.page h2 { font-family: var(--serif); font-size: 1.35rem; margin: 30px 0 8px; }
.page .lead { font-size: 1.08rem; color: var(--ink-2); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin: 12px 0; border-left: 6px solid var(--c, #333); }
.pcard h3 { margin: 0; font-family: var(--serif); font-size: 1.15rem; }
.pcard .tagline { font-size: .78rem; font-weight: 700; color: var(--c); text-transform: uppercase; letter-spacing: .06em; }
.pcard p { margin: 6px 0; font-size: .94rem; }
.pcard .row { display: flex; gap: 14px; flex-wrap: wrap; font-size: .86rem; }
.mapbtn { display: inline-block; background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .9rem; }
.mapbtn:hover { background: #2b3650; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding: 0; list-style: none; margin: 18px 0; }
.cgrid a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.cgrid a:hover { border-color: var(--ink-2); }
.cgrid b { display: block; }
.cgrid small { color: var(--muted); }
.foot { border-top: 1px solid var(--line); padding: 22px 20px 30px; color: var(--muted); font-size: .85rem; text-align: center; }
.foot a { color: var(--muted); }


/* ---------- panes: shared bits ---------- */
.hint { margin: 0 0 10px; color: var(--ink-2); font-size: .9rem; }
.fine { color: var(--muted); font-size: .8rem; margin: 8px 0; }
.note { background: #fff8e6; border: 1px solid #ecd9a0; border-radius: 10px; padding: 10px 12px; font-size: .9rem; color: #5b4300; }
.sec { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 14px 4px 4px; list-style: none; }
.plist .empty { color: var(--muted); font-size: .9rem; padding: 8px 4px; list-style: none; }
.plist li { position: relative; }
.plist .rm { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: #eee8da; width: 26px; height: 26px; border-radius: 50%; line-height: 1; font-size: 1.1rem; }
.mini { border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: .84rem; color: var(--ink); }
.mini:hover { border-color: var(--ink-2); }
.mini.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.mini.danger { color: #a4161a; border-color: #e9b9ba; }
.mini:disabled { opacity: .5; cursor: default; }
.filebtn { display: inline-block; cursor: pointer; }
.big { width: 100%; border: 0; background: var(--accent); color: #fff; padding: 12px 14px; border-radius: 12px; font-weight: 800; font-size: 1rem; margin: 6px 0 10px; }
.big:hover { filter: brightness(.93); }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { --c: #243044; border: 1px solid var(--line); background: #fff; padding: 5px 11px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.chip:hover { border-color: var(--c); }
.chip.on { background: var(--c); border-color: var(--c); color: #fff; }
.ph { font-family: var(--serif); font-size: 1.05rem; margin: 18px 0 6px; }
.cal-exp { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }

/* time travel */
.tt-year { text-align: center; margin: 4px 0 0; }
.tt-year output { font-family: var(--serif); font-size: 2rem; font-weight: 700; }
#tt-range { width: 100%; accent-color: #243044; height: 28px; }
.tt-ends { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); margin-top: -4px; }
.tt-ctl { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.tt-ctl input { width: 110px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.tt-sum { font-size: .85rem; font-weight: 700; color: var(--ink-2); margin: 8px 0 0; }

/* calendar */
.cal-head { display: flex; gap: 6px; align-items: center; margin-bottom: 8px; }
.cal-head select, .cal-head input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: #fff; }
.cal-head input { width: 80px; }
.cal-head select { flex: 1; }
.addcal { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem; color: var(--ink-2); }

/* quiz */
.q-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 12px; }
.q-stats div { background: #fff; border: 1px solid var(--line); border-radius: 12px; text-align: center; padding: 8px 4px; }
.q-stats b { display: block; font-size: 1.4rem; font-family: var(--serif); }
.q-stats span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.q-done { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.q-sq { font-size: 1.4rem; letter-spacing: 2px; margin: 4px 0 8px; }
#quiz-bar { position: absolute; z-index: 11; left: 12px; right: 12px; bottom: 28px; max-width: 560px; background: #fff; border-radius: 16px; box-shadow: var(--shadow); padding: 12px 14px; }
#quiz-bar[hidden] { display: none; }
#quiz-bar .q-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-family: var(--serif); font-size: 1.05rem; }
#quiz-bar .q-top span { color: var(--muted); font-size: .85rem; font-family: var(--sans); }
#quiz-bar .q-clue { margin: 6px 0 8px; font-size: .96rem; font-style: italic; }
#quiz-bar .q-clue.small { font-style: normal; font-size: .85rem; color: var(--ink-2); max-height: 22vh; overflow: auto; }
#quiz-bar .q-hint { margin: 0 0 8px; font-size: .85rem; background: #f4efe3; padding: 6px 10px; border-radius: 8px; }
#quiz-bar .q-res { margin: 4px 0; }
#quiz-bar .row { display: flex; gap: 8px; flex-wrap: wrap; }
#quiz-bar button { border: 1px solid var(--line); background: #fff; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .85rem; }
#quiz-bar button.go { background: var(--accent); color: #fff; border-color: var(--accent); }
#quiz-bar button:disabled { opacity: .55; cursor: default; }
.in-quiz .tabs { display: none; }

/* passport */
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
.stamp { width: 100%; height: auto; }
.badges { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.badges li { background: #fff; border: 1px dashed #cfc8b8; border-radius: 10px; padding: 6px 10px; opacity: .6; }
.badges li.got { opacity: 1; border-style: solid; border-color: #e6c36a; background: #fff8e6; }
.badges b { display: block; font-size: .88rem; }
.badges small { color: var(--muted); }

/* card extras */
.thumb { margin: 0 0 10px; }
.thumb img { display: block; width: 100%; max-height: 150px; object-fit: cover; border-radius: 10px; background: #eee8da; }
.thumb figcaption { font-size: .7rem; color: var(--muted); margin-top: 2px; }
.xtra { display: grid; gap: 8px; margin: 0 0 10px; }
.pp-row { display: flex; gap: 6px; flex-wrap: wrap; }
.pp-btn { border: 1px solid var(--line); background: #fff; padding: 5px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.pp-btn.on { background: #fff8e6; border-color: #e6c36a; color: #6b4400; }
.greet { background: #f1ecff; border-radius: 12px; padding: 8px 10px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.gtxt { font-size: 1.4rem; font-weight: 700; }
.gguide { font-size: .8rem; color: var(--ink-2); }
.gnote { flex-basis: 100%; font-size: .78rem; color: #6a3a00; }
.chips-row .chip { text-align: left; }
.thumb-slot:empty { display: none; }

/* forms and etiquette */
.sform { display: grid; gap: 12px; max-width: 640px; }
.sform label { display: grid; gap: 4px; font-weight: 700; font-size: .92rem; }
.sform input:not([type=checkbox]), .sform select, .sform textarea { font: inherit; padding: 9px 10px; border: 1px solid #cfc8b8; border-radius: 10px; background: #fff; width: 100%; font-weight: 400; }
.sform .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sform fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.sform .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.sform .hp { position: absolute; left: -9999px; }
.pickmap { height: 260px; border-radius: 10px; overflow: hidden; }
.sf-status { margin: 0; font-weight: 700; }
.sf-status.ok { color: #1e6b2f; }
.sf-status.err { color: #a4161a; }
.tips { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.tips li { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.tips .topic { display: inline-block; min-width: 76px; font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.feat > div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.feat h3 { margin: 0 0 4px; font-size: 1rem; }
.feat p { margin: 0; font-size: .88rem; color: var(--ink-2); }
#toast { position: absolute; z-index: 60; left: 50%; bottom: 90px; transform: translateX(-50%); background: #1b2333; color: #fff; padding: 9px 16px; border-radius: 999px; font-size: .88rem; box-shadow: var(--shadow); max-width: 90%; }
#toast[hidden] { display: none; }
#print-sheet { display: none; }

@media print {
  html:has(body.printing), body.printing { height: auto !important; min-height: 0 !important; overflow: visible !important; display: block !important; background: #fff !important; }
  body.printing > *:not(#print-sheet) { display: none !important; }
  body.printing #print-sheet { display: block !important; padding: 24px; font-family: var(--serif); color: #000; }
  body.printing #print-sheet { position: static !important; width: auto !important; height: auto !important; }
  body.printing #print-sheet .stamps { display: grid; gap: 8pt; }
  body.printing #print-sheet svg { max-width: 100%; height: auto; }
  body.printing #print-sheet h1 { font-size: 24pt; margin: 0 0 4pt; }
  body.printing #print-sheet h2 { font-size: 15pt; border-bottom: 1px solid #999; margin: 16pt 0 6pt; }
  body.printing #print-sheet h3 { font-size: 11pt; margin: 8pt 0 2pt; }
  body.printing #print-sheet .stamps { grid-template-columns: repeat(5, 1fr); }
  body.printing #print-sheet li { font-size: 10.5pt; }
}

/* ---------- small screens ---------- */
@media (max-width: 780px) {
  .brand small { display: none; }
  .brand { font-size: 1.05rem; white-space: nowrap; gap: 8px; }
  .brand svg { width: 28px; height: 28px; }
  .top { padding: 0 10px; gap: 8px; }
  .nav { gap: 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; white-space: nowrap; }
  .brand { flex: none; }
  .nav a { padding: 8px 8px; font-size: .84rem; }
  .nav a[href="/"], .nav a[href="/trails/"] { display: none; }
  .ptabs { display: flex; overflow-x: auto; scrollbar-width: none; gap: 8px; }
  .ptabs button { flex: none; white-space: nowrap; padding: 7px 12px 7px 8px; }
  .ptabs button .tl small { display: none; }
  .ptabs button .ti { width: 26px; height: 26px; padding: 5px; }
  #quiz-bar { bottom: 58px; left: 8px; right: 8px; max-width: none; }
  .has-sheet #quiz-bar { display: none; }
  #toast { bottom: 120px; }
  .sform .two { grid-template-columns: 1fr; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; scrollbar-width: none; }
  .pane { padding-bottom: 34px; }
  .stage { display: block; }
  .mapwrap { position: absolute; inset: 0; }
  .panel { position: absolute; left: 0; right: 0; bottom: 0; width: auto; height: 62%; border-right: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -6px 24px rgba(27, 35, 51, .22); transform: translateY(calc(100% - 46px)); transition: transform .25s; z-index: 15; }
  .panel.open { transform: none; }
  .drawer-handle { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 0; background: transparent; font-weight: 700; color: var(--ink-2); font-size: .9rem; flex: none; }
  .drawer-handle::before { content: ""; width: 38px; height: 4px; border-radius: 2px; background: #cfc8b8; position: absolute; top: 8px; left: 50%; margin-left: -19px; }
  .ctrls { bottom: 64px; }
  .ctrls .zbtn { display: none; }
  .ctrls .world { height: 38px; font-size: .85rem; }
  .attrib { bottom: 0; z-index: 16; }
  .sheet { position: absolute; z-index: 30; left: 8px; right: 8px; bottom: 22px; max-height: 56vh; overflow: auto; display: block; }
  .sheet[hidden] { display: none; }
  .has-sheet .panel, .has-sheet .ctrls { display: none; }
  .card-body { max-height: none; }
  #trail-bar { bottom: 58px; left: 8px; right: 8px; }
  .has-sheet #trail-bar { bottom: auto; top: 118px; }
  .overlay-top { left: 8px; right: 8px; top: 8px; }
  .search { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- content pages: FAQ, leaders, figures, hubs ---------- */
.fine { font-size: .84rem; color: var(--muted); }
.faq, .below .faq { margin: 34px 0 10px; }
.faq h3 { font-family: var(--serif); font-size: 1.08rem; margin: 18px 0 4px; line-height: 1.3; }
.faq p { margin: 0; color: var(--ink-2); max-width: 70ch; }
.mapbtn.alt { background: #fff; color: var(--ink); border: 1.5px solid var(--ink); margin-left: 6px; }
.mapbtn.alt:hover { background: #f1ece0; }
.glance { list-style: none; padding: 0; margin: 10px 0 8px; display: grid; gap: 6px; }
.glance li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font-size: .94rem; }
.glance li a { color: var(--ink); }
.glance li span { color: var(--ink-2); }
.lead-table { border-collapse: collapse; width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 8px 0; }
.lead-table th, .lead-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: .95rem; }
.lead-table th { width: 42%; color: var(--ink-2); font-weight: 600; background: #faf6ec; }
.lead-table tr:last-child th, .lead-table tr:last-child td { border-bottom: 0; }
.figs { list-style: none; padding: 0; margin: 10px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.figs li { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; }
.figs li span { color: var(--muted); font-size: .86rem; }
.hubgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 16px 0 30px; }
.hubcard { display: block; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--c); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.hubcard:hover { box-shadow: var(--shadow); }
.hubcard h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.hubcard h3 .gl { background: var(--c); border-radius: 50%; padding: 4px; box-sizing: content-box; }
.hubcard p { margin: 0 0 6px; font-size: .92rem; color: var(--ink-2); }
.hubcard small { color: var(--muted); }

#sug .prow { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
#sug .prow:hover, #sug .prow:focus-visible { background: #f1ece0; }
#sug .li-ic.ld { background: #1D5FBF; color: #fff; font-size: .8rem; }
#sug .li-ic.fg { background: #7C3AED; color: #fff; font-size: .55rem; }

#who-bar { position: absolute; left: 12px; bottom: 34px; z-index: 11; max-width: 330px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 38px 12px 14px; border-left: 5px solid #1D5FBF; display: flex; flex-direction: row; gap: 12px; align-items: flex-start; }
#who-bar .who-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#who-bar .who-ph { flex: none; width: 72px; text-align: center; }
#who-bar .who-ph[hidden] { display: none; }
#who-bar .who-ph img { width: 72px; height: 88px; object-fit: cover; object-position: top; border-radius: 10px; background: #eee; display: block; }
#who-bar .who-ph small { font-size: .62rem; color: var(--ink-2); }
#who-bar[hidden] { display: none; }
#who-bar .who-k { font-size: .7rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: #1D5FBF; }
#who-bar b { font-family: var(--serif); font-size: 1.1rem; }
#who-bar span { color: var(--ink-2); font-size: .9rem; }
#who-bar a { margin-top: 4px; font-size: .86rem; font-weight: 600; }
#who-bar .who-x { position: absolute; right: 6px; top: 6px; border: 0; background: transparent; font-size: 1.3rem; line-height: 1; width: 28px; height: 28px; border-radius: 50%; }
#who-bar .who-x:hover { background: #f1ece0; }
@media (max-width: 760px) { #who-bar { left: 8px; right: 8px; bottom: 58px; max-width: none; } .has-sheet #who-bar { display: none; } }

.tt-era { font-size: .8rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #7C3AED; min-height: 1.1em; }
.chips-row .chip.on[data-i] { background: #7C3AED; color: #fff; border-color: #7C3AED; }
.seg { display: flex; margin: 10px 0 4px; border: 1.5px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: #fff; padding: 8px 10px; font-weight: 700; font-size: .84rem; color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.plist .more-row { list-style: none; padding: 4px 0 2px; }

/* contact page */
.contactgrid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ccard { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.ccard h3 { margin: 0 0 6px; font-size: 16px; }
.ccard p { margin: 0; color: var(--ink-2); font-size: 14px; }
.mailline { margin: 12px 0 18px; }

/* world map pages */
.maptools { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; align-items: center; }
.maptools button { font: inherit; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink); }
.maptools button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.mapstage { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 18px; }
.wmap { display: block; width: 100%; height: auto; }
.wmap:not(.brick) .land path { fill: #f6f1e4; stroke: #666; stroke-width: .6; stroke-linejoin: round; }
.wmap:not(.brick) .land path:hover { fill: #ffe08a; }
.wmap.colour .land path[data-c="0"] { fill: #e4572e; } .wmap.colour .land path[data-c="1"] { fill: #2e86ab; }
.wmap.colour .land path[data-c="2"] { fill: #f2b134; } .wmap.colour .land path[data-c="3"] { fill: #3c9d5d; }
.wmap.colour .land path[data-c="4"] { fill: #8e5aa8; } .wmap.colour .land path[data-c="5"] { fill: #e07a9b; }
.wmap .names { display: none; pointer-events: none; }
.wmap.names .names { display: block; }
.wmap .names text { font: 600 6.5px system-ui, sans-serif; text-anchor: middle; fill: #222; paint-order: stroke; stroke: rgba(255,255,255,.8); stroke-width: 1.6px; }
.wmap.brick.mono .land g { fill: #d9423a; }
.maptip { position: absolute; transform: translate(-50%, -100%); background: #1b2333; color: #fff; padding: 4px 9px; border-radius: 6px; font-size: 13px; pointer-events: none; white-space: nowrap; }
@media print {
  body.print-map > *:not(main) { display: none !important; }
  body.print-map main > *:not(.mapstage) { display: none !important; }
  body.print-map .mapstage { border: 0; }
}
.ccard a { display: inline; background: none; border: 0; padding: 0; border-radius: 0; color: #1D5FBF; text-decoration: underline; }
