/* duara-geo playground
 *
 * The playground's own stylesheet, separate from portal.css because it is the only page here
 * that is an application rather than a document: it owns the whole viewport, it has a tool
 * rail, a map that must never scroll away, and a dozen widgets the reference pages have no
 * use for. Keeping it apart means the overview and reference pages do not download layout
 * rules for a screen they never render.
 *
 * ============================ THE LAYOUT DECISION ===================================
 *
 * Three columns: a rail of tools, a panel of inputs and results, and the map.
 *
 * The version this replaces stacked every control -- basemap switcher, tool picker, search,
 * points, options, results, request -- into one scrolling column beside the map. Everything
 * was reachable and nothing was findable: choosing a tool meant scrolling past the basemap
 * chips, and reading a result meant scrolling away from the Run button that produced it.
 *
 * So: the tools move to a rail that is always fully visible, the map controls (search, layer
 * switcher, locate) move onto the map where a person who has used any map before will look
 * for them, and the Run button is pinned to the bottom of the panel where it cannot scroll
 * out of reach. What is left in the panel is the one thing that genuinely differs per tool --
 * its inputs and its answer.
 */

body.pg-body { overflow: hidden; }

.pg {
  display: grid;
  grid-template-columns: 92px 348px 1fr;
  height: calc(100dvh - 56px);
  min-height: 420px;
}

/* ---------------------------------------------------------------- the tool rail */

.pg-rail {
  border-right: 1px solid var(--border);
  background: var(--bg-soft);
  overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 8px 6px 20px;
  scrollbar-width: thin;
}

.rail-group {
  margin: 10px 0 4px; padding: 0 4px;
  font: 640 9px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase;
  color: var(--fg-faint);
}

.rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 100%; padding: 8px 2px 7px; margin-bottom: 2px;
  border: 1px solid transparent; border-radius: 9px;
  background: none; color: var(--fg-muted); cursor: pointer;
  font: 500 10px/1.15 var(--sans); text-align: center;
  position: relative;
}
.rail-item svg { display: block; width: 19px; height: 19px; }
.rail-item:hover:not(:disabled) { background: var(--bg-sunken); color: var(--fg); }
.rail-item.active {
  background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, transparent);
  font-weight: 620;
}
.rail-item:disabled { opacity: .34; cursor: not-allowed; }
.rail-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }


/* ---------------------------------------------------------------- the panel */

.pg-panel {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--border); background: var(--bg-soft);
}
.pg-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

.blk { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.blk:last-child { border-bottom: 0; }
.blk > h3 {
  margin: 0 0 2px; font: 640 11px/1.4 var(--sans);
  letter-spacing: .06em; text-transform: uppercase; color: var(--fg-muted);
}
.blk .hint { margin: 0 0 10px; font-size: 12.5px; color: var(--fg-muted); }
.blk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.blk-head > h3 { margin: 0; flex: 1; }

.tool-head { padding: 15px 16px 13px; }
.tool-head h2 {
  margin: 0; font-size: 17px; font-weight: 660; letter-spacing: -.015em;
  display: flex; align-items: center; gap: 8px;
}
.tool-head h2 svg { width: 17px; height: 17px; color: var(--accent); flex: none; }
.tool-head p { margin: 5px 0 9px; font-size: 12.5px; color: var(--fg-muted); }
.tool-head .sig {
  display: inline-flex; align-items: center; gap: 7px;
  font: 12px/1 var(--mono); color: var(--fg-faint);
}

.ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  height: 24px; min-width: 24px; padding: 0 7px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--fg-muted);
  font: 500 11.5px/1 var(--sans); cursor: pointer;
}
.ghost:hover:not(:disabled) { background: var(--bg-sunken); color: var(--fg); border-color: var(--border-strong); }
.ghost:disabled { opacity: .4; cursor: not-allowed; }
.ghost svg { width: 13px; height: 13px; }
.ghost.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------- the point list */

.pt {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 4px; border-radius: 8px; margin-bottom: 2px;
  cursor: grab; border: 1px solid transparent;
}
.pt:hover { background: var(--bg-sunken); }
.pt.dragging { opacity: .4; }
.pt.dropbefore { border-top-color: var(--accent); }
.pt.dropafter { border-bottom-color: var(--accent); }
.pt .grip { color: var(--fg-faint); font-size: 12px; line-height: 1; letter-spacing: -1px; flex: none; }
.pt .badge {
  flex: none; width: 20px; height: 20px; border-radius: 50%;
  font: 620 10.5px/20px var(--mono); text-align: center; color: #fff; background: var(--accent);
}
.pt .body { flex: 1; min-width: 0; }
.pt .coord { font: 11.5px/1.35 var(--mono); color: var(--fg); }
.pt .where {
  font-size: 11px; color: var(--fg-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pt .kill {
  flex: none; border: 0; background: none; cursor: pointer; color: var(--fg-faint);
  font-size: 15px; line-height: 1; padding: 2px 4px; border-radius: 5px; opacity: 0;
}
.pt:hover .kill { opacity: 1; }
.pt .kill:hover { color: var(--bad); background: var(--bad-soft); }
.pt .coord-edit { width: 100%; padding: 3px 6px; font: 11.5px/1.3 var(--mono); }

.empty {
  padding: 14px; border: 1px dashed var(--border-strong); border-radius: 9px;
  text-align: center; font-size: 12.5px; color: var(--fg-muted);
}
.empty kbd { margin: 0 1px; }

/* ---------------------------------------------------------------- fields */

.field label { display: flex; align-items: baseline; gap: 6px; }
.field label .val {
  margin-left: auto; font: 600 11.5px/1 var(--mono); color: var(--fg); text-transform: none; letter-spacing: 0;
}
.field .note-sm { margin: 4px 0 0; font-size: 11.5px; color: var(--fg-faint); }
input[type=range] { width: 100%; accent-color: var(--accent); }

.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; margin-bottom: 12px; }
.switch input { appearance: none; margin: 0; flex: none; width: 32px; height: 18px; border-radius: 999px;
  background: var(--border-strong); position: relative; cursor: pointer; transition: background .12s; }
.switch input::after {
  content: ''; position: absolute; left: 2px; top: 2px; width: 14px; height: 14px;
  border-radius: 50%; background: #fff; transition: transform .12s;
}
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(14px); }
.switch span { font-size: 12.5px; font-weight: 520; color: var(--fg); }
.switch small { display: block; font-size: 11.5px; font-weight: 400; color: var(--fg-muted); }

.chips { display: flex; gap: 5px; flex-wrap: wrap; }
.chip {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--bg); font: 500 12px/1.35 var(--sans); cursor: pointer; color: var(--fg);
}
.chip:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip:disabled { opacity: .4; cursor: not-allowed; }
.chip .sw { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }

.chipsearch { margin-bottom: 7px; }
.chipbox { max-height: 132px; overflow-y: auto; padding: 2px; scrollbar-width: thin; }

/* ---------------------------------------------------------------- run bar */

.pg-run {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-top: 1px solid var(--border);
  background: var(--bg); box-shadow: 0 -4px 14px rgba(0,0,0,.05);
}
.pg-run .btn { padding: 8px 14px; }
.pg-run .go { flex: 1; justify-content: center; }
.pg-run .timing { font: 600 11px/1 var(--mono); color: var(--fg-muted); white-space: nowrap; }

/* ---------------------------------------------------------------- output */

.tabbar { display: flex; gap: 1px; margin: 0 0 10px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.tabbar button {
  padding: 6px 9px; border: 0; background: none; cursor: pointer; margin-bottom: -1px;
  font: 550 12px/1 var(--sans); color: var(--fg-muted); border-bottom: 2px solid transparent;
}
.tabbar button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabbar .grow { flex: 1; }

.result { font-size: 13px; }
.result dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0 0 4px; }
.result dt { color: var(--fg-muted); font-size: 12.5px; }
.result dd { margin: 0; font-weight: 560; font-variant-numeric: tabular-nums; text-align: right; }
.result h4 {
  margin: 14px 0 6px; font: 640 11px/1 var(--sans); letter-spacing: .05em;
  text-transform: uppercase; color: var(--fg-muted);
}

.steps { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12.5px; max-height: 260px; overflow-y: auto; scrollbar-width: thin; }
.steps li {
  padding: 6px 6px; border-radius: 7px; display: flex; gap: 9px; align-items: flex-start;
  cursor: default;
}
.steps li + li { border-top: 1px solid var(--border); border-radius: 0; }
.steps li.hot { background: var(--accent-soft); }
.steps .n {
  flex: 0 0 19px; height: 19px; border-radius: 50%; background: var(--bg-sunken);
  font: 600 10.5px/19px var(--mono); text-align: center; color: var(--fg-muted);
}
.steps li.hot .n { background: var(--accent); color: var(--on-accent); }

/* The matrix grid. A table of numbers is unreadable at a glance; a table of numbers with the
 * slowest cells tinted is a picture of where the depot should go. */
.mx { border-collapse: separate; border-spacing: 2px; font-size: 11.5px; width: 100%; }
.mx th { padding: 3px; font: 600 10.5px/1 var(--mono); color: var(--fg-muted); text-transform: none; letter-spacing: 0; border: 0; text-align: center; }
.mx td {
  padding: 5px 3px; text-align: center; border: 0; border-radius: 5px;
  font-variant-numeric: tabular-nums; background: var(--bg-sunken); white-space: nowrap;
}
.mx td.self { color: var(--fg-faint); background: none; }
.mx td.est { outline: 1px dashed var(--warn); }

.bars { margin-top: 8px; }
.bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.bar .lab {
  flex: 0 0 94px; display: flex; align-items: center; gap: 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar .track { flex: 1; height: 9px; border-radius: 5px; background: var(--bg-sunken); overflow: hidden; }
/* display:block, because a bare <span> is inline and an inline box ignores width and height --
 * which renders as a track with no bar in it and no error anywhere. */
.bar .fill { display: block; height: 100%; border-radius: 5px; min-width: 3px; }
.bar .num { flex: 0 0 auto; font: 600 11.5px/1 var(--mono); font-variant-numeric: tabular-nums; }

.swatch { width: 9px; height: 9px; border-radius: 3px; flex: none; }

.profile { position: relative; margin-top: 10px; }
.profile svg { display: block; width: 100%; height: 92px; overflow: visible; }
.profile .tipbox {
  position: absolute; top: -4px; padding: 3px 7px; border-radius: 6px; pointer-events: none;
  background: var(--fg); color: var(--bg); font: 600 11px/1.3 var(--mono); white-space: nowrap;
  transform: translateX(-50%); display: none;
}

.rowlist { margin-top: 6px; }
.rowlist .row {
  display: flex; gap: 9px; align-items: flex-start; padding: 7px 6px; border-radius: 7px;
  font-size: 12.5px; cursor: pointer;
}
.rowlist .row + .row { border-top: 1px solid var(--border); border-radius: 0; }
.rowlist .row:hover { background: var(--bg-sunken); }
.rowlist .row .n {
  flex: 0 0 17px; height: 17px; border-radius: 50%; background: var(--bg-sunken);
  font: 600 10px/17px var(--mono); text-align: center; color: var(--fg-muted);
}
.rowlist .row .t { font-weight: 560; flex: 1; min-width: 0; }
.rowlist .row .s { display: block; font-size: 11.5px; color: var(--fg-muted); }
.rowlist .row .r { margin-left: auto; text-align: right; font: 600 11px/1.4 var(--mono); color: var(--fg-muted); white-space: nowrap; }

.clock { font: 700 26px/1.1 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 2px 0 2px; }

.kv { display: flex; gap: 8px; align-items: baseline; font-size: 13px; margin-bottom: 4px; }
.kv .k { color: var(--fg-muted); min-width: 120px; }
.kv .v { font-family: var(--mono); font-size: 12.5px; }

.hist { margin: 0; padding: 0; list-style: none; font-size: 12px; }
.hist li { display: flex; gap: 8px; align-items: center; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.hist li:hover { background: var(--bg-sunken); }
.hist .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--ok); }
.hist .dot.bad { background: var(--bad); }
.hist .ms { margin-left: auto; font: 600 11px/1 var(--mono); color: var(--fg-muted); }

/* ---------------------------------------------------------------- the map column */

.pg-map { position: relative; background: var(--bg-sunken); overflow: hidden; }
#pg-map { position: absolute; inset: 0; }

.map-panel {
  position: absolute; z-index: 410;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 3px 14px rgba(0,0,0,.13);
}

.map-search { top: 12px; left: 12px; width: min(340px, calc(100% - 24px)); }
.map-search .row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; }
.map-search svg { width: 15px; height: 15px; color: var(--fg-faint); flex: none; }
.map-search input {
  border: 0; padding: 2px 0; background: none; font-size: 13.5px; width: 100%;
}
.map-search input:focus { outline: 0; }
.map-search .k { font: 500 10px/1 var(--sans); color: var(--fg-faint); border: 1px solid var(--border); border-radius: 5px; padding: 3px 5px; flex: none; }

.suggest { border-top: 1px solid var(--border); max-height: 320px; overflow-y: auto; }
.suggest button {
  display: block; width: 100%; text-align: left; padding: 8px 11px; border: 0;
  background: none; cursor: pointer; font: inherit; color: var(--fg);
}
.suggest button + button { border-top: 1px solid var(--border); }
.suggest button:hover, .suggest button.cursor { background: var(--accent-soft); }
.suggest .main { font-size: 13px; font-weight: 550; }
.suggest .secondary { font-size: 11.5px; color: var(--fg-muted); }

.map-tools { top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 410; position: absolute; }
.map-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 9px; background: var(--bg); color: var(--fg-muted);
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); position: relative;
}
.map-btn[hidden] { display: none; }
.map-btn:hover { color: var(--fg); background: var(--bg-soft); }
.map-btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.map-btn svg { width: 16px; height: 16px; }
.map-btn .tip {
  position: absolute; right: calc(100% + 8px); top: 50%; transform: translateY(-50%);
  display: none; width: max-content; padding: 5px 9px; border-radius: 7px;
  background: var(--fg); color: var(--bg); font: 500 11.5px/1 var(--sans); pointer-events: none;
}
.map-btn:hover .tip { display: block; }

/* The layer switcher is a popover rather than a permanent panel: it is consulted once and
 * then wanted out of the way of the map it is describing. */
.layers { top: 12px; right: 54px; width: 236px; padding: 8px; display: none; }
.layers.open { display: block; }
.layers h4 { margin: 2px 6px 7px; font: 640 10px/1 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--fg-faint); }
.layers .opt {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 7px; border: 0;
  border-radius: 7px; background: none; cursor: pointer; text-align: left; color: var(--fg);
  font: 500 12.5px/1.3 var(--sans);
}
.layers .opt:hover { background: var(--bg-sunken); }
.layers .opt.active { background: var(--accent-soft); color: var(--accent); }
.layers .opt .dot { width: 22px; height: 22px; border-radius: 6px; flex: none; border: 1px solid var(--border); }
.layers .opt small { display: block; font-weight: 400; font-size: 11px; color: var(--fg-muted); }
.layers .foot { margin: 7px 6px 2px; font-size: 11px; color: var(--fg-muted); line-height: 1.45; }
.layers .foot code { font-size: 10.5px; }

.readout {
  position: absolute; left: 12px; bottom: 42px; z-index: 405;
  padding: 4px 9px; border-radius: 7px; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border: 1px solid var(--border);
  font: 500 11px/1.4 var(--mono); color: var(--fg-muted); white-space: nowrap;
}

.legend {
  position: absolute; right: 12px; bottom: 30px; z-index: 405; max-width: 220px;
  padding: 9px 11px; border-radius: 9px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border: 1px solid var(--border); box-shadow: 0 2px 10px rgba(0,0,0,.12);
  font-size: 12px;
}
.legend h5 { margin: 0 0 6px; font: 640 10px/1 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--fg-faint); }
.legend .row { display: flex; align-items: center; gap: 7px; padding: 2px 0; cursor: pointer; }
.legend .row.off { opacity: .4; }
.legend .row .sw { width: 13px; height: 9px; border-radius: 3px; flex: none; }
.legend .row .n { margin-left: auto; font: 600 11px/1 var(--mono); color: var(--fg-muted); }

/* A transparent sheet over the map, used by the trace tool so a drag draws instead of pans. */
.draw-layer { position: absolute; inset: 0; z-index: 408; cursor: crosshair; touch-action: none; }
.draw-layer .hintbar {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  background: var(--accent); color: var(--on-accent); padding: 6px 13px; border-radius: 999px;
  font: 550 12px/1 var(--sans); box-shadow: 0 3px 12px rgba(0,0,0,.2); white-space: nowrap;
}
.draw-layer svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.ctxmenu {
  position: absolute; z-index: 600; min-width: 190px; padding: 5px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 26px rgba(0,0,0,.2);
}
.ctxmenu button {
  display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 9px; border: 0;
  border-radius: 7px; background: none; cursor: pointer; text-align: left;
  font: 500 12.5px/1.3 var(--sans); color: var(--fg);
}
.ctxmenu button:hover { background: var(--bg-sunken); }
.ctxmenu button svg { width: 14px; height: 14px; color: var(--fg-faint); flex: none; }
.ctxmenu .sep { height: 1px; margin: 4px 6px; background: var(--border); }
.ctxmenu .head { padding: 5px 9px 6px; font: 11px/1.3 var(--mono); color: var(--fg-muted); }

/* ---------------------------------------------------------------- overlays */

/* Two independent ways of being hidden, on purpose.
 *
 * These overlays are shown and hidden with the `hidden` attribute, whose user-agent rule any
 * author `display` beats -- so `display: flex` here, written the obvious way, silently
 * outranks it. portal.css restores `hidden` globally, but relying on that means one stale
 * stylesheet turns a dialog into a trap with no way out. The default here is therefore
 * `display: none`, and it is the ABSENCE of the attribute that shows the thing. */
.scrim { display: none; }
.scrim:not([hidden]) {
  position: fixed; inset: 0; z-index: 800; background: rgba(9,11,15,.42);
  display: flex; align-items: flex-start; justify-content: center; padding: 12vh 20px 20px;
  backdrop-filter: blur(2px);
}

.palette {
  width: min(560px, 100%); background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 13px; box-shadow: 0 20px 60px rgba(0,0,0,.35); overflow: hidden;
}
.palette input {
  width: 100%; border: 0; border-bottom: 1px solid var(--border); border-radius: 0;
  padding: 14px 16px; font-size: 15px; background: none;
}
.palette input:focus { outline: 0; }
.palette .list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.palette .item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px 10px; border: 0;
  border-radius: 8px; background: none; cursor: pointer; text-align: left; color: var(--fg);
}
.palette .item.cursor { background: var(--accent-soft); }
.palette .item svg { width: 16px; height: 16px; color: var(--fg-muted); flex: none; }
.palette .item.cursor svg { color: var(--accent); }
.palette .item > span { min-width: 0; }
.palette .item .t { display: block; font-size: 13.5px; font-weight: 550; }
.palette .item .d {
  display: block; font-size: 11.5px; color: var(--fg-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.palette .item .badge { margin-left: auto; font: 500 10px/1 var(--sans); color: var(--fg-faint); }
.palette .none { padding: 22px; text-align: center; color: var(--fg-muted); font-size: 13px; }

.sheet {
  width: min(620px, 100%); background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: 13px; box-shadow: 0 20px 60px rgba(0,0,0,.35); padding: 22px 24px;
  max-height: 76vh; overflow-y: auto;
}
.sheet { position: relative; }
.sheet h2 { margin: 0 0 4px; font-size: 18px; font-weight: 660; padding-right: 34px; }
.sheet .shut {
  position: absolute; right: 12px; top: 12px;
  width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-soft); color: var(--fg-muted); cursor: pointer;
  font: 400 17px/1 var(--sans);
}
.sheet .shut:hover { background: var(--bg-sunken); color: var(--fg); }
.sheet p.sub { margin: 0 0 16px; color: var(--fg-muted); font-size: 13.5px; }
.sheet .keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 3px 22px; }
.sheet .keyrow { display: flex; align-items: center; gap: 10px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--border); }
.sheet .keyrow span { flex: 1; color: var(--fg-muted); }

kbd {
  display: inline-block; min-width: 19px; text-align: center;
  padding: 2px 5px; border-radius: 5px; border: 1px solid var(--border-strong);
  border-bottom-width: 2px; background: var(--bg-soft);
  font: 600 10.5px/1.4 var(--mono); color: var(--fg);
}

/* ---------------------------------------------------------------- fares
 *
 * A fare renders as a RECEIPT. The number a dispatcher needs is one line and everything else
 * is the derivation, so the price is set large and unmistakable and the arithmetic sits under
 * it in a table that visibly adds up -- which is the whole reason the API returns a breakdown.
 */

.fare-head {
  margin: 0 0 14px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--accent-soft), transparent 140%);
}
.fare-total {
  font: 650 30px/1.1 var(--sans); letter-spacing: -.02em; color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.fare-range { margin-top: 4px; font-size: 12.5px; color: var(--fg-muted); font-variant-numeric: tabular-nums; }

table.receipt { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 2px 0 4px; }
table.receipt td { padding: 6px 0; border-bottom: 1px dashed var(--border); vertical-align: top; }
table.receipt td.amt {
  text-align: right; white-space: nowrap; padding-left: 12px;
  font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px;
}
/* The rounding line is the one people query, so it is visibly a correction rather than a
 * charge -- and the minimum line is visibly a floor rather than a component. */
table.receipt tr.rc-rounding td, table.receipt tr.rc-minimum td { color: var(--fg-muted); font-style: italic; }
table.receipt tr.total td {
  border-bottom: 0; border-top: 2px solid var(--border-strong);
  padding-top: 9px; font-weight: 640; font-style: normal; color: var(--fg);
}
table.receipt tr.total td.amt { font-size: 14px; }

/* A badge in a result body, as opposed to the numbered pin badge above. */
#out-body .badge, .zone-card .badge, dd .badge {
  display: inline-block; width: auto; height: auto; border-radius: 999px;
  padding: 1px 8px; margin-left: 5px; font: 600 10.5px/1.6 var(--sans);
  letter-spacing: .01em; text-transform: none; background: var(--bg-sunken); color: var(--fg-muted);
}
#out-body .badge.ok, .zone-card .badge.ok { background: var(--ok-soft); color: var(--ok); }
#out-body .badge.bad, .zone-card .badge.bad { background: var(--bad-soft); color: var(--bad); }
#out-body .badge.warn, dd .badge.warn { background: var(--warn-soft); color: var(--warn); }

/* A non-interactive chip, for a surcharge that was applied rather than an option to pick. */
.chip-warn {
  cursor: default; background: var(--warn-soft); border-color: transparent; color: var(--warn);
  font-weight: 600; font-size: 11.5px; padding: 3px 9px;
}
.chip-warn:hover { border-color: transparent; color: var(--warn); }

/* ---------------------------------------------------------------- zones and traffic */

.zone-card { padding: 10px 0; border-bottom: 1px solid var(--border); }
.zone-card:last-child { border-bottom: 0; }
.zone-card h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 2px; }

ul.plain { list-style: none; margin: 6px 0; padding: 0; font-size: 12.5px; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--border); line-height: 1.5; }
ul.plain li:last-child { border-bottom: 0; }

ul.traffic-list li { display: flex; align-items: baseline; gap: 7px; }
ul.traffic-list .sw {
  flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 2px;
}

/* ---------------------------------------------------------------- addressing */

/* The sentence is the answer. Everything under it is evidence for it, so it is set as prose
 * and given room rather than dropped into a definition list with the coordinates. */
.describe-line {
  margin: 0 0 14px; padding: 14px 16px;
  border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-soft); font-size: 15px; line-height: 1.5; color: var(--fg);
}

.pluscode-head { margin: 0 0 12px; text-align: center; }
.pluscode-head code {
  display: inline-block; padding: 10px 16px; border-radius: var(--radius);
  background: var(--bg-sunken); border: 1px solid var(--border);
  font: 640 19px/1.2 var(--mono); letter-spacing: .04em; color: var(--fg);
}

/* ---------------------------------------------------------------- response notes
 *
 * Every endpoint in this service explains its own limitations in a `notes` array. Dropping
 * them on the floor in the UI would be undoing that work at the last step, so they are
 * rendered -- quietly, because they are caveats and not errors.
 */
.notes {
  list-style: none; margin: 12px 0 0; padding: 10px 12px;
  border-radius: var(--radius); background: var(--bg-soft);
  font-size: 11.5px; line-height: 1.55; color: var(--fg-muted);
}
.notes li { padding: 3px 0 3px 14px; position: relative; }
.notes li::before {
  content: ""; position: absolute; left: 3px; top: 9px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--fg-faint);
}

/* ---------------------------------------------------------------- narrow screens */

/* Below the three-column threshold the map goes on top, where it is the thing being looked
 * at, and the rail becomes a horizontal strip of tools above the panel. */
@media (max-width: 1080px) {
  body.pg-body { overflow: auto; }
  .pg { grid-template-columns: 1fr; height: auto; }
  .pg-map { order: -1; height: 58vh; min-height: 320px; }
  .pg-rail {
    display: flex; overflow-x: auto; overflow-y: hidden; border-right: 0;
    border-bottom: 1px solid var(--border); padding: 6px 8px; gap: 3px;
    position: sticky; top: 56px; z-index: 45;
  }
  .rail-group { display: none; }
  .rail-item { flex: none; width: auto; min-width: 62px; padding: 6px 9px; }
  .pg-panel { border-right: 0; }
  .pg-scroll { overflow: visible; }
  .pg-run { position: sticky; bottom: 0; z-index: 44; }
  .map-search { width: calc(100% - 88px); }
}
