/* mesh.expanseelectronics.com
   Design tokens, masthead and foot are taken from the main site's
   styles-v2.css so the two read as one system. Keep them in step: if
   styles-v2.css moves, this file needs the same edit. */

:root {
  --bg:           #0c0907;
  --ink:          #f1ebe1;
  --ink-muted:    #a59889;
  --ink-faint:    #6b5e51;

  --surface:      rgba(30, 22, 16, 0.55);
  --surface-2:    rgba(40, 30, 22, 0.65);
  --border:       rgba(241, 235, 225, 0.08);
  --border-warm:  rgba(224, 120, 0, 0.18);

  --accent:       #e07800;
  --accent-2:     #ff9a1f;
  --accent-soft:  #f0b067;

  --ok:           #22cc77;
  --warn:         #e07800;
  --err:          #ff5555;

  --shadow:       0 18px 60px rgba(224, 120, 0, 0.06),
                  0 4px 16px rgba(0, 0, 0, 0.4);
  --inner-hi:     inset 0 1px 0 rgba(255, 235, 210, 0.04);

  --mono: ui-monospace, "Cascadia Code", "Fira Code", "Courier New", monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --radius:       14px;
  --radius-sm:    10px;
}
/* Aliases, mirroring the main stylesheet's own compatibility block. */
:root {
  --text:        var(--ink);
  --text-dim:    var(--ink-muted);
  --text-faint:  var(--ink-faint);
  --surface2:    var(--surface-2);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.55;
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  position: relative;
}
/* The warm glow behind everything -- the main site's signature. */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(60vw 50vh at 18% -10%, rgba(224, 120, 0, 0.22), transparent 60%),
    radial-gradient(50vw 40vh at 90% 20%, rgba(180, 88, 30, 0.18), transparent 65%),
    radial-gradient(70vw 60vh at 50% 110%, rgba(140, 60, 20, 0.16), transparent 60%),
    var(--bg);
}
@media (max-width: 720px) {
  body::before {
    background:
      radial-gradient(80vw 60vh at 30% 0%, rgba(224, 120, 0, 0.22), transparent 70%),
      var(--bg);
  }
}
::selection { background: var(--accent); color: #0a0604; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: color-mix(in srgb, var(--accent) 78%, white); }

.stage { max-width: 1100px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 720px) { .stage { padding: 0 20px; } }

h1, h2, h3 { font-family: var(--sans); color: var(--ink); line-height: 1.2; font-weight: 500; }
h1 { font-size: 1.7rem; margin: 0 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 40px 0 12px; letter-spacing: .01em; }
h2:first-child { margin-top: 0; }

.dim   { color: var(--ink-muted); }
.faint { color: var(--ink-faint); }
.mono  { font-family: var(--mono); }

/* ── Masthead ──────────────────────────────────────────────────── */
.masthead {
  display: flex; justify-content: space-between; align-items: center;
  padding: 28px 0 22px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  gap: 16px; flex-wrap: wrap;
}
.masthead .mark {
  color: var(--ink); font-weight: 600; letter-spacing: 0.02em;
  font-size: 14px; text-decoration: none;
}
.masthead .mark em { color: var(--accent); font-style: normal; font-weight: 600; }
.masthead .mark:hover { color: var(--ink); }
.masthead .right { display: flex; align-items: center; flex-wrap: wrap; }
.masthead .right a {
  color: var(--ink-muted); margin-left: 24px;
  text-transform: lowercase; text-decoration: none;
}
.masthead .right a:hover { color: var(--ink); }
.masthead .right a[aria-current="page"] { color: var(--accent); }
.masthead .right .ext { color: var(--ink-faint); }
.masthead .right .ext:hover { color: var(--accent); }
@media (max-width: 720px) {
  .masthead .right a { margin-left: 0; margin-right: 18px; }
}

/* ── Status strip (mesh-specific) ──────────────────────────────── */
.statusbar { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 18px; }
.pill {
  font-family: var(--mono); font-size: 11px; padding: 3px 10px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--ink-muted);
  letter-spacing: 0.04em; white-space: nowrap; background: var(--surface);
}
.pill.ok  { color: var(--ok);  border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.pill.err { color: var(--err); border-color: color-mix(in srgb, var(--err) 35%, transparent); }

main.stage { padding-top: 8px; padding-bottom: 8px; }

/* ── Stat tiles ────────────────────────────────────────────────── */
.tiles {
  display: grid; gap: 12px; margin: 22px 0 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--inner-hi);
}
.tile .v {
  font-family: var(--mono); font-size: 1.7rem; color: var(--ink);
  line-height: 1.1; display: block; font-weight: 400;
}
.tile .k {
  font-family: var(--mono); font-size: 10px; color: var(--ink-faint);
  text-transform: uppercase; letter-spacing: .08em; margin-top: 6px; display: block;
}
.tile.accent .v { color: var(--accent); }

/* ── Panels ────────────────────────────────────────────────────── */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--inner-hi);
}
.panel + .panel { margin-top: 12px; }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }

/* ── Tables ────────────────────────────────────────────────────── */
.tablewrap {
  overflow-x: auto; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td {
  text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  font-family: var(--mono); font-size: 10px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-faint);
  background: var(--surface-2); position: sticky; top: 0; user-select: none;
  font-weight: 500;
}
th.sortable { cursor: pointer; }
th.sortable:hover { color: var(--ink); }
th[data-dir]::after { content: ' ▲'; color: var(--accent); }
th[data-dir="desc"]::after { content: ' ▼'; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
td.num { text-align: right; font-family: var(--mono); }
td.mono, th.mono { font-family: var(--mono); }
.tag {
  font-family: var(--mono); font-size: 10px; padding: 2px 7px;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--ink-muted); letter-spacing: .04em;
}
.tag.direct { color: var(--accent); border-color: var(--border-warm); }
.tag.self   { color: var(--ok);     border-color: color-mix(in srgb, var(--ok) 35%, transparent); }

/* ── Charts ────────────────────────────────────────────────────── */
.chart { width: 100%; display: block; }
.chart .axis  { stroke: var(--border); stroke-width: 1; }
.chart .grid  { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.chart .lbl   { fill: var(--ink-faint); font-family: var(--mono); font-size: 9px; }
.chart .bar   { fill: rgba(241, 235, 225, 0.14); }
.chart .bar.d { fill: var(--accent); }
.chart .line  { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.chart .dot   { fill: var(--accent); }
.chart .area  { fill: rgba(224, 120, 0, 0.12); }
.legend {
  font-family: var(--mono); font-size: 11px; color: var(--ink-faint);
  display: flex; gap: 16px; margin-top: 8px; letter-spacing: .04em;
}
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.empty { color: var(--ink-faint); font-family: var(--mono); font-size: 12px; padding: 26px 0; text-align: center; }

/* ── Map ───────────────────────────────────────────────────────── */
#map {
  height: 620px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); z-index: 1;
}
.leaflet-container { background: #0c0907; font-family: var(--sans); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: #171009; color: var(--ink);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.leaflet-popup-content { margin: 12px 14px; font-size: 13px; }
.leaflet-popup-content b { color: var(--ink); }
.leaflet-popup-content .mono { font-size: 11px; color: var(--ink-muted); }
.leaflet-control-attribution {
  background: rgba(12, 9, 7, .82) !important; color: var(--ink-faint) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--ink-muted) !important; }
.leaflet-bar a {
  background: #171009 !important; color: var(--ink) !important;
  border-color: var(--border) !important;
}
.leaflet-bar a:hover { background: #1f1710 !important; }
/* Dark + warm the raster tiles -- OSM only ships a light style. */
.leaflet-tile-pane { filter: invert(1) hue-rotate(190deg) brightness(.78) contrast(1.05) saturate(.5) sepia(.18); }

.maplegend {
  display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono);
  font-size: 11px; color: var(--ink-faint); margin-top: 12px; letter-spacing: .04em;
}
.maplegend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }

/* ── Misc ──────────────────────────────────────────────────────── */
.lead { color: var(--ink-muted); max-width: 68ch; margin: 0 0 4px; font-size: 15px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; font-size: 14px; }
.kv dt { font-family: var(--mono); font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .07em; padding-top: 3px; }
.kv dd { margin: 0; font-family: var(--mono); font-size: 13px; }
.note {
  border-left: 2px solid var(--accent); padding: 10px 0 10px 16px;
  color: var(--ink-muted); font-size: 14px; margin: 16px 0;
}
.controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.controls button, .controls input {
  font-family: var(--mono); font-size: 11px; background: var(--surface-2);
  color: var(--ink-muted); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 6px 12px; cursor: pointer;
  letter-spacing: .04em;
}
.controls button:hover { color: var(--ink); }
.controls button[aria-pressed="true"] { color: var(--accent); border-color: var(--border-warm); }
.controls input { cursor: text; min-width: 220px; }
.controls input::placeholder { color: var(--ink-faint); }
.controls a.pill { text-decoration: none; }

/* ── Foot ──────────────────────────────────────────────────────── */
.pagefoot {
  margin-top: 90px; padding: 28px 0 40px;
  border-top: 1px solid var(--border);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--ink-faint);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 18px;
}
.pagefoot a { color: var(--ink-muted); text-decoration: none; }
.pagefoot a:hover { color: var(--accent); }
.pagefoot .trader { max-width: 64ch; line-height: 1.7; }
.pagefoot .footer-links { display: inline-flex; gap: 14px; flex-wrap: wrap; }
.pagefoot .footer-trader {
  width: 100%; order: 2; flex-basis: 100%; margin-top: 12px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.06em; color: var(--ink-faint); line-height: 1.7;
}
.pagefoot .footer-trader strong { color: var(--ink-muted); font-weight: 500; }
.pagefoot .footer-trader sup { font-size: 8px; vertical-align: super; }

/* Channel page: message bodies are free text from other people -- wrap hard so
   a long unbroken string cannot push the table off the page. */
.msgtext{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;
  max-width:46ch}

/* ── Station switcher ──────────────────────────────────────────────
   The site is multi-station: which station you are viewing changes every
   number on the page, so this has to read as a mode selector, not a filter.
   Deliberately louder than the .pill status strip it replaced.           */
.stationbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 4px 0 20px;
}
.stationbar-lede {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--ink-faint); white-space: nowrap;
}
.stationbar-note {
  font-size: 12.5px; color: var(--ink-faint); font-style: italic;
}
.stationswitch {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
}
.station {
  display: flex; flex-direction: column; gap: 1px;
  padding: 7px 16px; border-radius: calc(var(--radius) - 6px);
  text-decoration: none; color: var(--ink-muted);
  border: 1px solid transparent; transition: background .15s, color .15s,
    border-color .15s;
}
.station:hover { color: var(--ink); background: var(--surface-2); }
.station .station-name { font-size: 15px; font-weight: 400; letter-spacing: 0.01em; }
.station .station-meta {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.03em;
  color: var(--ink-faint);
}
.station.is-active {
  color: var(--ink);
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border-color: var(--border-warm);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.station.is-active .station-name { font-weight: 500; }
.station.is-active .station-meta { color: var(--accent-soft); }

@media (max-width: 640px) {
  .stationbar { gap: 8px; }
  .stationbar-note { display: none; }
  .stationswitch { width: 100%; }
  .station { flex: 1; align-items: center; }
}
