/* Map group: IsraelMapCanvas, RegionInspectorCard, CausalTooltipManager, SpotlightTutorialOverlay. */

/* IsraelMapCanvas (240,52)-(1680,994). Paper map sheet background (theme application; the
 * Godot Control has no background). */
.map-selection.map-selection-pulse path {
  animation: map-sel-pulse 1.1s ease-out;
}
@keyframes map-sel-pulse {
  0% { stroke-width: 3; stroke-opacity: 1; }
  100% { stroke-width: 2; stroke-opacity: 0.85; }
}
.region-inspector-shifted { border-color: var(--amber); }

.map-canvas { overflow: hidden; background: #CBD8D5; }
.map-svg { position: absolute; left: 0; top: 0; display: block; cursor: default; touch-action: none; user-select: none; }
.map-svg.panning { cursor: grabbing; }
.map-svg text { font-family: var(--font-title); pointer-events: none; }
.map-region-fill { cursor: pointer; }
.map-region-fill:hover { filter: brightness(1.06) saturate(1.1); }
/* Paper grain + vignette over the whole sheet (static image, multiply). */
.map-grain {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply;
  background-image:
    radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 58%, rgba(70, 50, 25, 0.16) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.27  0 0 0 0 0.16  0 0 0 0.16 0'/></filter><rect width='300' height='300' filter='url(%23n)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='m'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='3' seed='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.45  0 0 0 0 0.36  0 0 0 0 0.22  0 0 0 0.22 -0.04'/></filter><rect width='600' height='600' filter='url(%23m)'/></svg>");
}

/* Labels (screen-space, paper halo via paint-order). */
.map-label text { paint-order: stroke; stroke-linejoin: round; }
.map-region-name {
  font-size: 13px; font-weight: 700; letter-spacing: 0.12em; fill: #1E1C1A;
  stroke: #F4EFE6; stroke-width: 3.2px; stroke-opacity: 0.92;
}
.map-region-metric {
  font-family: var(--font-ui); font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  fill: #2B2218; stroke: #FAF5EB; stroke-width: 3px; stroke-opacity: 0.94;
}
.map-label-region text { pointer-events: auto; cursor: pointer; }
.map-label-region.big .map-region-name { font-size: 17px; letter-spacing: 0.4em; }
.map-label-region.big .map-region-metric { font-size: 11.5px; }
.map-label-region.selected .map-region-name { fill: #7A4E08; }
.map-label-region.selected .map-region-metric { fill: #7A4E08; }
.map-leader { stroke: #1E1C1A; stroke-width: 0.7; stroke-opacity: 0.8; }
.map-leader-dot { fill: #1E1C1A; }
.map-country-zh {
  font-size: 19px; letter-spacing: 0.55em; fill: #5E4C36; stroke: #E9DFC8; stroke-width: 3px; stroke-opacity: 0.8;
}
.map-country-en {
  font-size: 9.5px; letter-spacing: 0.42em; fill: #6E5B42; font-variant: small-caps;
  stroke: #E9DFC8; stroke-width: 2.5px; stroke-opacity: 0.8;
}
.map-sea-zh { font-size: 30px; font-style: italic; letter-spacing: 0.9em; fill: #3F5E64; fill-opacity: 0.85; stroke: #CBD8D5; stroke-width: 4px; }
.map-sea-en { font-size: 11px; font-style: italic; letter-spacing: 0.55em; fill: #3F5E64; fill-opacity: 0.85; stroke: #CBD8D5; stroke-width: 3px; }
.map-sea-mid { font-size: 20px; font-style: italic; letter-spacing: 0.6em; fill: #3F5E64; fill-opacity: 0.85; stroke: #CBD8D5; stroke-width: 3px; }
.map-sea-small { font-size: 12px; font-style: italic; letter-spacing: 0.15em; fill: #3F5E64; stroke: #CBD8D5; stroke-width: 3px; }
.map-lake { font-size: 10.5px; font-style: italic; fill: #2F5463; stroke: #E9DFC8; stroke-width: 2.6px; stroke-opacity: 0.9; }

/* Pins. */
.map-pin { cursor: help; }
.map-pin-halo { fill: #F4EFE6; fill-opacity: 0.75; }
.map-pin-dot { stroke: #1E1C1A; stroke-width: 1.1; }
.map-pin:hover .map-pin-dot { stroke-width: 1.8; }

/* Sheet ornaments. */
.map-deg { font-size: 10px; font-style: italic; fill: #2E2924; paint-order: stroke; stroke: #F2EADB; stroke-width: 2.5px; }
.map-compass-n { font-size: 17px; font-weight: 700; fill: #2E2924; }
.map-compass-zh { font-size: 10px; fill: #2E2924; }
.map-cartouche-title { font-size: 22px; font-weight: 700; letter-spacing: 0.14em; fill: #1E1C1A; }
.map-cartouche-sub { font-size: 9.5px; letter-spacing: 0.3em; fill: #3A332B; font-style: italic; }
.map-cartouche-sub2 { font-size: 10px; letter-spacing: 0.25em; fill: #3A332B; }
.map-scale-num, .map-scale-unit { font-size: 10px; fill: #2E2924; }

/* Zoom controls (bottom-left, inside the neat line). */
.map-zoom-controls { position: absolute; left: 22px; bottom: 20px; display: flex; gap: 6px; z-index: 12; }
.map-zoom-btn.btn {
  background: #F2EADB; font-family: var(--font-title); font-size: 18px; line-height: 24px;
  min-width: 38px; min-height: 34px; padding: 4px 10px; box-shadow: inset 0 0 0 2px #F2EADB, inset 0 0 0 3px rgba(30, 28, 26, 0.5);
}
.map-focus-btn.btn { font-size: 13.5px; font-weight: 600; letter-spacing: 0.08em; padding: 4px 12px; }

.map-legend {
  position: absolute; right: 304px; top: 16px; pointer-events: none;
  background: #F2EADB; border: 1px solid var(--ink); padding: 7px 12px 8px;
  font-family: var(--font-ui);
  box-shadow: inset 0 0 0 2px #F2EADB, inset 0 0 0 3px rgba(30, 28, 26, 0.5);
  display: flex; flex-direction: column; gap: 4px; max-width: 470px; z-index: 14;
}
.map-legend-head {
  font-family: var(--font-title); font-size: 14px; font-weight: 700; letter-spacing: 0.06em; color: var(--ink);
}
.map-legend-sub {
  font-size: 11.5px; color: #4A3F33; line-height: 1.3;
}
.map-legend-swatches {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 1px;
}
.map-legend-item {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink); padding: 0 2px;
}
.map-legend-swatch {
  width: 11px; height: 11px; border: 1px solid rgba(0, 0, 0, 0.38); flex: 0 0 auto;
}
.map-legend-label {
  white-space: nowrap;
}

/* RegionInspectorCard: floating card anchored to right edge. */
.region-inspector {
  padding: 10px 12px 12px; z-index: 20;
  box-shadow: 0 2px 6px rgba(30, 28, 26, 0.25);
}
.region-inspector-box { width: 100%; }
.region-inspector-title { font-family: var(--font-title); font-weight: 700; padding-right: 28px; white-space: pre-wrap; }
.region-inspector .region-metric { color: var(--blue); cursor: pointer; text-decoration: underline dotted; }
.region-inspector .region-metric:hover { color: var(--amber); }
.region-inspector .option-button { width: 100%; }
.region-inspector-close { position: absolute; right: 6px; top: 6px; padding: 2px 9px; line-height: 22px; font-size: 18px; }

/* CausalTooltipManager (980,80), 300 wide; container ignores the mouse, cards do not. */
.causal-tooltips { pointer-events: none !important; }
.causal-tooltip { pointer-events: auto; padding: 8px 10px; box-shadow: 0 2px 6px rgba(30, 28, 26, 0.25); }
.causal-tooltip.locked { border: 2px solid #C89D54; }
.causal-tooltip-head { align-items: center; }
.causal-tooltip-lockline { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.causal-tooltip-btn { font-size: 12.5px !important; padding: 3px 9px !important; line-height: 20px !important; min-height: 26px; }
.causal-tooltip-body { margin: 3px 0 5px; font-variant-numeric: tabular-nums; }
.causal-tooltip .sparkline { display: block; }

/* SpotlightTutorialOverlay: Detailed 10-step Cabinet Secretariat Onboarding Dossier. */
.onboarding-overlay {
  width: 560px !important;
  height: auto !important;
  max-height: calc(var(--stage-h, 1080px) - 136px);
  padding: 12px 14px 12px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 6px 22px rgba(30, 28, 26, 0.35);
  z-index: 65;
}
.onboarding-box {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.onboarding-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(30, 28, 26, 0.3);
}
.onboarding-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.onboarding-stamp {
  font-family: var(--font-title);
  font-size: 12.5px;
  font-weight: 700;
  color: #8A5A0C;
  background: #FDF3DF;
  border: 1px solid var(--amber);
  padding: 1px 7px;
  letter-spacing: 0.04em;
}
.onboarding-phase {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.onboarding-hdr-ctrls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
button.btn.onboarding-ctrl-btn {
  padding: 2px 8px;
  font-size: 11.5px !important;
  min-height: 24px;
}
.onboarding-step-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
button.btn.onboarding-step-pill {
  padding: 3px 4px;
  font-size: 11.5px !important;
  min-height: 25px;
  text-align: center;
  border: 1px solid rgba(30, 28, 26, 0.38);
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
button.btn.onboarding-step-pill.done {
  background: var(--paper-2);
  color: var(--ink);
}
button.btn.onboarding-step-pill.active {
  background: var(--blue);
  color: var(--paper);
  border-color: var(--blue);
  font-weight: 700;
}
.onboarding-body {
  font-family: var(--font-title);
  font-size: 16.5px !important;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
  padding: 2px 0;
}
.onboarding-detail-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 2px;
}
.onboarding-sec {
  padding: 6px 9px;
  border: 1px solid rgba(30, 28, 26, 0.38);
  background: #FAF6EE;
}
.onboarding-sec-title {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(30, 28, 26, 0.2);
}
.onboarding-sec-text {
  font-size: 12.5px;
  line-height: 1.48;
  color: var(--ink);
  white-space: pre-wrap;
}
.onboarding-demo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}
button.btn.onboarding-demo-btn {
  padding: 4px 10px;
  font-size: 12.5px !important;
  min-height: 29px;
}
button.btn.onboarding-demo-btn.primary { background: #F2E3C4; border-color: var(--amber); font-weight: 600; }
.onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(30, 28, 26, 0.25);
  flex-wrap: wrap;
}
.onboarding-optout-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.onboarding-optout-check {
  cursor: pointer;
}
.onboarding-buttons {
  justify-content: flex-end;
  gap: 6px;
  margin-left: auto;
}
button.btn.onboarding-nav-btn {
  padding: 4px 12px;
  font-size: 13px !important;
  min-height: 31px;
}
button.btn.onboarding-next-btn { font-weight: 700; }
.onboarding-spotlight {
  pointer-events: none !important;
  border: 3px solid var(--amber);
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgba(244, 239, 230, 0.7), 0 0 14px rgba(200, 138, 30, 0.6);
}
html.layout-compact .onboarding-spotlight {
  display: none !important;
}
.onboarding-spot-badge {
  background: #FDF3DF;
  color: #8A5A0C;
  border: 1px solid var(--amber);
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 1.4;
  padding: 4px 8px;
}
