/* Lost mileage.
 *
 * Rides on punctuality.css for the frame and pinch.css for tables, pills and
 * the map shell. Only what neither of those has is here: the measurement-basis
 * pill, the clickable operator row, and the deviation dot.
 *
 * The basis pill carries a word as well as a colour, the same rule the rest of
 * the site holds to -- "estimated" and "road" are the meaning, and the colour
 * is only there to let someone scan the column.
 */

.filter-note {
  color: var(--text-muted);
  font-size: 13px;
  align-self: end;
  padding-bottom: 8px;
}

/* ---------- Tiles ---------- */

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 18px 0 14px;
}

.tile {
  background: var(--surface-1, #fff);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand-orange);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
}

.tile-warn { border-top-color: var(--band-late, #b45309); }

.tile-value {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.tile-label { font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.tile-note { font-size: 12.5px; color: var(--text-muted); margin-top: 4px; }

/* ---------- Panels ---------- */

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-1, #fff);
  padding: 16px 18px 18px;
  margin: 16px 0;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.panel-head h2 { margin: 0; font-size: 17px; }
.panel-note { font-size: 12.5px; color: var(--text-muted); }
.panel-sub { font-size: 13.5px; line-height: 1.6; color: var(--text-secondary); margin: 0 0 12px; }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

table.data td .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
table.data td .muted { color: var(--text-muted); font-weight: 400; }
table.data td .share { font-variant-numeric: tabular-nums; font-weight: 600; }

/* The operator rows filter the rest of the page, so they have to look like
   they do something. */
#operators-table tbody tr { cursor: pointer; }
#operators-table tbody tr:hover { background: var(--surface-2, #f6f6f7); }
#operators-table tbody tr.is-on {
  background: var(--surface-2, #f2f4f8);
  box-shadow: inset 3px 0 0 var(--brand-orange);
}

/* ---------- Measurement basis ---------- */

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pill-road { background: rgba(22, 122, 78, 0.12); color: #0f6b42; }
.pill-mixed { background: rgba(180, 120, 10, 0.14); color: #8a5a06; }
.pill-estimate {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
  border-style: dashed;
}

/* ---------- Map ---------- */

.map-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

#map { height: 520px; width: 100%; }

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.legend-item { display: inline-flex; align-items: center; gap: 7px; }

.dev-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(214, 106, 20, 0.72);
  border: 1.5px solid #b4550f;
  box-sizing: border-box;
  cursor: pointer;
}

/* A deviation whose cost could not be measured is drawn hollow. It happened;
   what it cost is unknown, and a filled dot would imply a number. */
.dev-unpriced { background: transparent; border-style: dashed; }

/* Not seen rejoining -- which is not the same as still off route. The bus may
   simply have stopped reporting. */
.dev-open { border-color: #7a2e0e; border-width: 2.5px; }

.legend-item i.dev-dot { width: 12px; height: 12px; flex: none; }

/* ---------- Method ---------- */

.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.notes .note h3 { margin: 0 0 5px; font-size: 14px; }
.notes .note p { margin: 0; font-size: 13px; line-height: 1.6; color: var(--text-secondary); }

@media (max-width: 640px) {
  #map { height: 380px; }
  .panel { padding: 14px; }
}

/* The part of the record that is wrong and cannot be repaired. Given its own
   treatment rather than folded into the ordinary caveat: a reader skimming
   should not be able to take a percentage off this page without meeting it. */
.caveat-hard {
  border-left: 3px solid var(--band-late, #b45309);
  padding-left: 12px;
  margin-top: 10px;
}

.tile-muted { border-top-color: var(--text-muted); }
.tile-muted .tile-value { color: var(--text-secondary); }

table.data td .sub.warn { color: var(--band-late, #b45309); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--brand-orange);
  cursor: pointer;
  text-decoration: underline;
}
