/* ============================================================================
   Namma Metro map — styles
   Dark cartographic theme, no frameworks.
   ========================================================================== */

:root {
  --bg:            #080d18;
  --panel:         #0e1524;
  --panel-2:       #131c2e;
  --line:          #1e2a40;
  --line-soft:     #182134;
  --ink:           #e8eefc;
  --ink-2:         #9fb0cd;
  --ink-3:         #64769a;
  --accent:        #5aa9ff;
  --water:         #16304f;
  --water-edge:    #1d456e;
  --boundary:      #24344f;
  --radius:        11px;
  --panel-w:       352px;
  --shadow:        0 18px 44px rgba(0, 0, 0, .55);
  --font:          ui-sans-serif, -apple-system, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono:          ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --st-operational:  #4ade80;
  --st-construction: #fbbf24;
  --st-approved:     #60a5fa;
  --st-planned:      #a78bfa;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; color: inherit; }
a { color: var(--accent); }

/* ------------------------------------------------------------------ shell -- */
#app {
  display: grid;
  grid-template-columns: var(--panel-w) 1fr;
  height: 100%;
  position: relative;
}
#panel { grid-column: 1; grid-row: 1; }
#stage { grid-column: 2; grid-row: 1; }
#app.panel-hidden { grid-template-columns: 0 1fr; }
#app.panel-hidden #panel { transform: translateX(-100%); opacity: 0; pointer-events: none; }

/* ------------------------------------------------------------------- map --- */
#stage { position: relative; overflow: hidden; background: var(--bg); }

#map {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#map.dragging { cursor: grabbing; }

/* basemap layers */
.water        { fill: var(--water); stroke: var(--water-edge); stroke-width: 1; vector-effect: non-scaling-stroke; }
.boundary     { fill: none; stroke: #24344f; stroke-width: 1.25; stroke-dasharray: 7 6; vector-effect: non-scaling-stroke; opacity: .85; }

#layer-water, #layer-boundary { transition: opacity .25s ease; }
#app.no-base #layer-water,
#app.no-base #layer-boundary { opacity: 0; }

/* metro track geometry */
.track {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  transition: opacity .22s ease, stroke-width .22s ease;
}
.track-casing { stroke: #05080f; opacity: .85; }
.track-halo   {
  fill: none; stroke-linecap: round;
  vector-effect: non-scaling-stroke;
  opacity: .11;
  filter: url(#softglow);
  transition: opacity .2s ease;
}
.track-halo.is-lit { opacity: .38; }

.track[data-status="operational"]  { stroke-width: 5.2; }
.track[data-status="construction"] { stroke-width: 4.4; stroke-dasharray: 13 7;  opacity: .95; }
.track[data-status="approved"]     { stroke-width: 3.8; stroke-dasharray: 8 8;   opacity: .78; }
.track[data-status="planned"]      { stroke-width: 3.4; stroke-dasharray: 2.5 7; opacity: .68; }

.track-casing[data-status="operational"]  { stroke-width: 9.5; }
.track-casing[data-status="construction"] { stroke-width: 8.4; }
.track-casing[data-status="approved"]     { stroke-width: 7.4; }
.track-casing[data-status="planned"]      { stroke-width: 7.0; }

/* dimming when a line is isolated / filtered out */
.is-dim   { opacity: .07 !important; }
.is-hidden { display: none !important; }

/* stations */
.stn { cursor: pointer; }
.stn-hit { fill: transparent; }
.stn-dot { stroke-width: 2.4; transition: r .15s ease; }
.stn-dot[data-kind="op"]      { fill: #0a1020; }
.stn-dot[data-kind="future"]  { fill: #0a1020; stroke-dasharray: 3 2.6; }
.stn-ix  { fill: #f2f6ff; stroke: #0a1020; stroke-width: 2; }
.stn-ix-ring { fill: none; stroke-width: 2.6; }
.stn.is-active .stn-dot { stroke-width: 3.4; }
.stn.is-active .stn-ix  { stroke: var(--accent); }
.stn:hover .stn-dot { stroke-width: 3.4; }

.pulse { fill: none; stroke: var(--accent); stroke-width: 2; opacity: 0; }
.stn.is-active .pulse { animation: pulse 1.8s ease-out infinite; }
@keyframes pulse {
  0%   { r: 7;  opacity: .85; }
  100% { r: 26; opacity: 0; }
}

/* labels */
.lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1px;
  fill: #dbe6fb;
  paint-order: stroke fill;
  stroke: #060a13;
  stroke-width: 3.2;
  stroke-linejoin: round;
  pointer-events: none;
  user-select: none;
}
.lbl[data-ix="1"] { font-size: 12px; fill: #ffffff; font-weight: 700; }
.lbl[data-terminus="1"] { font-size: 12px; fill: #ffffff; }
.lbl-line { font-size: 11px; font-weight: 700; letter-spacing: .3px; opacity: .9; }
#app.no-labels #layer-labels { display: none; }

/* ------------------------------------------------------- floating controls -- */
.floating {
  position: absolute;
  background: rgba(14, 21, 36, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 5;
}

#zoombar { top: 16px; right: 16px; display: flex; flex-direction: column; overflow: hidden; }
#zoombar button {
  width: 38px; height: 38px;
  background: none; border: 0;
  color: var(--ink-2);
  font-size: 17px; line-height: 1;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s, color .15s;
}
#zoombar button:hover { background: var(--panel-2); color: var(--ink); }
#zoombar button + button { border-top: 1px solid var(--line); }

#compass { top: 16px; right: 66px; padding: 4px; display: grid; place-items: center; }
.c-ring  { fill: none; stroke: #253552; stroke-width: 1.5; }
.c-n     { fill: #e05a5a; }
.c-s     { fill: #33425f; }
.c-label { fill: #8fa3c6; font-size: 8px; font-weight: 700; font-family: var(--font); }

#scalebar {
  left: 16px; bottom: 44px;
  padding: 7px 10px 6px;
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10.5px; color: var(--ink-2); font-family: var(--mono);
}
#scalebar .bar {
  height: 5px; width: 90px;
  border: 1px solid var(--ink-3);
  border-top: 0;
  transition: width .15s ease;
}

#panel-toggle {
  top: 16px; left: 16px;
  width: 38px; height: 38px;
  display: none; place-items: center;
  color: var(--ink-2); cursor: pointer;
}
#app.panel-hidden #panel-toggle { display: grid; }

#attrib {
  position: absolute; left: 16px; bottom: 12px;
  font-size: 10.5px; color: var(--ink-3);
  z-index: 4; max-width: 62%;
}
#attrib a { color: var(--ink-2); }

/* tooltip */
#tooltip {
  position: absolute;
  z-index: 40;
  pointer-events: none;
  transform: translate(-50%, -100%);
  background: rgba(9, 14, 26, .96);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 12px;
  box-shadow: var(--shadow);
  white-space: nowrap;
  animation: fade .12s ease;
}
#tooltip .tt-name { font-weight: 650; }
#tooltip .tt-lines { display: flex; gap: 5px; margin-top: 5px; }
#tooltip .tt-chip { width: 22px; height: 4px; border-radius: 2px; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }

/* ------------------------------------------------------------------ panel -- */
#panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  z-index: 10;
  transition: transform .28s cubic-bezier(.4,0,.2,1), opacity .2s;
}

#brand {
  display: flex; gap: 12px; align-items: center;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.brand-mark { display: grid; grid-template-columns: repeat(2, 7px); gap: 3px; }
.brand-mark span { width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.brand-text h1 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.brand-text p  { margin: 3px 0 0; font-size: 11.5px; color: var(--ink-3); }

/* search */
.search-wrap { position: relative; padding: 14px 16px 10px; }
.search-icon { position: absolute; left: 27px; top: 25px; color: var(--ink-3); pointer-events: none; }
#search {
  width: 100%;
  padding: 9px 30px 9px 32px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none;
  font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
#search:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90,169,255,.14); }
#search::-webkit-search-cancel-button { display: none; }
#search-clear {
  position: absolute; right: 26px; top: 23px;
  background: none; border: 0; color: var(--ink-3);
  font-size: 17px; cursor: pointer; line-height: 1;
}
#results {
  position: absolute; left: 16px; right: 16px; top: 52px;
  margin: 0; padding: 5px;
  list-style: none;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 320px; overflow-y: auto;
  z-index: 20;
}
#results li {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: 7px;
  font-size: 12.5px; cursor: pointer;
}
#results li:hover, #results li.is-cursor { background: #1b2740; }
#results .r-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#results .r-code { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }
#results .r-swatches { display: flex; gap: 3px; }
#results .r-sw { width: 4px; height: 15px; border-radius: 2px; }
#results .r-empty { color: var(--ink-3); justify-content: center; cursor: default; }

/* stats */
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; margin: 4px 16px 14px;
  background: var(--line-soft);
  border: 1px solid var(--line-soft);
  border-radius: 10px; overflow: hidden;
}
.stat { background: var(--panel-2); padding: 10px 8px; text-align: center; }
.stat b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
.stat span { font-size: 9.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .55px; }

/* tabs */
.tabs { display: flex; gap: 3px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); }
.tab {
  flex: 1; padding: 9px 6px;
  background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--ink-3); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink-2); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }

.tab-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.tab-pane { display: none; padding: 14px 16px 26px; }
.tab-pane.is-active { display: block; }

/* status filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 8px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px; color: var(--ink-2);
  cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, opacity .15s;
}
.chip:hover { border-color: #2c3d5c; }
.chip.is-off { opacity: .4; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip .n { font-family: var(--mono); font-size: 10px; color: var(--ink-3); }

/* line list */
#line-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.line-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  overflow: hidden;
  transition: border-color .18s, opacity .18s, transform .18s;
}
.line-item:hover { border-color: #2c3d5c; }
.line-item.is-off { opacity: .38; }
.line-item.is-solo { border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }

.line-head {
  display: grid;
  grid-template-columns: 6px 1fr auto;
  gap: 11px; align-items: center;
  padding: 10px 12px 10px 0;
  cursor: pointer;
  position: relative;
}
.line-head::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; background: var(--c);
}
.line-title { min-width: 0; }
.line-title .nm { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; }
.line-title .sub { margin-top: 3px; font-size: 11px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill {
  font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  padding: 2px 6px; border-radius: 4px;
  background: color-mix(in srgb, var(--sc) 20%, transparent);
  color: var(--sc);
  border: 1px solid color-mix(in srgb, var(--sc) 35%, transparent);
}
.line-meta { text-align: right; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); line-height: 1.5; }
.line-meta b { display: block; color: var(--ink-2); font-size: 12px; }

.line-body { display: none; padding: 2px 14px 14px 18px; border-top: 1px solid var(--line-soft); }
.line-item.is-open .line-body { display: block; }
.line-note { font-size: 11.5px; line-height: 1.6; color: var(--ink-2); margin: 11px 0 13px; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 14px; font-size: 11.5px; }
.timeline li::before {
  content: ""; position: absolute; left: -19px; top: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--c);
}
.timeline li.future::before { background: var(--panel); border-style: dashed; }
.timeline .when { display: block; font-family: var(--mono); font-size: 10px; color: var(--ink-3); margin-bottom: 2px; }
.timeline .what { color: var(--ink-2); line-height: 1.5; }
.timeline li.future .what { color: var(--ink); }

.line-actions { display: flex; gap: 7px; margin-top: 12px; }
.btn {
  flex: 1; padding: 7px 9px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 7px;
  font-size: 11px; color: var(--ink-2); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: #1b2740; color: var(--ink); border-color: #2c3d5c; }

/* legend + about */
.legend-block { margin-bottom: 22px; }
.legend-block h3 {
  margin: 0 0 11px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3);
}
.legend-row { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; font-size: 12px; }
.legend-row .swatch { flex: 0 0 46px; height: 18px; display: grid; place-items: center; }
.legend-row .txt b { display: block; font-weight: 600; font-size: 12px; }
.legend-row .txt span { font-size: 10.5px; color: var(--ink-3); }

.toggles { display: flex; flex-direction: column; gap: 9px; }
.toggle { display: flex; align-items: center; gap: 9px; font-size: 12px; cursor: pointer; user-select: none; }
.toggle input { appearance: none; width: 32px; height: 18px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .18s; flex: 0 0 auto; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--ink-3); transition: transform .18s, background .18s; }
.toggle input:checked { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.toggle input:checked::after { transform: translateX(14px); background: var(--accent); }

.prose { font-size: 12px; line-height: 1.7; color: var(--ink-2); }
.prose h3 { margin: 20px 0 8px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3); }
.prose h3:first-child { margin-top: 0; }
.prose p { margin: 0 0 11px; }
.prose ul { margin: 0 0 11px; padding-left: 17px; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: var(--mono); font-size: 11px; background: var(--panel-2); padding: 1.5px 5px; border-radius: 4px; color: var(--ink); }
.prose kbd {
  font-family: var(--mono); font-size: 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; color: var(--ink);
}
.caveat {
  margin-top: 14px; padding: 11px 12px;
  background: color-mix(in srgb, var(--st-construction) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--st-construction) 26%, transparent);
  border-radius: 9px;
  font-size: 11.5px; line-height: 1.6; color: #f3ddb0;
}

/* ---------------------------------------------------------- route planner -- */
.planner { margin-bottom: 16px; }

.od { display: grid; grid-template-columns: 12px 1fr 32px; gap: 9px; align-items: center; }
.od-rail { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.od-o, .od-d { width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--ink-3); }
.od-d { border-radius: 2px; border-color: var(--accent); background: var(--accent); }
.od-line { width: 2px; flex: 1; min-height: 22px; background: repeating-linear-gradient(180deg, var(--line) 0 3px, transparent 3px 6px); }
.od-fields { display: flex; flex-direction: column; gap: 8px; }

.picker { position: relative; }
.picker input {
  width: 100%;
  padding: 9px 11px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  outline: none; font-size: 13px;
  transition: border-color .15s, box-shadow .15s;
}
.picker input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(90,169,255,.14); }
.picker input::-webkit-search-cancel-button { display: none; }

.picker-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 5px);
  margin: 0; padding: 5px; list-style: none;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  max-height: 260px; overflow-y: auto; z-index: 25;
}
.picker-list li {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: 7px; font-size: 12.5px; cursor: pointer;
}
.picker-list li:hover, .picker-list li.is-cursor { background: #1b2740; }

#swap {
  width: 32px; height: 32px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--ink-2); cursor: pointer;
  display: grid; place-items: center;
  transition: background .15s, color .15s, transform .2s;
}
#swap:hover { background: #1b2740; color: var(--ink); transform: rotate(180deg); }

.seg-group { margin-top: 14px; }
.seg-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--ink-3); margin-bottom: 6px; }
.seg {
  display: flex; gap: 2px; padding: 3px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px;
}
.seg button {
  flex: 1; padding: 6px 4px;
  background: none; border: 0; border-radius: 6px;
  font-size: 11px; color: var(--ink-3); cursor: pointer; white-space: nowrap;
  transition: background .15s, color .15s;
}
.seg button:hover { color: var(--ink-2); }
.seg button.is-on { background: #22314c; color: var(--ink); font-weight: 600; }
.seg-hint { margin: 7px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--ink-3); }

.btn-wide { width: 100%; margin-top: 14px; }

.route-empty {
  padding: 15px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.route-empty b { font-size: 12.5px; }
.route-empty p { margin: 6px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }
.route-empty.is-warn {
  background: color-mix(in srgb, var(--st-construction) 9%, transparent);
  border-color: color-mix(in srgb, var(--st-construction) 30%, transparent);
}
.route-empty.is-warn b { color: var(--st-construction); }
.route-empty.is-warn p { color: #e8d5ab; }

.route-summary {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}
.rs-main { padding: 13px 15px 11px; }
.rs-time { font-size: 25px; font-weight: 700; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.rs-sub { margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }
.rs-break { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line-soft); border-top: 1px solid var(--line-soft); }
.rs-break span { background: var(--panel); padding: 8px 6px; text-align: center; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.rs-break i { display: block; font-style: normal; font-size: 9px; text-transform: uppercase; letter-spacing: .5px; color: var(--ink-3); margin-bottom: 2px; }

.route-note {
  margin-top: 10px; padding: 10px 12px;
  background: color-mix(in srgb, var(--st-construction) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--st-construction) 26%, transparent);
  border-radius: 9px; font-size: 11px; line-height: 1.55; color: #f3ddb0;
}

.itinerary { list-style: none; margin: 14px 0 0; padding: 0; }
.itn-leg { display: grid; grid-template-columns: 4px 1fr; gap: 11px; padding: 3px 0; }
.itn-bar { background: var(--c); border-radius: 2px; }
.itn-head { display: flex; align-items: center; gap: 7px; font-size: 12.5px; }
.itn-dir { font-size: 10.5px; color: var(--ink-3); margin: 2px 0 8px; }
.itn-od { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; padding: 2px 0; }
.itn-dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--c); background: var(--panel); flex: 0 0 auto; }
.itn-via, .itn-via-none {
  display: flex; align-items: center; gap: 6px;
  margin: 5px 0 5px 16px; padding: 4px 0;
  background: none; border: 0;
  font-size: 11px; color: var(--ink-3); text-align: left;
}
.itn-via { cursor: pointer; }
.itn-via:hover { color: var(--ink-2); }
.itn-via .chev { transition: transform .18s; }
.itn-via.is-open .chev { transform: rotate(180deg); }
.itn-via-list { list-style: none; margin: 0 0 6px 16px; padding: 0 0 0 12px; border-left: 1px dashed var(--line); }
.itn-via-list li { font-size: 11px; color: var(--ink-3); padding: 3px 0; }
.itn-change {
  display: flex; align-items: center; gap: 9px;
  margin: 7px 0; padding: 8px 11px;
  background: var(--panel-2); border: 1px dashed var(--line); border-radius: 8px;
  font-size: 11.5px; color: var(--ink-2);
}
.itn-change .itn-icon { color: var(--accent); font-size: 13px; }
.itn-change em { font-style: normal; color: var(--ink-3); font-size: 10.5px; }

.route-assume { margin: 14px 0 0; font-size: 10px; line-height: 1.6; color: var(--ink-3); }

.d-actions { display: flex; gap: 7px; margin-top: 14px; }

/* route highlight on the map */
.route-casing {
  fill: none; stroke: #05080f; stroke-width: 13;
  stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.route-track {
  fill: none; stroke-width: 7;
  stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 0 6px currentColor);
}
#app.routing #layer-lines .track,
#app.routing #layer-casing .track { opacity: .1; }
#app.routing #layer-halo { opacity: 0; }
#app.routing #layer-water,
#app.routing #layer-boundary { opacity: .45; }
.stn.on-route .stn-dot { stroke-width: 3.2; }
.stn.is-endpoint .stn-dot,
.stn.is-endpoint .stn-ix { stroke: #ffffff; stroke-width: 3; }
.stn.is-endpoint .stn-ix-ring { stroke: #ffffff; }

/* --------------------------------------------------------- detail drawer --- */
#detail {
  position: absolute;
  right: 16px; bottom: 16px;
  width: 320px; max-height: calc(100% - 100px);
  overflow-y: auto;
  background: rgba(14, 21, 36, .95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: var(--shadow);
  padding: 16px 17px 17px;
  z-index: 30;
  animation: rise .2s cubic-bezier(.3,1.2,.5,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: none } }

#detail-close {
  position: absolute; top: 9px; right: 10px;
  width: 24px; height: 24px; border-radius: 6px;
  background: none; border: 0; color: var(--ink-3);
  font-size: 17px; line-height: 1; cursor: pointer;
}
#detail-close:hover { background: var(--panel-2); color: var(--ink); }

.d-kicker { font-size: 9.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--ink-3); margin-bottom: 5px; }
.d-name { margin: 0 0 3px; font-size: 17px; line-height: 1.25; letter-spacing: -.2px; padding-right: 22px; }
.d-kn { font-size: 12px; color: var(--ink-3); margin-bottom: 12px; }
.d-rows { display: flex; flex-direction: column; gap: 9px; margin-top: 13px; }
.d-row { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; }
.d-row .k { flex: 0 0 74px; color: var(--ink-3); font-size: 11px; padding-top: 1px; }
.d-row .v { flex: 1; min-width: 0; }
.d-lines { display: flex; flex-direction: column; gap: 7px; }
.d-line { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }
.d-line .bar { width: 4px; height: 17px; border-radius: 2px; background: var(--c); flex: 0 0 auto; }
.d-line:hover { color: #fff; }
.d-badge {
  display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; padding: 2px 6px; border-radius: 4px;
  background: color-mix(in srgb, var(--sc) 20%, transparent);
  color: var(--sc); border: 1px solid color-mix(in srgb, var(--sc) 35%, transparent);
}
.d-code { font-family: var(--mono); }
.d-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 13px; font-size: 11.5px; }

/* ----------------------------------------------------------------- loader -- */
#loader {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 15px;
  background: var(--bg); z-index: 100;
  transition: opacity .35s ease, visibility .35s;
}
#app:not(.is-loading) #loader { opacity: 0; visibility: hidden; }
#loader p { margin: 0; font-size: 12px; color: var(--ink-3); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ------------------------------------------------------------- responsive -- */
@media (max-width: 880px) {
  #app,
  #app.panel-hidden { grid-template-columns: 1fr; }
  #stage { grid-column: 1; }
  #panel {
    grid-column: 1;
    position: absolute; inset: 0 auto 0 0;
    width: min(88vw, var(--panel-w));
    box-shadow: var(--shadow);
  }
  #panel-toggle { display: grid; }
  #app:not(.panel-hidden) #panel-toggle { left: calc(min(88vw, var(--panel-w)) + 12px); }
  #app:not(.panel-hidden) #zoombar,
  #app:not(.panel-hidden) #compass { display: none; }
  #detail { left: 12px; right: 12px; width: auto; bottom: 12px; max-height: 52%; }
  #scalebar { bottom: 62px; }
  #attrib { max-width: 100%; bottom: 6px; font-size: 9.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
