@media (max-width: 380px) {
  .adg-hd { --adg-gutter: 10px; gap: 8px; }
  .adg-hd-right { gap: 8px; }
  .adg-hd-name { font-size: 14px; }
}

.party-record-point {
  fill: #e8b04b;
  fill-opacity: .68;
  stroke: #071015;
  stroke-width: .8;
}

.truthful-legend .legend-text {
  font-size: 12px;
}

.share-fallback {
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid var(--gold);
  border-radius: 4px;
  background: #07151d;
  color: var(--text);
  font-size: 12px;
}

/* ── Layout fixes (2026-09-26) ────────────────────────────────────────────── */

/* Toolbar: collapse grid to single column when brand/copy are hidden by
   adg-header-host.css, so the buttons are not pushed off-screen. */
.studio-header {
  grid-template-columns: 1fr !important;
  justify-content: flex-start !important;
}

/* Map dimensions: constrain map-wrap so the SVG viewBox cannot create a
   height feedback loop. The SVG reads clientHeight, which must be bounded. */
#map-wrap {
  max-height: calc(100vh - 260px);
  overflow: hidden;
}

/* Hide the old studio-footer — the estate footer carries the same content. */
.studio-footer { display: none; }

/* The poster heading eats too much vertical space in hero composition;
   tighten it so the map is visible above the fold. */
.poster-heading {
  padding: 18px 20px 12px;
}
#headline-metric {
  font-size: clamp(48px, 7vw, 80px);
  line-height: 1;
}

/* ── Light mode: triggered by the estate header theme toggle ──────── */
html[data-theme="light"] {
  color-scheme: light;
  --ink: #f5f7fa;
  --panel: #ffffff;
  --line: #e2e6ea;
  --muted: #6A6354; /* canon text_bone_m: 5.5:1 on the light grounds (was 4.0) */
  --text: #1a2b32;
  --gold: #b8912e;
  --cyan: #1a8a94;
}
html[data-theme="light"] body {
  background: linear-gradient(180deg, #f0f2f5 0%, #ffffff 50%, #f5f7fa 100%);
  color: var(--text);
}
html[data-theme="light"] .studio-header {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(18px);
  border-color: var(--line);
}
html[data-theme="light"] .builder-panel {
  background: rgba(255,255,255,.95);
  border-color: var(--line);
}
html[data-theme="light"] .map-stage {
  background: rgba(248,250,252,.95);
  border-color: var(--line);
}
html[data-theme="light"] .field {
  background: #f5f7fa;
  border-color: var(--line);
  color: var(--text);
}
html[data-theme="light"] .button {
  border-color: var(--line);
  color: var(--text);
}
html[data-theme="light"] .button:hover,
html[data-theme="light"] .button:focus-visible {
  border-color: var(--gold);
}
html[data-theme="light"] .button-primary {
  background: var(--gold);
  color: #0C0F17; /* canon ink on brass: 6.5:1 (white was 2.9) */
  border-color: var(--gold);
}
html[data-theme="light"] .button-export {
  background: #eef5f7;
  border-color: #d0dce0;
}
html[data-theme="light"] .stage-topline {
  border-color: var(--line);
}
html[data-theme="light"] .stage-caption {
  border-color: var(--line);
}
html[data-theme="light"] #map-wrap {
  background: radial-gradient(circle at 48% 45%, rgba(200,230,225,.25), transparent 44%);
}
html[data-theme="light"] .context-country {
  fill: #e8eff2;
  stroke: #c8d5da;
}
html[data-theme="light"] .focus-country {
  stroke: #ffffff;
}
html[data-theme="light"] .map-label {
  fill: #2a3d42;
  stroke: #ffffff;
}
html[data-theme="light"] .map-title {
  fill: var(--text);
}
html[data-theme="light"] .map-subtitle {
  fill: var(--muted);
}
html[data-theme="light"] .legend-box {
  fill: rgba(255,255,255,.95);
  stroke: var(--line);
}
html[data-theme="light"] .legend-text {
  fill: var(--text);
}
html[data-theme="light"] .network-edge {
  stroke: var(--gold);
}
html[data-theme="light"] .network-node {
  stroke: #ffffff;
  fill: var(--cyan);
}
html[data-theme="light"] .studio-footer {
  color: var(--muted);
}

/* ── Accessibility floor (QA gate, 2026-10-18) ─────────────────────────
   Small gold text on the light grounds reads at 2.7-2.9:1; it takes the
   canon text_bone_2 instead. Footer links get a 24 px target. */
html[data-theme="light"] .mode-select-kicker,
html[data-theme="light"] .mode-option-name { color: #4A4538; }
/* The map caption band stays dark (#081118) in the light theme: its title takes canon bone. */
html[data-theme="light"] .stage-caption strong { color: #F4EFE6; }
.adg-x-map-studio-10.adg-x-map-studio-10 { display: inline-block; min-height: 24px; line-height: 24px; }
