/* network.css -- the Network page's own rules, loaded after the map page's
   sheets (tokens.css, scenario_results.css, scenario_results.mobile.css),
   which lay out every shared part by its id. Only what is this page's own
   lives here; colours are tokens (tokens.css), never literals. */

/* The legend's last line: which model stage the mode's layer comes from
   (session choice S3, DECISIONS). */
.nw-leg-source { margin-top: 4px; font-size: 11px; line-height: 1.3; color: var(--text-muted); }
#leg-keys:empty { display: none; }

/* A chip with nothing to choose (the indicator before a mode has a
   registry; the scenario chip in a mode with one scenario): no caret, no
   pointer, the words muted. */
#ms-ind:disabled { cursor: default; }
#ms-ind:disabled::after, #ms-ind:disabled:has(#ms-ind-text:not(:empty))::after { content: none; }
#ms-ind:disabled #ms-ind-text { color: var(--text-muted); font-weight: 600; }
#scenario-chip-btn:disabled { cursor: default; }
#scenario-chip-btn:disabled .scenario-chip-caret { display: none; }

/* ---- The sentence on a desktop (D22, Taylor 2026-11-07) ---------------------
   Line 1 keeps the subject, the indicator, the value and the scenario; the
   mode chip and the mode's own chips (cars: width-by and the two filters) go
   below the fold, as on a phone and as the sketch placed them. The map page's
   own mechanism: the bar is one flex flow of clauses, line 2 is moved up by a
   CSS order (as scenario_results.mobile.css does on a phone), and the
   below-the-fold block (#mp-header) becomes the flow's next full-width line.
   The exact complement of the phone query (layout.js LAYOUT_MQ), so the phone
   keeps the shared sheet rules untouched. */
@media (min-width: 761px) and (min-height: 501px) {
  #summary-bar #summary-line2 { order: 1; }
  #summary-bar #mp-header {
    order: 2; flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: baseline;
    gap: 6px var(--sb-clause-gap); margin-top: -2px;
  }
  #summary-bar #sb-note { order: 3; }
}

/* ---- Cars (cars_mode.js, S3a) ---------------------------------------------- */

/* The mode's own chips below the fold, shown for their mode only. */
#mp-params .param-chip[hidden] { display: none; }

/* The legend: the stat's pivot as a tick on the ramp (v/c at 1.0, the
   diverging stats' centre), wherever it falls; categories as chips in place
   of the ramp; the width key; the selected-link ring. */
#legend #leg-bar { position: relative; }
#legend .nw-pivot {
  position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px;
  background: var(--n-33); border-radius: 1px;
}
#legend.nw-leg-cat #leg-bar, #legend.nw-leg-cat .leg-labels { display: none; }
.nw-leg-cats { display: flex; flex-wrap: wrap; gap: 3px 10px; margin: 2px 0 4px; font-size: 11px; color: var(--brand-ink); }
.nw-leg-chip { display: inline-flex; align-items: center; gap: 5px; }
.nw-leg-chip i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.nw-leg-note { font-size: 11px; color: var(--text-muted); margin: 0 0 4px; }
.nw-width-key {
  display: flex; align-items: center; gap: 6px; margin: 4px 0;
  font-size: 11px; color: var(--brand-ink);
}
.nw-width-key span { flex: 0 1 auto; }
.nw-width-key i { display: inline-block; width: 22px; border-radius: 1px; background: var(--brand-slate); }
#legend .leg-ring-swatch.nw-ring-sel { color: var(--sel); }
#legend .leg-ring { font-size: 11px; color: var(--brand-ink); margin: 2px 0; }

/* The hover tooltip: a value readout at the cursor (D5). */
.nw-tip {
  position: absolute; z-index: 20; pointer-events: none; max-width: 260px;
  padding: 6px 8px; border-radius: 6px; border: 1px solid var(--n-cc);
  background: var(--veil-ground-96); box-shadow: 0 2px 8px var(--shade-15);
  font-size: 12px; line-height: 1.35; color: var(--brand-ink);
}
.nw-tip[hidden] { display: none; }
.nw-tip-name { font-weight: 700; margin-bottom: 2px; }
.nw-tip-row { display: flex; justify-content: space-between; gap: 10px; }
.nw-tip-label { color: var(--text-muted); }
.nw-tip-val { font-weight: 600; white-space: nowrap; }

/* The body for a selected link (cars_body.js): rows flow through the dock's
   columns; a group keeps its rows together. */
#mp-body .nw-id { font-weight: 400; color: var(--text-muted); font-size: 11px; margin-left: 6px; }
/* The title spans the columns: at the dock's resting height (one row, the
   map page's rule) it is the line the reader sees. Rows, not groups, keep
   together, so a group flows on into the next column. */
#mp-body .pn-name { column-span: all; }
#mp-body .pn-row { break-inside: avoid; }
#mp-body .nw-group { margin-bottom: 6px; }
#mp-body .nw-group + .nw-group { padding-top: 4px; border-top: 1px solid var(--n-ee); }
#mp-body .nw-group-title { font-weight: 600; color: var(--brand-ink); margin-bottom: 2px; }
.nw-vot-bar { display: flex; height: 10px; border-radius: 2px; overflow: hidden; margin: 3px 0; }
.nw-vot-seg { display: block; height: 100%; }
.nw-vot-key { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; color: var(--text-muted); }
.nw-vot-key i { display: inline-block; width: 8px; height: 8px; margin-right: 4px; border-radius: 1px; }
.nw-jump {
  margin-top: 4px; padding: 2px 8px; border: 1px solid var(--n-cc); border-radius: 10px;
  background: var(--n-ff); font: inherit; font-size: 11px; color: var(--brand-ink); cursor: pointer;
}
.nw-jump:hover { border-color: var(--brand-slate); }

/* The volume filter's slider, a row inside its menu. */
.nw-slider-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 14px 10px 34px; font-size: 13px; color: var(--brand-ink); }
.nw-slider-row label { flex: 1 0 100%; color: var(--text-muted); font-size: 12px; }
.nw-slider-row input[type="range"] { flex: 1 1 160px; min-height: 28px; cursor: pointer; }
.nw-slider-val { font-weight: 600; white-space: nowrap; }

/* ---- The scenario popup's "(compare)" hint, compare (S3b) ------------------- */
/* Walking's chip is disabled (C4): no hint, no caret (above). */
#scenario-chip-btn:disabled #scn-compare-hint { display: none; }

/* ---- Overlays (cars_overlays.js, S3b) ----------------------------------------- */
.nw-ov-note { font-size: 10px; color: var(--text-muted); margin: 2px 0 0 26px; }
#nw-ov-rows[hidden] { display: none; }
.nw-ov-key { margin: 6px 0 2px; font-size: 11px; color: var(--brand-ink); }
.nw-ov-title { font-weight: 600; margin-bottom: 2px; }
.nw-ov-title span { font-weight: 400; color: var(--text-muted); }
.nw-ov-ramp { position: relative; height: 8px; border-radius: 2px; }
.nw-ov-ends { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); }
.nw-leg-chip i { flex: none; }

/* Compare's dashed key: a link present in one scenario only. */
.nw-dash-swatch {
  width: 22px !important; height: 3px !important; border-radius: 0 !important;
  background: repeating-linear-gradient(to right, var(--nw-dash) 0 6px, transparent 6px 10px) !important;
}

/* ---- The body: tables (Diagnostics, compare, overlays) ------------------------ */
#mp-body .nw-note { font-size: 12px; color: var(--text-muted); margin: 0 0 4px; }
#mp-body .nw-table, #mp-body .nw-cmp { width: 100%; border-collapse: collapse; font-size: 12px; break-inside: avoid; }
#mp-body .nw-table td, #mp-body .nw-cmp td { padding: 1px 6px 1px 0; vertical-align: baseline; }
#mp-body .nw-table td:first-child, #mp-body .nw-cmp .nw-cmp-label { color: var(--text-muted); }
#mp-body .nw-table td:not(:first-child), #mp-body .nw-cmp td:not(.nw-cmp-label) {
  text-align: right; font-weight: 600; color: var(--brand-ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
#mp-body .nw-table .nw-th td, #mp-body .nw-cmp .nw-cmp-head td {
  font-weight: 700; color: var(--brand-ink); font-size: 11px; border-bottom: 1px solid var(--n-e3);
}
#mp-body .nw-cmp .nw-cmp-head td { white-space: normal; max-width: 120px; }
#mp-body .nw-cmp .nw-cmp-same { text-align: center; }
#mp-body .nw-cmp .nw-cmp-delta { color: var(--brand-ink); }
#mp-body .nw-flag { color: var(--neg); font-weight: 700; }
#mp-body .nw-diag .nw-group { break-inside: avoid; }
#mp-body .nw-banner {
  column-span: all; margin: 2px 0 6px; padding: 5px 8px; border-radius: 4px; font-size: 12px;
  border: 1px solid var(--warn-border); background: var(--warn-bg); color: var(--warn-text);
}
#mp-body .nw-banner--bad { border-color: var(--neg); color: var(--neg); background: none; }
#mp-body .nw-banner code { font-size: 11px; }

/* The modeled-vs-observed scatter. */
#mp-body .nw-sc-svg { width: 100%; max-width: 380px; height: auto; display: block; margin-top: 4px; }
.nw-sc-grid { stroke: var(--n-e3); stroke-width: 1; }
.nw-sc-frame { fill: none; stroke: var(--n-cc); stroke-width: 1; }
.nw-sc-band30 { fill: var(--brand-slate); opacity: 0.08; }
.nw-sc-band10 { fill: var(--brand-slate); opacity: 0.12; }
.nw-sc-diag { stroke: var(--brand-slate); stroke-width: 1.2; stroke-dasharray: 4 3; }
.nw-sc-tick { fill: var(--text-muted); font-size: 9px; }
.nw-sc-axis { fill: var(--brand-ink); font-size: 10px; }
.nw-sc-pt { cursor: pointer; stroke: var(--brand-ink); stroke-width: 0.8; }
.nw-sc-pt:hover { stroke-width: 1.8; }
.nw-sc-pt:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* The tooltip in compare: a table, A | B | delta. */
.nw-tip:has(.nw-tip-table) { max-width: 400px; }
.nw-tip-table { border-collapse: collapse; font-size: 12px; }
.nw-tip-table td { padding: 1px 0 1px 10px; text-align: right; white-space: nowrap; font-weight: 600; }
.nw-tip-table td.nw-tip-label { padding-left: 0; text-align: left; font-weight: 400; color: var(--text-muted); white-space: normal; }
.nw-tip-head td { font-weight: 700; font-size: 11px; color: var(--brand-ink); white-space: normal; max-width: 110px; }
.nw-tip-note { font-size: 11px; color: var(--warn-text); margin-bottom: 2px; }

/* ---- Walking (walk_mode.js, walk_body.js, S4) ----------------------------------
   The retired Links page's inspector rules (its links.css), scoped to the
   body; the dock's columns flow the Summary's rows, and the tables span them. */
#mp-body .nw-wspan { column-span: all; }
#mp-body .li-head { margin-bottom: 6px; }
#mp-body .pn-name.li-unnamed { font-style: italic; }
#mp-body .li-sub { font-weight: 400; font-size: 10.5px; color: var(--n-88); }
#mp-body .li-meta { font-size: 11px; color: var(--n-55); line-height: 1.4; }
#mp-body .li-notes { margin: 0 0 6px; font-size: 11px; line-height: 1.4; color: var(--n-33); }
#mp-body .li-notes > div { padding: 2px 6px; border-left: 2px solid var(--n-cc); background: var(--ground-band); }
#mp-body .li-notes > div + div { margin-top: 2px; }
#mp-body .li-note { margin-top: 6px; font-size: 11px; }
#mp-body .li-warn, #mp-body .li-warnt { color: var(--warn-text); }
#mp-body .li-block { max-width: 760px; }
#mp-body .li-tab { border-collapse: collapse; width: 100%; font-size: 11px; font-variant-numeric: tabular-nums; }
#mp-body .li-tab th { font-weight: 600; color: var(--n-55); text-align: right; padding: 2px 5px;
                      border-bottom: 1px solid var(--n-cc); white-space: nowrap; }
#mp-body .li-tab th.li-f { text-align: left; }
#mp-body .li-tab tr.li-grp th { border-bottom: none; padding-bottom: 0; }
#mp-body .li-tab tr.li-grp th.li-twin { text-align: center; border-bottom: 1px solid var(--n-dd); }
#mp-body .li-tab td { padding: 2px 5px; border-bottom: 1px solid var(--n-f0); vertical-align: top; color: var(--n-22); }
#mp-body .li-tab td.li-f { color: var(--n-33); white-space: nowrap; }
#mp-body .li-tab .li-n { text-align: right; white-space: nowrap; }
#mp-body .li-time .li-n { white-space: normal; }
#mp-body .li-tab .li-strong { font-weight: 700; }
#mp-body .li-tab .li-ind { font-style: italic; color: var(--n-55); }
#mp-body .li-tab .li-na { color: var(--n-aa); }
#mp-body .li-tab .li-sh { background: var(--ground-band); }
#mp-body .li-tab .li-chosen { box-shadow: inset 0 -2px 0 var(--sel); }
#mp-body .li-tab th.li-clicked, #mp-body .li-tab td.li-clicked { background: var(--hover); }
#mp-body .li-tab .li-blank { background: transparent; }
#mp-body .li-tab tr.li-prod td, #mp-body .li-tab tr.li-total td { border-top: 1px solid var(--n-cc); }
#mp-body .li-tab tr.li-total td { font-weight: 700; }
#mp-body .li-tab tr.li-subrow td { color: var(--n-66); }
#mp-body .li-tab tr.li-sum td { border-top: 1px solid var(--n-cc); }
#mp-body .li-tab tr.li-check td { border-top: 1px solid var(--n-bb); background: var(--ground-band); font-weight: 600; }
#mp-body .li-tab tr.li-grp-f td { padding-top: 5px; color: var(--brand-ink); }
#mp-body .li-tab tr.li-in td { color: var(--n-44); }
#mp-body .li-tab td.li-inl { padding-left: 14px; white-space: normal; }
#mp-body .li-tab td.li-span { text-align: center; }
#mp-body .li-tab td.li-imp { font-style: italic; }
#mp-body .li-tab .li-mks { margin-top: 1px; white-space: normal; font-style: normal; }
#mp-body .li-tab td.li-f .li-sub { white-space: normal; }
#mp-body .li-mkt { display: inline-block; padding: 0 4px; border-radius: 3px; font-size: 10px; line-height: 14px;
                   color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-border); }
#mp-body .li-mk { color: var(--warn-text); font-weight: 700; }
#mp-body .li-foot { margin-top: 3px; font-size: 10.5px; color: var(--n-77); line-height: 1.35; }
#mp-body .lk-about p { margin: 0 0 6px; font-size: 12px; line-height: 1.45; color: var(--brand-ink); max-width: 760px; }

/* The legend's walking keys (the Links page's swatches). */
#legend .lk-key { display: flex; align-items: center; gap: 6px; line-height: 1.3; font-size: 11px; color: var(--brand-ink); }
#legend .lk-key + .lk-key { margin-top: 3px; }
#legend .lk-sw { flex: 0 0 22px; height: 10px; position: relative; }
#legend .lk-sw-sides::before, #legend .lk-sw-sides::after {
  content: ""; position: absolute; left: 0; right: 0; height: 3px; border-radius: 2px; background: var(--n-66);
}
#legend .lk-sw-sides::before { top: 1px; }
#legend .lk-sw-sides::after { bottom: 1px; }
#legend .lk-sw-dash { border-top: 3px dashed var(--n-77); height: 0; margin-top: 1px; }
#legend .lk-sw-arrow { height: auto; text-align: center; font-weight: 700; font-size: 14px; line-height: 10px; color: var(--n-22); }
#legend .lk-sw-ring::before {
  content: ""; position: absolute; left: 6px; top: 0; width: 10px; height: 10px;
  border-radius: 50%; border: 1.5px solid var(--n-99); box-sizing: border-box;
}
#legend .lk-jn-bar { flex: 0 0 22px; height: 8px; border-radius: 4px; }
#legend .nw-leg-warn { color: var(--warn-text); }

/* A Display-fold row that does not apply in the current view (O1 as routed). */
.layer-toggle-row.nw-row-off { opacity: 0.5; }
#nw-walk-rows[hidden] { display: none; }

/* The walking body on a phone: the tables take the sheet's width. The phone
   legend keeps the title, the ramp and its ends, as the Links page's did (its
   notes and keys stay on the desktop legend; About says the same). */
@media (max-width: 760px), (max-height: 500px) {
  #legend.nw-leg-walk .nw-leg-note, #legend.nw-leg-walk .lk-key, #legend.nw-leg-walk .nw-leg-source { display: none; }
  /* Cars' phone legend is the map page's chip (S6): the page head (with the
     Legend button that contracts it), the ramp between its ends, the title,
     the key rows that stand in for or sit beside a ramp (categories, compare's
     dashed links, its "no change" notes) and the ring while a link is
     selected. The width key, the clamp note, the ticked overlays' keys and the
     source line stay on the desktop legend, so ticking an overlay in Display
     no longer grows the chip down the map. */
  #legend .nw-width-key, #legend .nw-ov-key, #legend .nw-leg-source,
  #legend .nw-leg-note:not([data-part="legend-compare-note"]) { display: none; }
  #legend .leg-ring { margin: 3px 0 0; font-size: 12px; }
  #mp-body .li-tab th, #mp-body .li-tab td { padding: 3px 2px; }
  #mp-body .li-tab th.li-twin { white-space: normal; }
}

/* ---- Finger targets (S6) ----------------------------------------------------
   44 px for a finger on the page's own menus and controls, as the indicator
   menu's rows already are (scenario_results.css, `pointer: coarse`): the chip
   menus' rows (network_menu.js; the shared sheet gives them 40 px), the
   scenario popup's radio cells, its fold-free buttons and its "Add an
   alternative" link (network_scenario.js; 36 px on the map page's phone
   sheet), the volume filter's slider, the body's reverse-link button and the
   Display fold's rows. The menus grow by the difference; nothing else moves.
   The map page's own copies of these menus are not touched (shared sheets). */
@media (pointer: coarse) {
  #param-menu .msm-opt { min-height: 44px; padding-top: 10px; padding-bottom: 12px; }
  #scenario-menu .sm-radio { min-height: 44px; }
  #scenario-menu .sm-lab { padding-top: 12px; padding-bottom: 12px; }
  #sm-cancel, #sm-apply { min-height: 44px; }
  #sm-add { position: relative; }
  #sm-add::before { content: ""; position: absolute; left: -6px; right: -6px; top: -12px; bottom: -14px; }
  .nw-slider-row input[type="range"] { min-height: 44px; }
  .nw-jump { position: relative; }
  .nw-jump::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; bottom: -10px; }
  #legend-overlay-rows .layer-toggle-row { min-height: 44px; }
}
