/* Interface font — Golos Text (OFL, self-hosted Google Fonts build, variable 400–700): one face for the whole UI, tabular figures for numbers; it is also one of the label fonts. */
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/golos-text-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/golos-text-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/golos-text-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
/* Label fonts for the map — Google Fonts under OFL, self-hosted bold subsets (Latin + Cyrillic); Golos Text above serves both roles. Originals for the export archive live in fonts/pack. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/inter-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/montserrat-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/montserrat-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/montserrat-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/montserrat-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-sans-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-sans-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-serif-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-serif-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-serif-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "PT Serif"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/pt-serif-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/unbounded-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/unbounded-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/unbounded-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Editor surfaces: white tools, a quiet lavender board and a blue selection accent.
   Control heights and spacing follow a 4 px rhythm. Map/export styles are independent. */
:root {
  --ink: #252d42;
  --text-soft: #4b536b;
  --muted: #5c647b;
  --faint: #666e84;
  --line: #e8eaf1;
  --line-soft: #f0f1f6;
  --panel: #ffffff;
  --field: #f6f7fb;
  --hover: #f4f5fa;
  --canvas: #f5f5fa;
  --grid-dot: #dfe1ed;
  --accent: #4263eb;
  --accent-soft: #eef1ff;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 12px;
  --shadow-card: 0 16px 48px -20px rgba(32, 39, 76, .18), 0 2px 6px rgba(32, 39, 76, .04), 0 0 0 1px rgba(32, 39, 76, .03);
  --shadow-pop: 0 0 0 1px var(--line), 0 10px 28px -10px rgba(28, 39, 64, .22);
  --font-ui: "Golos Text", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-family: var(--font-ui);
  color: var(--ink);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { overflow: hidden; background: var(--canvas); -webkit-font-smoothing: antialiased; font-size: 13px; }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

.app-shell { height: 100%; display: grid; grid-template-rows: 72px minmax(0, 1fr); }
.topbar {
  position: relative; z-index: 50; display: grid; grid-template-columns: 1fr auto; align-items: center;
  height: 72px; padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; width: max-content; align-items: center; color: var(--ink); text-decoration: none; }
.brand:hover { opacity: .75; }
.brand svg { display: block; height: 24px; width: auto; }
.brand .brand-symbol { display: none; }
.ui-icon { display: inline-block; flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.top-actions { position: relative; display: flex; gap: 8px; align-items: center; }
.button, .icon-button { border: 0; border-radius: var(--radius); background: transparent; cursor: pointer; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; font-size: 12px; font-weight: 500; transition: background .15s, box-shadow .15s; }
.button svg { display: block; flex: none; width: 16px; height: 16px; }
.button--ghost { color: var(--text-soft); }
.button--ghost:hover { color: var(--ink); background: var(--hover); }
.button--secondary { color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }
.button--secondary:hover { background: var(--hover); }
.button--primary { color: #fff; background: var(--accent); box-shadow: 0 2px 3px rgba(66,99,235,.14); }
.button--primary:hover { background: #2a55d6; }
.icon-button { width: 36px; height: 36px; font-size: 18px; color: var(--text-soft); }
.icon-button:hover { color: var(--ink); background: var(--hover); }
.icon-button:disabled { color: #c3c9d6; cursor: default; background: transparent; }
.help-button { display: grid; place-items: center; font-size: 15px; font-weight: 600; }
.help-button[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.history-buttons { display: flex; gap: 2px; margin-right: 4px; padding-right: 12px; border-right: 1px solid var(--line); }
.history-button { display: grid; place-items: center; width: 36px; height: 36px; }
.history-button svg { display: block; width: 16px; height: 16px; }
.history-button--redo svg { transform: scaleX(-1); }
.export-menu { position: relative; }
.export-popover { position: absolute; right: 0; top: calc(100% + 8px); width: 352px; max-width: calc(100vw - 20px); padding: 6px; border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-pop); }
.export-popover > button, .export-popover > a { color: inherit; text-decoration: none; }
.export-popover > button, .export-popover > a { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 0 8px; width: 100%; padding: 10px 10px; text-align: left; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; }
.export-popover > button:hover, .export-popover > a:hover { background: var(--hover); }
.help-menu { position: relative; }
.help-popover { width: 240px; }
.help-popover > button, .help-popover > a { grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px; }
.help-popover b { font-weight: 500; }
.export-popover .shortcut { padding: 1px 5px; font-size: 11px; }
.export-popover__scale { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px 8px 82px; color: var(--muted); font-size: 12px; }
.export-popover__scale .segmented--inline button { padding: 4px 10px; font-size: 12px; }
.export-popover b { font-size: 13px; font-weight: 700; }
.export-popover small { color: var(--muted); font-size: 12px; }
.export-popover__divider { height: 1px; margin: 4px 8px; background: var(--line-soft); }
.export-popover__option { display: flex; gap: 10px; align-items: center; padding: 8px 10px 6px; color: var(--text-soft); font-size: 12px; line-height: 1.35; cursor: pointer; }
.export-popover__option input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); flex: none; }
.export-popover__option.is-disabled { color: var(--faint); cursor: default; }
.visually-hidden { position: fixed !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.workspace { min-height: 0; display: grid; grid-template-columns: 280px minmax(0, 1fr) 320px; }
.panel-column { min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--panel); scrollbar-width: thin; scrollbar-color: #cfd5e2 transparent; }
.library { display: flex; flex-direction: column; padding: 24px 20px 0; border-right: 1px solid var(--line); }
.inspector { border-left: 1px solid var(--line); }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.panel-eyebrow { margin: 0 0 7px; font-size: 11px; line-height: 1; color: var(--faint); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.panel-head h1, .panel-head h2 { margin: 0; font-size: 17px; line-height: 1.35; font-weight: 600; letter-spacing: -.035em; }
.library-caption { margin: 8px 0 10px; color: var(--muted); font-size: 12px; }
.library:has(#fd-chips[hidden]) .library-caption { display: none; }
.close-mobile, .mobile-panel-toggle { display: none; }

.search-field { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; height: 40px; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--field); }
.search-field:focus-within { border-color: var(--accent); background: var(--panel); }
.search-field > span { color: var(--faint); font-size: 18px; line-height: 1; transform: translateY(-1px); }
.search-field input { min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-field input::placeholder { color: var(--faint); }
.search-field input::-webkit-search-cancel-button { cursor: pointer; }
.search-field > svg { width: 16px; color: var(--faint); }
kbd { padding: 2px 6px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); font: 11px var(--font-ui); white-space: nowrap; }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); margin: 16px -2px 12px; padding: 3px; gap: 2px; border-radius: 8px; background: var(--field); }
.tab { display: flex; justify-content: center; align-items: baseline; gap: 4px; padding: 8px 3px; border: 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 12px; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--ink); }
.tab span { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.tab.is-active { color: var(--ink); background: white; box-shadow: 0 1px 4px rgba(30,40,75,.09); font-weight: 500; }
.tab.is-active span { color: var(--accent); opacity: .8; }
.fd-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0 0 12px; }
.fd-chips button { padding: 6px 4px; border: 1px solid var(--line); border-radius: 6px; color: var(--muted); background: var(--panel); font-size: 11px; font-weight: 500; letter-spacing: .02em; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.fd-chips button:hover { border-color: #c5cddc; color: var(--ink); }
.fd-chips button.is-partial { border-color: #b9c9fb; background: var(--accent-soft); color: var(--accent); }
.fd-chips button.is-active { border-color: var(--accent); background: var(--accent); color: #fff; }
.selection-summary { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; padding: 0 2px 10px; color: var(--muted); font-size: 12px; }
.selection-summary__spacer { flex: 1; }
.selection-summary button { padding: 0; border: 0; color: var(--muted); background: transparent; font-size: 12px; font-weight: 400; cursor: pointer; }
.selection-summary #select-found { color: var(--accent); font-weight: 500; }
.selection-summary button:hover { text-decoration: underline; }
.object-list { min-height: 120px; flex: 1; overflow-y: auto; margin-right: -8px; padding-right: 8px; }
.object-section + .object-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.object-group { position: sticky; top: 0; z-index: 1; padding: 8px 8px 6px; color: var(--faint); background: var(--panel); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.object-item { position: relative; display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; min-height: 40px; padding: 5px 8px; border-radius: 7px; cursor: pointer; transition: background .12s; }
.object-item:has(input:checked) { background: var(--accent-soft); }
.object-item:hover, .object-item.is-hover { background: var(--hover); }
.object-item.is-flash { background: var(--accent-soft); }
.object-item input { position: absolute; opacity: 0; pointer-events: none; }
.object-item input:focus-visible + .object-check { outline: 2px solid var(--accent); outline-offset: 2px; }
.object-check { display: grid; place-items: center; width: 17px; height: 17px; border: 1.5px solid #c5cddc; border-radius: 5px; background: var(--panel); transition: background .12s, border-color .12s; }
.object-item input:checked + .object-check { border-color: var(--accent); background: var(--accent); }
.object-item input:checked + .object-check::after { content: ""; width: 7px; height: 4px; margin-top: -1px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg); }
.object-copy { min-width: 0; }
.object-copy b, .object-copy small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.object-copy b { font-size: 12px; font-weight: 500; }
.object-copy small { margin-top: 1px; color: var(--faint); font-size: 11.5px; }
.object-meta { padding: 2px 5px; border-radius: 4px; color: var(--muted); background: var(--field); font-size: 11px; font-weight: 400; }
.empty-state { padding: 30px 12px; color: var(--muted); text-align: center; font-size: 12.5px; line-height: 1.55; }
.empty-state__action { margin-top: 8px; padding: 0; border: 0; color: var(--accent); background: transparent; font-size: 12.5px; cursor: pointer; }
.empty-state__action:hover { text-decoration: underline; }

/* Infinite board: a dot grid that pans and zooms with the artboard (see applyCanvasTransform). */
.stage {
  position: relative; min-width: 0; overflow: hidden; background-color: var(--canvas);
  --grid-size: 24px; --grid-x: 50%; --grid-y: 50%;
  background-image: radial-gradient(circle, var(--grid-dot) .8px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  background-position: calc(var(--grid-x) + var(--grid-size) / 2) calc(var(--grid-y) + var(--grid-size) / 2);
}
.stage-toolbar { position: absolute; z-index: 5; top: 16px; right: 24px; display: flex; align-items: center; gap: 18px; }
.view-switch { display: flex; gap: 3px; padding: 4px; border-radius: var(--radius); background: var(--panel); box-shadow: 0 2px 8px rgba(32,39,76,.04), 0 0 0 1px var(--line); }
.view-switch button { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 500; cursor: pointer; }
.view-switch .ui-icon { width: 15px; height: 15px; }
.view-switch button:hover { color: var(--ink); }
.view-switch button.is-active { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
/* The viewport only positions the board; clipping is left to the stage, so the faded overflow of a zoomed map stays
   visible right up to the panels on every side. */
.canvas-viewport { position: absolute; inset: 76px 24px 72px; cursor: grab; touch-action: none; }
.canvas-viewport.is-panning { cursor: grabbing; }
.canvas-viewport.is-panning .region, .canvas-viewport.is-panning .city-marker { cursor: grabbing; }
/* The slide is a sheet on the board: the one soft shadow in the interface. */
.artboard { position: absolute; left: 50%; top: 50%; width: min(100%, calc((100vh - 220px) * 1.7778)); aspect-ratio: 16 / 9; background: #fff; border-radius: 4px; box-shadow: var(--shadow-card); transform: translate(-50%, -50%); transform-origin: center; transition: width .2s, aspect-ratio .2s, box-shadow .2s; will-change: transform; }
.artboard.ratio-4-3 { width: min(100%, calc((100vh - 220px) * 1.3333)); aspect-ratio: 4 / 3; }
.artboard.no-frame { background: transparent !important; box-shadow: none; }
#map { position: relative; width: 100%; height: 100%; display: block; overflow: visible; }
/* Map text keeps the export font stack so the screen matches PNG/SVG/PPTX output. */
#map text { font-family: var(--map-font, Inter, Arial, sans-serif); }
.frame-label { position: absolute; right: -6px; bottom: -26px; padding: 3px 6px; border: 0; border-radius: var(--radius-sm); color: var(--muted); background: transparent; font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer; }
.frame-label:hover { color: var(--accent); background: var(--accent-soft); }
.artboard.no-frame .frame-label { display: none; }
.region { cursor: pointer; transition: filter .12s, opacity .12s; vector-effect: non-scaling-stroke; }
.region:hover, .region.is-hover { filter: brightness(1.1); }
.region.is-selected { filter: saturate(1.08); }
.region:focus { outline: none; }
.region:focus-visible { stroke: var(--accent); stroke-width: 2px; }
.country-outline { fill: none; pointer-events: none; vector-effect: non-scaling-stroke; }
.graticule { fill: none; pointer-events: none; vector-effect: non-scaling-stroke; }
/* Mosaic dots sit under the (transparent) region polygons, which keep the hover, click and borders. */
.dots { pointer-events: none; transition: filter .12s; }
.dots.is-hover { filter: brightness(1.1); }
.dots.is-selected { filter: saturate(1.08); }
/* In the mosaic a city is one of the grid's dots: flat like its neighbours, dimmed a little on hover. */
#map.is-mosaic .city-marker { filter: none; transition: opacity .12s; }
#map.is-mosaic .city.is-hover .city-marker { opacity: .7; }
.compass { pointer-events: none; }
.compass text { font-weight: 700; paint-order: stroke; stroke-linejoin: round; text-anchor: middle; }
.region-label { pointer-events: none; text-anchor: middle; font-weight: 650; paint-order: stroke; stroke-linejoin: round; }
.city-marker { cursor: pointer; filter: url(#marker-shadow); }
.city-marker__eye { pointer-events: none; }
.city-leader { pointer-events: none; stroke-linecap: round; }
.city-marker__ring { fill: none; stroke-width: 1; opacity: .3; transition: opacity .12s, stroke-width .12s; }
.city.is-hover .city-marker__ring { opacity: .9; stroke-width: 2; }
.city-label { font-weight: 650; paint-order: stroke; stroke-linejoin: round; cursor: move; user-select: none; -webkit-user-select: none; }
.city-label:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.city-label.is-dragging { opacity: .75; }
.map-controls { position: absolute; z-index: 5; left: 50%; bottom: 24px; display: flex; padding: 5px; gap: 2px; transform: translateX(-50%); border-radius: var(--radius); background: var(--panel); box-shadow: 0 2px 8px rgba(32,39,76,.04), 0 0 0 1px var(--line); }
.map-controls button { display: grid; place-items: center; height: 30px; min-width: 30px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-soft); font-size: 13px; font-weight: 500; cursor: pointer; }
.map-controls button:hover { color: var(--ink); background: var(--hover); }
.map-controls #fit-map { display: flex; gap: 7px; margin-left: 4px; border-left: 1px solid var(--line); border-top-left-radius: 0; border-bottom-left-radius: 0; font-size: 12px; }
.map-controls .zoom-level { min-width: 56px; padding: 0 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.map-controls .ui-icon { width: 14px; height: 14px; }
/* Status strip like a GIS editor's: board zoom and the geographic coordinate under the cursor (screen only). It is a
   readout, not a control, so it sits flat on the board, and the coordinate part only exists while the cursor is over
   the map. */
.status-bar { position: absolute; z-index: 5; left: 20px; bottom: 28px; display: flex; align-items: center; gap: 10px; height: 30px; padding: 0 8px; border-radius: var(--radius-sm); background: var(--canvas); color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
/* Regions picked on the map: screen-only outline above the map, plus a floating bar to recolour or unmark them. */
.active-outline { pointer-events: none; }
.active-outline path { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.active-outline__halo { stroke: #fff; stroke-width: 4; }
.active-outline__line { stroke: var(--accent); stroke-width: 1.5; }
/* Sits in the toolbar row, left of the projection switch, so a pick on the map is answered where the eye already is. */
.selection-bar { position: absolute; z-index: 6; left: 24px; top: 16px; display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 14px; max-width: calc(100% - 24px); border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-pop); font-size: 12.5px; }
.selection-bar__count { color: var(--text-soft); white-space: nowrap; }
.selection-bar .swatch { min-height: 31px; padding: 0 8px; border-right: 1px solid var(--line-soft); }
.selection-bar button { height: 31px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: transparent; font-size: 12px; font-weight: 500; cursor: pointer; }
.selection-bar button:hover { background: var(--hover); }
/* The whole map as one object: bounding box with corner (resize) and top (rotate) handles, screen-only. Handles are
   drawn in screen pixels — their groups get scale(1/screenScale) from JS. */
.map-selection__box { fill: none; stroke: var(--accent); stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-selection.is-hover .map-selection__box { stroke-dasharray: 5 4; opacity: .55; }
.map-selection.is-hover .map-selection__handle, .map-selection.is-hover .map-selection__stem { display: none; }
.map-selection__stem { stroke: var(--accent); stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.map-selection__handle { pointer-events: all; }
.map-selection__handle rect, .map-selection__handle circle { fill: #fff; stroke: var(--accent); stroke-width: 1.5; }
.map-selection__handle path { stroke: var(--accent); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.map-selection__handle:hover rect, .map-selection__handle:hover circle { fill: var(--accent-soft); }
/* Turn zones just outside each corner, as in Figma: invisible, they only change the cursor and turn the map. */
.map-selection__turn rect, .map-selection__turn:hover rect { fill: transparent; stroke: none; }
.map-selection__rotate { cursor: grab; }
.map-selection__rotate.is-dragging { cursor: grabbing; }
.map-selection__corner[data-handle="nw"], .map-selection__corner[data-handle="se"] { cursor: nwse-resize; }
.map-selection__corner[data-handle="ne"], .map-selection__corner[data-handle="sw"] { cursor: nesw-resize; }
/* Globe viewpoint: the crosshair marks the point the viewer hangs over; screen-only, drawn in screen pixels via scale(). */
/* Globe rotation handle, like PowerPoint's 3-D rotate grip: sits at the globe's centre, drag turns the globe. */
.lens-focus { cursor: grab; pointer-events: all; }
.lens-focus__ring { fill: rgba(255,255,255,.94); stroke: var(--accent); stroke-width: 1.5; filter: drop-shadow(0 1px 2px rgba(28,39,64,.25)); }
.lens-focus__globe { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 1.3; }
.lens-focus__arrow { fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lens-focus:hover .lens-focus__ring, .lens-focus.is-dragging .lens-focus__ring { fill: var(--accent-soft); }
.lens-focus.is-dragging { cursor: grabbing; }
.tooltip { position: fixed; z-index: 80; max-width: 250px; padding: 8px 11px; border-radius: 8px; color: #fff; background: rgba(28,39,64,.96); pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); font-size: 12.5px; }
.tooltip b, .tooltip small { display: block; }
.tooltip small { margin-top: 2px; color: #aeb7cc; font-size: 11.5px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 76px; width: max-content; max-width: min(92vw, 440px); padding: 11px 16px; border-radius: var(--radius); color: #fff; background: var(--ink); box-shadow: 0 10px 28px -10px rgba(28,39,64,.4); transform: translateX(-50%); font-size: 13px; text-align: center; }
.toast:not([hidden]) { display: flex; align-items: center; gap: 14px; }

.toast__action { flex: none; margin: -6px -8px -6px 0; padding: 6px 10px; border: 0; border-radius: var(--radius-sm); color: #b9c8ff; background: rgba(255,255,255,.08); font-size: 13px; font-weight: 600; cursor: pointer; }
.toast__action:hover { color: #fff; background: rgba(255,255,255,.16); }
/* First-run card: the three steps of the editor, dismissed once for good. */
.onboarding { position: absolute; z-index: 7; left: 20px; bottom: 76px; width: 300px; padding: 16px 16px 14px; border-radius: var(--radius-lg); background: var(--panel); box-shadow: var(--shadow-pop); color: var(--text-soft); font-size: 12.5px; line-height: 1.45; }
.onboarding__close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; font-size: 18px; }
.onboarding__title { margin: 0 28px 8px 0; color: var(--ink); font-size: 13px; font-weight: 600; }
.onboarding ol { margin: 0; padding-left: 18px; }
.onboarding li + li { margin-top: 4px; }
.onboarding b { color: var(--ink); font-weight: 600; }
.onboarding__more { margin: 8px 0 12px; color: var(--muted); font-size: 12px; }
.onboarding__actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.onboarding__link { padding: 0; border: 0; color: var(--accent); background: transparent; font-size: 12.5px; cursor: pointer; }
.onboarding__link:hover { text-decoration: underline; }
.onboarding__ok { min-height: 32px; padding: 0 14px; }
/* The first-run card speaks the layout's language: clicks and side panels on a desktop, taps and header buttons
   when the panels are tucked away (the same 1000 px breakpoint as the layout). */
.onboarding .for-touch { display: none; }
@media (max-width: 1000px) {
  .onboarding .for-desktop { display: none; }
  .onboarding .for-touch { display: revert; }
  .onboarding__actions { justify-content: flex-end; }
}
/* Drag a project file over the board to open it. */
.drop-overlay { position: absolute; z-index: 20; inset: 12px; display: grid; place-items: center; border: 2px dashed var(--accent); border-radius: var(--radius-lg); background: rgba(238,241,255,.88); color: var(--ink); font-size: 14px; pointer-events: none; }
.drop-overlay p { margin: 0; padding: 12px 18px; border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-pop); }
/* Shortcut list: a native modal dialog. */
.shortcuts { width: min(92vw, 480px); max-height: min(88vh, 640px); padding: 0; border: 0; border-radius: var(--radius-lg); color: var(--ink); background: var(--panel); box-shadow: var(--shadow-pop); font-family: var(--font-ui); }
.shortcuts::backdrop { background: rgba(28,39,64,.28); }
.shortcuts__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 8px 22px; }
.shortcuts__head h2 { margin: 0; font-size: 15px; font-weight: 600; }
.support, .confirm { width: min(92vw, 400px); }
.confirm__body { padding: 4px 22px 20px; color: var(--text-soft); font-size: 13px; line-height: 1.5; }
.confirm__body p { margin: 0 0 20px; }
.confirm__actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm__actions--start { justify-content: flex-start; }
.support__body { padding: 4px 22px 22px; color: var(--text-soft); font-size: 13px; line-height: 1.5; }
.support__body p { margin: 0 0 16px; }
.support__link { width: 100%; text-decoration: none; }
.place-dialog { width: min(92vw, 420px); }
.place-form { display: grid; gap: 12px; padding: 4px 22px 20px; }
.place-field { display: grid; gap: 6px; color: var(--text-soft); font-size: 12px; font-weight: 500; }
.place-field input { box-sizing: border-box; width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); outline: 0; color: var(--ink); background: var(--field); font: 13px var(--font-ui); }
.place-field input::placeholder { color: var(--faint); }
.place-field input:focus { border-color: var(--accent); background: var(--panel); }
.place-field input.is-invalid { border-color: #d64545; }
.place-hint { min-height: 2.9em; margin: -6px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.45; }
.place-hint.is-found { color: var(--ink); }
.place-hint.is-invalid { color: #d64545; }
.place-pick { display: inline-flex; align-items: center; justify-self: start; gap: 6px; margin-top: -4px; padding: 0; border: 0; color: var(--accent); background: transparent; font: 500 12.5px var(--font-ui); cursor: pointer; }
.place-pick:hover { text-decoration: underline; }
.place-pick svg { width: 16px; height: 16px; }
.place-actions { margin-top: 8px; }
.place-actions__spacer { flex: 1; }
.place-delete { padding: 0 10px; color: #d64545; }
.place-delete:hover { background: rgba(214,69,69,.08); }
.add-place { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; margin-bottom: 4px; padding: 5px 8px; border: 1px dashed var(--line); border-radius: 7px; color: var(--accent); background: transparent; font: 500 12px var(--font-ui); text-align: left; cursor: pointer; }
.add-place span { display: grid; place-items: center; width: 16px; height: 16px; font-size: 16px; line-height: 1; }
.add-place:hover { border-color: var(--accent); background: var(--accent-soft); }
.object-edit { display: grid; place-items: center; width: 28px; height: 28px; margin: -4px -4px -4px 0; padding: 0; border: 0; border-radius: 6px; color: var(--muted); background: transparent; cursor: pointer; }
.object-edit:hover { color: var(--ink); background: var(--panel); }
.object-edit .ui-icon { width: 15px; height: 15px; }
.canvas-viewport.is-picking, .canvas-viewport.is-picking .region, .canvas-viewport.is-picking .city-marker { cursor: crosshair; }
.ai-help { width: min(92vw, 520px); }
.ai-help__steps { margin: 0 0 12px; padding-left: 20px; }
.ai-help__steps li + li { margin-top: 4px; }
.ai-help__note { color: var(--muted); font-size: 12px; }
.ai-help__prompt { display: block; box-sizing: border-box; width: 100%; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); outline: 0; color: var(--ink); background: var(--field); font: 12px/1.5 var(--font-ui); resize: vertical; }
.ai-help__prompt:focus { border-color: var(--accent); }
.shortcuts__list { margin: 0; padding: 0 22px 20px; }
.shortcuts__list div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 12.5px; }
.shortcuts__list dt { color: var(--muted); }
.shortcuts__list dd { margin: 0; color: var(--text-soft); line-height: 1.4; }

/* Inspector: one scrollable stack of collapsible sections under a sticky heading. */
.inspector .panel-head { padding: 24px 24px 22px; margin: 0; }
.inspector-header { position: sticky; top: 0; z-index: 8; background: var(--panel); }
.control-section { border-top: 1px solid var(--line); }
.section-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 20px 24px 16px; border: 0; background: transparent; text-align: left; color: var(--ink); font-size: 12px; font-weight: 600; cursor: pointer; }
.section-toggle:hover { color: var(--ink); }
.section-toggle:focus-visible { outline-offset: -3px; }
.section-toggle > span:first-child { flex: 1; }
.section-chevron { display: grid; place-items: center; width: 16px; height: 16px; color: var(--faint); transform-origin: center; transition: transform .18s ease; }
.section-chevron svg { display: block; }
.control-section.is-collapsed .section-chevron { transform: rotate(-90deg); }
.section-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .2s ease; }
.control-section.is-collapsed .section-body { grid-template-rows: 0fr; }
.section-body__inner { min-height: 0; overflow: hidden; padding: 0 24px 22px; }
.control-section.is-collapsed .section-body__inner { padding-bottom: 0; visibility: hidden; transition: visibility 0s .2s, padding .2s; }
.control-section.is-disabled .section-body__inner > :not(.section-hint) { opacity: .48; }
/* A block inside a section that waits for something (city settings without marked cities): dimmed, not hidden. */
.control-group.is-disabled { opacity: .48; }
.control-group.is-disabled .control-group.is-disabled { opacity: 1; }
.control-group.is-disabled .range-row output { pointer-events: none; }
.group-hint { margin: 0 0 6px; }
.shape-picker button:disabled, .segmented button:disabled { cursor: default; }
.shape-picker button:disabled:hover, .segmented button:disabled:hover { color: inherit; }
.section-hint { margin: 0 0 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; scroll-behavior: auto !important; } }
.switch-row, .color-row, .select-row, .shape-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; color: var(--text-soft); font-size: 12px; }
.switch { width: 34px; height: 20px; margin: 0; appearance: none; border-radius: 20px; background: #cdd4e1; cursor: pointer; transition: background .15s; flex: none; }
.switch::after { content: ""; display: block; width: 16px; height: 16px; margin: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(28,39,64,.2); transition: transform .15s; }
.switch:checked { background: var(--accent); }
.switch:checked::after { transform: translateX(14px); }
.switch:disabled { opacity: .4; cursor: default; }
/* Colour property: HEX in tabular figures next to a square swatch (the native picker) on the row's right edge. */
.swatch { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.swatch:focus-within { border-color: var(--accent); }
.swatch input[type="color"] { order: 0; width: 20px; height: 20px; }
input[type="color"] { width: 24px; height: 24px; padding: 0; overflow: hidden; border: 0; border-radius: var(--radius-sm); background: transparent; cursor: pointer; flex: none; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(28,39,64,.18); border-radius: var(--radius-sm); }
input[type="color"]::-moz-color-swatch { border: 1px solid rgba(28,39,64,.18); border-radius: var(--radius-sm); }
.hex-input { min-width: 0; width: 64px; padding: 3px 0; border: 0; border-bottom: 1px solid transparent; outline: 0; color: var(--text-soft); background: transparent; font-size: 12.5px; font-variant-numeric: tabular-nums; text-transform: uppercase; text-align: right; }
.hex-input:hover { border-bottom-color: var(--line); }
.hex-input:focus { color: var(--ink); border-bottom-color: var(--accent); }
.hex-input.is-invalid { color: #d64545; border-bottom-color: #d64545; }
.select-row select { min-width: 0; width: 156px; height: 40px; padding: 0 30px 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%2366708a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center / 16px 16px; color: var(--ink); font-size: 13px; font-weight: 500; appearance: none; -webkit-appearance: none; cursor: pointer; }
.select-row select:hover { border-color: #c5cddc; }
.select-row select:focus-visible { outline: none; border-color: var(--accent); }
/* Gradient editor: a preview bar carrying its two stops (draggable swatches), plus rotate and swap tools. */
.segmented--top { margin: 2px 0 10px; }
.gradient-editor { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; }
.gradient-bar { position: relative; flex: 1; height: 24px; padding: 0 9px; }
.gradient-bar::before { content: ""; position: absolute; inset: 4px 9px; border-radius: 6px; background: var(--preview, #ccc); box-shadow: inset 0 0 0 1px rgba(28,39,64,.12); }
.gradient-stop { position: absolute; top: 50%; width: 16px; height: 16px; padding: 0; border: 2px solid #fff; border-radius: 5px; background: var(--stop, #888); box-shadow: 0 0 0 1px rgba(28,39,64,.35), 0 1px 3px rgba(28,39,64,.2); transform: translate(-50%, -50%); cursor: ew-resize; touch-action: none; }
.gradient-stop.is-selected { width: 20px; height: 20px; box-shadow: 0 0 0 1.5px var(--accent), 0 1px 3px rgba(28,39,64,.2); z-index: 1; }
.gradient-stop:focus-visible { outline-offset: 3px; }
.gradient-tool { width: 36px; height: 36px; flex: none; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.gradient-tool:hover { color: var(--ink); background: var(--hover); }
.gradient-tool svg { display: block; width: 16px; height: 16px; margin: auto; }
/* Range property: label and tabular value above the track; `--ticks` draws N interval marks under integer scales. */
.range-row { display: block; margin-top: 12px; color: var(--text-soft); font-size: 12px; }
.range-row > span { display: flex; justify-content: space-between; margin-bottom: 4px; }
.range-row output { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
/* The value next to a slider is a field too: click (or focus + Enter) to type an exact number. */
.range-row output[tabindex] { margin: -2px -5px; padding: 2px 5px; border-radius: 5px; cursor: text; }
.range-row output[tabindex]:hover { color: var(--ink); background: var(--field); }
.range-edit { width: 64px; height: 22px; margin: -3px -5px; padding: 0 5px; border: 1px solid var(--accent); border-radius: 5px; outline: 0; color: var(--ink); background: var(--panel); font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; }
.range-track { position: relative; display: block; height: 22px; }
input[type="range"] { position: relative; z-index: 1; width: 100%; height: 22px; margin: 0; appearance: none; outline: 0; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: #dbe1ec; }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: #dbe1ec; }
input[type="range"]::-webkit-slider-thumb { width: 16px; height: 16px; margin-top: -6.5px; appearance: none; border: 2.5px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 1px 3px rgba(28,39,64,.25); cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 11px; height: 11px; border: 2.5px solid #fff; border-radius: 50%; background: var(--accent); box-shadow: 0 1px 3px rgba(28,39,64,.25); cursor: pointer; }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
.range-track[style*="--ticks"]::after { content: ""; position: absolute; left: 8px; right: 8px; top: 14px; height: 4px; background: repeating-linear-gradient(to right, rgba(28,39,64,.18) 0 1px, transparent 1px calc((100% - 1px) / var(--ticks))); pointer-events: none; }
.projection-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 2px; }
.projection-grid button { display: grid; place-items: center; gap: 8px; min-height: 68px; padding: 10px 4px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); background: var(--panel); font-size: 12px; font-weight: 500; cursor: pointer; transition: border-color .12s, background .12s, color .12s; }
.projection-grid button:hover { color: var(--ink); border-color: #c5cddc; }
.projection-grid button.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.projection-grid button:disabled, .view-switch button:disabled { color: #b8c0d0; cursor: not-allowed; }
.projection-grid button:disabled:hover { border-color: var(--line); }
.projection-icon { display: block; width: 28px; height: 19px; border: 1.5px solid currentColor; opacity: .8; }
.projection-icon--conic { border-radius: 45% 45% 28% 28%; transform: perspective(20px) rotateX(-5deg); }
.projection-icon--flat { border-radius: 3px; }
.style-icon--atlas { border: 0; border-radius: 42% 58% 48% 52% / 55% 45% 55% 45%; background: currentColor; opacity: .55; }
.style-icon--mosaic { border: 0; opacity: .8; background: radial-gradient(circle, currentColor 1.4px, transparent 1.8px) 1px 1px / 5.5px 5.5px; }
.style-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.style-grid button { position: relative; gap: 4px; padding: 12px 8px; color: #6f7ea3; }
.style-grid button > span { color: var(--text-soft); margin-top: 5px; font-size: 12px; }
.style-grid button.is-active > span { color: var(--accent); }
.style-grid button small { color: var(--faint); font-size: 11px; font-weight: 400; }
.style-preview { width: 90px; max-width: 100%; height: 44px; }
.style-grid button.is-active::after { content: ""; position: absolute; top: 8px; right: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.projection-icon--globe { width: 25px; height: 21px; border-radius: 48% 48% 34% 34%; background: radial-gradient(circle, currentColor 0 8%, transparent 9% 34%, currentColor 35% 39%, transparent 40%); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin: 8px 0 12px; padding: 4px; border-radius: var(--radius); background: var(--field); }
.segmented button { padding: 7px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.segmented button:hover { color: var(--ink); }
.segmented button.is-active { color: var(--ink); background: var(--panel); box-shadow: 0 1px 3px rgba(28,39,64,.12), 0 0 0 1px rgba(28,39,64,.04); font-weight: 600; }
.segmented--sub { margin: 0 0 8px; }
.segmented--inline { display: inline-grid; grid-auto-flow: column; grid-template-columns: none; margin: 0; }
.segmented--inline button { padding: 5px 11px; }
.sub-options { padding: 0 0 4px 12px; border-left: 2px solid var(--line-soft); margin: 0 0 6px; }
.sub-options .range-row { margin-top: 6px; }
.shape-picker { display: flex; gap: 3px; padding: 4px; border-radius: var(--radius); background: var(--field); }
.shape-picker button { display: grid; place-items: center; width: 32px; height: 26px; border: 0; border-radius: 7px; color: var(--faint); background: transparent; cursor: pointer; }
.shape-picker button svg { width: 16px; height: 16px; fill: currentColor; }
.shape-picker button:hover { color: var(--ink); }
.shape-picker button.is-active { color: var(--accent); background: var(--panel); box-shadow: 0 1px 3px rgba(28,39,64,.12), 0 0 0 1px rgba(28,39,64,.04); }
.theme-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 4px; }
.theme-picker button { display: grid; gap: 6px; padding: 6px 6px 7px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--text-soft); background: var(--panel); font-size: 11.5px; font-weight: 500; text-align: left; cursor: pointer; }
.theme-picker button:hover { color: var(--ink); border-color: #c5cddc; }
.theme-picker button.is-active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.theme-swatch { position: relative; display: block; height: 26px; overflow: hidden; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(28,39,64,.1); }
.theme-swatch i { position: absolute; top: 5px; bottom: 5px; left: 6px; right: 16px; border-radius: 3px; }
.theme-swatch b { position: absolute; top: 9px; right: 6px; width: 8px; height: 8px; border-radius: 50%; }
/* Project colours (and the screen eyedropper) under a focused HEX field. */
.palette-pop { position: fixed; z-index: 90; display: flex; flex-wrap: wrap; gap: 6px; width: 212px; padding: 8px; border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-pop); }
.palette-pop__title { width: 100%; color: var(--faint); font-size: 11px; }
.palette-pop button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(28,39,64,.18); cursor: pointer; }
.palette-pop button:hover { transform: scale(1.1); }
.palette-pop .palette-pop__pick { display: grid; place-items: center; color: var(--text-soft); background: var(--field); }
.palette-pop__pick svg { width: 14px; height: 14px; }
.microcopy { margin: 8px 0 0; color: var(--faint); font-size: 11.5px; line-height: 1.45; }
.route-order { list-style: none; padding: 0; margin: 12px 0 0; max-height: 220px; overflow-y: auto; }
.route-order li { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--line-soft); }
.route-order li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.route-order button { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); cursor: pointer; }
.route-order button:disabled { opacity: .3; cursor: default; }
.scope-switch { flex: 0 0 auto; margin: 0 0 14px; }
.control-subheading { margin: 18px 0 8px; color: var(--text-soft); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.control-subheading:first-child { margin-top: 2px; }
.object-meta:empty { display: none; }
#city-labels-hint { margin: 6px 0 2px; }
.projection-help { min-height: 23px; }
.control-section:last-of-type { border-bottom: 1px solid var(--line); }

/* Too narrow for both in one row: the pick bar drops under the projection switch. */
@media (max-width: 1320px) {
  .selection-bar { left: auto; right: 24px; top: 68px; }
}

@media (max-width: 1100px) {
  .workspace { grid-template-columns: 250px minmax(0, 1fr) 296px; }
    .canvas-viewport { inset-inline: 24px; }
  .stage-toolbar { left: 50%; right: auto; transform: translateX(-50%); }
  .selection-bar { left: 50%; right: auto; top: 68px; transform: translateX(-50%); }
  .status-bar { display: none !important; }
  .library { padding-inline: 16px; }
  .inspector .panel-head, .section-toggle, .section-body__inner { padding-inline: 16px; }
}

@media (max-width: 1000px) {
    .mobile-panel-toggle { display: inline-grid; place-items: center; }
  .history-buttons { margin-right: 0; padding-right: 6px; }
  .onboarding { left: 12px; right: 12px; width: auto; bottom: 72px; }
  .workspace { display: block; }
  .stage { height: 100%; }
  .panel-column { position: fixed; z-index: 60; top: 72px; bottom: 0; height: calc(100dvh - 72px); width: min(88vw, 330px); overflow-y: auto; touch-action: pan-y; box-shadow: var(--shadow-pop); transition: transform .22s ease; }
  .library { left: 0; transform: translateX(-105%); }
  .inspector { right: 0; transform: translateX(105%); }
  .panel-column.is-open { transform: translateX(0); }
  .close-mobile { display: grid; place-items: center; }
  .canvas-viewport { inset-inline: 14px; }
  .artboard { width: 100%; }
  .status-bar { display: none; }
}

@media (max-width: 520px) {
  .app-shell { grid-template-rows: 64px minmax(0, 1fr); }
  .topbar { height: 64px; }
  .panel-column { top: 64px; height: calc(100dvh - 64px); }
  .topbar { padding-inline: 14px 10px; }
  .button--ghost { display: none; }
  .button__label { display: none; }
  .button { padding: 0 12px; }
  .brand .brand-full { display: none; }
  .brand .brand-symbol { display: block; }
  .stage-toolbar { top: 10px; }
  .selection-bar { top: 60px; padding-left: 10px; gap: 6px; }
  .help-popover { position: fixed; left: 10px; right: 10px; top: 60px; width: auto; }
  .selection-bar .hex-input { width: 58px; }
  .view-switch button { padding: 8px 9px; gap: 5px; }
  .history-buttons { gap: 0; padding-right: 2px; border-right: 0; }
  .top-actions { gap: 4px; }
  .canvas-viewport { inset: 72px 16px 76px; }
  }
