/* Atlas - SE brand */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --dark-purple: #1B1534;
  --purple: #8A00E5;
  --gradient-end: #4D217A;
  --white: #FFFFFF;
  --muted: rgba(255, 255, 255, 0.55);
  --muted-2: rgba(255, 255, 255, 0.35);
  --line: rgba(255, 255, 255, 0.08);

  --tier-mapped: #8A00E5;
  --tier-indexed: #4D217A;
  --tier-watchlist: rgba(255, 255, 255, 0.22);
}

html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--dark-purple);
  color: var(--white);
  display: grid;
  grid-template-rows: 130px 1fr 32px;
}

header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  z-index: 10;
}
.wordmark img { height: 22px; display: block; }
.wordmark img.mark { height: 110px; }
.title { display: flex; align-items: baseline; gap: 0.5rem; color: rgba(255,255,255,0.85); }
.title .product { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; }
.title .divider-dot { color: var(--muted-2); }
.title .subtitle { font-size: 0.85rem; color: var(--muted); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 0.5rem; }
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(138, 0, 229, 0.35);
  color: var(--white);
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}
.btn-ghost:hover {
  border-color: var(--purple);
  background: rgba(138, 0, 229, 0.12);
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--gradient-end));
  border: none;
  color: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(138, 0, 229, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(138, 0, 229, 0.5);
}
.btn-primary:active { transform: translateY(0); }

.config-menu-wrap { position: relative; }
.config-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 0.4rem);
  background: rgba(27, 21, 52, 0.98);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(138, 0, 229, 0.35);
  border-radius: 10px;
  padding: 0.35rem;
  min-width: 380px;
  max-width: 460px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(138,0,229,0.12);
  z-index: 100;
}
.config-menu.hidden { display: none; }
.config-menu .group {
  padding: 0.45rem 0.65rem 0.25rem;
  font-size: 0.65rem;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.config-menu button {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--white);
  text-align: left;
  padding: 0.65rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 0.2rem;
}
.config-menu button:hover {
  background: rgba(138, 0, 229, 0.14);
}
.config-menu button .row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}
.config-menu button .name { font-weight: 600; font-size: 0.88rem; }
.config-menu button .est {
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.config-menu button .desc {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.25rem;
  line-height: 1.4;
}
.config-menu button.destructive .name { color: #ffb38a; }
.config-menu button.destructive:hover { background: rgba(255, 120, 50, 0.12); }
.config-menu .divider-h {
  height: 1px;
  background: rgba(255,255,255,0.07);
  margin: 0.2rem 0.5rem;
}
.job-status {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 120px;
  text-align: right;
}
.compare-badge {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.25rem 0.6rem;
  background: rgba(255,181,76,0.08);
  border: 1px solid rgba(255,181,76,0.25);
  border-radius: 999px;
}
.compare-badge:empty { display: none; }
.compare-badge b { color: #FFCD82; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem 0.35rem 0.8rem;
  background: rgba(138,0,229,0.08);
  border: 1px solid rgba(138,0,229,0.28);
  border-radius: 999px;
  font-size: 0.78rem;
}
.user-chip:empty { display: none; }
.user-chip .u-name { font-weight: 600; }
.user-chip .u-role {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  background: rgba(138,0,229,0.35);
  color: var(--white);
}
.user-chip .logout {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 1rem; padding: 0.1rem 0.3rem;
  border-radius: 3px;
}
.user-chip .logout:hover { color: var(--white); background: rgba(255,255,255,0.08); }

/* Modal */
.modal { position: fixed; inset: 0; display: grid; place-items: center; z-index: 1000; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(4px); }
.modal-body {
  position: relative;
  background: rgba(27,21,52,0.98);
  border: 1px solid rgba(138,0,229,0.35);
  border-radius: 14px;
  padding: 1.5rem;
  width: min(620px, 95vw);
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
}
.modal-body h2 { font-weight: 400; margin-bottom: 1rem; }
.modal-body .close {
  position: absolute; top: 0.8rem; right: 0.8rem;
  background: transparent; border: none; color: var(--muted);
  font-size: 1.3rem; cursor: pointer;
}
.modal-body table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.modal-body th { text-align: left; padding: 0.45rem 0.4rem; color: var(--muted-2); font-weight: 500; font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid rgba(255,255,255,0.08); }
.modal-body td { padding: 0.55rem 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.04); vertical-align: middle; }
.modal-body .role-pill { font-size: 0.65rem; padding: 0.1rem 0.5rem; border-radius: 3px; background: rgba(138,0,229,0.25); text-transform: uppercase; letter-spacing: 0.06em; }
.modal-body .role-pill.user { background: rgba(255,255,255,0.08); color: var(--muted); }
.modal-body .icon-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 0.3rem 0.5rem; border-radius: 4px; }
.modal-body .icon-btn:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.modal-body .form-row { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 0.5rem; margin-top: 1rem; align-items: end; }
/* Scope only to real text-style inputs so checkboxes / radios stay native-small */
.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body input[type="number"],
.modal-body input[type="email"],
.modal-body input[type="search"],
.modal-body input:not([type]),
.modal-body select {
  padding: 0.5rem 0.7rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(138,0,229,0.2);
  border-radius: 6px;
  color: var(--white);
  font-size: 0.85rem;
  width: 100%;
}
.modal-body input[type="text"]:focus,
.modal-body input[type="password"]:focus,
.modal-body input[type="number"]:focus,
.modal-body input[type="email"]:focus,
.modal-body input[type="search"]:focus,
.modal-body input:not([type]):focus,
.modal-body select:focus {
  outline: none; border-color: var(--purple);
  background: rgba(138,0,229,0.08);
}
.modal-body input[type="checkbox"],
.modal-body input[type="radio"] {
  accent-color: var(--purple);
  width: auto;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}
/* Block-level form labels stay uppercase-small ONLY if they're top-level.
   Inline labels (wrapping a checkbox + text) opt out via normal-text rules. */
.modal-body > label,
.modal-body .form-row > div > label {
  font-size: 0.65rem; color: var(--muted-2);
  text-transform: uppercase; letter-spacing: 0.06em;
  display: block; margin-bottom: 0.2rem;
}
.modal-body .primary-btn {
  padding: 0.55rem 1rem;
  background: linear-gradient(135deg, var(--purple), var(--gradient-end));
  border: none;
  border-radius: 6px;
  color: white;
  font-weight: 600;
  cursor: pointer;
}

main {
  display: grid;
  grid-template-columns: 360px 1fr 52px;
  overflow: hidden;
  transition: grid-template-columns 0.24s ease;
}
main.dock-open {
  grid-template-columns: 360px 1fr 412px;
}

aside#sidebar {
  background: rgba(0, 0, 0, 0.35);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  padding: 1.5rem 1.25rem;
}
.panel.hidden { display: none; }
.panel-subsection {
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.small-title { font-size: 0.68rem !important; }

/* Horizon list */
.horizon-list .h-row {
  display: block;
  padding: 0.55rem 0.65rem;
  background: rgba(255,181,76,0.06);
  border: 1px solid rgba(255,181,76,0.22);
  border-radius: 6px;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.15s;
}
.horizon-list .h-row:hover {
  background: rgba(255,181,76,0.12);
  border-color: rgba(255,181,76,0.45);
}
.horizon-list .h-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.horizon-list .h-code { font-weight: 600; color: #ffcd82; }
.horizon-list .h-eta { font-size: 0.68rem; color: rgba(255,205,130,0.75); white-space: nowrap; }
.horizon-list .h-title { color: var(--white); margin-top: 0.15rem; }
.horizon-list .h-sub { color: var(--muted-2); font-size: 0.7rem; margin-top: 0.15rem; }

/* Chat */
.chat-log {
  max-height: 320px;
  overflow-y: auto;
  padding: 0.4rem 0.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.chat-log:empty::before {
  content: "Try: \"What does the CRA say about supply chain?\" or \"Does NERC CIP-007 apply to transformers?\"";
  color: var(--muted-2);
  font-size: 0.75rem;
  font-style: italic;
  line-height: 1.5;
}
.chat-msg { padding: 0.55rem 0.7rem; border-radius: 8px; font-size: 0.8rem; line-height: 1.5; }
.chat-msg.user { background: rgba(138,0,229,0.15); border: 1px solid rgba(138,0,229,0.3); align-self: flex-end; max-width: 92%; }
.chat-msg.assistant { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); align-self: flex-start; max-width: 96%; }
.chat-msg.pending { font-style: italic; color: var(--muted); }
.chat-msg .cite {
  font-size: 0.65rem;
  color: var(--purple);
  cursor: pointer;
  padding: 0 0.2rem;
  font-weight: 600;
}
.chat-msg .cite:hover { text-decoration: underline; }
.chat-msg p { margin: 0 0 0.5rem; }
.chat-msg p:last-child { margin-bottom: 0; }
.chat-msg strong { color: var(--white); font-weight: 600; }
.chat-msg em { color: rgba(255,255,255,0.95); font-style: italic; }
.chat-msg code {
  background: rgba(138, 0, 229, 0.18);
  border: 1px solid rgba(138, 0, 229, 0.3);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  font-size: 0.85em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.chat-msg ul.md-list {
  margin: 0.35rem 0 0.5rem 1rem;
  padding: 0;
}
.chat-msg ul.md-list li { margin-bottom: 0.2rem; font-size: 0.8rem; line-height: 1.5; }

.chat-msg .sources {
  margin-top: 0.7rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(138, 0, 229, 0.15);
}
.chat-msg .sources-label {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 0.35rem;
}
.chat-msg .source-card {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.4rem 0.5rem;
  margin-bottom: 0.3rem;
  background: rgba(138, 0, 229, 0.06);
  border: 1px solid rgba(138, 0, 229, 0.18);
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
}
.chat-msg .source-card:hover {
  background: rgba(138, 0, 229, 0.14);
  border-color: rgba(138, 0, 229, 0.4);
}
.chat-msg .source-card .source-n {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--purple);
  font-size: 0.72rem;
  min-width: 22px;
}
.chat-msg .source-card .source-inst {
  color: var(--white);
  font-weight: 600;
  font-size: 0.75rem;
}
.chat-msg .source-card .source-path {
  color: var(--muted-2);
  font-size: 0.68rem;
  line-height: 1.35;
  margin-top: 0.1rem;
}

/* Typing dots indicator */
.typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 1.5em;
}
.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple);
  opacity: 0.4;
  animation: typingDot 1.3s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typingDot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-3px); }
}
.chat-form {
  display: flex;
  gap: 0.4rem;
}
.chat-form input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(138,0,229,0.25);
  border-radius: 6px;
  color: var(--white);
  font-size: 0.85rem;
}
.chat-form input:focus {
  outline: none;
  border-color: var(--purple);
  background: rgba(138,0,229,0.08);
}

/* Preparedness gauge */
.prep-gauge {
  margin: 0.75rem 0;
  padding: 0.8rem 0.9rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(138,0,229,0.2);
  border-radius: 8px;
}
.prep-gauge .prep-label {
  font-size: 0.65rem;
  color: var(--muted-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}
.prep-gauge .prep-value {
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.prep-gauge .prep-sub { font-size: 0.7rem; color: var(--muted); margin-top: 0.15rem; }
.prep-gauge .prep-bar {
  margin-top: 0.6rem;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.prep-gauge .prep-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), #c466ff);
  border-radius: 3px;
  transition: width 0.6s ease;
}
.panel h2 {
  font-weight: 300;
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}
.panel h2 strong { font-weight: 600; color: var(--purple); }
.panel .muted { color: var(--muted); font-size: 0.85rem; line-height: 1.6; }
.panel .small { font-size: 0.75rem; color: var(--muted-2); margin-top: 1rem; }

.divider {
  width: 42px;
  height: 2px;
  background: var(--purple);
  border-radius: 2px;
  margin: 1.5rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.stat {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(138, 0, 229, 0.12);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.stat .n { font-size: 1.5rem; font-weight: 600; color: var(--white); }
.stat .l { font-size: 0.7rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.05em; }

.legend {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}
.legend .sw {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 0.5rem;
  border-radius: 3px;
  vertical-align: -3px;
}
.legend .mapped    { background: var(--tier-mapped); }
.legend .indexed   { background: var(--tier-indexed); }
.legend .watchlist { background: var(--tier-watchlist); }

/* Country panel */
.country-header {
  display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem;
}
.country-header h2 { font-size: 1.4rem; font-weight: 400; }
.country-header .iso3 { color: var(--muted-2); font-family: monospace; font-size: 0.85rem; }
.tier-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(138, 0, 229, 0.15);
  border: 1px solid rgba(138, 0, 229, 0.35);
  color: var(--white);
  margin-bottom: 1rem;
}
.tier-pill.mapped    { background: rgba(138, 0, 229, 0.25); border-color: var(--purple); }
.tier-pill.indexed   { background: rgba(77, 33, 122, 0.35); }
.tier-pill.watchlist { background: rgba(255, 255, 255, 0.06); border-color: rgba(255,255,255,0.15); }

.section-title {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin: 1.5rem 0 0.5rem;
}
.item-list { list-style: none; }
.item-list li {
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  font-size: 0.82rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 0.35rem;
  line-height: 1.4;
}
.item-list li .sub { color: var(--muted-2); font-size: 0.72rem; display: block; margin-top: 0.2rem; }

.back-btn {
  background: none;
  border: none;
  color: var(--purple);
  cursor: pointer;
  font-size: 0.8rem;
  margin-bottom: 0.5rem;
  padding: 0;
}
.back-btn:hover { text-decoration: underline; }

/* Globe container */
#globe-wrap {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 70% 50%, rgba(77, 33, 122, 0.45) 0%, var(--dark-purple) 65%),
    var(--dark-purple);
}
#globe {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

/* Orbital rings - ported from munich-2026 slide 1, scaled to globe viewport */
.orbitals {
  position: absolute;
  width:  min(85vh, 75%);
  height: min(85vh, 75%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  animation: orbitalsIn 2.2s ease-out 0.3s forwards;
}
@keyframes orbitalsIn { to { opacity: 1; } }
.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.orbit--1 { width:100%; height:100%; top:0; left:0; animation: orbitSpin1 28s linear infinite; }
.orbit--2 {
  width:75%; height:75%; top:12.5%; left:12.5%;
  border-style: dashed; border-color: rgba(255,255,255,0.05);
  animation: orbitSpin2 22s linear infinite reverse;
}
.orbit--3 {
  width:50%; height:50%; top:25%; left:25%;
  border-color: rgba(138, 0, 229, 0.14);
  animation: orbitSpin1 16s linear infinite;
}
.orbit--arc {
  width:112%; height:82%; top:9%; left:-6%;
  border-color: transparent;
  border-top-color: rgba(0, 210, 210, 0.18);
  border-right-color: rgba(0, 210, 210, 0.08);
  animation: orbitSpin2 32s linear infinite;
}
.orbit-dot {
  position: absolute;
  width:6px; height:6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  box-shadow: 0 0 6px 2px rgba(255,255,255,0.28);
}
.orbit--1 .orbit-dot { top:-3px; left:50%; }
.orbit--3 .orbit-dot { bottom:-3px; left:30%; }
@keyframes orbitSpin1 { to { transform: rotate(360deg); } }
@keyframes orbitSpin2 { to { transform: rotate(-360deg); } }
.energy-node {
  position: absolute;
  width:14px; height:14px;
  top:50%; left:50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: white;
  box-shadow:
    0 0 12px 4px rgba(255,255,255,0.45),
    0 0 44px 12px rgba(138,0,229,0.3),
    0 0 90px 22px rgba(138,0,229,0.12);
  animation: nodePulse 3.2s ease-in-out infinite;
}
@keyframes nodePulse {
  0%,100% { box-shadow:
    0 0 12px 4px rgba(255,255,255,0.45),
    0 0 44px 12px rgba(138,0,229,0.3),
    0 0 90px 22px rgba(138,0,229,0.12); }
  50%     { box-shadow:
    0 0 18px 7px rgba(255,255,255,0.6),
    0 0 56px 16px rgba(138,0,229,0.45),
    0 0 115px 32px rgba(138,0,229,0.18); }
}

/* Bottom-left legend overlay */
.globe-legend {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(138, 0, 229, 0.28);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
  pointer-events: none;
  z-index: 5;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.globe-legend .gl-title {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted-2);
  margin-bottom: 0.45rem;
  font-weight: 600;
}
.globe-legend .gl-row { display: flex; align-items: center; gap: 0.5rem; }
.globe-legend .sw {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.globe-legend .sw.mapped    { background: #8A00E5; box-shadow: 0 0 8px rgba(138,0,229,0.5); }
.globe-legend .sw.indexed   { background: #4D217A; }
.globe-legend .sw.watchlist { background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.25); }
.globe-legend .sw.horizon   { background: #FFB54C; box-shadow: 0 0 10px rgba(255,181,76,0.6); animation: horizonPulse 2s ease-in-out infinite; }
@keyframes horizonPulse {
  0%,100% { box-shadow: 0 0 6px rgba(255,181,76,0.4); }
  50%     { box-shadow: 0 0 14px rgba(255,181,76,0.85); }
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted-2);
  background: rgba(0, 0, 0, 0.3);
  letter-spacing: 0.04em;
}
.pending {
  /* INDICATIVE stays uppercase because it's typed that way; rest flows as-written */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 60px);
}

/* Right-side dock */
.right-dock {
  display: flex;
  border-left: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
}
.right-dock .dock-rail {
  width: 52px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0;
  gap: 0.4rem;
  border-right: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.15);
}
.right-dock .dock-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: all 0.15s;
}
.right-dock .dock-btn:hover {
  color: var(--white);
  background: rgba(138, 0, 229, 0.1);
  border-color: rgba(138, 0, 229, 0.3);
}
.right-dock .dock-btn.active {
  color: var(--white);
  background: rgba(138, 0, 229, 0.18);
  border-color: rgba(138, 0, 229, 0.5);
  box-shadow: 0 0 10px rgba(138, 0, 229, 0.3);
}
.right-dock .dock-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: #FFB54C;
  color: #1B1534;
  font-size: 0.55rem;
  font-weight: 700;
  border-radius: 8px;
  display: grid;
  place-items: center;
}
.right-dock .dock-badge:empty { display: none; }

.right-dock .dock-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.right-dock .dock-body.hidden { display: none; }
.right-dock .dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem 0.65rem;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--white);
}
.right-dock .dock-close {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 3px;
}
.right-dock .dock-close:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.right-dock .dock-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  min-height: 0;
}
.right-dock .dock-pane.hidden { display: none; }
.right-dock .chat-log { max-height: none; }

/* Country-panel list truncation helpers */
.item-list.truncated > li.hidden-extra { display: none; }

/* Favourites star + row layout */
.fav-row {
  display: flex !important;
  gap: 0.5rem;
  align-items: flex-start;
}
.fav-row .fav-body { flex: 1; min-width: 0; }
.fav-row .star {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.1rem;
  flex-shrink: 0;
  transition: color 0.15s, transform 0.1s;
}
.fav-row .star:hover { color: #FFD166; transform: scale(1.15); }
.fav-row .star.on { color: #FFD166; }
.dossier-link { cursor: pointer; }
.dossier-link:hover { color: var(--purple); text-decoration: underline; }

.compare-btn {
  background: transparent;
  border: 1px solid rgba(255,181,76,0.35);
  color: #FFCD82;
  font-size: 0.85rem;
  padding: 0.15rem 0.5rem;
  border-radius: 5px;
  cursor: pointer;
  margin-left: auto;
  line-height: 1;
}
.compare-btn:hover { background: rgba(255,181,76,0.12); }
.country-header { align-items: center; }
.fav-section-label {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FFD166;
  margin: 0.4rem 0 0.3rem;
  font-weight: 600;
}

/* Country panel empty-state */
.empty-state {
  background: rgba(255, 181, 76, 0.06);
  border: 1px solid rgba(255, 181, 76, 0.25);
  border-radius: 8px;
  padding: 0.85rem 0.95rem;
  margin-bottom: 0.5rem;
}
.empty-state-icon {
  font-size: 1.4rem;
  color: #FFB54C;
  margin-bottom: 0.2rem;
}
.empty-state-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #FFCD82;
  margin-bottom: 0.3rem;
}
.empty-state-body {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
}
.empty-state-body b { color: var(--white); }

/* ---------------- Country search ---------------- */
.country-search-wrap {
  position: relative;
  flex: 0 1 280px;
  margin-right: auto;
}
.country-search-wrap input {
  width: 100%;
  padding: 0.45rem 0.8rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(138,0,229,0.22);
  border-radius: 8px;
  color: var(--white);
  font-size: 0.82rem;
}
.country-search-wrap input:focus {
  outline: none;
  border-color: var(--purple);
  background: rgba(138,0,229,0.1);
}
.cs-results {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0; right: 0;
  background: rgba(27,21,52,0.98);
  border: 1px solid rgba(138,0,229,0.35);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.45);
  padding: 0.3rem;
  max-height: 320px;
  overflow-y: auto;
  z-index: 50;
}
.cs-results.hidden { display: none; }
.cs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.6rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.82rem;
  gap: 0.5rem;
}
.cs-row:hover { background: rgba(138,0,229,0.12); }
.cs-meta { color: var(--muted-2); font-size: 0.7rem; }
.cs-tier {
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.6rem;
}
.cs-tier.mapped    { background: rgba(138,0,229,0.3); color: #fff; }
.cs-tier.indexed   { background: rgba(77,33,122,0.35); color: #fff; }
.cs-tier.watchlist { background: rgba(255,255,255,0.08); color: var(--muted); }
.cs-empty { padding: 0.5rem 0.6rem; color: var(--muted); font-size: 0.8rem; font-style: italic; }

/* ---------------- Recent chips ---------------- */
.recent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.recent-chips:empty { display: none; }
.recent-chip {
  padding: 0.25rem 0.6rem;
  background: rgba(138,0,229,0.08);
  border: 1px solid rgba(138,0,229,0.22);
  border-radius: 999px;
  color: var(--white);
  font-size: 0.72rem;
  cursor: pointer;
  text-decoration: none;
}
.recent-chip:hover {
  background: rgba(138,0,229,0.2);
  border-color: var(--purple);
}

/* ---------------- Presenter mode ---------------- */
body.presenter header .header-right,
body.presenter header .country-search-wrap,
body.presenter #user-chip,
body.presenter footer .version { display: none !important; }
body.presenter header .title { display: none; }
body.presenter header { padding: 0 2.5rem; }
body.presenter .stat .n { font-size: 2.6rem; }
body.presenter .panel h2 { font-size: 2rem; }
body.presenter .globe-legend { font-size: 0.85rem; }

/* ---------------- Dead-man pill ---------------- */
.deadman {
  background: rgba(255, 181, 76, 0.15);
  border: 1px solid rgba(255, 181, 76, 0.5);
  color: #FFCD82;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  margin-right: 0.6rem;
}

/* ---------------- Snoop toast ---------------- */
.snoop-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  padding: 1rem 1.8rem;
  background: linear-gradient(135deg, #FFD166, #FFB54C);
  color: #1B1534;
  font-size: 1.6rem;
  font-weight: 700;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(255,181,76,0.6);
  z-index: 9999;
  animation: snoopIn 0.35s ease-out forwards;
}
.snoop-toast.out { animation: snoopOut 0.6s ease-in forwards; }
@keyframes snoopIn {
  to { transform: translate(-50%, -50%) scale(1); }
}
@keyframes snoopOut {
  to { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

/* ---------------- Pitch demo ---------------- */
body.pitch-playing {
  cursor: progress;
}
body.pitch-playing .btn-ghost, body.pitch-playing .btn-primary,
body.pitch-playing .config-menu-wrap, body.pitch-playing .country-search-wrap {
  pointer-events: none; opacity: 0.6;
}
.pitch-caption {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(27, 21, 52, 0.92);
  border: 1px solid rgba(138, 0, 229, 0.5);
  color: var(--white);
  padding: 1rem 1.6rem;
  border-radius: 12px;
  font-size: 1.05rem;
  max-width: 70vw;
  text-align: center;
  line-height: 1.55;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  z-index: 9998;
  animation: pitchCaptionIn 0.4s ease-out;
}
@keyframes pitchCaptionIn {
  from { transform: translate(-50%, 20px); opacity: 0; }
  to   { transform: translateX(-50%); opacity: 1; }
}
.pitch-skip {
  position: fixed;
  bottom: 12px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: 0.75rem;
  cursor: pointer;
  z-index: 9999;
}
.pitch-skip:hover { color: var(--white); border-color: var(--purple); }

/* ---------------- Simulator list ---------------- */
.sim-list { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 1rem; }
.sim-row {
  padding: 0.7rem 0.9rem;
  background: rgba(138,0,229,0.06);
  border: 1px solid rgba(138,0,229,0.22);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.sim-row:hover {
  background: rgba(138,0,229,0.14);
  border-color: var(--purple);
}

/* ---------------- Horizon dock badge pulse (imminent) ---------------- */
.dock-badge.imminent {
  animation: imminentPulse 1.8s ease-in-out infinite;
}
@keyframes imminentPulse {
  0%,100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,181,76,0.7); }
  50%     { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(255,181,76,0); }
}
.show-more-link {
  display: inline-block;
  margin-top: 0.3rem;
  color: var(--purple);
  cursor: pointer;
  font-size: 0.75rem;
  text-decoration: none;
}
.show-more-link:hover { text-decoration: underline; }

@media (max-width: 960px) {
  main { grid-template-columns: 320px 1fr 52px; }
  main.dock-open { grid-template-columns: 320px 1fr 360px; }
}
@media (max-width: 720px) {
  main { grid-template-columns: 1fr; grid-template-rows: 260px 1fr; }
  aside#sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  .right-dock { display: none; }
}
