/* Stats&Market · Earth monitor v2 — styles. All colour comes from tokens-v2.css (semantic hues + neutrals). */
.ge { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--side); overflow: hidden; color: var(--text); font-size: 12px; outline: 0; }
.ge-stage { position: relative; display: grid; grid-template-columns: 232px minmax(0, 1fr) 312px; height: clamp(580px, calc(100vh - 300px), 860px); background: #03050a; }
.ge-map { grid-column: 2; grid-row: 1; position: relative; min-width: 0; background: #03050a; }
.ge-map .maplibregl-canvas { outline: 0; }
.ge-topbar { grid-column: 2; grid-row: 1; z-index: 3; align-self: start; justify-self: start; display: flex; flex-wrap: wrap; gap: 8px; margin: 10px; max-width: calc(100% - 20px); pointer-events: none; }
.ge-topbar > * { pointer-events: auto; }
.ge-layers { grid-column: 1; grid-row: 1; z-index: 2; overflow: auto; padding: 12px 10px 14px; background: var(--surface); border-right: 1px solid var(--border); }
.ge-side { grid-column: 3; grid-row: 1; z-index: 2; display: flex; flex-direction: column; min-height: 0; padding: 12px 10px 10px; background: var(--surface); border-left: 1px solid var(--border); }
.ge h3 { margin: 14px 8px 6px; font: 600 10.5px/1 var(--font-sans); letter-spacing: .07em; color: var(--subtle); text-transform: none; }
.ge-layers h3:first-child { margin-top: 2px; }
.ge-muted { color: var(--subtle); font-size: 11.5px; }

.ge-ic { width: 15px; height: 15px; fill: currentColor; flex: none; }
.ge-chip { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 7px; background: color-mix(in srgb, var(--h, var(--accent)) 16%, transparent); color: var(--h, var(--accent)); }
.ge-list { display: grid; gap: 1px; }
.ge-row { display: flex; align-items: center; gap: 9px; width: 100%; padding: 5px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--secondary); text-align: left; font-size: 12.5px; transition: background .14s, color .14s; }
.ge-row:hover { background: var(--hover); color: var(--text); }
.ge-row .ge-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ge-row .ge-n { font: 500 11.5px var(--font-mono); color: var(--subtle); font-variant-numeric: tabular-nums; }
.ge-row[aria-pressed=false] { color: var(--subtle); }
.ge-row[aria-pressed=false] .ge-chip { background: var(--panel); color: var(--faint); }
.ge-row[aria-pressed=true] .ge-n { color: var(--h); }

.ge-feeds { display: grid; gap: 5px; padding: 0 8px; }
.ge-feed { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; color: var(--muted); font-size: 11.5px; }
.ge-feed i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone, var(--subtle)); }
.ge-feed em { font-style: normal; color: var(--tone, var(--subtle)); font-variant-numeric: tabular-nums; }

.ge-seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: color-mix(in srgb, var(--surface) 94%, transparent); }
.ge-seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 12px; transition: background .14s, color .14s; }
.ge-seg button:hover { color: var(--text); }
.ge-seg button[aria-pressed=true] { background: var(--selected); color: var(--text); font-weight: 500; }
.ge-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border: 1px solid var(--border); border-radius: 10px; background: color-mix(in srgb, var(--surface) 94%, transparent); color: var(--secondary); font-size: 12px; text-decoration: none; transition: background .14s, border-color .14s, color .14s; }
.ge-btn:hover { background: var(--hover); border-color: var(--border-strong); color: var(--text); }
.ge-btn[aria-pressed=true] { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.ge-btn .ge-ic { width: 15px; height: 15px; }
.ge :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ge-roster-head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 6px 6px; }
.ge-roster-head h3 { margin: 0; }
.ge-search { display: flex; align-items: center; gap: 8px; margin: 0 2px 8px; padding: 0 10px; height: 32px; border: 1px solid var(--border); border-radius: 9px; background: var(--canvas); color: var(--subtle); }
.ge-search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.ge-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text); font-size: 12.5px; outline: 0; }
.ge-roster { flex: 1; min-height: 0; margin: 0; padding: 0 2px 0 0; list-style: none; overflow: auto; }
.ge-roster button { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; transition: background .12s; }
.ge-roster button:hover { background: var(--hover); }
.ge-roster button.on { background: var(--selected); }
.ge-main { min-width: 0; display: grid; gap: 1px; }
.ge-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 500; letter-spacing: -.008em; }
.ge-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--subtle); font-size: 11.5px; }
.ge-empty { padding: 18px 10px; color: var(--subtle); text-align: center; }
.ge-lvl { padding: 1px 6px; border-radius: 5px; font: 600 10px/1.5 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.ge-lvl.red { color: var(--sem-red); background: color-mix(in srgb, var(--sem-red) 14%, transparent); }
.ge-lvl.orange { color: var(--sem-orange); background: color-mix(in srgb, var(--sem-orange) 14%, transparent); }
.ge-lvl.yellow { color: var(--sem-yellow); background: color-mix(in srgb, var(--sem-yellow) 14%, transparent); }

.ge-sel:not(.on) { display: none; }
.ge-sel.on { margin: 0 2px 12px; padding: 12px; border: 1px solid color-mix(in srgb, var(--h) 34%, var(--border)); border-radius: 12px; background: color-mix(in srgb, var(--h) 6%, var(--panel)); }
.ge-sel-head { display: grid; grid-template-columns: 24px minmax(0, 1fr) 24px; gap: 10px; align-items: start; }
.ge-sel-head strong { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: -.012em; line-height: 1.3; }
.ge-sel-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.ge-x { width: 24px; height: 24px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--subtle); }
.ge-x:hover { background: var(--hover); color: var(--text); }
.ge-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; margin: 12px 0 0; }
.ge-kv div { min-width: 0; }
.ge-kv dt { color: var(--subtle); font-size: 11px; }
.ge-kv dd { margin: 1px 0 0; font-size: 12.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ge-sel-actions { display: flex; gap: 8px; margin-top: 12px; }
.ge-sel-actions .ge-btn { height: 30px; }

.ge-tip { position: absolute; z-index: 5; max-width: 250px; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--raised); box-shadow: var(--shadow-pop); pointer-events: none; display: grid; gap: 2px; }
.ge-tip[hidden] { display: none; }
.ge-tip strong { font-size: 12.5px; font-weight: 600; }
.ge-tip span { color: var(--muted); font-size: 11.5px; }
.ge-state { grid-column: 2; grid-row: 1; z-index: 3; align-self: end; justify-self: center; margin: 0 12px 44px; padding: 7px 12px; border: 1px solid color-mix(in srgb, var(--tone, var(--blue)) 36%, var(--border)); border-radius: 10px; background: color-mix(in srgb, var(--tone, var(--blue)) 10%, var(--surface)); color: var(--tone, var(--blue)); display: flex; align-items: center; gap: 8px; max-width: 90%; }
.ge-state[hidden] { display: none; }
.ge-state .ge-ic { width: 16px; height: 16px; }
.ge-spin { width: 12px; height: 12px; border: 2px solid color-mix(in srgb, var(--tone, var(--blue)) 30%, transparent); border-top-color: var(--tone, var(--blue)); border-radius: 50%; animation: ge-spin .8s linear infinite; }
@keyframes ge-spin { to { transform: rotate(360deg); } }

.ge-time { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.ge-scrub { position: relative; flex: 1; height: 34px; min-width: 0; }
.ge-scrub canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ge-scrub input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: ew-resize; }
.ge-scrub input::-webkit-slider-runnable-track { height: 34px; background: transparent; }
.ge-scrub input::-webkit-slider-thumb { -webkit-appearance: none; width: 3px; height: 34px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ge-scrub input::-moz-range-thumb { width: 3px; height: 34px; border: 0; border-radius: 2px; background: var(--accent); }
.ge-asof { min-width: 124px; text-align: right; color: var(--muted); font: 500 11.5px var(--font-mono); font-variant-numeric: tabular-nums; }
.ge-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--border); background: var(--surface); }
.ge-stat { display: grid; gap: 1px; padding: 10px 14px; border-right: 1px solid var(--border); min-width: 0; }
.ge-stat:last-child { border-right: 0; }
.ge-stat span { color: var(--subtle); font-size: 11.5px; }
.ge-stat strong { color: var(--tone, var(--text)); font-size: 19px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ge-stat small { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* compact variant (Overview card) */
.ge-compact { border-radius: var(--radius-lg); }
.ge-compact .ge-stage { display: block; height: 330px; }
.ge-compact .ge-map { position: absolute; inset: 0; }
.ge-compact .ge-state { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; }
.ge-compact .ge-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ge-compact .ge-stats .ge-stat:nth-child(n+4) { display: none; }
.ge-compact .ge-stat:nth-child(3) { border-right: 0; }

/* map engine chrome, themed */
.ge .maplibregl-ctrl-group { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: none; overflow: hidden; }
.ge .maplibregl-ctrl-group button { background-color: transparent; border-color: var(--border); }
.ge .maplibregl-ctrl-group button:hover { background-color: var(--hover); }
.ge .maplibregl-ctrl-icon { filter: invert(1) brightness(.9); }
.ge .maplibregl-ctrl-attrib { background: color-mix(in srgb, var(--canvas) 78%, transparent); color: var(--subtle); border-radius: 8px 0 0 0; font-size: 10.5px; }
.ge .maplibregl-ctrl-attrib a { color: var(--muted); }
.ge .maplibregl-ctrl-attrib-button { filter: invert(1) brightness(.9); }
body.light .ge .maplibregl-ctrl-icon, body.light .ge .maplibregl-ctrl-attrib-button { filter: none; }

@media (max-width: 1180px) { .ge-stage { grid-template-columns: 208px minmax(0, 1fr) 280px; } .ge-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } .ge-stat:nth-child(3) { border-right: 0; } .ge-stat:nth-child(-n+3) { border-bottom: 1px solid var(--border); } }
@media (max-width: 900px) {
  .ge-stage { display: flex; flex-direction: column; height: auto; }
  .ge-map { height: 56vh; min-height: 360px; flex: none; }
  .ge-topbar { position: absolute; left: 0; top: 0; }
  .ge-layers, .ge-side { border: 0; border-top: 1px solid var(--border); max-height: 360px; }
  .ge-side { min-height: 320px; }
  .ge-state { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); margin: 0; }
  .ge-time { flex-wrap: wrap; }
  .ge-scrub { flex-basis: 100%; order: 5; }
  .ge-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ge-spin { animation: none; } }

.ge-topbar .ge-btn:not([data-act=reset]) { padding: 0 9px; }
.ge-topbar .ge-btn:not([data-act=reset]) span { display: none; }
.ge-legend { position: absolute; left: 10px; bottom: 10px; z-index: 3; display: flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 9px; background: color-mix(in srgb, var(--surface) 92%, transparent); color: var(--muted); font-size: 11px; }
.ge-legend[hidden] { display: none; }
.ge-legend span { color: var(--subtle); margin-right: 2px; }
.ge-legend i { width: 14px; height: 8px; border-radius: 3px; background: var(--h); flex: none; }
.ge-legend i.dot { width: var(--d); height: var(--d); border-radius: 50%; }
.ge-legend em { font-style: normal; font-variant-numeric: tabular-nums; margin-right: 4px; }

.ge-roster button.on .ge-main small { color: var(--muted); }

.ge-note { margin: 0; padding: 7px 14px; border-top: 1px solid var(--border); background: var(--surface); color: var(--subtle); font-size: 11.5px; line-height: 1.45; }
.ge-link { margin-left: 4px; padding: 2px 8px; border: 1px solid color-mix(in srgb, var(--tone, var(--accent)) 40%, transparent); border-radius: 6px; background: transparent; color: inherit; font-size: 11.5px; }
.ge-link:hover { background: color-mix(in srgb, var(--tone, var(--accent)) 14%, transparent); }
.ge-stat:not([data-tone]) strong { color: var(--text); }
