:root {
  color: #172026;
  background: #eef3f1;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --panel: #ffffff;
  --line: #d6e0dc;
  --muted: #61706a;
  --ink: #172026;
  --red: #d9414e;
  --orange: #e98c30;
  --blue: #2867d8;
  --teal: #168678;
  --green: #25885f;
  --slate: #26333b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 320px; min-height: 100vh; margin: 0; overflow: hidden; }
button, input, select { font: inherit; }
button {
  min-height: 34px;
  border: 1px solid #c8d5d0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
button:hover { border-color: #98aaa3; }
button:disabled { cursor: not-allowed; opacity: .45; }
.primary {
  border-color: var(--blue) !important;
  background: var(--blue) !important;
  color: #fff !important;
  font-weight: 800;
}
.large { min-height: 44px; }
input, select {
  width: 100%;
  min-height: 34px;
  border: 1px solid #c8d5d0;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}
input[type="text"] { min-height: 42px; padding: 0 12px; }

.access-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgb(28 99 112 / .12), transparent 28%),
    radial-gradient(circle at bottom right, rgb(31 138 117 / .14), transparent 30%),
    #f3f7f5;
}
.access-story {
  display: grid;
  align-content: center;
  gap: 24px;
  min-width: 0;
  padding: 48px 56px;
}
.access-brandline { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.access-kicker {
  color: #17606a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.access-chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgb(23 108 96 / .1);
  color: #1a6c60;
  font-size: 12px;
  font-weight: 700;
}
.access-story h1 {
  margin: 0;
  color: #10171b;
  font-size: clamp(52px, 7vw, 86px);
  line-height: .92;
  letter-spacing: 0;
}
.access-lead {
  max-width: 720px;
  margin: 0;
  color: #40504a;
  font-size: 20px;
  line-height: 1.45;
}
.access-points {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.access-points div {
  display: grid;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid rgb(207 219 214 / .9);
  border-radius: 8px;
  background: rgb(255 255 255 / .72);
}
.access-points strong { color: #13252d; font-size: 14px; }
.access-points span { color: #5b6863; font-size: 13px; line-height: 1.45; }
.access-preview {
  display: grid;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  padding: 18px 18px 16px;
  border: 1px solid #d4dfda;
  border-radius: 8px;
  background: rgb(255 255 255 / .82);
  box-shadow: 0 16px 50px rgb(22 39 37 / .08);
}
.preview-topbar,
.preview-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #62706a;
  font-size: 12px;
  font-weight: 700;
}
.preview-stage {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border-radius: 8px;
  background:
    linear-gradient(rgb(214 226 221 / .9) 1px, transparent 1px),
    linear-gradient(90deg, rgb(214 226 221 / .9) 1px, transparent 1px),
    #ecf2ef;
  background-size: 42px 42px;
}
.preview-route {
  position: absolute;
  height: 4px;
  transform-origin: left center;
  border-radius: 999px;
  opacity: .75;
}
.preview-route.route-a {
  top: 104px;
  left: 180px;
  width: 180px;
  background: #2f72d5;
  transform: rotate(18deg);
}
.preview-route.route-b {
  top: 212px;
  left: 112px;
  width: 220px;
  background: #e18d34;
  transform: rotate(-21deg);
}
.preview-node {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 800;
}
.preview-base {
  width: 74px;
  height: 74px;
  border: 7px solid rgb(255 255 255 / .92);
  background: rgb(37 161 145 / .24);
  box-shadow: 0 0 0 12px rgb(37 161 145 / .12);
}
.preview-node-core {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #1f9f92;
  color: #ffffff;
  font-size: 25px;
  line-height: 1;
}
.preview-node-count {
  position: absolute;
  top: -11px;
  right: -11px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #253b4a;
  color: #ffffff;
  font-size: 13px;
}
.preview-incident {
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 3px solid #ffffff;
  background: #db545d;
  color: #ffffff;
  font-size: 13px;
}
.preview-vehicle {
  min-width: 58px;
  height: 30px;
  padding: 0 10px;
  border: 2px solid #ffffff;
  background: #ffffff;
  color: #2861da;
  font-size: 11px;
  box-shadow: 0 6px 14px rgb(20 34 38 / .08);
}
.base-a { top: 58px; left: 112px; }
.base-b { top: 204px; left: 238px; }
.base-c { top: 126px; left: 386px; }
.incident-a { top: 92px; left: 332px; }
.incident-b { top: 242px; left: 88px; }
.vehicle-a { top: 144px; left: 234px; }
.vehicle-b { top: 186px; left: 324px; }
.access-tool {
  display: grid;
  align-content: center;
  gap: 16px;
  padding: 40px 42px;
  border-left: 1px solid #d8e0dd;
  background: rgb(255 255 255 / .92);
  backdrop-filter: blur(12px);
}
.access-tool-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.access-tool-header h2 {
  margin: 6px 0 0;
  color: #12181c;
  font-size: 28px;
  line-height: 1.08;
}
.access-price { display: grid; justify-items: end; gap: 2px; }
.access-price strong { color: #11181b; font-size: 26px; line-height: 1; }
.access-price span {
  color: #61706a;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.access-disclaimer {
  margin: 0;
  color: #5b6863;
  font-size: 14px;
  line-height: 1.45;
}
.access-field {
  display: grid;
  gap: 7px;
  color: #53615b;
  font-size: 12px;
  font-weight: 700;
}
.access-pay,
.access-enter { min-height: 44px; font-weight: 800; }
.access-enter { border-color: #162d36; background: #162d36; color: #ffffff; }
.access-key-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.access-copy { min-width: 88px; }
.access-key-block input,
.access-field input[readonly] {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
}
.access-error {
  margin: 0;
  color: #a53a30;
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: #eef3f1;
}
.control-panel {
  display: grid;
  grid-template-columns: 166px minmax(140px, .95fr) minmax(168px, 1.2fr) minmax(106px, .7fr) 74px 78px 86px 128px auto;
  gap: 10px;
  align-items: end;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.brand-block { display: grid; gap: 4px; align-self: center; }
.brand-block strong { font-size: 18px; }
.brand-block span, .control-panel label { color: var(--muted); font-size: 12px; }
.control-panel label { display: grid; gap: 4px; font-weight: 800; }
.speed-field span { float: right; color: var(--ink); font-weight: 900; }
.command-row { display: grid; grid-template-columns: repeat(3, auto); gap: 7px; }
.paywall-return {
  min-width: 138px;
  border-color: #d2ccc3;
  background: #fffaf2;
  color: #624327;
  font-weight: 700;
}

.thesis-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .9fr) minmax(260px, .8fr);
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f8fbfa;
}
.thesis-strip > div {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #e1e9e6;
  border-radius: 8px;
  background: #fff;
}
.thesis-strip span { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; }
.thesis-strip strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.threat-hot { border-color: rgba(217, 65, 78, .34) !important; background: #fff7f6 !important; }
.threat-hot strong { color: var(--red); }

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
}
.viewport-shell {
  position: relative;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #e6eeeb;
}
.map-head {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 14px;
  right: auto;
  max-width: calc(100% - 28px);
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
  pointer-events: none;
}
.map-head > div {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(210, 224, 218, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(8px);
}
.map-head span { color: var(--muted); font-size: 11px; font-weight: 800; }
.map-head strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.legend { grid-auto-flow: column; align-items: center; gap: 7px !important; }
.legend { display: none !important; }
.legend i { width: 12px; height: 12px; border-radius: 999px; }
.base-dot { background: var(--teal); }
.hospital-dot { background: #182026; }
.vehicle-dot { background: var(--blue); }
.p1-dot { background: var(--red); }
#mapCanvas { width: 100%; height: 100%; display: block; }
.inspector {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  background: var(--panel);
}
.inspector section {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid #e0e8e5;
  border-radius: 8px;
  background: #fff;
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.panel-heading h2 { margin: 0; font-size: 13px; }
.panel-heading span { color: var(--muted); font-size: 12px; font-weight: 800; }
.life-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.life {
  height: 34px;
  border-radius: 8px;
  background: var(--red);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .75);
}
.life.lost { background: #dfe7e3; box-shadow: inset 0 0 0 1px #c6d3ce; }
.threat-banner {
  padding: 10px;
  border-radius: 8px;
  background: #eef8f5;
  color: #16675d;
  font-weight: 900;
}
.threat-banner.hot { background: #fff1ef; color: var(--red); }
.game-stats, .metric-grid, .comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}
.game-stats div, .metric, .comparison-card {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #e0e8e5;
  border-radius: 8px;
  background: #f8fbfa;
}
.game-stats span, .metric span, .comparison-card span { color: var(--muted); font-size: 11px; font-weight: 800; }
.game-stats strong, .metric strong, .comparison-card strong { font-size: 16px; line-height: 1.05; }
.comparison-card.good strong { color: var(--green); }
.comparison-card.bad strong { color: var(--red); }
.item-list { display: grid; gap: 8px; }
.item {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid #e0e8e5;
  border-radius: 8px;
  background: #f8fbfa;
}
.item strong { font-size: 13px; }
.item span { color: var(--muted); font-size: 12px; }
.item.p1 { border-color: rgba(217, 65, 78, .32); background: #fff7f6; }
.empty { color: var(--muted); font-size: 13px; margin: 0; }

.timeline-panel {
  display: grid;
  grid-template-columns: 300px 1fr;
  align-items: center;
  gap: 14px;
  padding: 7px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.timeline-panel strong { display: block; font-size: 13px; }
.timeline-panel span { color: var(--muted); font-size: 12px; }
.timeline-svg { width: 100%; height: 26px; }

@media (max-width: 1280px) {
  body { min-width: 980px; }
  .control-panel { grid-template-columns: 150px 142px 170px 104px 72px 124px auto; }
  .control-panel label:nth-of-type(5),
  .control-panel label:nth-of-type(6) { display: none; }
  .command-row { grid-column: span 2; }
  .workspace { grid-template-columns: minmax(0, 1fr) 286px; }
}

@media (max-width: 900px) {
  body {
    min-width: 0;
    overflow: auto;
  }

  .access-shell {
    display: block;
  }

  .access-story {
    padding: 28px 20px;
  }

  .access-points {
    grid-template-columns: 1fr;
  }

  .access-tool {
    margin: 0 20px 24px;
    padding: 24px 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .access-preview {
    display: none;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    display: block;
  }

  .control-panel {
    grid-template-columns: 1fr 1fr;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .brand-block,
  .command-row,
  .paywall-return {
    grid-column: 1 / -1;
  }

  .control-panel label:nth-of-type(4) {
    display: none;
  }

  .thesis-strip {
    grid-template-columns: 1fr;
  }

  .workspace {
    display: block;
  }

  .viewport-shell {
    height: 58vh;
    min-height: 420px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .map-head {
    left: 10px;
    top: 10px;
  }

  .map-head strong {
    font-size: 20px;
  }

  .inspector {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .timeline-panel {
    grid-template-columns: 1fr;
  }
}
