/* Customize page — dark, refined editor chrome (map styling lives in dist/krackedmaps.css). */
:root {
  --bg: #0a0a0c;        /* page */
  --side: #0d0d10;      /* sidebar */
  --row: rgba(255,255,255,.04);
  --row-hi: rgba(255,255,255,.07);
  --bd: rgba(255,255,255,.07);
  --bd2: rgba(255,255,255,.11);
  --fg: #e6e7ea;
  --muted: #74777f;
  --faint: #4a4d55;
  --amber: #e0a435;     /* the < > brackets */
  --name: #d4d7db;
  --pill: rgba(12,12,15,.62);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, "Cascadia Code", monospace;
  --focus: #4aa3ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
body {
  display: grid; grid-template-columns: 284px 1fr; height: 100vh;
  background: var(--bg); color: var(--fg); font-family: var(--font); overflow: hidden;
  transition: grid-template-columns .32s cubic-bezier(.4,0,.2,1);
}
/* globe mode: hide the flat-map-only controls (textures, district/static toggles) */
body.is-globe #sec-texture, body.is-globe #textures, body.is-globe #modes { display: none; }
/* …and drop the rectangular canvas frame — it reads as a stray white box around the
   round globe (flat country maps keep the frame). */
body.is-globe #canvas { border-color: transparent; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5;
      stroke-linecap: round; stroke-linejoin: round; }

/* ---------- sidebar ---------- */
#sidebar { background: var(--side); border-right: 1px solid var(--bd); display: flex; flex-direction: column; min-height: 0; position: relative;
  /* min-width keeps the panel a fixed 284px so it slides (not squishes) as the grid
     column animates to 0; it also stays full-width on mobile (1fr ≥ 284). */
  min-width: 284px; transition: transform .32s cubic-bezier(.4,0,.2,1), visibility 0s; will-change: transform; }

/* ---------- country selector ---------- */
#country-pick { display: flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--bd2);
  color: var(--fg); border-radius: 8px; padding: 6px 10px; cursor: pointer; font: 700 13px var(--font); }
#country-pick:hover { background: var(--row-hi); border-color: var(--focus); }
#country-pick svg { width: 12px; height: 12px; opacity: .6; }
#country-picker { display: none; position: absolute; top: 92px; left: 12px; right: 12px; z-index: 20;
  max-height: 52vh; flex-direction: column; background: var(--side); border: 1px solid var(--bd2);
  border-radius: 10px; overflow: hidden; box-shadow: 0 14px 36px rgba(0,0,0,.5); }
#country-picker.open { display: flex; }
#csearch { border: 0; border-bottom: 1px solid var(--bd); background: transparent; color: var(--fg);
  padding: 10px 12px; font: 13px var(--font); outline: none; }
#csearch::placeholder { color: var(--muted); }
#clist { overflow-y: auto; padding: 5px; }
.cc { padding: 7px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--name); }
.cc:hover { background: var(--row-hi); color: var(--fg); }
.cc.on { color: var(--focus); font-weight: 600; }

#brand { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--bd); }
.brand-row { display: flex; align-items: center; gap: 10px; }
#brand .logo { width: 22px; height: 22px; display: block; border-radius: 6px; }
.brand-id { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
#brand .wordmark { font-size: 13px; font-weight: 700; letter-spacing: .4px; color: var(--fg); }
.brand-npm { font: 11px var(--mono); color: var(--faint); text-decoration: none; white-space: nowrap; }
.brand-npm:hover { color: var(--muted); }
#brand .spacer { flex: 1; }

.icon-btn { position: relative; display: grid; place-items: center; width: 28px; height: 28px; padding: 0;
  color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 7px; cursor: pointer; }
.icon-btn::before { content: ""; position: absolute; inset: -8px; }  /* 44px hit target, visual unchanged */
.icon-btn:hover { color: var(--fg); background: var(--row); border-color: var(--bd); }
.icon-btn:active { transform: translateY(1px); }

#scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 12px 16px; }
.sec { margin: 14px 4px 8px; font-size: 10.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--faint); }
.sec:first-child { margin-top: 2px; }

/* boxed groups — each section sits in its own distinct card */
.card { background: var(--row); border: 1px solid var(--bd); border-radius: 10px; padding: 6px 9px 8px; margin: 0 2px 10px; }
.card .subsec { margin: 4px 2px 7px; }
.card .row { padding: 3px 2px; }

/* preset swatches — boxed, just the colours */
.layer-list { display: flex; flex-wrap: wrap; gap: 9px; padding: 10px; margin: 0 2px;
  background: var(--row); border: 1px solid var(--bd); border-radius: 10px; }
.swatch { width: 38px; height: 38px; padding: 0; border-radius: 8px; cursor: pointer;
  background-color: #1a1a1e; background-size: cover;
  border: 1px solid var(--bd2); transition: transform .08s ease; }
.swatch:hover { transform: translateY(-1px); }
.swatch:active { transform: translateY(0); }
.swatch.active { box-shadow: 0 0 0 2px var(--side), 0 0 0 3px var(--fg); }

/* texture preview swatches */
.tex-swatch { background-color: #1c1c20; }
.tex-none  { background-image: linear-gradient(135deg, transparent 45%, #6a6d75 45% 55%, transparent 55%); }
.tex-dots  { background-image: radial-gradient(#8a8d95 1px, transparent 1.6px); background-size: 7px 7px; }
.tex-lines { background-image: repeating-linear-gradient(45deg, #8a8d95 0 1px, transparent 1px 6px); }
.tex-cross { background-image: repeating-linear-gradient(45deg, #8a8d95 0 1px, transparent 1px 6px), repeating-linear-gradient(-45deg, #8a8d95 0 1px, transparent 1px 6px); }
.tex-grid  { background-image: repeating-linear-gradient(0deg, #8a8d95 0 1px, transparent 1px 8px), repeating-linear-gradient(90deg, #8a8d95 0 1px, transparent 1px 8px); }

.builder-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 2px 12px; }
.builder-btn { display: flex; align-items: center; gap: 8px; min-width: 0; height: 38px; padding: 0 10px;
  color: var(--muted); background: var(--row); border: 1px solid var(--bd); border-radius: 8px;
  cursor: pointer; font: 650 12px var(--font); text-align: left; }
.builder-btn svg { width: 15px; height: 15px; flex: none; }
.builder-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.builder-btn:hover { color: var(--fg); background: var(--row-hi); border-color: var(--bd2); }
.builder-btn:active { transform: translateY(1px); }
.builder-btn.wide { grid-column: 1 / -1; justify-content: center; color: var(--fg); border-color: rgba(95,208,255,.24); }

/* sub-group headers + reset link inside the Colors panel */
.subsec { margin: 12px 6px 4px; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--faint); }
.subsec:first-child { margin-top: 4px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; }
.mini { all: unset; position: relative; cursor: pointer; font-size: 10px; letter-spacing: .4px; color: var(--muted); padding: 7px 8px; border-radius: 5px; }
.mini:hover { color: var(--fg); background: var(--row); }

/* color / range rows */
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 6px; font-size: 12.5px; }
.row label { color: var(--muted); }
.row-right { display: flex; align-items: center; gap: 9px; }
.readout { font: 11px var(--mono); color: var(--faint); min-width: 22px; text-align: right; }
/* colour swatch button — opens the dark in-app picker (same square style as presets) */
.cp-swatch { width: 38px; height: 38px; padding: 0; border: 1px solid var(--bd2); border-radius: 8px;
  cursor: pointer; transition: transform .08s ease; }
.cp-swatch:hover { transform: translateY(-1px); }
.cp-swatch:active { transform: translateY(0); }
.cp-swatch:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* in-app colour picker (dark) */
.cp { position: fixed; z-index: 100; width: 200px; padding: 10px; background: var(--side);
  border: 1px solid var(--bd2); border-radius: 11px; box-shadow: 0 16px 48px rgba(0,0,0,.55); }
.cp[hidden] { display: none; }
.cp-sv { position: relative; height: 130px; border-radius: 7px; cursor: crosshair; touch-action: none;
  background-image: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent); }
.cp-sv-handle { position: absolute; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5); transform: translate(-50%, -50%); pointer-events: none; }
.cp-hue { position: relative; height: 14px; margin-top: 10px; border-radius: 7px; cursor: ew-resize; touch-action: none;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00); }
.cp-hue-handle { position: absolute; top: 50%; width: 6px; height: 20px; border-radius: 3px; background: #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.5); transform: translate(-50%, -50%); pointer-events: none; }
.cp-foot { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.cp-sw { width: 30px; height: 30px; flex: none; border-radius: 7px; border: 1px solid var(--bd2); }
.cp-hex { flex: 1; min-width: 0; font: 12px var(--mono); text-transform: lowercase; color: var(--fg);
  background: #131316; border: 1px solid var(--bd2); border-radius: 7px; padding: 8px 9px; }
.cp-hex:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
/* shader-editor style range: ticked track + thin line handle + boxed value */
.row-range { flex-direction: column; align-items: stretch; gap: 8px; }
.row-range > label { color: var(--muted); }
.row-range .row-right { display: flex; align-items: stretch; gap: 8px; }
.row-range input[type=range] { flex: 1; -webkit-appearance: none; appearance: none; min-width: 0; height: 38px; margin: 0; background: transparent; cursor: ew-resize; touch-action: none; }
.row-range input[type=range]::-webkit-slider-runnable-track { height: 38px; border: 1px solid var(--bd2); border-radius: 8px;
  background: linear-gradient(90deg, #2a2a30 0 var(--pct, 0%), transparent var(--pct, 0%) 100%); }
.row-range input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 22px; height: 30px; margin-top: 3px;
  background: linear-gradient(90deg, transparent 0 10px, var(--fg) 10px 12px, transparent 12px 100%); border: 0; border-radius: 8px; box-shadow: 0 0 6px rgba(255,255,255,.18); }
.row-range input[type=range]::-moz-range-track { height: 38px; border: 1px solid var(--bd2); border-radius: 8px;
  background: linear-gradient(90deg, #2a2a30 0 var(--pct, 0%), transparent var(--pct, 0%) 100%); }
.row-range input[type=range]::-moz-range-thumb { width: 22px; height: 30px; background: linear-gradient(90deg, transparent 0 10px, var(--fg) 10px 12px, transparent 12px 100%); border: 0; border-radius: 8px; }
.row-range .readout { display: grid; place-items: center; width: 54px; min-width: 54px; height: 40px;
  border: 1px solid var(--bd2); border-radius: 8px; background: #131316; color: var(--fg); font: 13px var(--mono); text-align: center; }

/* dock */
.dock { display: flex; align-items: center; gap: 8px; padding: 11px 12px; border-top: 1px solid var(--bd); }
/* Export + Copy code share the row equally and shrink to fit the narrow sidebar */
.dock .export-btn { flex: 1; min-width: 0; justify-content: center; }
.export-btn { display: flex; align-items: center; gap: 7px; font: 600 12.5px var(--font); color: var(--fg);
  background: var(--row-hi); border: 1px solid var(--bd2); border-radius: 8px; padding: 8px 11px; cursor: pointer;
  white-space: nowrap; }
.export-btn svg { flex: none; }
.export-btn:hover { border-color: #4aa3ff66; color: #fff; }
.dock-icons { display: flex; gap: 4px; }
.dock .chev { margin-left: auto; }

/* signature footer */
.sig { display: flex; align-items: center; gap: 7px; padding: 11px 14px 15px;
  border-top: 1px solid var(--bd); font-size: 11.5px; color: var(--faint); text-decoration: none; }
.sig img { height: 18px; width: auto; opacity: .8; }
.sig:hover { color: var(--muted); }
.sig:hover img { opacity: 1; }

/* ---------- setup docs modal ---------- */
.docs-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  padding: 18px; background: rgba(0,0,0,.58); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.docs-modal[hidden] { display: none; }
.docs-panel { position: relative; width: min(640px, 100%); max-height: min(760px, calc(100vh - 36px)); overflow-y: auto;
  background: #101116; border: 1px solid var(--bd2); border-radius: 10px; padding: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,.55); }
.docs-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 30px; height: 30px;
  color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.docs-close:hover { color: var(--fg); background: var(--row); border-color: var(--bd); }
.docs-close svg { width: 16px; height: 16px; }
.docs-kicker { margin: 0 0 7px; color: var(--amber); font: 700 11px var(--mono); letter-spacing: 1px; text-transform: uppercase; }
.docs-panel h2 { margin: 0 36px 18px 0; font-size: 24px; letter-spacing: 0; }
.docs-steps { display: grid; gap: 12px; }
.docs-steps > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 13px; background: var(--row); border: 1px solid var(--bd); border-radius: 8px; }
.docs-steps span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px;
  color: var(--fg); background: rgba(95,208,255,.15); border: 1px solid rgba(95,208,255,.24); font: 700 12px var(--mono); }
.docs-steps p { grid-column: 2; margin: 1px 0 8px; color: var(--name); font-size: 13px; }
.docs-steps pre { margin: 0; overflow-x: auto; padding: 10px; background: #091c38; border: 1px solid rgba(95,208,255,.18);
  grid-column: 2; min-width: 0; border-radius: 7px; color: #d8ecff; font: 11.5px/1.55 var(--mono); }
.docs-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.docs-copy, .docs-actions a { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 13px;
  border-radius: 8px; font: 700 12px var(--font); text-decoration: none; cursor: pointer; }
.docs-copy { color: var(--fg); background: var(--row-hi); border: 1px solid rgba(95,208,255,.28); }
.docs-actions a { color: var(--muted); border: 1px solid var(--bd); }
.docs-copy:hover, .docs-actions a:hover { color: var(--fg); border-color: var(--bd2); }

/* ---------- main canvas ---------- */
/* instant colour feedback while theming — drop the fill fade so the tiles
   recolour in sync with the background (keeps the drill opacity animations) */
#map .state { transition: opacity .24s ease, transform .28s ease; }
#map .district { transition: opacity .35s ease; }

#stage { position: relative; padding: 14px; transition: padding .32s cubic-bezier(.4,0,.2,1); }
#canvas { position: absolute; inset: 14px; border: 1px solid var(--bd2); border-radius: 12px; overflow: hidden;
  transition: inset .32s cubic-bezier(.4,0,.2,1), border-radius .32s cubic-bezier(.4,0,.2,1); }
#map { position: absolute; inset: 0; }
#map.mmap { width: 100%; height: 100%; aspect-ratio: auto; }
/* the spinning globe: full-screen on the landing, shrinks to a mini locator in the
   top-left corner while a country is open (it keeps spinning). Click it to fly back. */
#globe-host { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 2;
  transition: top .5s cubic-bezier(.5,0,.2,1), left .5s cubic-bezier(.5,0,.2,1),
              width .5s cubic-bezier(.5,0,.2,1), height .5s cubic-bezier(.5,0,.2,1); }
body.drilled #globe-host { top: 12px; left: 12px; width: 132px; height: 132px; z-index: 6; cursor: pointer;
  border-radius: 14px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.45); border: 1px solid var(--pill-bd); }
body.drilled #globe-host .globe { pointer-events: none; }   /* a click hits the host → back to globe */
@media (prefers-reduced-motion: reduce) { #globe-host { transition: none; } }

/* overlay pill palette — flips with the map's lightness (JS sets .map-light).
   On light maps: solid dark pills + white text. On dark maps: readable with a
   light border. */
body { --pill-bg: rgba(10,10,13,.5); --pill-bd: rgba(255,255,255,.16); --pill-fg: #eef0f3; --pill-muted: #b9bcc3; }
body.map-light { --pill-bg: rgba(14,14,18,.92); --pill-bd: rgba(255,255,255,.08); --pill-fg: #ffffff; --pill-muted: #ced1d7; }

/* always present so it can fade; invisible + non-interactive until collapsed */
#reopen { display: grid; opacity: 0; pointer-events: none; position: absolute; top: 18px; left: 18px; z-index: 5;
  width: 30px; height: 30px; padding: 0; place-items: center; color: var(--pill-muted);
  background: var(--pill-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--pill-bd); border-radius: 8px; cursor: pointer;
  transition: opacity .25s ease .12s; }
#reopen:hover { color: var(--pill-fg); }

/* floating overlays (pills) */
.ov { position: absolute; z-index: 4; display: flex; align-items: center;
  background: var(--pill-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--pill-bd); border-radius: 12px; color: var(--pill-muted); font-size: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.22); }
/* top-right tool cluster: modes + zoom read as one row, but remain separate controls */
.ov-zoom { top: 12px; right: 12px; flex-direction: row; padding: 4px; gap: 3px; }
.ov-modes { top: 12px; right: 91px; padding: 4px; gap: 3px; }
.zbtn { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px;
  color: var(--pill-muted); background: transparent; border: 1px solid transparent; cursor: pointer; }
.zbtn:hover { color: var(--pill-fg); background: rgba(255,255,255,.12); }
.zbtn:active { transform: translateY(1px); }
.zbtn svg { width: 16px; height: 16px; }
/* the map SVG scales from its centre for zoom; smooth + clipped by #canvas */
#map .mmap-svg { transform-origin: center; transition: transform .2s ease; }
/* country appears immediately while the globe recedes to the corner */
@keyframes mm-pop { from { opacity: 0; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }
#map .mmap-svg.mm-pop { animation: mm-pop .16s ease-out both; }
@media (prefers-reduced-motion: reduce) { #map .mmap-svg.mm-pop { animation: none; } }
.mode { display: flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border-radius: 8px; cursor: pointer;
  font: 600 12px var(--font); color: var(--pill-muted); background: transparent; border: 1px solid transparent; }
.mode svg { width: 14px; height: 14px; }
.mode:hover { color: var(--pill-fg); background: rgba(255,255,255,.08); }
.mode.on { color: var(--pill-fg); background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.10); }
.mode:disabled { opacity: .42; cursor: not-allowed; }

/* collapsed sidebar — single full-width column (the hidden sidebar leaves the
   grid, so the map must own the only track or it falls into a 0-width one).
   The map goes fullscreen + frameless, so there's no inset canvas border. */
/* grid-template-rows:1fr forces the single row to fill the viewport height — without
   it, #stage (whose only child is the abs-positioned #canvas) has no intrinsic
   height, so a browser that doesn't stretch the implicit row would collapse it and
   leave dark space below the map. */
/* collapse the sidebar column to 0 (the map track grows to fill) and slide the panel
   out to the left — both transition, so it's a smooth mini slide. visibility flips to
   hidden only after the slide finishes (and back to visible instantly on reopen). */
body.collapsed { grid-template-columns: 0 1fr; grid-template-rows: 1fr; }
body.collapsed #sidebar { transform: translateX(-100%); visibility: hidden;
  transition: transform .32s cubic-bezier(.4,0,.2,1), visibility 0s .32s; }
body.collapsed #reopen { opacity: 1; pointer-events: auto; }
/* while a country is open, the mini-globe owns the top-left — drop reopen below it */
body.collapsed.drilled #reopen { top: 156px; left: 12px; }
body.collapsed #stage { padding: 0; }
body.collapsed #canvas { inset: 0; border: 0; border-radius: 0; }
/* respect users who prefer no motion — snap instead of slide */
@media (prefers-reduced-motion: reduce) {
  body, #sidebar, #stage, #canvas, #reopen { transition: none; }
}

/* embed mode: pure map, no chrome */
body.embed { grid-template-columns: 1fr; }
body.embed #sidebar, body.embed .ov, body.embed #reopen { display: none; }
body.embed.drilled #globe-host { display: none; }   /* country embeds: just the country, no mini-globe */
body.embed #stage { padding: 0; }
body.embed #canvas { inset: 0; border: 0; border-radius: 0; }

/* toast */
#toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: #16161a; color: var(--fg); font: 600 12.5px var(--font); padding: 10px 18px;
  border: 1px solid var(--bd2); border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 50; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* mobile: stack canvas over a shorter sidebar */
@media (max-width: 760px) {
  html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
  body { height: 100dvh; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(280px, 52dvh) minmax(0, 48dvh); }
  #stage { order: -1; }
  #sidebar { display: block; min-width: 0; width: 100%; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
    border-right: none; border-top: 1px solid var(--bd); }
  #scroll { flex: none; min-height: auto; overflow: visible; padding: 12px 10px 4px; }
  .layer-list { gap: 7px; padding: 9px; margin: 0; }
  .swatch { width: 34px; height: 34px; border-radius: 8px; }
  .dock { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 10px; padding: 10px 0; gap: 7px;
    border-top: 0; }
  .dock .export-btn { width: 100%; min-height: 38px; padding: 8px 9px; font-size: 12px; }
  .dock-icons { display: none; }
  .sig { padding: 10px 14px 13px; }
  /* the decorative theme-name title collides with the mode toggles on a narrow
     screen — hide it and centre the toggles across the top */
  .ov-title { display: none; }
  .ov-modes { right: auto; left: 50%; transform: translateX(-50%); }
  .mode { padding: 6px 8px; gap: 5px; }
}

/* keyboard focus rings (mouse clicks don't show them); mechanical press feedback */
.swatch:focus-visible, .icon-btn:focus-visible, .mode:focus-visible, .builder-btn:focus-visible,
.docs-close:focus-visible, .docs-copy:focus-visible, .docs-actions a:focus-visible,
.export-btn:focus-visible, .mini:focus-visible, #reopen:focus-visible,
.row input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mode:active, .export-btn:active, #reopen:active { transform: translateY(1px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
