/* ───────────────────────────────────────────────────────────────
   Chicrime — landing page.
   Committed single-theme: this is a phosphor CRT pretending to be
   an operating system. Every colour is painted explicitly so the
   page never borrows the host's ground.
   ─────────────────────────────────────────────────────────────── */

:root {
  --ground:   #020402;
  --screen:   #030703;
  --panel:    rgba(6,16,6,.74);
  --panel-2:  rgba(10,26,10,.74);
  --panel-solid: #061006;
  --line:     #14331A;
  --line-hi:  #1E4A26;

  --phos:     #2BFF5E;   /* primary phosphor */
  --phos-dim: #00B22D;
  --phos-deep:#065E1C;

  --amber:    #FFB000;
  --alert:    #FF3B57;

  --text:     #BFFFC6;
  --text-dim: #57C46A;
  --faint:    #2C7A3C;

  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --crt:  "VT323", "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }

/* Any explicit display value silently beats the browser's default
   [hidden] { display: none }, which had the map legend advertising an address
   pin that was never dropped and would have kept the hover tooltip on screen
   permanently. Guard it once rather than per-component. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 26px 18px 46px;
  background:
    radial-gradient(ellipse at 50% 0%, #071207 0%, var(--ground) 62%);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* ── the machine ──────────────────────────────────────────────── */
.bezel {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(160deg, #0d150d, #050905 55%, #0b120b);
  box-shadow:
    0 0 0 1px #16301A,
    0 40px 90px rgba(0,0,0,.85),
    0 0 120px rgba(43,255,94,.06);
}

.screen {
  position: relative;
  border-radius: 11px;
  background: var(--screen);
  border: 1px solid var(--line-hi);
  overflow: hidden;
}

/* Scanlines + glass glare.
   Two-tone on purpose: a dark line plus a faint phosphor line, so the CRT
   texture reads with the same strength over the near-black map canvas and
   over the lighter panel surfaces. A single green line washed out against
   anything but pure black, which made some tabs look flat next to others. */
.screen::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,.30)      0px,
    rgba(0,0,0,.30)      1px,
    rgba(43,255,94,.045) 1px,
    rgba(43,255,94,.045) 2px,
    transparent          2px,
    transparent          4px
  );
  background-size: 100% 4px;
}
.screen::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 60% at 20% -10%, rgba(255,255,255,.05), transparent 60%),
    radial-gradient(150% 90% at 50% 50%, transparent 55%, rgba(0,0,0,.5) 100%);
}

/* Everything readable rides above the texture. Surfaces below are translucent
   so the scanlines still show through them — the CRT look comes from the
   texture passing through the glass, not from lying on top of the type. */
.titlebar, .tabstrip, .view, .statusbar {
  position: relative;
  z-index: 1;
}

/* ── chrome ───────────────────────────────────────────────────── */
.titlebar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  padding: 9px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: .18em;
  color: var(--phos-dim);
}
.tb-mid {
  color: var(--phos);
  text-shadow: 0 0 12px rgba(43,255,94,.5);
  font-weight: 600;
}
.tb-ver { color: var(--faint); letter-spacing: .1em; margin-left: 6px; }
.tb-right { display: flex; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-hi); display: block; }

.led {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--phos);
  box-shadow: 0 0 8px var(--phos);
  margin-right: 7px;
  vertical-align: middle;
}

.tabstrip {
  display: flex; gap: 4px;
  padding: 6px 12px 0;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.tab {
  font-size: 11px;
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  color: var(--faint);
  background: var(--screen);
}
.tab.active { color: var(--phos); border-color: var(--line-hi); }
.tab.active b { color: var(--faint); margin-left: 10px; font-weight: 400; }
.tab.ghost { color: var(--faint); padding: 5px 11px; }

.menubar {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.menubar a {
  font-size: 11px; letter-spacing: .12em;
  padding: 5px 12px;
  color: var(--text-dim);
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 3px;
}
.menubar a:hover, .menubar a:focus-visible {
  color: var(--phos);
  border-color: var(--line-hi);
  background: rgba(43,255,94,.06);
  outline: none;
}

/* ── hero ─────────────────────────────────────────────────────── */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 268px;
  gap: 0 26px;
  padding: 34px 26px 30px;
  border-bottom: 1px solid var(--line);
}

.skyline {
  grid-column: 1 / -1;
  color: var(--phos);
  filter: drop-shadow(0 0 6px rgba(43,255,94,.55))
          drop-shadow(0 0 26px rgba(43,255,94,.22));
  margin-bottom: 18px;
}
.skyline svg { width: 100%; height: auto; display: block; }

/* the trace draws itself in on load */
.skyline path {
  stroke-dasharray: 9000;
  stroke-dashoffset: 9000;
  animation: draw 3.4s cubic-bezier(.22,.9,.3,1) .2s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  .skyline path { animation: none; stroke-dashoffset: 0; }
}

.hero-copy h1 {
  font-family: var(--crt);
  font-size: clamp(56px, 9vw, 104px);
  line-height: .85;
  margin: 0 0 14px;
  color: var(--phos);
  letter-spacing: .02em;
  text-shadow: 0 0 20px rgba(43,255,94,.45), 0 0 60px rgba(43,255,94,.18);
}
.lede {
  margin: 0;
  font-size: 16px;
  color: var(--text);
  max-width: 56ch;
  line-height: 1.68;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.tag {
  font-size: 10px; letter-spacing: .16em;
  padding: 5px 11px;
  border: 1px solid var(--line-hi);
  border-radius: 3px;
  color: var(--text-dim);
  background: var(--panel);
}
.tag.on {
  color: #04240B; background: var(--phos); border-color: var(--phos);
  font-weight: 700;
}

/* ── live feed ────────────────────────────────────────────────── */
.livefeed {
  border: 1px solid var(--line-hi);
  border-radius: 5px;
  background: var(--panel-solid);
  display: flex; flex-direction: column;
  overflow: hidden;
  align-self: start;
}
.lf-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  font-size: 10px; letter-spacing: .16em;
  color: var(--phos);
}
.lf-src { color: var(--faint); letter-spacing: .06em; }
.pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--phos); margin-right: 6px;
  animation: blip 1.8s ease-in-out infinite;
}
@keyframes blip { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }

.lf-body { max-height: 268px; overflow-y: auto; }
.lf-row {
  padding: 8px 11px;
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 2px;
}
.lf-row:last-child { border-bottom: none; }
.lf-t { font-size: 11px; font-weight: 700; color: var(--alert); }
.lf-t.b { color: var(--amber); }
.lf-b { font-size: 11px; color: var(--text); }
.lf-m { font-size: 10px; color: var(--faint); }
.lf-loading, .lf-err { padding: 14px 11px; font-size: 11px; color: var(--faint); }
.lf-err { color: var(--amber); }
.lf-foot {
  padding: 7px 11px;
  border-top: 1px solid var(--line);
  font-size: 9.5px; color: var(--faint); letter-spacing: .05em;
}

/* ── panels ───────────────────────────────────────────────────── */
.panel { border-bottom: 1px solid var(--line); }
.panel-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-bottom: 1px solid var(--line);
  font-size: 11px; letter-spacing: .16em;
  color: var(--phos);
}
.panel.warn .panel-bar { color: var(--amber); }
.panel-min { color: var(--faint); }
.panel-body { padding: 26px 26px 32px; }
.panel-body p { max-width: 78ch; }
.panel-body p:first-child { margin-top: 0; }

.big {
  font-size: 21px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 18px;
}
.big b { color: var(--phos); }
em { color: var(--text); font-style: italic; }

.statrow {
  display: flex; flex-wrap: wrap; gap: 12px;
  margin: 24px 0;
}
.stat {
  flex: 1 1 190px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--phos);
  background: var(--panel);
  padding: 14px 16px;
}
.stat b {
  display: block;
  font-family: var(--crt);
  font-size: 40px; line-height: 1;
  color: var(--phos);
  font-variant-numeric: tabular-nums;
}
.stat span { font-size: 11px; color: var(--faint); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.lane {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 16px 18px;
}
.lane.live { border-left: 3px solid var(--phos); }
.lane.arch { border-left: 3px solid var(--faint); }
.lane-h {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 11px; letter-spacing: .16em; color: var(--text-dim);
  margin-bottom: 10px;
}
.lane-h b {
  font-family: var(--crt); font-size: 30px; color: var(--phos);
  font-variant-numeric: tabular-nums;
}
.lane.arch .lane-h b { color: var(--faint); }
.bar { height: 9px; background: var(--screen); border: 1px solid var(--line); }
.bar i { display: block; height: 100%; background: var(--phos); }
.bar.dim i {
  background: repeating-linear-gradient(-45deg,
    #123212 0 6px, #0A1A0A 6px 12px);
}
.lane p { font-size: 13px; color: var(--text-dim); margin: 12px 0 0; }
.lane b { color: var(--text); }

/* ── timeline ─────────────────────────────────────────────────── */
.timeline { list-style: none; margin: 24px 0 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 78px 1fr; gap: 18px;
  padding-bottom: 20px;
  position: relative;
}
.timeline li::before {
  content: ""; position: absolute;
  left: 84px; top: 26px; bottom: 0; width: 1px;
  background: var(--line-hi);
}
.timeline li:last-child::before { display: none; }
.t-when {
  font-family: var(--crt); font-size: 27px; line-height: 1;
  color: var(--phos); text-align: right; padding-top: 12px;
  font-variant-numeric: tabular-nums;
}
.timeline li.late .t-when { color: var(--faint); }
.notif {
  border: 1px solid var(--line-hi);
  border-radius: 9px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 12px 15px;
  max-width: 470px;
}
.n-app { font-size: 9px; letter-spacing: .18em; color: var(--faint); margin-bottom: 4px; }
.n-title { font-size: 14px; font-weight: 700; color: var(--text); }
.n-body { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }
.note { font-size: 13px; color: var(--faint); margin-top: 6px; }
.note b { color: var(--phos); }

/* ── features ─────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}
.card {
  border: 1px solid var(--line);
  border-top: 2px solid var(--line-hi);
  background: var(--panel);
  padding: 18px 20px;
}
.c-ico { font-size: 22px; line-height: 1; margin-bottom: 10px; }
.card h3 {
  margin: 0 0 7px; font-size: 15px; color: var(--phos); font-weight: 600;
}
.card p { margin: 0; font-size: 13px; color: var(--text-dim); line-height: 1.6; }

/* ── limits ───────────────────────────────────────────────────── */
.limits { display: grid; gap: 10px; }
.limits div {
  border-left: 3px solid var(--amber);
  background: rgba(255,176,0,.05);
  padding: 12px 16px;
  font-size: 13.5px; color: var(--text-dim); line-height: 1.6;
}
.limits b { color: var(--text); }
.disclaim { font-size: 11.5px; color: var(--faint); margin-top: 20px; }

/* ── status bar ───────────────────────────────────────────────── */
.statusbar {
  display: flex; flex-wrap: wrap; gap: 20px;
  padding: 9px 16px;
  background: var(--panel);
  font-size: 10px; letter-spacing: .12em;
  color: var(--faint);
}
.statusbar b { color: var(--text-dim); font-weight: 500; }
.sb-right { margin-left: auto; }
#wstat.ok { color: var(--phos); }
#wstat.bad { color: var(--amber); }

/* ── responsive ───────────────────────────────────────────────── */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; }
  .livefeed { margin-top: 22px; }
  .split { grid-template-columns: 1fr; }
  .panel-body { padding: 20px 16px 24px; }
  .hero { padding: 24px 16px; }
  .timeline li { grid-template-columns: 54px 1fr; gap: 12px; }
  .timeline li::before { left: 60px; }
  .t-when { font-size: 20px; padding-top: 14px; }
  body { padding: 12px 8px 30px; }
  .bezel { padding: 7px; }
}

/* ── neighborhood trends ──────────────────────────────────────── */
.tr-controls {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin: 22px 0 20px;
}
.tr-field { display: flex; flex-direction: column; gap: 6px; }
.tr-field > span { font-size: 10px; letter-spacing: .16em; color: var(--phos-dim); }

#tr-area {
  appearance: none;
  font-family: var(--mono); font-size: 14px;
  color: var(--text);
  background: var(--screen);
  border: 1px solid var(--line-hi);
  border-radius: 3px;
  padding: 10px 34px 10px 12px;
  min-width: 250px;
  background-image: linear-gradient(45deg, transparent 50%, var(--phos) 50%),
                    linear-gradient(135deg, var(--phos) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
#tr-area:focus-visible { outline: 2px solid var(--phos); outline-offset: 1px; }

.tr-seg {
  display: flex; gap: 3px;
  border: 1px solid var(--line-hi);
  border-radius: 3px; padding: 3px;
  background: var(--screen);
}
.tr-seg button {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em;
  font-weight: 700;
  padding: 8px 16px;
  border: none; border-radius: 2px;
  background: transparent; color: var(--faint);
  cursor: pointer;
}
.tr-seg button.on { background: var(--phos); color: #04240B; }
.tr-seg button:focus-visible { outline: 2px solid var(--phos); outline-offset: 1px; }

.tr-out {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 20px;
  min-height: 150px;
}
.tr-msg { color: var(--faint); font-size: 13px; }
.tr-msg.err { color: var(--amber); }

.tr-head {
  display: flex; flex-wrap: wrap; gap: 14px;
  align-items: flex-start; justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.tr-name { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.2; }
.tr-sub { font-size: 11px; color: var(--faint); margin-top: 3px; }
.tr-head-r { text-align: right; }
.tr-delta {
  font-family: var(--crt); font-size: 46px; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.tr-head.bad  .tr-delta { color: var(--alert); text-shadow: 0 0 18px rgba(255,59,87,.4); }
.tr-head.good .tr-delta { color: var(--phos);  text-shadow: 0 0 18px rgba(43,255,94,.4); }
.tr-counts { font-size: 11px; color: var(--faint); margin-top: 2px; }

.tr-verdict { font-size: 14px; color: var(--text-dim); margin: 14px 0 0; }
.tr-verdict b { color: var(--text); }
.tr-verdict.bad b  { color: var(--alert); }
.tr-verdict.good b { color: var(--phos); }
.tr-thin {
  margin-top: 14px; padding: 11px 14px;
  border-left: 3px solid var(--amber);
  background: rgba(255,176,0,.06);
  font-size: 12.5px; color: var(--text-dim); line-height: 1.55;
}

.tr-spark {
  display: flex; align-items: flex-end; gap: 10px;
  height: 116px; margin-top: 22px;
}
.tr-spark-y { font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.tr-bars {
  flex: 1; display: flex; align-items: flex-end; gap: 4px; height: 100%;
  border-bottom: 1px solid var(--line-hi);
}
.tr-bar {
  flex: 1;
  background: var(--phos-deep);
  border-top: 2px solid var(--phos-dim);
  min-height: 2px;
  transition: background .15s;
}
.tr-bar.last { background: var(--phos-dim); border-top-color: var(--phos); }
.tr-bar:hover { background: var(--phos); }
.tr-spark-x {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--faint); margin-top: 6px;
}

.tr-cats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.tr-cat {
  border: 1px solid var(--line);
  border-left: 3px solid var(--faint);
  background: var(--screen);
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 3px;
}
.tr-cat.bad  { border-left-color: var(--alert); }
.tr-cat.good { border-left-color: var(--phos); }
.tr-cat-n { font-size: 10px; letter-spacing: .14em; color: var(--faint); }
.tr-cat-v {
  font-family: var(--crt); font-size: 30px; line-height: 1; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.tr-cat-d { font-size: 11px; color: var(--text-dim); }
.tr-cat.bad  .tr-cat-d { color: var(--alert); }
.tr-cat.good .tr-cat-d { color: var(--phos); }

.tr-movers { margin-top: 22px; }
.tr-movers-h { font-size: 10px; letter-spacing: .16em; color: var(--phos-dim); margin-bottom: 8px; }
.tr-mover {
  display: grid; grid-template-columns: 1fr auto 84px;
  gap: 12px; align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--text-dim);
}
.tr-mover:last-child { border-bottom: none; }
.tr-mover-d { font-weight: 700; font-variant-numeric: tabular-nums; }
.tr-mover.bad  .tr-mover-d { color: var(--alert); }
.tr-mover.good .tr-mover-d { color: var(--phos); }
.tr-mover-c { font-size: 11px; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.tr-movers-empty { margin-top: 20px; font-size: 12.5px; color: var(--faint); }

.tr-caveat {
  margin-top: 20px; font-size: 12.5px; color: var(--faint); line-height: 1.65;
}
.tr-caveat b { color: var(--text-dim); }

@media (max-width: 700px) {
  .tr-cats { grid-template-columns: 1fr; }
  .tr-controls { flex-direction: column; gap: 12px; }
  #tr-area { width: 100%; min-width: 0; }
  .tr-seg { width: 100%; }
  .tr-seg button { flex: 1; }
  .tr-head { flex-direction: column; }
  .tr-head-r { text-align: left; }
  .tr-delta { font-size: 38px; }
  .tr-mover { grid-template-columns: 1fr auto; }
  .tr-mover-c { display: none; }
  .tr-out { padding: 14px; }
}

.tr-frontier {
  margin-top: 12px;
  font-size: 11px;
  color: var(--faint);
  border-left: 2px solid var(--line-hi);
  padding-left: 10px;
}

/* ── map view ─────────────────────────────────────────────────── */
.tab { font-family: var(--mono); cursor: pointer; }
button.tab { background: var(--screen); }
.tab.ghost { cursor: default; }
.tab:focus-visible { outline: 2px solid var(--phos); outline-offset: -2px; }

.map-toolbar {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
}
.mt-group { display: flex; flex-direction: column; gap: 6px; }
.mt-group.grow { flex: 1; min-width: 190px; }
.mt-label { font-size: 9.5px; letter-spacing: .18em; color: var(--phos-dim); }
.mt-status {
  font-size: 12px; color: var(--text-dim);
  border: 1px solid var(--line);
  background: var(--screen);
  padding: 9px 12px; border-radius: 3px;
  font-variant-numeric: tabular-nums;
}

.map-stage {
  position: relative;
  height: min(72vh, 660px);
  background: #020602;
  border-bottom: 1px solid var(--line);
}
#map-canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }

.map-stage::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  z-index: 2;                 /* over the canvas, under the controls (5+) */
  background: repeating-linear-gradient(
    to bottom,
    rgba(0,0,0,.30)      0px,
    rgba(0,0,0,.30)      1px,
    rgba(43,255,94,.045) 1px,
    rgba(43,255,94,.045) 2px,
    transparent          2px,
    transparent          4px
  );
}

.map-tip {
  position: absolute; z-index: 6;
  pointer-events: none;
  background: rgba(0,0,0,.94);
  border: 1px solid var(--phos);
  border-radius: 3px;
  padding: 8px 11px;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 150px;
  box-shadow: 0 0 22px rgba(43,255,94,.2);
}
.map-tip b { font-size: 12.5px; color: var(--phos); }
.map-tip span { font-size: 10.5px; color: var(--text-dim); }
.map-tip .tip-go { color: var(--faint); font-size: 9.5px; letter-spacing: .1em; margin-top: 2px; }

.map-legend {
  position: absolute; left: 14px; bottom: 14px; z-index: 5;
  display: flex; flex-wrap: wrap; gap: 12px;
  background: rgba(0,0,0,.86);
  border: 1px solid var(--line-hi);
  border-radius: 3px;
  padding: 8px 12px;
}
.map-legend .k {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: var(--text-dim);
}

.map-legend i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.map-legend i.ring {
  background: transparent;
  border: 1.6px solid var(--phos);
  width: 10px; height: 10px;
}

.map-foot { padding: 18px 20px 24px; }
.map-foot p { margin: 0; font-size: 13px; color: var(--text-dim); max-width: 80ch; line-height: 1.6; }
.map-note { margin-top: 10px !important; font-size: 11.5px !important; color: var(--faint) !important; }

@media (max-width: 700px) {
  .map-toolbar { gap: 12px; padding: 12px; }
  .mt-group { width: 100%; }
  .mt-group .tr-seg { width: 100%; }
  .mt-group .tr-seg button { flex: 1; padding: 8px 6px; }
  .map-stage { height: 62vh; }
  .map-legend { left: 8px; right: 8px; bottom: 8px; gap: 8px; padding: 7px 9px; }
  .map-legend .k { font-size: 9px; }
  .map-foot { padding: 14px 12px 20px; }
}

#tr-search {
  font-family: var(--mono); font-size: 14px;
  color: var(--text);
  background: var(--screen);
  border: 1px solid var(--line-hi);
  border-radius: 3px;
  padding: 10px 12px;
  min-width: 290px;
}
#tr-search::placeholder { color: var(--faint); }
#tr-search:focus-visible { outline: 2px solid var(--phos); outline-offset: 1px; }

.tr-alias {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--faint);
  line-height: 1.5;
  max-width: 46ch;
  border-left: 2px solid var(--line-hi);
  padding-left: 9px;
}
.tr-alias b { color: var(--text-dim); }

@media (max-width: 700px) { #tr-search { width: 100%; min-width: 0; } }

/* ── tab strip as primary nav ─────────────────────────────────── */
.tabstrip { flex-wrap: wrap; padding-bottom: 0; row-gap: 0; }
.tabstrip .tab { white-space: nowrap; }

/* Below the point where seven tabs fit on one line, wrap onto rows rather
   than hiding them behind a horizontal scroll nobody discovers. */
@media (max-width: 760px) {
  .tabstrip { gap: 4px; padding: 6px 8px 0; }
  .tabstrip .tab {
    flex: 1 1 auto;
    min-width: calc(33.333% - 4px);
    text-align: center;
    border-radius: 4px;
    border-bottom: 1px solid var(--line);
    padding: 8px 6px;
  }
  .tabstrip .tab.active { border-color: var(--phos); }
  .tabstrip .tab.ghost { display: none; }
}
@media (max-width: 420px) {
  .tabstrip .tab { min-width: calc(50% - 4px); }
}

/* ── map: address search ──────────────────────────────────────── */
.mt-find { display: flex; gap: 6px; }
.mt-find input {
  flex: 1; min-width: 150px;
  font-family: var(--mono); font-size: 13px;
  color: var(--text); background: var(--screen);
  border: 1px solid var(--line-hi); border-radius: 3px;
  padding: 9px 11px;
}
.mt-find input::placeholder { color: var(--faint); }
.mt-find input:focus-visible { outline: 2px solid var(--phos); outline-offset: 1px; }
.mt-find button {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  padding: 9px 14px; cursor: pointer;
  border: 1px solid var(--phos); border-radius: 3px;
  background: var(--phos); color: #04240B;
}
.mt-find #map-clear {
  background: var(--screen); color: var(--faint);
  border-color: var(--line-hi); font-size: 15px; padding: 6px 11px;
}
.mt-find button:focus-visible { outline: 2px solid var(--phos); outline-offset: 2px; }

/* ── map: type filter ─────────────────────────────────────────── */
.mt-filter { position: relative; }
#filter-btn {
  font-family: var(--mono); font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  padding: 10px 14px; cursor: pointer;
  border: 1px solid var(--line-hi); border-radius: 3px;
  background: var(--screen); color: var(--text-dim);
  white-space: nowrap;
}
#filter-btn.narrowed { border-color: var(--phos); color: var(--phos); }
#filter-btn b { color: var(--phos); font-weight: 700; margin-left: 6px; }

.filter-pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0;
  width: 290px;
  background: #050C05;
  border: 1px solid var(--phos);
  border-radius: 4px;
  box-shadow: 0 18px 50px rgba(0,0,0,.8), 0 0 30px rgba(43,255,94,.12);
}
.fp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  font-size: 10px; letter-spacing: .16em; color: var(--phos);
}
.fp-head button {
  background: none; border: none; color: var(--faint);
  font-size: 16px; cursor: pointer; line-height: 1; padding: 0 2px;
}
.fp-presets { display: flex; gap: 4px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.fp-presets button {
  flex: 1; font-family: var(--mono); font-size: 9px; font-weight: 700; letter-spacing: .1em;
  padding: 6px 4px; cursor: pointer;
  border: 1px solid var(--line-hi); border-radius: 2px;
  background: var(--panel); color: var(--text-dim);
}
.fp-presets button:hover { border-color: var(--phos); color: var(--phos); }
.fp-list { max-height: 280px; overflow-y: auto; padding: 5px 0; }
.fp-row {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px; cursor: pointer; font-size: 12px; color: var(--text-dim);
}
.fp-row:hover { background: rgba(43,255,94,.06); }
.fp-row input { accent-color: #2BFF5E; width: 14px; height: 14px; cursor: pointer; }
.fp-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }

/* ── map: zoom + floating status ──────────────────────────────── */
.map-zoom {
  position: absolute; top: 12px; right: 12px; z-index: 6;
  display: flex; flex-direction: column; gap: 5px;
}
.map-zoom button {
  width: 34px; height: 34px;
  font-family: var(--mono); font-size: 16px; line-height: 1; cursor: pointer;
  background: rgba(0,0,0,.86); color: var(--phos);
  border: 1px solid var(--line-hi); border-radius: 3px;
}
.map-zoom button:hover { border-color: var(--phos); background: rgba(43,255,94,.1); }
.map-zoom button:focus-visible { outline: 2px solid var(--phos); outline-offset: 1px; }

.map-status-float {
  position: absolute; top: 12px; left: 12px; z-index: 6;
  max-width: min(60%, 430px);
  background: rgba(0,0,0,.9);
  border-color: var(--line-hi);
  font-size: 11.5px;
}
.map-status-float b { color: var(--phos); font-weight: 700; }
.ms-sub { color: var(--faint); }
.map-legend i.home {
  background: #2BFF5E; border: 1.5px solid #fff; width: 9px; height: 9px;
}

#map-canvas { touch-action: none; }

@media (max-width: 700px) {
  .mt-find input { min-width: 0; }
  .filter-pop { width: min(88vw, 300px); }
  .map-status-float { max-width: calc(100% - 66px); font-size: 10.5px; padding: 7px 9px; }
  .map-zoom button { width: 30px; height: 30px; font-size: 14px; }
}

/* ── modal ────────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,.78);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  width: min(480px, 100%);
  max-height: min(84vh, 720px);
  display: flex; flex-direction: column;
  background: #050C05;
  border: 1px solid var(--phos);
  border-radius: 5px;
  box-shadow: 0 24px 70px rgba(0,0,0,.9), 0 0 44px rgba(43,255,94,.14);
}
.modal-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 10px; letter-spacing: .18em; color: var(--phos);
}
.modal-bar button {
  background: none; border: none; color: var(--faint);
  font-size: 20px; line-height: 1; cursor: pointer; padding: 0 3px;
}
.modal-bar button:hover { color: var(--phos); }
.modal-bar button:focus-visible { outline: 2px solid var(--phos); outline-offset: 2px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-body h2 { margin: 0 0 4px; font-size: 21px; color: var(--phos); font-weight: 700; }
.modal-body h2.md-violent  { color: var(--alert); }
.modal-body h2.md-property { color: var(--amber); }
.modal-body h2.md-other    { color: var(--phos); }
.md-sub { margin: 0 0 16px; font-size: 13px; color: var(--text-dim); line-height: 1.55; }
.md-loading { color: var(--faint); font-size: 13px; margin: 0; }

.md-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.md-cat {
  border: 1px solid var(--line); border-top: 2px solid var(--faint);
  background: var(--panel-solid); padding: 10px;
  display: flex; flex-direction: column; gap: 2px;
}
.md-cat.v { border-top-color: var(--alert); }
.md-cat.p { border-top-color: var(--amber); }
.md-cat.o { border-top-color: var(--phos); }
.md-cat.s { border-top-color: #fff; }
.md-cat b {
  font-family: var(--crt); font-size: 26px; line-height: 1; color: var(--text);
  font-variant-numeric: tabular-nums;
}
.md-cat span { font-size: 9px; letter-spacing: .1em; color: var(--faint); }

.md-h { font-size: 10px; letter-spacing: .16em; color: var(--phos-dim); margin-bottom: 7px; }
.md-top { margin-bottom: 18px; }
.md-t {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-dim);
}
.md-t:last-child { border-bottom: none; }
.md-t b { color: var(--text); font-variant-numeric: tabular-nums; }

.md-fields {
  margin: 0 0 18px;
  border: 1px solid var(--line); border-radius: 3px;
  background: var(--panel-solid); padding: 0 13px;
}
.md-row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.md-row:last-child { border-bottom: none; }
.md-row dt { color: var(--faint); margin: 0; }
.md-row dd { color: var(--text); margin: 0; font-weight: 600; text-align: right; }

.md-btn {
  width: 100%; font-family: var(--mono);
  font-size: 11px; font-weight: 700; letter-spacing: .12em;
  padding: 12px; cursor: pointer;
  border: 1px solid var(--phos); border-radius: 3px;
  background: transparent; color: var(--phos);
}
.md-btn.on { background: var(--phos); color: #04240B; }
.md-btn:focus-visible { outline: 2px solid var(--phos); outline-offset: 2px; }

.md-note { margin: 10px 0 0; font-size: 11px; color: var(--text-dim); line-height: 1.5; }
.md-caveat { margin: 12px 0 0; font-size: 10.5px; color: var(--faint); line-height: 1.55; }

.fp-special {
  border-bottom: 1px solid var(--line);
  padding: 9px 12px !important;
}
.fp-special em { color: var(--faint); font-style: normal; font-size: 10px; }
.fp-dot.ring { background: transparent; border: 1.5px solid var(--phos); }

@media (max-width: 700px) {
  .modal-back { padding: 10px; align-items: flex-end; }
  .modal { max-height: 88vh; }
  .md-cats { grid-template-columns: repeat(2, 1fr); }
}

.map-legend .attrib { color: var(--faint); font-size: 9px; }
.map-legend .attrib a { color: var(--faint); text-decoration: underline; }
.map-legend .attrib a:hover { color: var(--phos); }

/* ── street view inside a modal ───────────────────────────────── */
.md-row-btn dd { width: 100%; text-align: right; }
.md-sv-open {
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  color: var(--phos); background: none; border: none;
  padding: 0; cursor: pointer; text-align: right;
  border-bottom: 1px dashed var(--phos-dim);
}
.md-sv-open:hover { border-bottom-style: solid; }
.md-sv-open:focus-visible { outline: 2px solid var(--phos); outline-offset: 3px; }
.md-sv-cue { color: var(--faint); font-size: 10px; font-weight: 400; letter-spacing: .08em; }

.md-sv {
  margin: 10px 0 4px;
  border: 1px solid var(--line-hi);
  border-radius: 4px;
  overflow: hidden;
  background: var(--screen);
}
.md-sv img { display: block; width: 100%; height: auto; }
.md-sv-load { padding: 22px 14px; font-size: 12px; color: var(--faint); text-align: center; }
.md-sv-link {
  display: block; padding: 8px 11px;
  font-size: 10.5px; letter-spacing: .06em;
  color: var(--text-dim); text-decoration: none;
  border-top: 1px solid var(--line);
}
.md-sv-link:hover { color: var(--phos); }

/* ── icons ────────────────────────────────────────────────────── */
.c-ico { color: var(--phos); margin-bottom: 10px; line-height: 0; }
.c-ico svg { display: block; }
.n-ico, .lf-ico { display: inline-flex; vertical-align: -2px; margin-right: 7px; }
.n-ico svg, .lf-ico svg { display: block; }
.lf-t { display: flex; align-items: center; gap: 0; }

.lg-dots, .lg-heat { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.lg-heat .ramp {
  width: 96px; height: 8px; border-radius: 2px;
  background: linear-gradient(90deg, #004D14, #00B22D, #2BFF5E, #FFB000, #FF3B57);
}
.map-legend .k.dim { color: var(--faint); font-size: 9px; }

.map-legend i.diamond {
  width: 9px; height: 9px;
  background: rgba(255,59,87,0.22);
  border: 1.5px solid #FF3B57;
  border-radius: 0;
  transform: rotate(45deg);
}

.map-legend i.ring.alert { border-color: #FF3B57; }

.split.three { grid-template-columns: repeat(3, 1fr); }
.lane.med { border-left: 3px solid var(--amber); }
.lane.med .lane-h b { color: var(--amber); }
.lane.med .bar i { background: var(--amber); }
@media (max-width: 900px) { .split.three { grid-template-columns: 1fr; } }

#map-area {
  flex: 1; min-width: 150px;
  appearance: none;
  font-family: var(--mono); font-size: 13px;
  color: var(--text); background: var(--screen);
  border: 1px solid var(--line-hi); border-radius: 3px;
  padding: 9px 30px 9px 11px;
  background-image: linear-gradient(45deg, transparent 50%, var(--phos) 50%),
                    linear-gradient(135deg, var(--phos) 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
#map-area:focus-visible { outline: 2px solid var(--phos); outline-offset: 1px; }

/* ── store buttons ────────────────────────────────────────────── */
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.store {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 18px 10px 15px;
  border: 1px solid var(--phos); border-radius: 5px;
  background: var(--panel);
  color: var(--phos); text-decoration: none;
  transition: background .15s, transform .1s;
}
.store i { display: flex; color: inherit; }
.store i svg { display: block; }
.store span { display: flex; flex-direction: column; line-height: 1.15; }
.store b { font-size: 14px; font-weight: 700; letter-spacing: .04em; }
.store em { font-size: 9.5px; font-style: normal; letter-spacing: .14em; color: var(--text-dim); }
.store:hover { background: rgba(43,255,94,.1); }
.store:active { transform: translateY(1px); }
.store:focus-visible { outline: 2px solid var(--phos); outline-offset: 3px; }

/* Not yet released: still communicates both platforms are coming, but does
   not pretend to be a link to a page that does not exist. */
.store.soon {
  border-color: var(--line-hi); color: var(--text-dim);
  cursor: default; pointer-events: none;
}
.store.soon em { color: var(--faint); }
.store.soon::after {
  content: "SOON"; margin-left: 4px;
  font-size: 8px; letter-spacing: .16em; font-weight: 700;
  color: var(--faint); border: 1px solid var(--line-hi);
  border-radius: 2px; padding: 2px 5px; align-self: center;
}

@media (max-width: 700px) { .store { flex: 1 1 auto; justify-content: center; } }
