/* Amboterra web app (the state site). Layout and type follow Areg's v0.3–v0.5 (docs/design/drops/ai-state-figma-2026-10-25).
   Colours come only from --st-* tokens (src/tokens.css, generated from the Figma variables). Spacing on a 4 grid. */
:root {
  --font-ui: "Poppins", "Noto Sans Armenian", "Noto Sans", system-ui, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --rail: var(--st-size-rail, 72px);
  --panel: var(--st-size-panel, 400px);
  --panel-wide: var(--st-size-panel-wide, 520px);
  --toolbar: 56px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-ui); font-size: 14px; line-height: 22px; color: var(--st-text-primary);
  background: var(--st-surface-canvas); -webkit-font-smoothing: antialiased; overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--st-focus-ring); outline-offset: 2px; border-radius: 6px; }
/* the plain text block for readers without JavaScript (written by build_static.py): the page itself when scripts don't
   run, a scrollable sheet over the empty app; with scripts (boot.js sets .js) the map app is the page */
.pre-js { position: fixed; inset: 0; z-index: 100; overflow-y: auto; padding: 24px max(16px, calc((100vw - 720px) / 2)) 48px;
  background: var(--st-surface-canvas); color: var(--st-text-primary); font-size: 16px; line-height: 1.6; }
.pre-js h1 { font-size: 30px; line-height: 1.25; margin: 0 0 12px; }
.pre-js h2 { font-size: 21px; line-height: 1.3; margin: 28px 0 8px; }
.pre-js p { margin: 0 0 12px; }
.pre-js a { color: var(--st-accent-text, #2251C9); text-decoration: underline; }
.js .pre-js { display: none; }
.ic { display: block; flex: none; }
.grow { flex: 1; min-width: 0; }
.mono { font-family: var(--font-mono); font-size: 13px; line-height: 18px; display: inline-flex; align-items: center; gap: 4px; }

/* ---------------- type scale (Poppins; Areg's 23 styles, the ones the screens use) ---------------- */
.t-display { font-size: 44px; line-height: 56px; font-weight: 400; letter-spacing: -.01em; }
.t-h1 { font-size: 32px; line-height: 40px; font-weight: 400; letter-spacing: -.005em; }
.t-h2 { font-size: 28px; line-height: 38px; font-weight: 400; }
.t-h3 { font-size: 24px; line-height: 32px; font-weight: 400; }
.t-h4 { font-size: 20px; line-height: 28px; font-weight: 500; }
.t-h5 { font-size: 16px; line-height: 24px; font-weight: 500; }
.t-body-l { font-size: 15px; line-height: 24px; font-weight: 400; }
.t-body-m { font-size: 14px; line-height: 22px; font-weight: 400; }
.t-body-s { font-size: 13px; line-height: 19px; font-weight: 400; }
.t-label-l { font-size: 14px; line-height: 20px; font-weight: 500; }
.t-label-m { font-size: 13px; line-height: 18px; font-weight: 500; }
.t-label-s { font-size: 12px; line-height: 16px; font-weight: 500; }
.t-caption { font-size: 12px; line-height: 16px; font-weight: 400; }
.t-overline { font-size: 11px; line-height: 16px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.t-num-m { font-size: 14px; line-height: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.t-num-l { font-size: 28px; line-height: 34px; font-weight: 400; font-variant-numeric: tabular-nums; }
.t-num-xl { font-size: 32px; line-height: 40px; font-weight: 400; font-variant-numeric: tabular-nums; }
.c-2 { color: var(--st-text-secondary); } .c-3 { color: var(--st-text-tertiary); } .c-acc { color: var(--st-accent-text); }
.c-ok { color: var(--st-status-ok-text); } .c-danger { color: var(--st-status-danger); } .c-human { color: var(--st-line-human-text); }

/* ---------------- shell ---------------- */
.app { display: grid; grid-template-columns: var(--rail) var(--panel) 1fr; height: 100vh; height: 100dvh; }
.app.wide { grid-template-columns: var(--rail) var(--panel-wide) 1fr; }
/* a page with no panel (a news story): the page takes the panel's column too */
.app.nopanel { grid-template-columns: var(--rail) 1fr; }
.app.nopanel > .panel { display: none; }
.app[data-mode="focus"] { grid-template-columns: 1fr; }
.app[data-mode="focus"] .rail, .app[data-mode="focus"] .panel, .app[data-mode="focus"] .toolbar { display: none; }

.rail {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 0 12px; overflow-y: auto; scrollbar-width: none;
  background: var(--st-surface-rail); border-right: 1px solid var(--st-border-default); z-index: 3;
}
.rail .logo { margin-bottom: 10px; border-radius: 8px; }
/* The flag's colours (Areg's guide, T-0147). Not theme tokens: the flag is never recoloured, in Light or Dark. */
:root { --st-flag-indigo: #17284D; --st-flag-gold: #F2B33D; --st-flag-white: #FFFFFF; }
.st-logo, .st-flag { display: block; flex: none; }
.st-logo-edge { stroke: transparent; }
/* 12 rail sections since State symbols: on a short desktop the items tighten so Settings and Me stay on screen */
@media (min-width: 768px) and (max-height: 960px) {
  .rail { gap: 2px; padding-top: 10px; }
  .rail .logo { margin-bottom: 6px; }
  .rail-items { gap: 2px; }
  .rail-item .pill { height: 28px; }
}
[data-theme="dark"] .st-logo-edge { stroke: var(--st-border-strong); }
.rail-items { display: flex; flex-direction: column; gap: 4px; }
.rail-item { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 64px; padding: 2px 0 4px; color: var(--st-text-secondary); border-radius: 12px; }
.rail-item .pill { width: 56px; height: 32px; border-radius: 16px; display: grid; place-items: center; color: var(--st-icon-default); transition: background .15s; }
.rail-item:hover .pill { background: var(--st-surface-hover); }
.rail-item[aria-current="page"] { color: var(--st-accent-text); }
.rail-item[aria-current="page"] .pill { background: var(--st-accent-subtle); color: var(--st-accent-text); }
.rail .spacer { flex: 1; min-height: 8px; }
/* a rail group's sections, as tabs at the top of the panel (founder 10-28); the phone has its own tab bar and More */
.subnav { display: flex; gap: 4px; margin: 16px 20px 0; padding: 4px; border-radius: 20px; background: var(--st-surface-sunken); flex: none; }
.subnav a { flex: 1; height: 32px; display: grid; place-items: center; padding: 0 8px; border-radius: 16px; color: var(--st-text-secondary); font-size: 13px; font-weight: 500; white-space: nowrap; text-decoration: none; }
.subnav a:hover { color: var(--st-text-primary); }
.subnav a[aria-current="page"] { background: var(--st-surface-raised); color: var(--st-text-primary); box-shadow: var(--st-elevation-pill); }
@media (max-width: 767px) { .subnav { display: none; } }
.rail .me .av { margin: 2px 0 4px; }
.rail .me[aria-current="page"] .av { box-shadow: 0 0 0 2px var(--st-line-human), 0 0 0 4px var(--st-accent-default); }

/* ---------------- panel ---------------- */
.panel { position: relative; display: flex; flex-direction: column; background: var(--st-surface-panel); border-right: 1px solid var(--st-border-default); min-height: 0; z-index: 2; }
.app.wide .panel { box-shadow: var(--st-elevation-dock); }
.grabber { display: none; }
.p-head { padding: 24px 20px 12px; display: flex; flex-direction: column; gap: 12px; }
.p-head > div > .t-h3 + .t-body-s, .p-head .t-h3 + .t-body-s { margin-top: 2px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--st-text-secondary); margin: -6px 0 -4px -6px; padding: 4px 6px; border-radius: 8px; align-self: flex-start; }
.back:hover { background: var(--st-surface-hover); color: var(--st-text-primary); }
.p-body { flex: 1; overflow-y: auto; padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 14px; min-height: 0; scrollbar-width: thin; }
.p-foot { padding: 16px 20px; border-top: 1px solid var(--st-border-default); display: flex; flex-direction: column; gap: 10px; }
.p-foot.two { flex-direction: row; }
.p-foot.two .btn.full { flex: 1.4; }
.foot-note { margin-top: 2px; }
.sec { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 6px; }
.p-body > *, .pp-tab > *, .ref-main > *, .law-main > *, .arc-main > *, .me-main > *, .dr-body > * { flex-shrink: 0; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--st-status-ok); flex: none; }
.lnk { color: var(--st-accent-text); display: inline-flex; align-items: center; gap: 6px; }
.lnk:hover { text-decoration: underline; }
a.lnk .ic, button.lnk .ic { color: inherit; }
.row { display: flex; align-items: center; gap: 12px; }
.tagrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

/* ---------------- components (v0.4 Components) ---------------- */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; flex: none;
  background: var(--st-surface-pressed); color: var(--st-text-secondary); }
.tag .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.accent { background: var(--st-accent-subtle); color: var(--st-accent-text); }
.tag.success { background: var(--st-status-ok-subtle); color: var(--st-status-ok-text); }
.tag.danger { background: var(--st-status-danger-subtle); color: var(--st-status-danger); }
.tag.human { background: var(--st-line-human-subtle); color: var(--st-line-human-text); }
.tag.human .d { background: var(--st-line-human); }
.tag.outline { background: none; box-shadow: inset 0 0 0 1px var(--st-border-strong); color: var(--st-text-secondary); }
.tag.sm { height: 18px; padding: 0 6px; font-size: 11px; vertical-align: 1px; }
a.link-tag:hover { box-shadow: inset 0 0 0 1px var(--st-accent-default); color: var(--st-accent-text); }

.chips-f, .mfil { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-f { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border-radius: 16px; font-size: 13px; line-height: 18px; font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--st-border-default); color: var(--st-text-primary); white-space: nowrap; flex: none; transition: background .12s; }
.chip-f:hover { background: var(--st-surface-hover); }
.chip-f.on { background: var(--st-accent-subtle); box-shadow: inset 0 0 0 1px var(--st-accent-border-subtle); color: var(--st-accent-text); padding-left: 10px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; transition: background .15s; font-weight: 500; }
.btn.m { height: 36px; padding: 0 14px 0 12px; border-radius: 10px; font-size: 13px; line-height: 18px; }
.btn.l { height: 44px; padding: 0 22px; border-radius: 22px; font-size: 14px; line-height: 20px; }
.btn.full { width: 100%; }
.btn.primary { background: var(--st-accent-default); color: var(--st-text-on-accent); }
.btn.primary:hover { background: var(--st-accent-hover); }
.btn.primary:active { background: var(--st-accent-pressed); }
.btn.secondary { background: var(--st-surface-sunken); color: var(--st-text-primary); }
.btn.secondary:hover { background: var(--st-surface-pressed); }
.btn.ghost { color: var(--st-accent-text); }
.btn.ghost:hover { background: var(--st-surface-hover); }
.btn[disabled] { background: var(--st-control-track); color: var(--st-text-disabled); cursor: not-allowed; }

.segm { display: flex; gap: 2px; padding: 4px; border-radius: 22px; background: var(--st-surface-sunken); }
.segm button { flex: 1; height: 32px; padding: 0 12px; border-radius: 16px; color: var(--st-text-secondary); font-size: 13px; font-weight: 500; white-space: nowrap; }
.segm button:hover { color: var(--st-text-primary); }
.segm button[aria-pressed="true"] { background: var(--st-surface-raised); color: var(--st-text-primary); box-shadow: var(--st-elevation-pill); }
.segm.sm { padding: 3px; border-radius: 10px; }
.segm.sm button { height: 30px; border-radius: 8px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 20px; background: var(--st-surface-sunken); }
.seg button { flex: 1; height: 32px; border-radius: 16px; color: var(--st-text-secondary); }
.seg button[aria-pressed="true"] { background: var(--st-surface-raised); color: var(--st-text-primary); box-shadow: var(--st-elevation-pill); }

.tabs { flex: none; display: flex; gap: 24px; border-bottom: 1px solid var(--st-border-default); overflow-x: auto; scrollbar-width: none; }
.tabs button { height: 44px; font-size: 14px; font-weight: 500; color: var(--st-text-secondary); border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 0 2px; white-space: nowrap; }
.tabs button:hover { color: var(--st-text-primary); }
.tabs button[aria-selected="true"] { color: var(--st-text-primary); border-bottom-color: var(--st-accent-default); }

.av { position: relative; display: inline-grid; place-items: center; border-radius: 50%; flex: none; background: var(--st-surface-sunken); }
.av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.av .ini { font-weight: 500; color: var(--st-text-secondary); }
.av.xs { width: 24px; height: 24px; } .av.xs .ini { font-size: 10px; }
.av.s { width: 32px; height: 32px; } .av.s .ini { font-size: 12px; }
.av.m { width: 40px; height: 40px; } .av.m .ini { font-size: 13px; }
.av.l { width: 56px; height: 56px; } .av.l .ini { font-size: 18px; }
.av.xl { width: 112px; height: 112px; } .av.xl .ini { font-size: 32px; }
.av.human { box-shadow: 0 0 0 2px var(--st-line-human); }
.av.xl.human { box-shadow: 0 0 0 3px var(--st-line-human); }
.av .live { position: absolute; right: 0; bottom: 0; width: 26%; height: 26%; min-width: 9px; min-height: 9px; max-width: 22px; max-height: 22px; border-radius: 50%; background: var(--st-status-ok); box-shadow: 0 0 0 2px var(--st-surface-panel); }
.av.xl .live { right: 4px; bottom: 4px; box-shadow: 0 0 0 3px var(--st-surface-panel); }

.lrows { display: flex; flex-direction: column; gap: 2px; }
.lrow { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; margin: 0 -12px; border-radius: 12px; text-align: left; width: calc(100% + 24px); }
a.lrow:hover, button.lrow:hover { background: var(--st-surface-hover); }
.lrow.sel { background: var(--st-accent-subtle); }
.lrow.sel::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--st-accent-default); }
.lrow.dim > .av, .lrow.dim > .tile { opacity: .6; } /* only the picture fades: the text keeps >= 4.5:1 (Lusine, 10-25) */
.lrow .body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lrow .tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lrow.static { cursor: default; }
.count { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--st-surface-pressed); color: var(--st-text-secondary); font-size: 12px; font-weight: 500; display: grid; place-items: center; }
.tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--st-poi-glyph); }
.tile.sm { width: 28px; height: 28px; border-radius: 8px; }
.tile.inst { background: var(--st-poi-institution); } .tile.law { background: var(--st-poi-law); } .tile.biz { background: var(--st-poi-business); }
.tile.arc { background: var(--st-poi-archive); } .tile.vrt { background: var(--st-poi-vr); }
.tile.soft { background: var(--st-accent-subtle); color: var(--st-accent-text); }

.sfield { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; background: var(--st-surface-sunken); color: var(--st-icon-default); min-width: 0; }
.sfield:focus-within { background: var(--st-surface-raised); box-shadow: 0 0 0 2px var(--st-focus-ring); }
.sfield input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 14px; color: var(--st-text-primary); }
.sfield input::placeholder { color: var(--st-text-tertiary); }
.sfield input::-webkit-search-cancel-button { display: none; }
.sfield .clr { color: var(--st-icon-default); display: grid; place-items: center; width: 24px; height: 24px; border-radius: 12px; }
.sfield .clr:hover { background: var(--st-surface-hover); }

.fcard { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 4px 16px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--st-border-default); background: var(--st-surface-raised); }
.fcard > div { padding: 12px 0; border-bottom: 1px solid var(--st-border-default); min-width: 0; }
.fcard > div:nth-child(odd) { padding-right: 12px; }
.fcard > div:nth-last-child(-n+2):nth-child(odd), .fcard > div:last-child { border-bottom: 0; }
.fcard dt { color: var(--st-text-tertiary); font-size: 12px; line-height: 18px; }
.fcard dd { margin: 2px 0 0; font-size: 13px; line-height: 20px; overflow-wrap: anywhere; }
.fcard dd a { color: var(--st-accent-text); }

.box { padding: 16px 20px; border-radius: 16px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); display: flex; flex-direction: column; gap: 10px; }
.box.sunk { background: var(--st-surface-sunken); box-shadow: none; border-radius: 12px; }
.box.line { background: none; box-shadow: inset 0 0 0 1px var(--st-border-default); border-radius: 12px; }
.box.center { align-items: center; text-align: center; }
.box.row { flex-direction: row; align-items: center; color: var(--st-icon-default); }
.dashed { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; border: 1.5px dashed var(--st-border-strong); color: var(--st-icon-default); }
.dashed > div { display: flex; flex-direction: column; gap: 2px; color: var(--st-text-primary); }
.banner { display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px; }
.banner.human { background: var(--st-line-human-subtle); color: var(--st-text-primary); }
.banner.human .bi, .banner.human > .ic { color: var(--st-line-human-text); }
.banner .bi { width: 28px; height: 28px; border-radius: 14px; background: var(--st-surface-raised); display: grid; place-items: center; flex: none; }
.banner.human .t-body-s { color: var(--st-line-human-text); }
.banner.sm { padding: 12px 14px; }
.empty-st { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 24px 12px; max-width: 380px; margin: 0 auto; }
.empty-st .ic-wrap { width: 48px; height: 48px; border-radius: 24px; display: grid; place-items: center; background: var(--st-surface-sunken); color: var(--st-icon-default); margin-bottom: 4px; }
.empty-st .btn { margin-top: 8px; }
.rlist, .steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.rlist li { display: flex; gap: 12px; align-items: flex-start; color: var(--st-icon-default); }
.rlist li .tag { margin-top: -1px; }
.steps { counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 12px; }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 12px; background: var(--st-surface-sunken); color: var(--st-text-secondary); font-size: 12px; font-weight: 500; display: grid; place-items: center; }
.prose p { margin: 0 0 10px; }
.prose p:last-child { margin-bottom: 0; }
.src { font-family: var(--font-mono); font-size: 12px; color: var(--st-text-tertiary); overflow-wrap: anywhere; }
hr { border: 0; border-top: 1px solid var(--st-border-default); margin: 4px 0; width: 100%; }
.ibtn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--st-icon-strong); flex: none; }
.ibtn:hover { background: var(--st-surface-hover); }

/* map-panel pieces (v0.3) */
.card {
  display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: var(--st-surface-raised);
  box-shadow: inset 0 0 0 1px var(--st-border-default), var(--st-elevation-pill); text-align: left; width: 100%;
}
.card:hover { box-shadow: inset 0 0 0 1px var(--st-border-strong), var(--st-elevation-pill); }
.card.selected { box-shadow: inset 0 0 0 1px var(--st-accent-border-subtle), var(--st-elevation-pill); }
.badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--st-poi-glyph); }
.bar { height: 6px; border-radius: 3px; background: var(--st-control-track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--st-accent-default); }
.stack { display: flex; }
.stack > .av { box-shadow: 0 0 0 2px var(--st-surface-raised); margin-right: -6px; }
.stack > .av:last-child { margin-right: 6px; }
.feed { display: flex; gap: 12px; padding: 6px; margin: -6px; border-radius: 12px; text-align: left; }
.feed:hover { background: var(--st-surface-hover); }
.place-row { display: flex; align-items: center; gap: 12px; height: 40px; text-align: left; border-radius: 10px; padding: 0 6px; margin: 0 -6px; width: calc(100% + 12px); }
.place-row:hover { background: var(--st-surface-hover); }
.place-row .sq { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; color: var(--st-poi-glyph); flex: none; }
.place-row .name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-row { display: flex; align-items: center; gap: 12px; min-height: 52px; width: calc(100% + 12px); margin: 0 -6px; padding: 4px 6px; border-radius: 10px; text-align: left; }
.person-row:hover { background: var(--st-surface-hover); }

/* ---------------- main: toolbar + workspace ---------------- */
.main { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.toolbar {
  height: var(--toolbar); flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px;
  background: var(--st-surface-raised); border-bottom: 1px solid var(--st-border-default); position: relative; z-index: 4;
}
.toolbar, .toolbar * { white-space: nowrap; }
.toolbar > * { flex-shrink: 0; }
.toolbar > .crumb { flex-shrink: 1; min-width: 0; overflow: hidden; }
.crumb { display: flex; align-items: center; gap: 8px; color: var(--st-text-secondary); }
.crumb .sep { color: var(--st-text-disabled); }
.crumb .ic { color: var(--st-icon-default); }
.crumb .ci { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.crumb a.ci:hover { color: var(--st-text-primary); }
.crumb .ci.cur { color: var(--st-text-primary); }
.crumb .ci.cur .ic { color: var(--st-icon-strong); }
.crumb .ci span { overflow: hidden; text-overflow: ellipsis; }
.crumb .cur { display: flex; align-items: center; gap: 6px; color: var(--st-text-primary); height: 36px; padding: 0 6px; margin-left: -6px; border-radius: 10px; }
.crumb button.cur:hover { background: var(--st-surface-hover); }
.toolbar .grow { flex: 1; }
.tb-btn { height: 36px; min-width: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--st-icon-strong); padding: 0 10px; transition: background .15s; }
.tb-btn:hover { background: var(--st-surface-hover); }
.tb-btn.icon-only { padding: 0; }
.tb-btn .ic.dim { color: var(--st-icon-default); }
.tb-btn .t-label-m { color: var(--st-text-primary); }
.tb-btn.sortb .t-label-m, .tb-btn.sortb .ic { color: var(--st-accent-text); }
.tb-seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--st-surface-sunken); }
.tb-seg > * { width: 34px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--st-icon-default); }
.tb-seg > [aria-pressed="true"] { background: var(--st-surface-raised); color: var(--st-icon-strong); box-shadow: var(--st-elevation-pill); }
.tb-secondary { background: var(--st-surface-sunken); padding: 0 14px 0 12px; }
.tb-secondary:hover { background: var(--st-surface-pressed); }
.mwrap { position: relative; }

.search { position: relative; display: flex; align-items: center; }
.search .field { display: none; flex-direction: row; align-items: center; gap: 8px; width: 280px; height: 36px; padding: 0 10px; border-radius: 10px; background: var(--st-surface-sunken); color: var(--st-icon-default); }
.search.open .field { display: flex; }
.search.open .opener { display: none; }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 13px; color: var(--st-text-primary); }
.search input::placeholder { color: var(--st-text-tertiary); }
.search input::-webkit-search-cancel-button { display: none; } /* our own clear button only */
.app.searching .toolbar .mwrap .tb-btn > .t-label-m, .app.searching .toolbar .mwrap .tb-btn > .ic.dim { display: none; }
.results, .menu {
  position: absolute; top: 44px; right: 0; width: 360px; max-height: min(480px, 70vh); overflow-y: auto; padding: 6px;
  background: var(--st-surface-raised); border: 1px solid var(--st-border-default); border-radius: 12px; box-shadow: var(--st-elevation-popover); z-index: 10;
}
.menu { width: 260px; }
.menu.left { left: 0; right: auto; }
.results .grp { padding: 8px 10px 4px; }
.opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 6px 10px; border-radius: 8px; text-align: left; }
.opt:hover, .opt[aria-selected="true"] { background: var(--st-surface-hover); }
.opt .sq { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; color: var(--st-poi-glyph); flex: none; }
.opt .check { color: var(--st-accent-text); visibility: hidden; }
.opt[aria-checked="true"] .check { visibility: visible; }
.opt .street-ic { width: 24px; height: 24px; display: grid; place-items: center; color: var(--st-icon-default); flex: none; }

.map-wrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--st-map-ground); }
.maplibregl-canvas:focus-visible { outline: none; }
.page { display: none; flex: 1; min-height: 0; overflow-y: auto; background: var(--st-surface-canvas); scrollbar-width: thin; }
.app:not([data-mode="map"]) .map-wrap { display: none; }
.app:not([data-mode="map"]) .page { display: block; }
.mbar, .mtop, .mhead { display: none; }

/* map chrome */
.ov { position: absolute; z-index: 3; }
/* founder 10-27: the right-hand controls had no air: 6 px inside a group (around the divider), 16 px between groups */
.ctl-col { right: 16px; top: 16px; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.ctl-bot { right: 16px; bottom: 16px; display: flex; gap: 16px; align-items: flex-end; }
.mctl { display: none; }
.dark { display: flex; align-items: center; gap: 6px; padding: 3px; background: var(--st-mapctl-bg); border-radius: 13px; box-shadow: var(--st-elevation-popover); }
.dark.v { flex-direction: column; }
.dark > button, .dark > a { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--st-mapctl-icon); }
.dark > button:hover, .dark > a:hover { background: var(--st-mapctl-bg-hover); }
.dark .div { background: var(--st-mapctl-divider); width: 1px; height: 22px; }
.dark.v .div { width: 22px; height: 1px; }
.info-btn { left: 16px; top: 16px; width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; background: var(--st-surface-raised); color: var(--st-icon-default); box-shadow: var(--st-elevation-pill); }
.attrib { left: 16px; bottom: 16px; display: flex; align-items: center; gap: 10px; padding: 3px 8px; border-radius: 4px; background: color-mix(in srgb, var(--st-surface-raised) 85%, transparent); }
.scale { display: flex; align-items: center; gap: 6px; color: var(--st-text-secondary); }
.scale i { display: block; height: 6px; border: 1.5px solid var(--st-text-secondary); border-top: 0; }
.pop {
  position: absolute; z-index: 6; padding: 12px; min-width: 220px; background: var(--st-surface-raised); color: var(--st-text-primary);
  border: 1px solid var(--st-border-default); border-radius: 12px; box-shadow: var(--st-elevation-popover);
}
.pop.layers-pop { right: 16px; bottom: 70px; }
.pop h4 { margin: 0 0 6px; }
.pop label { display: flex; align-items: center; gap: 10px; min-height: 32px; cursor: pointer; }
.pop input[type="checkbox"] { accent-color: var(--st-accent-default); width: 16px; height: 16px; }

/* ---------------- map markers ---------------- */
.halo { text-shadow:
  0 0 2px var(--st-map-halo), 1px 1px 0 var(--st-map-halo), -1px -1px 0 var(--st-map-halo), 1px -1px 0 var(--st-map-halo), -1px 1px 0 var(--st-map-halo),
  0 1.5px 0 var(--st-map-halo), 0 -1.5px 0 var(--st-map-halo), 1.5px 0 0 var(--st-map-halo), -1.5px 0 0 var(--st-map-halo); }
.lbl { pointer-events: none; white-space: nowrap; font-size: 12px; line-height: 16px; color: var(--st-map-label); }
.lbl.major { font-weight: 500; color: var(--st-map-label-strong); }
.lbl.water, .lbl.water-strong { color: var(--st-map-water-label); }
.lbl.water-strong { font-weight: 500; }
.poi { cursor: pointer; }
.poi .grp { display: flex; gap: 2px; padding: 2px; border-radius: 7px; background: var(--st-pin-ring); box-shadow: var(--st-elevation-pill); transition: transform .12s; }
.poi .grp i { width: 20px; height: 20px; border-radius: 5px; display: grid; place-items: center; color: var(--st-poi-glyph); }
.poi.big .grp { border-radius: 9px; }
.poi.big .grp i { width: 26px; height: 26px; border-radius: 7px; }
.poi:hover .grp { transform: scale(1.08); }
.poi.selected .grp { box-shadow: 0 0 0 2px var(--st-accent-default), var(--st-elevation-pill); }
.poi.selected::before { content: ""; position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px 0 0 -30px; border-radius: 50%; background: color-mix(in srgb, var(--st-accent-default) 14%, transparent); z-index: -1; pointer-events: none; }
.poi .name { position: absolute; display: flex; flex-direction: column; white-space: nowrap; pointer-events: none; }
.poi .name b { font-weight: 500; font-size: 12px; line-height: 16px; color: var(--st-map-label-strong); }
.poi.big .name b { font-size: 13px; line-height: 18px; }
.poi .name span { font-size: 12px; line-height: 14px; color: var(--st-text-secondary); }
.poi .name.below { top: calc(100% + 3px); left: 50%; transform: translateX(-50%); align-items: center; text-align: center; }
.poi .name.left { right: calc(100% + 6px); top: 50%; transform: translateY(-30%); align-items: flex-end; text-align: right; }
.poi .name.right { left: calc(100% + 6px); top: 50%; transform: translateY(-30%); align-items: flex-start; }
.poi.unlabelled .name { display: none; }
.poi.unlabelled:hover .name, .poi.unlabelled:focus-visible .name { display: flex; }
.poi.planned { opacity: .6; }
.poi[hidden] { display: none; }
.dot { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--st-pin-ring); cursor: default; }
.cz { cursor: pointer; display: flex; flex-direction: column; align-items: center; }
.cz .face { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2.5px var(--st-pin-ring), var(--st-elevation-pill); background: var(--st-surface-sunken); font-size: 12px; transition: transform .12s; display: grid; place-items: center; color: var(--st-text-secondary); font-weight: 500; }
.cz .tail { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 8px solid var(--st-pin-ring); margin-top: 1px; }
.cz .live { position: absolute; left: 24px; top: 24px; width: 11px; height: 11px; border-radius: 50%; background: var(--st-status-ok); box-shadow: 0 0 0 2px var(--st-pin-ring); }
.cz:hover .face { transform: scale(1.08); }
.cz.human .face { width: 42px; height: 42px; box-shadow: 0 0 0 3px var(--st-line-human), var(--st-elevation-pill); }
.cz.human .tail { border-top-color: var(--st-line-human); }
.cz.selected .face { box-shadow: 0 0 0 2.5px var(--st-pin-ring), 0 0 0 5px var(--st-accent-default); }
.cz.human.selected .face { box-shadow: 0 0 0 3px var(--st-line-human), 0 0 0 5.5px var(--st-accent-default); }
.tagpin { position: absolute; left: calc(100% + 8px); top: 9px; display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 12px; background: var(--st-surface-raised); box-shadow: var(--st-elevation-pill); white-space: nowrap; color: var(--st-text-primary); }
.tagpin i { width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; background: var(--st-line-human-subtle); color: var(--st-line-human-text); }
.more { width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; background: var(--st-surface-raised); color: var(--st-text-primary); box-shadow: 0 0 0 2.5px var(--st-pin-ring), var(--st-elevation-pill); cursor: pointer; }
.house-lbl.selected { color: var(--st-text-on-accent); text-shadow: none; }
.house-lbl { pointer-events: none; font-size: 11px; line-height: 14px; font-weight: 500; color: var(--st-map-label-strong); white-space: nowrap; }
.map-wrap[data-zb="far"] .lbl, .map-wrap[data-zb="far"] .poi .name span, .map-wrap[data-zb="far"] .poi.unlabelled,
.map-wrap[data-zb="far"] .dot, .map-wrap[data-zb="far"] .tagpin { display: none; }
.map-wrap[data-zb="mid"] .lbl.street, .map-wrap[data-zb="mid"] .poi .name span { display: none; }
.map-wrap:not([data-zb="house"]) .house-lbl { display: none; }
.map-wrap.no-labels .lbl, .map-wrap.no-dots .dot, .map-wrap.no-citizens .cz, .map-wrap.no-citizens .more { display: none; }
.map-wrap[data-zb="house"] .poi[data-id="citizens-quarter"] { display: none; }
.map-wrap[data-zb="far"] .cz, .map-wrap[data-zb="far"] .more { display: none; }
.app.bare .ov, .app.bare .ctl-col, .app.bare .ctl-bot { display: none !important; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 30; max-width: min(560px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: 10px; background: var(--st-mapctl-bg); color: var(--st-mapctl-icon); font-size: 13px; line-height: 18px;
  box-shadow: var(--st-elevation-popover); transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ================================================================== pages ================================================================== */
.pg { padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 20px; max-width: 1180px; }
.pg-head { display: flex; align-items: flex-start; gap: 24px; justify-content: space-between; }
.pg-head > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.pg-head .sfield { width: 280px; flex: none; }
.pg > section { display: flex; flex-direction: column; gap: 12px; }

/* 02 passport (wide panel) */
.pp-top { display: flex; align-items: center; gap: 4px; padding: 16px 16px 4px 20px; }
.pp-top .back { margin: 0 0 0 -6px; }
.p-body.pp { gap: 18px; padding-top: 12px; }
.pp-id { display: flex; gap: 20px; align-items: center; }
.pp-id .who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pp-id .tagrow { margin-top: 6px; }
.pp-tab { display: flex; flex-direction: column; gap: 14px; }
.pp-tab .sec:first-child { margin-top: 0; }
.commits, .clist { display: flex; flex-direction: column; gap: 8px; }
.cm { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: baseline; padding: 10px 12px; border-radius: 10px; background: var(--st-surface-sunken); }
.vq { margin: 0; padding: 12px 16px; border-left: 3px solid var(--st-border-strong); display: flex; flex-direction: column; gap: 6px; }
.lrow.doc .tile { width: 36px; height: 36px; }
button.lnk.t-body-s, .fcard .lnk { font-size: inherit; }
.fcard dd button.lnk { color: var(--st-accent-text); text-align: left; }

/* 03 directory */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.ccard { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 12px; padding: 16px; border-radius: 16px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); transition: box-shadow .12s; }
.ccard:hover { box-shadow: inset 0 0 0 1px var(--st-accent-border-subtle), var(--st-elevation-pill); }
.ccard .av { grid-row: span 2; }
.ccard .nm { display: flex; align-items: center; gap: 8px; height: 22px; min-width: 0; }
.ccard .nm > :first-child { flex-shrink: 0; }
.ccard .nm > :not(:first-child) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ccard .role { min-height: 19px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.ccard .ft { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--st-border-default); color: var(--st-icon-default); }

/* 04 referendum */
.pg.ref { flex-direction: row; align-items: flex-start; gap: 24px; max-width: 1240px; }
.ref-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.ref-side { width: 304px; flex: none; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 24px; }
.ref .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ref .meta > span { display: inline-flex; align-items: center; gap: 6px; }
.ref .org .av { margin-right: 2px; }
.votes { display: flex; flex-direction: column; }
.vrow { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--st-border-default); align-items: flex-start; }
.vrow .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vrow .body a:hover { text-decoration: underline; }
.vrow .tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 180px; }
.res { display: flex; flex-direction: column; gap: 10px; }
.res .nums { display: flex; gap: 12px; }
.res .nums > div { flex: 1; display: flex; flex-direction: column; }
.res .nums .t-body-s { display: inline-flex; align-items: flex-start; gap: 6px; }
.res .nums .t-body-s .vd { margin-top: 6px; flex: none; }
/* Referendum No. 4: six options in a 3-column grid; the founder's three in the human line's colour, B in accent */
.res .nums.many { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; }
.res .nums.many .t-num-l { font-size: 24px; line-height: 30px; }
.res.many .vd.A1, .res.many .vbar .A1, .res.many .vd.A2, .res.many .vbar .A2, .res.many .vd.A3, .res.many .vbar .A3 { background: var(--st-line-human); }
.res.many .vd.B, .res.many .vbar .B { background: var(--st-accent-default); }
.res.many .vd.C, .res.many .vbar .C { background: var(--st-border-strong); }
.vd { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--st-vote-abstain); }
.vd.yes, .vbar .yes { background: var(--st-vote-yes); } .vd.no, .vbar .no { background: var(--st-vote-no); } .vd.abstain, .vbar .abstain { background: var(--st-vote-abstain); }
.vd.A, .vbar .A { background: var(--st-accent-default); } .vd.B, .vbar .B { background: var(--st-text-tertiary); }
.vbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--st-control-track); gap: 2px; }
.vbar i { display: block; height: 100%; }
/* a ranked ballot's rounds (Referendum No. 9): a plain table */
.rounds-wrap { max-width: 100%; overflow-x: auto; }
.rounds { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; line-height: 19px; }
.rounds th, .rounds td { text-align: right; padding: 4px 6px; border-bottom: 1px solid var(--st-border-default); }
.rounds th:first-child, .rounds td:first-child { text-align: left; }
.rounds th { font-weight: 500; color: var(--st-text-secondary); }
.rite-steps > p { margin: 0; }
button.card { text-align: left; width: 100%; }
.rules { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.rules > div { display: grid; grid-template-columns: 18px 1fr; gap: 0 10px; color: var(--st-icon-default); }
.rules dt { font-size: 12px; line-height: 18px; color: var(--st-text-tertiary); }
.rules dd { grid-column: 2; margin: 0; font-size: 13px; line-height: 19px; color: var(--st-text-primary); }
.rules.wide { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.qbox { display: flex; flex-direction: column; gap: 14px; }
.qbox .q { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; border-radius: 12px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); }
.conds { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 10px; }
.note-box { padding: 12px 16px; border-radius: 12px; background: var(--st-surface-sunken); display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }

/* 05 constitution */
.toc { gap: 0; padding-top: 0; }
.toc-ch { display: flex; align-items: center; gap: 8px; min-height: 40px; width: calc(100% + 16px); margin: 0 -8px; padding: 0 8px; border-radius: 10px; text-align: left; }
a.toc-ch:hover, button.toc-ch:hover { background: var(--st-surface-hover); }
.toc-ch .chev { width: 16px; color: var(--st-icon-default); flex: none; }
.toc-ch.muted { color: var(--st-text-tertiary); }
.toc-ch.sel { background: var(--st-accent-subtle); color: var(--st-accent-text); }
.toc-art { position: relative; display: flex; align-items: center; min-height: 32px; padding: 0 8px 0 32px; margin: 0 -8px; width: calc(100% + 16px); border-radius: 8px; color: var(--st-text-primary); }
.toc-art:hover { background: var(--st-surface-hover); }
.toc-art.sel { background: var(--st-accent-subtle); color: var(--st-accent-text); }
.toc-art.sel::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 2px; background: var(--st-accent-default); }
.app:has(.pg.law) .page { background: var(--st-surface-raised); }
.pg.law { flex-direction: row; gap: 48px; padding-top: 40px; max-width: 1040px; }
.law-main { flex: 1; max-width: 600px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.law-side { width: 232px; flex: none; display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.law-side .sec { margin-top: 10px; }
.law-side .sec:first-child { margin-top: 0; }
.law-side .lnk { display: block; }
.clauses { margin: 4px 0 8px; padding: 0; list-style: none; counter-reset: c; display: flex; flex-direction: column; gap: 16px; }
.clauses li { counter-increment: c; display: grid; grid-template-columns: 36px 1fr; font-size: 18px; line-height: 32px; }
.clauses li::before { content: counter(c); color: var(--st-text-tertiary); font-size: 14px; }
.reading p { font-size: 18px; line-height: 32px; margin: 0 0 14px; }
.chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.chain li { position: relative; padding-left: 20px; display: flex; flex-direction: column; }
.chain li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--st-border-strong); }
.chain li.cur::before { background: var(--st-accent-default); }
.chain li.cur .t-label-m { color: var(--st-accent-text); }
.prevnext { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
/* a clause's points "(a) ... (b) ..." under it, as Mkhitar wrote them (the letters are in the text) */
.clauses .points { list-style: none; margin: 10px 0 0; padding: 0 0 0 4px; display: flex; flex-direction: column; gap: 10px; }
.clauses .points li { display: block; counter-increment: none; font-size: inherit; line-height: inherit; padding-left: 0; }
.clauses .points li::before { content: none; }
.chintro { gap: 8px; }
.chintro strong, .lpart strong { font-weight: 500; }
.toc-sec { padding: 18px 0 6px; }
.lpart { display: flex; flex-direction: column; gap: 14px; }
.ltable-wrap { overflow-x: auto; margin: 0 -4px; }
.ltable { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 19px; }
.ltable th { text-align: left; font-weight: 500; color: var(--st-text-secondary); padding: 8px 10px; border-bottom: 1px solid var(--st-border-strong); vertical-align: bottom; }
.ltable td { padding: 10px; border-bottom: 1px solid var(--st-border-default); vertical-align: top; }
.ltable td:nth-child(2) { white-space: nowrap; }
.blist.sm { font-size: 15px; line-height: 24px; gap: 10px; margin: 0; }
.bquote.sm { font-size: 15px; line-height: 24px; }
.law .foot { margin-top: 8px; }

/* the founder's book (D-067): the cover, the contents, one section at a time in a ~66-character column */
.app:has(.pg.book) .page { background: var(--st-surface-raised); }
.pg.book { max-width: 1040px; padding-top: 40px; gap: 28px; }
.pg.book > .bcover { display: grid; grid-template-columns: minmax(0, 300px) 1fr; gap: 44px; align-items: center; }
/* the cover as a printed book (v2): the flat 2:3 cover (content/book/cover.png) uncropped on the front, turned 22deg on
   the spine side, a spine that carries the cover's orange and black band round the edge, a soft floor shadow */
.bcover-art { position: relative; margin: 0 0 0 4%; perspective: 1600px; }
.bcover-art::before { content: ""; position: absolute; left: 2%; right: -6%; bottom: -4%; height: 9%; border-radius: 50%;
  background: rgb(0 0 0 / .32); filter: blur(16px); pointer-events: none; }
.bk { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateY(22deg); transition: transform .45s ease; }
.bcover-art:hover .bk { transform: rotateY(12deg); }
.bk img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0 3px 3px 0;
  box-shadow: 14px 18px 32px rgb(0 0 0 / .22), 2px 3px 6px rgb(0 0 0 / .18); }
.bk::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 0 3px 3px 0; transform: translateZ(.5px);
  background: linear-gradient(90deg, rgb(0 0 0 / .26) 0, rgb(0 0 0 / .06) 1.4%, rgb(255 255 255 / .18) 2.2%, rgb(0 0 0 / .10) 3.6%, transparent 8%),
    linear-gradient(105deg, transparent 40%, rgb(255 255 255 / .07) 58%, transparent 72%); }
/* the cover's own inks (not UI tokens): the engraving's warm paper sky down to the horizon (66.4 % of the height), a
   thin haze line, then the brown ploughed earth; the spine in shade */
.bk-spine { position: absolute; top: 0; bottom: 0; left: -8%; width: 8%; transform-origin: right center; transform: rotateY(-90deg);
  background: linear-gradient(90deg, rgb(40 22 10 / .34), rgb(40 22 10 / .10) 45%, rgb(40 22 10 / .28)),
    linear-gradient(180deg, #ecd09c 0 66.4%, #d9b582 66.4% 67.6%, #6e4529 67.6%); }
.bcover-text { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.btitle { max-width: 24ch; text-wrap: balance; }  /* the cover carries the title now: the text is its record, not a second hero */
.bsub { font-weight: 400; }
.bcta { gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.bnote { max-width: 720px; }
.pg.book > .tnote { max-width: 720px; }
.bcontents { max-width: 720px; }
.bcontents .toc, .p-body.toc { display: flex; flex-direction: column; }
.book-toc { min-height: 44px; gap: 12px; }
.book-toc .bnum { width: 22px; flex: none; text-align: right; color: var(--st-text-tertiary); font-variant-numeric: tabular-nums; }
.book-toc.sel .bnum { color: inherit; }
.book-toc.muted .bnum { color: inherit; }
.book-toc em { font-style: italic; }
.pg.book.reader { align-items: center; padding-top: 48px; }
.bread { width: 100%; max-width: 680px; display: flex; flex-direction: column; gap: 16px; }
.bread .t-h1 { text-wrap: balance; }
.btext { display: flex; flex-direction: column; }
.btext p { font-size: 18px; line-height: 32px; margin: 0 0 18px; }
.btext strong, .bnote strong, .blist strong { font-weight: 500; }
.btext .bh { margin: 18px 0 12px; }
.btext .bh:first-child { margin-top: 0; }
.bquote { margin: 0 0 18px; padding: 2px 0 2px 20px; border-left: 3px solid var(--st-border-strong); font-size: 18px; line-height: 32px; color: var(--st-text-secondary); }
.blist { margin: 0 0 18px; padding-left: 26px; display: flex; flex-direction: column; gap: 14px; font-size: 17px; line-height: 30px; }
.blist li::marker { color: var(--st-text-tertiary); }
.btext .tnote { margin: 2px 0 20px; }
.bread .prevnext { border-top: 1px solid var(--st-border-default); padding-top: 20px; margin-top: 4px; }
.bread .prevnext .lnk { max-width: 48%; align-items: flex-start; }
.bread .prevnext .lnk .ic { margin-top: 1px; }
.bread .prevnext .lnk:last-child { text-align: right; flex-direction: row-reverse; margin-left: auto; }

/* 06 decisions */
.app.flush .page { overflow: hidden; }
.pg.dec { padding: 0; max-width: none; flex-direction: row; height: 100%; gap: 0; }
.table { flex: 1; min-width: 0; overflow-y: auto; scrollbar-width: thin; }
.thead, .trow { display: grid; grid-template-columns: 80px 72px minmax(0, 1fr) 136px; gap: 16px; align-items: center; padding: 0 20px; }
.thead { height: 40px; position: sticky; top: 0; z-index: 1; background: var(--st-surface-panel); border-bottom: 1px solid var(--st-border-default);
  font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--st-text-tertiary); }
.trow { position: relative; min-height: 56px; border-bottom: 1px solid var(--st-border-default); background: var(--st-surface-raised); }
.trow:hover { background: var(--st-surface-hover); }
.trow.sel { background: var(--st-accent-subtle); }
.trow.sel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--st-accent-default); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tfoot { padding: 16px 20px 32px; }
.drawer { width: 400px; flex: none; display: flex; flex-direction: column; background: var(--st-surface-raised); border-left: 1px solid var(--st-border-default); box-shadow: var(--st-elevation-popover); }
.dr-top { display: flex; align-items: center; gap: 8px; padding: 12px 12px 4px 20px; }
.dr-body { flex: 1; overflow-y: auto; padding: 8px 20px 20px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: thin; }
.dr-foot { padding: 14px 20px; border-top: 1px solid var(--st-border-default); }
.dline { display: flex; align-items: center; gap: 6px; color: var(--st-text-secondary); }
.dline .ic { color: var(--st-icon-default); }
.quote { margin: 0; padding: 16px; border-radius: 12px; background: var(--st-line-human-subtle); display: flex; flex-direction: column; gap: 8px; }
.quote > .ic { color: var(--st-line-human-text); }
.quote p { font-size: 13px; line-height: 20px; }
.quote > span { color: var(--st-line-human-text); }
.quote.sm { padding: 12px 14px; }
.bul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.lchips { display: flex; flex-wrap: wrap; gap: 8px; }
.lchip { height: 32px; padding: 0 14px; border-radius: 16px; display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; box-shadow: inset 0 0 0 1px var(--st-border-default); }
a.lchip:hover { background: var(--st-surface-hover); color: var(--st-accent-text); }
.lchip.static { color: var(--st-text-secondary); }

/* 13 announcements */
.sec.pin { margin-top: 0; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ncard { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 16px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); }
.ncard.pinned { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--st-accent-default) 45%, transparent); }
.ncard .iss { display: flex; align-items: center; gap: 8px; }
.ttl:hover { color: var(--st-accent-text); }
.nlist { border-radius: 16px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); overflow: hidden; }
.nrow { display: flex; gap: 16px; padding: 20px 20px 18px; border-bottom: 1px solid var(--st-border-default); }
.nrow:last-child { border-bottom: 0; }
.nrow:hover { background: var(--st-surface-hover); }
.nrow .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nrow .meta, .nrow .ft { display: flex; align-items: center; gap: 6px; }
.nrow .ft { margin-top: 4px; }

/* 14 news */
.notice-bar { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: 12px; background: var(--st-surface-sunken); color: var(--st-icon-default); }
/* every picture keeps its frame's aspect ratio: Areg's cover its own (--r, from the file), the rest 4:3. --fp is the
   focus a crop keeps when a frame differs (the phone's square thumbnail without a square slot). */
.nimg { display: block; overflow: hidden; background: var(--st-surface-sunken); aspect-ratio: var(--r, 4 / 3); }
.nimg picture { display: contents; }
.nimg img { width: 100%; height: 100%; object-fit: cover; object-position: var(--fp, 50% 38%); display: block; }
.nimg.missing img { visibility: hidden; }
.feat { display: grid; grid-template-columns: minmax(0, 46%) 1fr; align-items: start; border-radius: 16px; overflow: hidden; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); }
.feat .nimg { height: auto; }
.fbody { padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.scard { display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); }
.scard .nimg { height: auto; }
.sbody { flex: 1; padding: 16px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.by { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.srcl { color: var(--st-accent-text); }
/* a whole card opens its story (founder 10-27): the title's link is stretched over the card; the source links sit above it */
.tap { position: relative; }
.tap .slink { color: inherit; text-decoration: none; }
.tap .slink::after { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.tap .slink:focus-visible { outline: none; }
.tap:has(.slink:focus-visible) { box-shadow: inset 0 0 0 2px var(--st-accent-default); }
.tap:hover .slink { text-decoration: underline; text-underline-offset: 3px; }
.tap a:not(.slink), .tap button { position: relative; z-index: 2; }
/* 14b a story: one readable column (~68 characters), the cover wide above it */
.pg.art { max-width: 1040px; margin: 0 auto; padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.art-cover .nimg { border-radius: 16px; aspect-ratio: var(--r, 16 / 9); max-height: 520px; width: 100%; }
.art-col { max-width: 68ch; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.art-title { margin: 0; text-wrap: balance; }
.art-dek { margin: 0; }
.art-by { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--st-border-default); border-bottom: 1px solid var(--st-border-default); }
.art-src { display: flex; flex-direction: column; gap: 6px; }
.art-body { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; font-size: 17px; line-height: 1.7; color: var(--st-text-primary); }
.art-body p { margin: 0; }
.art-body h2 { margin: 12px 0 0; }
.art-body blockquote { margin: 4px 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--st-accent-default); display: flex; flex-direction: column; gap: 6px; }
.art-body blockquote p { font-size: 19px; line-height: 1.55; }
.art-navs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--st-border-default); }
.art-nav { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); color: var(--st-text-primary); }
.art-nav:hover { background: var(--st-surface-hover); }
.art-nav.next { text-align: right; }
.srcl:hover { text-decoration: underline; }

/* 07 government */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { display: flex; flex-direction: column; gap: 8px; padding: 16px 16px 18px; border-radius: 16px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); }
.kpi:hover { box-shadow: inset 0 0 0 1px var(--st-accent-border-subtle), var(--st-elevation-pill); }
.gov-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.gov-grid .col { display: flex; flex-direction: column; gap: 16px; }
.prof { display: flex; gap: 16px; padding: 16px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--st-border-default); }
.prof > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.prof .row { gap: 8px; }
.prof a { color: var(--st-accent-text); }
.prof.dim > .av { opacity: .6; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.hbar { height: 6px; border-radius: 3px; background: var(--st-control-track); overflow: hidden; }
.hbar i { display: block; height: 100%; border-radius: 3px; background: var(--st-accent-default); }
.hbar i.human { background: var(--st-line-human); }

/* 08 archive */
.pg.arc { flex-direction: row; align-items: flex-start; gap: 32px; max-width: 1240px; }
.arc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 16px; max-width: 600px; }
.arc-side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 10px; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { display: grid; grid-template-columns: 96px 24px 1fr; gap: 0 12px; position: relative; padding-bottom: 24px; }
.timeline li::before { content: ""; position: absolute; left: 119px; top: 14px; bottom: -4px; width: 1px; background: var(--st-border-default); }
.timeline li:last-child::before { display: none; }
.timeline .dt { text-align: right; padding-top: 2px; }
.timeline .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--st-border-strong); margin: 6px auto 0; position: relative; z-index: 1; box-shadow: none; }
.timeline li.acc .dot { background: var(--st-accent-default); }
.timeline .tb { display: flex; flex-direction: column; gap: 6px; }
.ppl { display: flex; gap: 12px; flex-wrap: wrap; }
.ppl a { display: inline-flex; align-items: center; gap: 6px; }
.banner.corr { align-items: flex-start; }
.banner.corr p { color: var(--st-text-primary); }
.ccm { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 12px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); }
.clist.wide { gap: 10px; }
.files { display: flex; flex-direction: column; border-radius: 12px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); }
.frow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--st-border-default); color: var(--st-icon-default); }
.frow:last-child { border-bottom: 0; }
.frow .mono.grow { color: var(--st-text-primary); overflow: hidden; text-overflow: ellipsis; display: block; white-space: nowrap; }

/* 11 me */
.pg.me { flex-direction: row; align-items: flex-start; gap: 24px; }
.me-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 20px; max-width: 600px; }
.me-side { width: 300px; flex: none; display: flex; flex-direction: column; gap: 16px; }
.hero-h { display: flex; gap: 24px; align-items: center; padding: 28px; border-radius: 16px; background: var(--st-line-human-subtle); }
.hero-h > div { display: flex; flex-direction: column; gap: 6px; }
.me-id { display: flex; align-items: center; gap: 12px; }
.signout { padding: 6px 0; }

/* 09 rite (focus flow, no rail) */
.app[data-mode="focus"] .page { background: var(--st-surface-canvas); }
.rite { min-height: 100%; display: flex; flex-direction: column; }
.rite-top { height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 24px; background: var(--st-surface-raised); border-bottom: 1px solid var(--st-border-default); position: sticky; top: 0; z-index: 2; }
.rite-body { display: grid; grid-template-columns: 280px minmax(0, 520px) 360px; gap: 48px; padding: 48px 48px 64px; justify-content: center; }
.rite-steps { display: flex; flex-direction: column; gap: 24px; }
.stepper { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.stepper li { display: flex; gap: 14px; position: relative; padding-bottom: 18px; color: var(--st-text-secondary); }
.stepper li::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--st-border-default); }
.stepper li:last-child::before { display: none; }
.stepper li.done::before { background: var(--st-status-ok); }
.stepper .sd { width: 28px; height: 28px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 500; box-shadow: inset 0 0 0 1.5px var(--st-border-strong); background: var(--st-surface-raised); }
.stepper li.done .sd { background: var(--st-status-ok); color: var(--st-text-on-accent); box-shadow: none; }
.stepper li.cur .sd { background: var(--st-accent-default); color: var(--st-text-on-accent); box-shadow: 0 0 0 4px var(--st-accent-subtle); }
.stepper li.cur .t-label-l, .stepper li.done .t-label-l { color: var(--st-text-primary); }
.rite-step { display: flex; flex-direction: column; gap: 20px; }
.ffield { display: flex; flex-direction: column; gap: 8px; } /* the rite form; not .search .field */
.inp { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 16px; border-radius: 12px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-strong); color: var(--st-status-ok); }
.inp:focus-within { box-shadow: inset 0 0 0 1px var(--st-accent-default), 0 0 0 3px var(--st-accent-subtle); }
.inp.bad { box-shadow: inset 0 0 0 1px var(--st-status-danger); }
.inp input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 16px; color: var(--st-text-primary); }
.ffield textarea { border: 0; border-radius: 12px; padding: 14px 16px; font: inherit; font-size: 14px; line-height: 22px; resize: vertical; color: var(--st-text-primary);
  background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-strong); outline: none; }
.ffield textarea:focus { box-shadow: inset 0 0 0 1px var(--st-accent-default), 0 0 0 3px var(--st-accent-subtle); }
.rite-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
.rite-prev { display: flex; flex-direction: column; gap: 12px; }
.pcard { padding: 24px; border-radius: 16px; background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default), var(--st-elevation-dock); display: flex; flex-direction: column; gap: 12px; }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; margin: 4px 0 0; padding-top: 14px; border-top: 1px solid var(--st-border-default); }
.kv dt { font-size: 12px; line-height: 20px; color: var(--st-text-tertiary); }
.kv dd { margin: 0; font-size: 13px; line-height: 20px; }
.pcard .why { font-style: italic; }

/* 10 vr */
.vr-fig { margin: 0; border-radius: 16px; overflow: hidden; background: var(--st-surface-sunken); }
.vr-fig img { width: 100%; display: block; max-height: 560px; object-fit: cover; }
.vr-fig figcaption { padding: 10px 16px; }

/* ---------------- narrower desktops ---------------- */
@media (max-width: 1360px) {
  .rite-body { grid-template-columns: 240px minmax(0, 1fr) 320px; gap: 32px; padding: 40px 32px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gov-grid { grid-template-columns: 1fr; }
  .pg { padding: 28px 28px 48px; }
}
@media (max-width: 1180px) {
  .pg.ref, .pg.arc, .pg.me, .pg.law { flex-direction: column; }
  .ref-side, .arc-side, .me-side, .law-side { width: 100%; position: static; }
  .feat { grid-template-columns: 1fr; } .feat .nimg { aspect-ratio: var(--r2, var(--r, 4 / 3)); } /* stacked (Areg, 10-26) */
  .pgrid { grid-template-columns: 1fr; }
  .drawer { position: absolute; right: 0; top: 0; bottom: 0; z-index: 3; }
  .pg.dec { position: relative; }
  .toolbar .tb-secondary span { display: none; }
  .toolbar .tb-secondary { padding: 0 10px; }
  .rite-body { grid-template-columns: minmax(0, 1fr); max-width: 640px; margin: 0 auto; }
  .rite-steps .stepper { flex-direction: row; gap: 8px; overflow-x: auto; }
  .rite-steps .stepper li { padding: 0; } .stepper li::before, .stepper li > div { display: none; }
}

/* ================================================================== tablet and mobile (Areg's v0.6) ================================================================== */
.mtabs, .peek, .m-actions, .rprog { display: none; }
.tile.sunk-t { background: var(--st-surface-sunken); color: var(--st-icon-strong); }
.me-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--st-line-human-subtle); color: var(--st-text-primary); }
.me-card .body { flex: 1; display: flex; flex-direction: column; }
.me-card > .ic { color: var(--st-icon-default); }
.badge-dot { position: absolute; top: 2px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--st-status-danger); box-shadow: 0 0 0 2px var(--st-surface-rail); }
.rail-item .pill { position: relative; }
.pg.mpanel { padding: 0; gap: 0; }
.pg.mpanel .p-body { overflow: visible; }
.pg.mpanel .p-foot { border-top: 0; }
.pg.mpanel .p-head > h1 { display: none; }

/* tablet 768–1023: the rail stays, the panel is 360, pages are one column (max 720, centred) with their filters on top */
@media (min-width: 768px) and (max-width: 1023px) {
  .app { grid-template-columns: var(--rail) 360px 1fr; }
  .app.wide { grid-template-columns: var(--rail) 400px 1fr; }
  .app[data-mode="page"] { grid-template-columns: var(--rail) 1fr; }
  .app[data-mode="page"] .panel { display: none; }
  .app[data-mode="page"] .mhead { display: flex; flex-direction: column; gap: 6px; padding: 20px 28px 0; max-width: 776px; margin: 0 auto; }
  .app[data-mode="page"] .mhead .t-h2 { display: none; }
  .pg { max-width: 776px; margin: 0 auto; }
  .pg.ref, .pg.arc, .pg.me, .pg.law { flex-direction: column; }
  .ref-side, .arc-side, .me-side, .law-side { width: 100%; position: static; }
  .pg.book > .bcover { grid-template-columns: minmax(0, 220px) 1fr; gap: 28px; }
  .bcover .btitle { font-size: 28px; line-height: 36px; }
  .toolbar .crumb .ci:not(.cur) span { display: none; }
  .search .field { width: 200px; }
  .app[data-mode="page"] .mhead > p { display: none; }
  .toolbar .mwrap .tb-btn > .t-label-m, .toolbar .mwrap .tb-btn > .ic.dim, .toolbar .btn.primary span { display: none; }
  .toolbar .btn.primary { padding: 0 10px; }
}

@media (max-width: 767px) {
  body { font-size: 14px; }
  .app, .app.wide { display: block; position: relative; height: 100dvh; }
  .rail { display: none; }
  .main { position: absolute; left: 0; right: 0; top: 0; bottom: var(--tabbar); }
  :root { --tabbar: calc(62px + max(env(safe-area-inset-bottom, 0px), 8px)); }
  .app[data-mode="focus"] .main { bottom: 0; }
  .toolbar { position: absolute; height: 0; padding: 0; border: 0; background: none; }
  .toolbar > :not(.search) { display: none; }
  .app[data-mode="focus"] .toolbar { display: none; }
  .ctl-col, .ctl-bot, .info-btn, .attrib { display: none; }
  .search { position: fixed; left: 12px; right: 12px; top: 12px; z-index: 40; display: none; }
  .app.msearching .search { display: block; }
  .app.msearching .toolbar { z-index: 50; } /* the toolbar is a stacking context (z 4): lift it over .mtop so the field is on top */
  .search.open .field { width: 100%; height: 52px; border-radius: 26px; background: var(--st-surface-raised); box-shadow: var(--st-elevation-popover); padding: 0 16px; }
  .search input, .sfield input, .inp input, .ffield textarea { font-size: 16px; } /* iOS zooms into inputs under 16 px */
  .results { top: 60px; width: 100%; }
  .btn.m { height: 44px; border-radius: 22px; padding: 0 20px; font-size: 14px; }

  /* the tab bar: the desktop Rail items turned 90 degrees */
  .mtabs { display: flex; justify-content: space-between; position: absolute; left: 0; right: 0; bottom: 0; height: var(--tabbar); padding: 2px 7px max(env(safe-area-inset-bottom, 0px), 8px);
    background: var(--st-surface-rail); border-top: 1px solid var(--st-border-default); z-index: 8; }
  .mtabs .rail-item { width: 68px; gap: 2px; padding-top: 4px; }
  .app[data-mode="focus"] .mtabs { display: none; }

  /* map: floating search bar + category chips, the controls, the sheet (Closed 96 / Half 346 / Full) */
  .app[data-mode="map"] .mtop { display: flex; flex-direction: column; gap: 10px; position: absolute; left: 0; right: 0; top: 0; padding: 12px 0 0; z-index: 4; pointer-events: none; }
  .msearch { pointer-events: auto; margin: 0 16px; height: 52px; border-radius: 26px; background: var(--st-surface-raised); box-shadow: var(--st-elevation-popover); display: flex; align-items: center; gap: 10px; padding: 0 4px 0 10px; }
  .msearch .mq { flex: 1; text-align: left; color: var(--st-text-tertiary); height: 100%; display: flex; align-items: center; }
  .msearch .mq.sel { color: var(--st-text-primary); }
  .mlogo, .mme { display: grid; place-items: center; width: 44px; height: 44px; flex: none; }
  .mlogo { width: 34px; }
  .mchips { pointer-events: auto; display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 8px; scrollbar-width: none; }
  .mchips .chip-f { background: var(--st-surface-raised); box-shadow: var(--st-elevation-pill); }
  .mchips .chip-f.on { background: var(--st-accent-subtle); box-shadow: inset 0 0 0 1px var(--st-accent-border-subtle), var(--st-elevation-pill); }
  /* the sheet's height is one variable (Peek 96 / Half 346 / Full), so the controls above it follow it, also mid-drag */
  .app[data-mode="map"] { --sheet-h: 346px; }
  .app[data-mode="map"][data-sheet="closed"] { --sheet-h: 96px; }
  .app[data-mode="map"][data-sheet="full"] { --sheet-h: calc(100% - var(--tabbar) - 48px); }
  .app[data-mode="map"] .mctl { display: flex; flex-direction: column; gap: 14px; right: 16px; bottom: calc(var(--sheet-h) + 16px); transition: bottom .25s ease; }
  .app[data-mode="map"][data-sheet="full"] .mctl { display: none; }
  .mctl .dark > button { width: 44px; height: 44px; }
  .app[data-mode="map"] .panel { position: absolute; left: 0; right: 0; bottom: var(--tabbar); height: var(--sheet-h); z-index: 5; border: 0; border-radius: 24px 24px 0 0;
    box-shadow: var(--st-elevation-dock); transition: height .25s ease; overflow: hidden; }
  /* Peek: the grabber and the title row (the home sheet has its own peek row) */
  .app[data-mode="map"][data-sheet="closed"]:not(.sheet-dragging) .panel > :not(.grabber):not(.peek):not(.p-head),
  .app[data-mode="map"][data-sheet="closed"]:not(.sheet-dragging) .panel:has(> .peek) > .p-head,
  .app[data-mode="map"][data-sheet="closed"]:not(.sheet-dragging) .panel > .p-head > :not(:has(h1, h2)) { display: none; }
  /* dragged with a finger on the grabber, the peek row or the header; the content keeps its own vertical scroll */
  .app[data-mode="map"]:not(.wide) .panel > .grabber, .app[data-mode="map"]:not(.wide) .panel > .p-head, .app[data-mode="map"] .panel > .peek { touch-action: none; }
  .app[data-mode="map"] .panel > .p-body { overscroll-behavior: contain; touch-action: pan-y; }
  .app.sheet-dragging .panel, .app.sheet-dragging .mctl, .app.sheet-dragging .city-pill { transition: none !important; }
  .app.sheet-dragging .panel { user-select: none; -webkit-user-select: none; }
  .app[data-mode="map"][data-sheet="closed"] .peek { display: flex; align-items: center; gap: 12px; padding: 0 16px 12px; text-align: left; }
  .grabber { display: block; width: 100%; height: 22px; flex: none; position: relative; }
  .grabber::after { content: ""; position: absolute; left: 50%; top: 8px; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--st-border-strong); }
  .p-head { padding: 4px 16px 10px; }
  .p-body { padding: 4px 16px 16px; }
  .p-foot { padding: 12px 16px; }
  .app[data-mode="map"]:not(.wide) .p-foot { display: none; }

  /* the passport: a pushed page above the tab bar; its actions move into the content (the tab bar owns the bottom) */
  .app.wide[data-mode="map"] .panel { top: 0; height: auto; border-radius: 0; box-shadow: none; }
  .app.wide .grabber, .app.wide .p-foot { display: none; }
  .m-actions { display: flex; gap: 10px; flex-wrap: wrap; } /* Lusine F9: two long buttons wrap instead of overflowing the sheet */
  .m-actions .btn { flex: 1 1 140px; min-width: 0; }
  .pp-top { padding: 8px 8px 0 12px; }
  .p-body.pp { padding: 8px 20px 24px; }
  .pp-id { gap: 16px; }
  .pp-id .av.xl { width: 56px; height: 56px; }
  .pp-id .t-h1 { font-size: 28px; line-height: 38px; }
  .prose.t-body-l { font-size: 14px; line-height: 22px; }

  /* pages: top bar (Root 56 / Pushed 52), the page head and its chips, one column */
  .app[data-mode="page"] .panel { display: none; }
  .app[data-mode="page"] .mbar { display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 8px 0 16px; flex: none; background: var(--st-surface-panel); }
  .app[data-mode="page"] .mbar:has(> a.ibtn:first-child) { height: 52px; padding-left: 4px; }
  .mbar .ibtn { width: 44px; height: 44px; }
  .mbar .t-h2 { font-size: 28px; line-height: 38px; }
  .app[data-mode="page"] .mhead:not(:empty) { display: flex; flex-direction: column; gap: 6px; padding: 8px 16px 4px; }
  .mhead .mfil { flex-wrap: nowrap; overflow-x: auto; margin: 8px -16px 0; padding: 0 16px 4px; scrollbar-width: none; }
  .pg { padding: 12px 16px 32px; gap: 16px; }
  .pg-head { flex-direction: column; gap: 12px; }
  .pg-head .sfield { width: 100%; }
  .pg-head > div:first-child { display: none; } /* the top bar or the mobile head already names the page */
  .pg.ref, .pg.arc, .pg.me, .pg.law { flex-direction: column; }
  .pg.ref { align-items: stretch; } /* Lusine F8: the tab strip must shrink to the screen and scroll inside itself */
  .pg.ref > .tabs, .pg.ref > .votes, .pg.ref > .qbox { min-width: 0; max-width: 100%; }
  .ref-side, .arc-side, .me-side, .law-side { width: 100%; position: static; }
  .ref-side { order: -1; } .ref-main { display: contents; } /* the result card moves above the tabs */
  .ref .ref-main > .t-overline, .ref .ref-main > .t-h2, .ref .ref-main > .meta, .ref .ref-main > .banner, .ref .ref-main > p.c-acc { order: -2; }
  .ref .t-h2 { font-size: 22px; line-height: 30px; }
  .ref-side .box:not(:first-child) { display: none; } /* Rules and "Not decided" live in the Rules tab on mobile */
  .rules.wide { grid-template-columns: 1fr; }
  .vrow .tags { max-width: 110px; }
  .cgrid, .sgrid, .pgrid, .gov-grid { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  /* directory: the card grid becomes one list */
  .cgrid { gap: 0; }
  .ccard { background: none; box-shadow: none; border-radius: 0; padding: 10px 0; border-bottom: 1px solid var(--st-border-default); }
  .ccard .ft { display: none; }
  .feat { grid-template-columns: 1fr; } .fbody { padding: 16px; }
  .fbody .t-h3 { font-size: 18px; line-height: 26px; }
  .fbody > .t-body-m { display: none; }
  /* notices: compact rows; news: rows with a 72 px thumbnail (Areg M07) */
  .nrow { padding: 14px 0; gap: 12px; } .nlist { background: none; box-shadow: none; border-radius: 0; }
  .nrow:hover { background: none; }
  .nrow .av.m { width: 32px; height: 32px; }
  .nrow .body > p, .nrow .ft { display: none; }
  .ncard { padding: 16px; } .ncard > p { display: none; }
  .scard { flex-direction: row; background: none; box-shadow: none; border-radius: 0; gap: 14px; }
  .pg.art { padding: 0 0 32px; gap: 16px; }
  .art-back { display: none; } /* the top bar has the way back */
  .art-cover .nimg { border-radius: 0; max-height: none; aspect-ratio: var(--r, 4 / 3); }
  .art-col { padding: 0 16px; }
  .art-body { font-size: 16px; line-height: 1.65; }
  .art-navs { grid-template-columns: 1fr; }
  .art-nav.next { text-align: left; }
  .scard .nimg { width: 72px; height: 72px; aspect-ratio: 1; border-radius: 12px; flex: none; }
  .scard .sbody { padding: 0; gap: 2px; }
  .scard .sbody > .tag { background: none; padding: 0; height: auto; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--st-text-tertiary); }
  .scard .sbody > p, .scard .sbody > .t-caption { display: none; }
  .scard .by .av { display: none; }
  /* decisions: two-line rows; a decision is a pushed page */
  .app.flush .page { overflow: auto; }
  .pg.dec { display: block; height: auto; }
  .pg.dec.with-drawer .table { display: none; }
  .thead { display: none; }
  .trow { grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 16px; }
  .trow > .mono { grid-row: 1; grid-column: 1; }
  .trow > .t-body-s { display: none; }
  .trow > .ell { grid-column: 1 / -1; grid-row: 2; white-space: normal; font-weight: 500; }
  .trow > span:last-child { grid-row: 1; grid-column: 2; }
  .drawer { position: static; width: auto; box-shadow: none; border: 0; }
  .dr-top .ibtn { display: none; }
  /* constitution: one reading column; the meta column goes under the article */
  .clauses li { font-size: 16px; line-height: 28px; grid-template-columns: 28px 1fr; }
  .clauses li::before { color: var(--st-accent-text); }
  .reading p { font-size: 16px; line-height: 28px; }
  .pg.book { padding-top: 16px; gap: 22px; }
  .pg.book.reader { padding-top: 8px; }
  .pg.book > .bcover { grid-template-columns: 1fr; gap: 20px; }
  .bcover-art { width: 62%; max-width: 240px; }
  .bk { transform: rotateY(16deg); }
  .bcover .btitle { font-size: 24px; line-height: 32px; }
  .bcover .bsub { font-size: 17px; line-height: 26px; }
  .bread .t-h1 { font-size: 26px; line-height: 34px; }
  .btext p, .bquote { font-size: 16px; line-height: 28px; margin-bottom: 16px; }
  .blist { font-size: 16px; line-height: 27px; gap: 12px; padding-left: 22px; }
  .bread .prevnext .lnk { max-width: 100%; }
  .bread .prevnext { flex-direction: column; }
  .pg.book.reader .bread > .t-overline { display: none; } /* the top bar already names the chapter */
  .timeline li { grid-template-columns: 20px 1fr; gap: 0 10px; }
  .timeline li::before { left: 9px; }
  .timeline .dt { grid-column: 2; grid-row: 1; text-align: left; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
  .timeline .dot { grid-column: 1; grid-row: 1; }
  .timeline .tb { grid-column: 2; }
  .hero-h { flex-direction: column; align-items: flex-start; padding: 20px; }
  .hero-h .av.xl { width: 56px; height: 56px; }
  .frow { flex-wrap: wrap; }
  .pg.morepg { gap: 20px; }
  .gov-grid .box > .row { flex-wrap: wrap; gap: 4px 12px; }
  .prof { padding: 12px; gap: 12px; } .prof .av.l { width: 40px; height: 40px; }
  /* the rite: full screen, a 6-segment progress bar, a sticky Back / Continue footer */
  .rite-top { padding: 0 8px 0 12px; height: 56px; } .rite-top .t-h5 { font-size: 15px; } .rite-top .theme-slot, .rite-top .tag { display: none; }
  .rite-body { display: flex; flex-direction: column; padding: 16px 16px 0; gap: 20px; }
  .rite-steps { display: none; }
  .rprog { display: flex; gap: 4px; }
  .rprog i { flex: 1; height: 4px; border-radius: 2px; background: var(--st-control-track); }
  .rprog i.done { background: var(--st-status-ok); } .rprog i.cur { background: var(--st-accent-default); }
  .rite-step .t-display { font-size: 32px; line-height: 40px; }
  .rite-nav { position: sticky; bottom: 0; margin: 0 -16px; padding: 12px 16px max(env(safe-area-inset-bottom, 0px), 12px); background: var(--st-surface-canvas); border-top: 1px solid var(--st-border-default); gap: 12px; }
  .rite-nav .btn { flex: 1; }
  .rite-prev { order: 2; padding-bottom: 24px; }
  .rite-prev .pcard > :not(.row):not(.tagrow) { display: none; } /* Areg v0.6: the live preview collapses to its head on mobile */

  /* hit areas >= 44 (Areg v0.6) where the visual stays smaller: icon buttons 36, chips 32, the sheet grabber 22 */
  .ibtn, .chip-f, .grabber { position: relative; }
  .ibtn::before { content: ""; position: absolute; inset: -4px; }
  .chip-f::before { content: ""; position: absolute; left: 0; right: 0; top: -6px; bottom: -6px; }
  .grabber::before { content: ""; position: absolute; left: 0; right: 0; top: -11px; bottom: -11px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---------------- the map when it can't draw (T-0142: a strict CSP, no WebGL): a message, not an empty canvas ---------------- */
.map-wrap.map-failed #map, .map-wrap.map-failed .ctl-bot, .map-wrap.map-failed .mctl, .map-wrap.map-failed .info-btn, .map-wrap.map-failed .scale { display: none; }
.map-fail { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 24px; background: var(--st-map-block); }
.map-fail-card { max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 28px 24px; text-align: center;
  background: var(--st-surface-raised); color: var(--st-text-primary); border: 1px solid var(--st-border-default); border-radius: 16px; box-shadow: var(--st-elevation-popover); }
.map-fail-card .tile { background: var(--st-accent-subtle); color: var(--st-accent-text); }
.map-fail-card h2, .map-fail-card p { margin: 0; }

/* ---------------- street view (T-0142: the founder's "360", Street-View-style panoramas) ---------------- */
.dark > button[aria-pressed="true"] { background: var(--st-accent-default); color: var(--st-text-on-accent); }
.sv-pickbar, .wk-pickbar { display: none; left: 50%; top: 16px; transform: translateX(-50%); align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 22px;
  background: var(--st-mapctl-bg); color: var(--st-mapctl-icon); box-shadow: var(--st-elevation-popover); white-space: nowrap; max-width: calc(100% - 32px); }
.sv-pickbar button, .wk-pickbar button { height: 32px; padding: 0 12px; border-radius: 16px; color: var(--st-mapctl-icon); background: var(--st-mapctl-bg-hover); }
.sv-pickdot { width: 10px; height: 10px; border-radius: 50%; background: var(--st-accent-default); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-accent-default) 35%, transparent); flex: none; }
.map-wrap.sv-pick .sv-pickbar, .map-wrap.wk-pick .wk-pickbar { display: flex; }
.map-wrap.sv-pick .maplibregl-canvas-container.maplibregl-interactive, .map-wrap.wk-pick .maplibregl-canvas-container.maplibregl-interactive { cursor: crosshair; }
.map-wrap.sv-pick .maplibregl-marker, .map-wrap.wk-pick .maplibregl-marker { pointer-events: none; opacity: .5; }
.sv-here { width: 22px; height: 22px; border-radius: 50%; background: var(--st-accent-default); border: 3px solid var(--st-map-halo); box-shadow: var(--st-elevation-pill); position: relative; transition: opacity .5s; }
.sv-here i { position: absolute; left: 50%; top: 50%; width: 16px; height: 52px; margin: -26px 0 0 -8px; }
.sv-here i::before { content: ""; position: absolute; left: 0; top: 0; border: 8px solid transparent; border-top: 0; border-bottom: 13px solid var(--st-accent-default); opacity: .9; }
.sv-here.gone { opacity: 0; }

.sv { position: absolute; inset: 0; z-index: 7; background: var(--st-map-block); overflow: hidden; }
.sv[hidden] { display: none; }
.sv-stage, .sv-pano { position: absolute; inset: 0; }
.sv-pano { opacity: 0; transition: opacity .25s ease; }
/* the depth step (T-0159 step 3): a canvas over the viewer, only while the eye moves */
.sv-depth { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; display: block; }
.sv-pano.in { opacity: 1; }
.sv .pnlm-container { background: var(--st-map-block); font-family: inherit; }
.sv .pnlm-load-box { background: var(--st-mapctl-bg); color: var(--st-mapctl-icon); border-radius: 12px; }
.sv .pnlm-compass { top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 22px; background-color: var(--st-mapctl-bg); box-shadow: var(--st-elevation-popover); }
.sv-bar { position: absolute; left: 16px; top: 16px; z-index: 3; display: flex; align-items: center; gap: 4px; max-width: min(460px, calc(100% - 96px)); padding: 4px;
  border-radius: 26px; background: var(--st-surface-raised); color: var(--st-text-primary); box-shadow: var(--st-elevation-popover); }
.sv-bar > button { width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; color: var(--st-icon-default); flex: none; }
.sv-bar > button:hover { background: var(--st-surface-hover); }
.sv-title { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0 4px; }
.sv-title > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sv-title .t-caption { color: var(--st-text-secondary); }
.sv-ph { font-weight: 500; color: var(--st-text-primary); }
.sv-hint { position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 3; padding: 8px 14px; border-radius: 18px; white-space: nowrap;
  background: var(--st-mapctl-bg); color: var(--st-mapctl-icon); box-shadow: var(--st-elevation-popover); transition: opacity .4s; pointer-events: none; }
.sv-hint.gone { opacity: 0; }
.sv-zoom { position: absolute; right: 16px; bottom: 16px; z-index: 3; }
.sv-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; padding: 8px 16px; border-radius: 18px;
  background: var(--st-mapctl-bg); color: var(--st-mapctl-icon); box-shadow: var(--st-elevation-popover); pointer-events: none; }
.sv[data-loaded] .sv-loading { display: none; }
/* the hot spots inside the panorama: walk arrows on the road, the street's name, the places around */
.sv .sv-hs { z-index: 2; }
.sv-go { width: 56px; height: 56px; border-radius: 28px; display: grid; place-items: center; color: #FFFFFF; background: rgba(20, 22, 26, .62);
  border: 2px solid rgba(255, 255, 255, .9); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); transition: transform .12s, background .12s; }
.sv-go:hover, .sv-go:focus-visible { transform: scale(1.08); background: var(--st-accent-default); }
.sv-street { display: block; padding: 4px 12px; border-radius: 6px; color: #FFFFFF; background: rgba(20, 22, 26, .6); white-space: nowrap; letter-spacing: .02em; pointer-events: none; }
.sv-place { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 18px; text-align: left; white-space: nowrap;
  background: var(--st-surface-raised); color: var(--st-text-primary); box-shadow: var(--st-elevation-popover); }
.sv-place:hover { background: var(--st-surface-hover); }
.sv-place > i { width: 28px; height: 28px; border-radius: 14px; display: grid; place-items: center; color: var(--st-poi-glyph); flex: none; }
.sv-place > span { display: flex; flex-direction: column; line-height: 1.2; }
.sv-place .t-caption { color: var(--st-text-secondary); }
/* spots inside a building (the Residence: the President's address on the desk, the way out at the door) */
.sv-spot { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 20px; white-space: nowrap; min-height: 44px;
  background: var(--st-surface-raised); color: var(--st-text-primary); box-shadow: var(--st-elevation-popover); transition: background .12s; }
.sv-spot:hover, .sv-spot:focus-visible { background: var(--st-surface-hover); }
.sv-spot > i { width: 36px; height: 36px; border-radius: 18px; display: grid; place-items: center; flex: none; color: #FFFFFF; background: var(--st-accent-default); }
.sv-spot[data-spot="exit"] > i { color: var(--st-text-primary); background: var(--st-surface-sunken); }
@media (prefers-reduced-motion: no-preference) {
  .sv-spot[data-spot="address"] > i { animation: sv-spot-pulse 2.4s ease-out infinite; }
}
@keyframes sv-spot-pulse { 0% { box-shadow: 0 0 0 0 var(--st-accent-default); } 70%, 100% { box-shadow: 0 0 0 10px transparent; } }
.sv.inside [data-act="sv-walk"] { display: none; } /* no 3D model from inside a room */
/* the President's address (a dialog over the Residence) */
.address .addr-head { display: flex; align-items: flex-start; gap: 12px; padding-right: 40px; }
.address .addr-text { display: flex; flex-direction: column; gap: 12px; }
.address .addr-text p { margin: 0; }
.address .addr-sign { margin: 4px 0 0; font-style: italic; }
.app.sv-on ~ .toast, .app.wk-on ~ .toast { z-index: 70; }

/* enter the city (T-0159): the map's one control into Street view, at the nearest panorama */
.city-pill { left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px;
  border-radius: 24px; background: var(--st-accent-default); color: var(--st-text-on-accent); box-shadow: var(--st-elevation-popover); white-space: nowrap; max-width: calc(100% - 32px); }
.city-pill:hover { filter: brightness(1.06); }
.city-pill .cp-sub { opacity: .85; overflow: hidden; text-overflow: ellipsis; }
.city-pill .cp-sub:empty { display: none; }
.city-pill .cp-sub::before { content: "· "; }
.map-wrap.sv-pick .city-pill, .map-wrap.wk-pick .city-pill, .app.bare .city-pill { display: none; }

/* walk (T-0150): the capital in 3D over the map; the chrome is street view's (.sv), the canvas takes every pointer */
.wk-stage { position: absolute; inset: 0; }
.wk-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.wk-canvas:active { cursor: grabbing; }
.wk .sv-hint { bottom: 72px; }
.wk-tools { position: absolute; right: 16px; bottom: 16px; z-index: 3; display: flex; gap: 8px; align-items: center; }
.wk-pill { height: 36px; padding: 0 14px; border-radius: 18px; display: inline-flex; align-items: center; background: var(--st-mapctl-bg); color: var(--st-mapctl-icon); box-shadow: var(--st-elevation-popover); }
button.wk-pill:hover { background: var(--st-mapctl-bg-hover); }
.wk-pill[aria-pressed="true"] { background: var(--st-accent-default); color: var(--st-text-on-accent); }
.wk-pill[hidden] { display: none; }
.wk-stick { position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px; border-radius: 50%; z-index: 2; pointer-events: none;
  background: rgba(20, 22, 26, .18); border: 2px solid rgba(255, 255, 255, .7); box-shadow: 0 2px 12px rgba(0, 0, 0, .2); }
.wk-stick[hidden] { display: none; }
.wk-stick i { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(255, 255, 255, .85); box-shadow: 0 1px 6px rgba(0, 0, 0, .3); }

@media (max-width: 767px) {
  .sv { position: fixed; inset: 0; z-index: 60; }
  .sv-bar { left: 12px; right: 12px; top: max(env(safe-area-inset-top, 0px), 12px); max-width: none; }
  .sv .pnlm-compass { top: calc(max(env(safe-area-inset-top, 0px), 12px) + 64px); right: 12px; }
  .sv-zoom { display: none; }
  .sv-hint { bottom: max(env(safe-area-inset-bottom, 0px), 20px); }
  .sv-pickbar, .wk-pickbar { top: 128px; }
  .app[data-mode="map"] .city-pill { left: 16px; transform: none; bottom: calc(var(--sheet-h) + 16px); height: 44px; max-width: calc(100% - 92px); transition: bottom .25s ease; }
  .app[data-mode="map"][data-sheet="full"] .city-pill { display: none; }
  .wk .sv-hint { bottom: calc(max(env(safe-area-inset-bottom, 0px), 16px) + 56px); }
  .wk-tools { right: 12px; bottom: max(env(safe-area-inset-bottom, 0px), 12px); }
  .map-fail { place-items: start center; padding-top: 140px; }
}

/* ============================== State symbols (T-0147): the flag page ============================== */
.st-name { gap: 10px; align-items: center; }
/* the small marks are the square icon with square corners (Areg's spec §3); the ring is outside the image */
.mini-flag { display: inline-flex; border-radius: 0; box-shadow: 0 0 0 1px var(--st-border-default); }
[data-theme="dark"] .mini-flag { box-shadow: 0 0 0 1px var(--st-border-strong); }
.tile.sym-tile { background: var(--st-surface-sunken); }
[data-theme="dark"] .tile.sym-tile { background: var(--st-surface-raised); }
.tile.sym-tile .st-flag { border-radius: 0; box-shadow: 0 0 0 1px var(--st-border-default); }
[data-theme="dark"] .tile.sym-tile .st-flag { box-shadow: 0 0 0 1px var(--st-border-strong); }
.pg.sym { max-width: 1080px; gap: 40px; padding-top: 40px; }
.sym-sec { display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 16px; }
.sym-sec > .t-h5 { margin-top: 8px; }
/* a flag sits on a plate: the guide says "on dark backgrounds, set it on a light panel or a card; any border belongs to
   the card, not the flag" */
.sym-plate { margin: 0; padding: 24px; border-radius: 16px; background: var(--st-surface-sunken); display: grid; place-items: center; }
/* the ring sits on the image, not on the plate (Areg's spec §2, symbols code §4.4): in dark the indigo field would
   otherwise melt into the plate (1.07:1) and the seed float */
.sym-plate img { display: block; width: 100%; height: auto; outline: 1px solid var(--st-border-default); outline-offset: 0; }
[data-theme="dark"] .sym-plate { background: var(--st-surface-raised); }
[data-theme="dark"] .sym-plate img { outline-color: var(--st-border-strong); }
.sym-plate.light img { outline: 0; } /* the construction sheet is a drawing on a white card, not the flag */
.sym-plate.light { background: var(--st-surface-raised); box-shadow: inset 0 0 0 1px var(--st-border-default); padding: 0; overflow: hidden; }
.pg.sym > .sym-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.sym-hero-flag { padding: 56px 40px; } /* clear space 0.25 H above and below the 2:1 flag (the guide, slide 8) */
.sym-hero-text { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sym-hero-text .t-h1 { text-wrap: balance; }
.sym-cta { gap: 10px; flex-wrap: wrap; }
.sym-meaning { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.sym-words { display: flex; flex-direction: column; gap: 14px; max-width: 620px; }
.sym-words .t-h4 { text-wrap: pretty; }
.sym-voices { display: flex; flex-direction: column; gap: 20px; }
.sym-voter { margin: 0; gap: 12px; }
.sym-voter blockquote { margin: 0; }
.sym-reasons { display: flex; flex-direction: column; gap: 14px; }
.sym-reason { margin: 0; padding-left: 14px; border-left: 2px solid var(--st-line-human); display: flex; flex-direction: column; gap: 6px; }
.sym-reason blockquote { margin: 0; }
.sym-who { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sym-who:hover .t-label-m { text-decoration: underline; }
/* the guide's slides: a scroll-snap carousel (swipe on a phone, keys or buttons on a desktop), no script needed to move */
.sl { display: flex; flex-direction: column; gap: 12px; max-width: 880px; }
.sl-track { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 16px; overscroll-behavior-x: contain; }
.sl-track::-webkit-scrollbar { display: none; }
.sl-track:focus-visible { outline: 2px solid var(--st-focus-ring); outline-offset: 2px; }
.sl-item { margin: 0; scroll-snap-align: start; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sl-img { display: block; border-radius: 16px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--st-border-default); aspect-ratio: 16 / 9; background: var(--st-surface-sunken); }
.sl-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sl-item figcaption { max-width: 760px; }
.sl-nav { display: flex; align-items: center; gap: 12px; justify-content: center; }
.sl-btn { width: 44px; height: 44px; border-radius: 22px; display: grid; place-items: center; background: var(--st-surface-sunken); color: var(--st-icon-strong); }
.sl-btn:hover { background: var(--st-surface-pressed); }
[data-theme="dark"] .sl-btn { background: var(--st-surface-raised); }
.sl-dots { display: flex; gap: 2px; }
.sl-dot { width: 24px; height: 44px; display: grid; place-items: center; }
.sl-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st-border-strong); transition: background .15s, width .15s; }
.sl-dot[aria-current="true"]::before { width: 18px; border-radius: 4px; background: var(--st-accent-default); }
/* specifications */
.sym-colours { display: flex; flex-direction: column; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--st-border-default); background: var(--st-surface-raised); overflow: hidden; }
.sc-row { display: grid; grid-template-columns: 180px 100px 120px 120px minmax(0, 1fr); gap: 16px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--st-border-default); }
.sc-row.sc-head { border-top: 0; padding-top: 10px; padding-bottom: 10px; background: var(--st-surface-sunken); }
.sc-name { display: inline-flex; align-items: center; gap: 12px; }
.sw { width: 40px; height: 40px; border-radius: 10px; flex: none; box-shadow: inset 0 0 0 1px var(--st-border-strong); }
.sc-k { display: none; }
.sym-cons { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.sym-dl { margin: 0 0 12px; display: flex; flex-direction: column; }
.sym-dl > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--st-border-default); }
.sym-dl > div:first-child { border-top: 0; padding-top: 0; }
.sym-dl dd { margin: 0; }
.sym-versions { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sym-ver { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sym-ver .sym-plate { aspect-ratio: 3 / 2; padding: 20px; }
.sym-ver .sym-plate img { max-height: 100%; width: auto; max-width: 100%; }
.sym-ver .sym-plate.sq img { height: 64px; width: 64px; }
.sym-ver figcaption { display: flex; flex-direction: column; gap: 4px; }
.sym-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sym-rules h4 { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.sym-rules ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; }
.sym-do { color: var(--st-status-ok-text); } .sym-dont { color: var(--st-status-danger); }
.sym-time { margin-top: 0; }
.sym-links { max-width: 640px; }
.sym-others { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sym-ph { align-items: flex-start; }
.sym-ph .row { gap: 8px; flex-wrap: wrap; }
.pg.sym > .foot { margin-top: -8px; }
@media (max-width: 1180px) {
  .pg.sym > .sym-hero, .sym-meaning, .sym-cons { grid-template-columns: 1fr; gap: 24px; }
  .sym-hero-flag { max-width: 640px; }
  .sym-versions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sc-row { grid-template-columns: 150px 90px 110px 110px minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .pg.sym { padding-top: 12px; gap: 32px; }
  .sym-hero-flag { padding: 20px; }
  .sym-hero-text .t-h1 { font-size: 26px; line-height: 34px; }
  .sym-hero-text > .t-overline { display: none; } /* the top bar already names the page */
  .sym-words .t-h4 { font-size: 17px; line-height: 26px; }
  .sc-row.sc-head { display: none; }
  .sc-row { grid-template-columns: 1fr 1fr 1fr; gap: 6px 12px; padding: 14px 16px; }
  .sc-row:nth-child(2) { border-top: 0; }
  .sc-row > .sc-name { grid-column: 1 / -1; }
  .sc-row > .t-body-s { grid-column: 1 / -1; }
  .sc-row > .mono { flex-direction: column; align-items: flex-start; gap: 0; font-size: 12px; }
  .sc-k { display: block; }
  .sym-dl > div { grid-template-columns: 1fr; gap: 2px; }
  .sym-versions { gap: 12px; }
  .sym-ver .sym-plate { padding: 14px; }
  .sym-rules, .sym-others { grid-template-columns: 1fr; }
}

/* ================================================================== the visitor view (founder 10-26) ================================================================== */
/* dialogs: the welcome and the sign-in stub (a native modal <dialog>) */
.dlg { padding: 0; border: 0; border-radius: 24px; background: var(--st-surface-raised); color: var(--st-text-primary); box-shadow: var(--st-elevation-popover);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; scrollbar-width: thin; }
.dlg::backdrop { background: var(--st-overlay-scrim); }
.dlg-in { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 28px 28px 24px; }
.dlg-x { position: absolute; right: 12px; top: 12px; }
.dlg-foot { display: flex; align-items: center; gap: 12px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.dlg-foot > .t-caption { flex: 1; min-width: 180px; }
/* the flag in the welcome (Areg's on-screen spec, 2026-10-31, symbols code §4.1): never shadowed, rounded or clipped; the
   1 px edge is an outline outside the image, and the clear space below is 0.25 H (16 px) */
.welcome .wl-flag { margin: 0 0 16px; width: 132px; border-radius: 0; }
.welcome .wl-flag img { display: block; width: 100%; height: auto; outline: 1px solid var(--st-border-default); outline-offset: 0; }
[data-theme="dark"] .welcome .wl-flag img { outline-color: var(--st-border-strong); }
.welcome .wl-text { display: flex; flex-direction: column; gap: 6px; }
.wl-text p, .join p { margin: 0; }
.doors { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.door { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: var(--st-surface-sunken); text-align: left; width: 100%; }
button.door:hover { background: var(--st-surface-pressed); }
.door .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.door .links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.signin .tile.lg { width: 48px; height: 48px; border-radius: 14px; }
.signin p { margin: 0; }

/* the rail's bottom for a visitor: Settings, Join, Sign in */
/* Join stands out by colour only: a filled pill read as "selected" (founder 10-28); the pill fills when Join is the open page */
.rail-item.join .pill { color: var(--st-accent-text); }
.rail-item.join { color: var(--st-accent-text); }
.rail-item.join[aria-current="page"] .pill { background: var(--st-accent-default); color: var(--st-text-on-accent); }
button.rail-item { text-align: center; }

/* "Internal": a part only officials will see */
.box.internal { align-items: flex-start; }
.box.internal .row { align-items: flex-start; width: 100%; }
.box.internal p { margin: 2px 0 0; }

/* the preview switch (visitor Settings, the founder's Me) */
.switch-row { display: flex; align-items: center; gap: 16px; cursor: pointer; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 24px; border-radius: 12px; background: var(--st-control-track); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 9px; background: var(--st-surface-raised); box-shadow: var(--st-elevation-pill); transition: transform .15s; }
.switch:checked { background: var(--st-accent-default); }
.switch:checked::after { transform: translateX(20px); }
.viewbox p { margin: 0; }

/* #/settings for a visitor */
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; max-width: 980px; }
.set-grid .box p { margin: 0; }

/* #/join: Become a citizen */
.pg.join { gap: 32px; max-width: 980px; }
.join-hero { display: grid !important; grid-template-columns: minmax(0, 1fr) 240px; gap: 32px; align-items: center; }
.jh-text { display: flex; flex-direction: column; gap: 10px; }
.jh-flag { margin: 0; border-radius: 0; }
.jh-flag img { display: block; width: 100%; height: auto; outline: 1px solid var(--st-border-default); outline-offset: 0; }
[data-theme="dark"] .jh-flag img { outline-color: var(--st-border-strong); }
.who-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.who-grid .box p { margin: 0; }
.rights { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 16px; }
.rights a { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 10px; }
.rights a:hover { background: var(--st-surface-hover); }
.rights .mono { min-width: 34px; }
.jsteps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.jsteps li { display: flex; gap: 14px; align-items: flex-start; }
.jsteps .sd { width: 28px; height: 28px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 13px; font-weight: 500; background: var(--st-accent-subtle); color: var(--st-accent-text); }
.box.apply { gap: 14px; align-items: flex-start; }
.box.apply .row { align-items: flex-start; width: 100%; }
.box.apply p { margin: 2px 0 0; }

/* the phone's More: the visitor card instead of the founder's */
.visitor-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 16px; background: var(--st-accent-subtle); }
.visitor-card .body { flex: 1; display: flex; flex-direction: column; }
.visitor-card .btn.full { flex: 1; }
.signin-m { color: var(--st-icon-strong); border-radius: 22px; }

@media (max-width: 1023px) {
  .rights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .dlg { border-radius: 20px; }
  .dlg-in { padding: 24px 20px 20px; }
  .dlg-foot .btn { flex: 1; }
  .pg.join { padding-top: 12px; gap: 28px; }
  .join-hero { grid-template-columns: 1fr; gap: 16px; }
  .join-hero .t-overline { display: none; }
  .jh-flag { max-width: 200px; order: -1; }
  .jh-text .t-h1 { font-size: 26px; line-height: 34px; }
  .who-grid, .rights { grid-template-columns: 1fr; }
  .set-grid { grid-template-columns: 1fr; }
}
/* the visitor's rail has 15 items (Join and Sign in instead of Me): on a short desktop they tighten again so Sign in stays on screen */
@media (min-width: 768px) and (max-height: 1000px) {
  .rail.visitor .rail-item { padding: 0 0 1px; gap: 0; }
  .rail.visitor .rail-item .pill { height: 26px; }
  .rail.visitor .logo { margin-bottom: 4px; }
}
/* founder 10-28, "too close together, give them air": the height left over goes into the items (each grows up to 62 px, its icon
   and label centred), not all into one gap above Settings; on a screen too short for that they keep their compact size */
@media (min-width: 768px) {
  .rail-items { flex: 1 0 auto; }
  .rail-items .rail-item, .rail > .rail-item { flex: 1 0 auto; max-height: 62px; justify-content: center; }  /* Settings, Join, Sign in too (founder) */
  .rail .spacer { flex: none; }
}
.nowrap { white-space: nowrap; }
/* the founder has no photo on the site (10-26): his monogram on the flag's indigo, in every size and on the map pin */
.av.mono, .cz .face.mono { background: var(--st-flag-indigo); }
.av.mono .ini, .cz .face.mono { color: var(--st-flag-white); font-weight: 500; }
.av.mono.xs .ini { font-size: 12px; } .av.mono.s .ini { font-size: 15px; } .av.mono.m .ini { font-size: 18px; }
.av.mono.l .ini { font-size: 24px; } .av.mono.xl .ini { font-size: 46px; }
.cz.human .face.mono { font-size: 19px; }
[data-theme="dark"] .av.mono:not(.human) { box-shadow: 0 0 0 1px var(--st-border-strong); }

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .app[data-mode="map"] .panel, .app[data-mode="map"] .mctl, .app[data-mode="map"] .city-pill { transition-duration: .12s; transition-timing-function: linear; }
}
