/* State precedent graph viewer (R37), ported from the Texas prototype's stylesheet. Every rule is scoped to the
   viewer (.pg, and .pgd for its dialogs) and its colors use --pg-* tokens, so nothing here changes the site shell.
   Dark by default like the site; light under the site's light theme. */
.pg, .pgd {
  --pg-page: #0d0d0d; --pg-surface: #18181b; --pg-panel: #23272a; --pg-ink: #f0efec; --pg-ink-2: #c3c2b7; --pg-muted: #9a998f;
  --pg-rule: #2c2c2a; --pg-axis: #3f3f46; --pg-held: #199e70; --pg-cited: #474641; --pg-cites: #3987e5; --pg-citedby: #d95926;
  --pg-critical: #d03b3b; --pg-warning: #fab219; --pg-focus: #3987e5; --pg-ring: rgba(255,255,255,0.12); --pg-scrim: rgba(0,0,0,0.55);
  --pg-font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --pg-font-ui: var(--font, system-ui, -apple-system, "Segoe UI", sans-serif);
  --pg-font-tag: var(--mono, ui-monospace, Menlo, monospace);
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .pg, :root:not([data-theme="dark"]) .pgd {
  --pg-page: #f9f9f7; --pg-surface: #ffffff; --pg-panel: #f1f0ec; --pg-ink: #0b0b0b; --pg-ink-2: #52514e; --pg-muted: #6b6a65;
  --pg-rule: #e1e0d9; --pg-axis: #c3c2b7; --pg-held: #1baf7a; --pg-cited: #cfcdc5; --pg-cites: #2a78d6; --pg-citedby: #eb6834;
  --pg-critical: #d03b3b; --pg-warning: #fab219; --pg-focus: #2a78d6; --pg-ring: rgba(11,11,11,0.12); --pg-scrim: rgba(11,11,11,0.35);
  color-scheme: light; }
}
:root[data-theme="light"] .pg, :root[data-theme="light"] .pgd {
  --pg-page: #f9f9f7; --pg-surface: #ffffff; --pg-panel: #f1f0ec; --pg-ink: #0b0b0b; --pg-ink-2: #52514e; --pg-muted: #6b6a65;
  --pg-rule: #e1e0d9; --pg-axis: #c3c2b7; --pg-held: #1baf7a; --pg-cited: #cfcdc5; --pg-cites: #2a78d6; --pg-citedby: #eb6834;
  --pg-critical: #d03b3b; --pg-warning: #fab219; --pg-focus: #2a78d6; --pg-ring: rgba(11,11,11,0.12); --pg-scrim: rgba(11,11,11,0.35);
  color-scheme: light;
}
.pg { color: var(--pg-ink); font-family: var(--pg-font-ui); font-size: 14px; line-height: 1.45; margin: 0 0 24px; }
.pg *, .pgd * { box-sizing: border-box; }
.pg .pgtop { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; flex-wrap: wrap;
  padding: 8px 0 10px; border-bottom: 1px solid var(--pg-rule); }
.pg .pgbrand { display: flex; align-items: center; gap: 10px; color: var(--pg-ink); font-weight: 600; font-size: 17px; }
.pg .pgbrand svg { width: 24px; height: 24px; flex: none; }
.pg .links { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; }
.pg .links button { color: var(--pg-ink-2); font: inherit; font-size: 15px; padding: 6px 0; border: 0; background: none; cursor: pointer; }
.pg .links button:hover { color: var(--pg-ink); }
.pg h2.pgh { font-family: var(--pg-font-display); font-weight: 600; font-size: clamp(22px, 3vw, 30px); line-height: 1.05; margin: 0; }
.pg .mu, .pgd .mu { color: var(--pg-muted); }
.pg .k-held, .pgd .k-held { background: var(--pg-held); }
.pg .k-cited, .pgd .k-cited { background: var(--pg-cited); }
.pg .k-critical, .pgd .k-critical { background: var(--pg-critical); }
.pg .k-warning, .pgd .k-warning { background: var(--pg-warning); }
.pg .sw-cites { background: var(--pg-cites); }
.pg .sw-citedby { background: var(--pg-citedby); }
.pg .sw-critical { background: var(--pg-critical); }
.pgd { font-family: var(--pg-font-ui); font-size: 14px; line-height: 1.45; }
.pg .theme-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--pg-rule) !important; display: grid; place-items: center; padding: 0 !important; }
.pg .theme-btn svg { width: 16px; height: 16px; }
.pg .app { display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); gap: 10px;
  padding-block: 14px 12px; padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.pg .bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.pg .help { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--pg-axis); background: var(--pg-surface);
  color: var(--pg-ink-2); font: 600 14px var(--pg-font-ui); cursor: pointer; flex: none; }
.pg .help:hover { background: var(--pg-panel); }
.pg .sub { color: var(--pg-muted); font-size: 13px; }
.pg .tag { font-family: var(--pg-font-tag); font-size: 0.92em; letter-spacing: 0; }
.pg .case { font-family: var(--pg-font-display); font-style: italic; }
.pg .toolbar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; min-width: 0; }
.pg .search { position: relative; flex: 1 1 260px; max-width: 380px; }
.pg .search input, .pg .toolbar select { width: 100%; height: 36px; border: 1px solid var(--pg-axis); border-radius: 8px;
  background: var(--pg-surface); color: var(--pg-ink); padding: 0 12px; font: inherit; }
.pg .part { display: inline-flex; align-items: center; gap: 6px; color: var(--pg-ink-2); font-weight: 600; }
.pg .toolbar select { width: auto; min-width: 210px; font-weight: 400; color: var(--pg-ink); }
.pg .results { position: absolute; z-index: 20; top: 40px; left: 0; right: 0; margin: 0; padding: 4px; list-style: none;
  background: var(--pg-surface); border: 1px solid var(--pg-axis); border-radius: 8px; box-shadow: 0 8px 24px var(--pg-ring); }
.pg .results button { all: unset; display: block; width: 100%; box-sizing: border-box; padding: 7px 9px; border-radius: 6px;
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg .results button:hover, .pg .results button[aria-selected="true"] { background: var(--pg-panel); }
.pg .results .none { padding: 8px 10px; color: var(--pg-muted); }
.pg .btn { height: 36px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--pg-axis); background: var(--pg-surface);
  color: var(--pg-ink); font: inherit; cursor: pointer; white-space: nowrap; }
.pg .btn:hover { background: var(--pg-panel); }
.pg .btn .mark { display: inline-block; width: 9px; height: 9px; border-radius: 2px; background: var(--pg-critical); margin-right: 7px; }
.pg :is(input, select, button, canvas, .row):focus-visible, .pgd :is(input, select, button, canvas, .row):focus-visible { outline: 2px solid var(--pg-focus); outline-offset: 2px; }
.pg .legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--pg-ink-2); font-size: 13px; min-width: 0; }
.pg .legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px;
  box-shadow: inset 0 0 0 1px var(--pg-ring); }
.pg .legend .sep { width: 1px; height: 16px; background: var(--pg-axis); }
.pg .toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.pg .toggle input { width: 16px; height: 16px; accent-color: var(--pg-focus); margin: 0; }
.pg .swatch-line { display: inline-block; width: 22px; height: 3px; border-radius: 2px; }
.pg .stage { position: relative; min-height: 0; background: var(--pg-surface); border: 1px solid var(--pg-rule); border-radius: 10px; overflow: hidden; }
.pg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
.pg canvas.dragging { cursor: grabbing; }
.pg .overlay { position: absolute; z-index: 5; top: 10px; left: 10px; display: flex; align-items: center; gap: 10px; pointer-events: none; max-width: calc(100% - 20px); }
.pg .zoom { display: flex; flex: none; border: 1px solid var(--pg-axis); border-radius: 8px; overflow: hidden; background: var(--pg-surface); pointer-events: auto; box-shadow: 0 1px 4px var(--pg-ring); }
.pg .zoom button { all: unset; cursor: pointer; padding: 5px 12px; font-size: 14px; color: var(--pg-ink); }
.pg .zoom button + button { border-left: 1px solid var(--pg-axis); }
.pg .zoom button:hover { background: var(--pg-panel); }
.pg .zoom button:focus-visible { outline: 2px solid var(--pg-focus); outline-offset: -2px; }
.pg .crumb { min-width: 0; font-size: 12.5px; color: var(--pg-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--pg-surface); border: 1px solid var(--pg-rule); border-radius: 8px; padding: 5px 9px; }
.pg .crumb:empty { display: none; }
.pg .crumb b { color: var(--pg-ink); font-weight: 600; }
.pg .hint { position: absolute; z-index: 5; left: 10px; bottom: 8px; font-size: 12px; color: var(--pg-muted); pointer-events: none;
  background: var(--pg-surface); border-radius: 6px; padding: 2px 6px; }
.pg .tip { position: absolute; z-index: 6; pointer-events: none; max-width: 300px; background: var(--pg-surface);
  border: 1px solid var(--pg-axis); border-radius: 8px; padding: 8px 11px; box-shadow: 0 8px 24px var(--pg-ring); }
.pg .tip strong { display: block; font-family: var(--pg-font-tag); font-size: 12.5px; font-weight: 500; color: var(--pg-ink-2); }
.pg .tip .t2 { font-family: var(--pg-font-display); font-style: italic; font-size: 15px; margin: 1px 0 2px; }
.pg .tip small { display: block; font-size: 12.5px; color: var(--pg-ink-2); }
.pg .state { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--pg-ink-2); padding: 20px; z-index: 7; background: var(--pg-surface); }
.pg .inspector { position: absolute; z-index: 8; top: 10px; right: 10px; bottom: 10px; width: 380px; max-width: calc(100% - 20px);
  overflow: auto; background: var(--pg-surface); border: 1px solid var(--pg-axis); border-radius: 10px; padding: 14px 16px 16px;
  box-shadow: 0 10px 30px var(--pg-ring); display: grid; grid-auto-rows: max-content; gap: 11px; align-content: start; }
.pg .inspector .close { position: sticky; top: 0; justify-self: end; margin: -4px -6px -30px 0; width: 30px; height: 30px;
  border-radius: 8px; border: 1px solid var(--pg-rule); background: var(--pg-surface); color: var(--pg-ink-2); cursor: pointer; font-size: 16px; z-index: 1; }
.pg .inspector .close:hover { background: var(--pg-panel); }
.pg .inspector .cite { font-family: var(--pg-font-tag); font-size: 15px; font-weight: 500; padding-right: 36px; }
.pg .inspector .par { font-family: var(--pg-font-tag); font-size: 12px; color: var(--pg-muted); }
.pg .inspector h2 { font-family: var(--pg-font-display); font-style: italic; font-weight: 500; font-size: 22px; line-height: 1.2;
  margin: 0; text-wrap: balance; overflow-wrap: anywhere; }
.pg .meta { color: var(--pg-ink-2); }
.pg .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 8px;
  border-radius: 999px; border: 1px solid var(--pg-axis); width: fit-content; }
.pg .chip i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.pg .ruled { border-left: 3px solid var(--pg-critical); padding: 8px 10px; background: var(--pg-panel); border-radius: 0 6px 6px 0; }
.pg .ruled p { margin: 4px 0 0; color: var(--pg-ink-2); font-family: var(--pg-font-display); font-size: 14px; }
.pg .ruled .after { margin-top: 8px; font-size: 13px; color: var(--pg-ink); }
.pg .note { color: var(--pg-ink-2); font-size: 13px; margin: 0; }
.pg .inspector h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pg-muted); margin: 4px 0 0; font-weight: 600; }
.pg .chart { display: grid; gap: 4px; }
.pg .chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.pg .chart .split { font-size: 12.5px; color: var(--pg-ink-2); }
.pg .list { display: grid; gap: 2px; max-height: 240px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.pg .row { all: unset; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: baseline;
  width: 100%; box-sizing: border-box; padding: 5px 6px; border-radius: 6px; cursor: pointer; }
.pg .row:hover { background: var(--pg-panel); }
.pg .row .rk { width: 8px; height: 8px; border-radius: 2px; align-self: center; }
.pg .row .rn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pg .row .ry { color: var(--pg-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.pg .row .ry.late { color: var(--pg-critical); font-weight: 600; }
.pg .out { font-size: 13px; color: var(--pg-ink); text-underline-offset: 2px; }
dialog.pgd { width: min(900px, calc(100% - 32px)); max-height: 86%; padding: 0; border: 1px solid var(--pg-axis); border-radius: 12px;
  background: var(--pg-surface); color: var(--pg-ink); box-shadow: 0 20px 60px var(--pg-ring); }
dialog.pgd::backdrop { background: var(--pg-scrim); }
.pgd .dlg { padding: 18px 22px 22px; display: grid; gap: 14px; }
.pgd .dlg header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pgd .dlg h2 { font-family: var(--pg-font-display); font-weight: 600; font-size: 24px; margin: 0; }
.pgd .dlg p { margin: 0; max-width: 74ch; color: var(--pg-ink-2); }
.pgd .dlg a { color: var(--pg-ink); text-underline-offset: 2px; }
.pgd .dlg .x { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--pg-rule); background: var(--pg-surface); color: var(--pg-ink-2); font-size: 16px; cursor: pointer; }
.pg .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--pg-rule);
  border: 1px solid var(--pg-rule); border-radius: 10px; overflow: hidden; }
.pg .stat { background: var(--pg-surface); padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.pg .stat b { font-size: 20px; font-weight: 600; }
.pg .stat span { color: var(--pg-ink-2); font-size: 12.5px; }
.pg .stat .mark { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.pg .notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.pg .tablewrap { overflow-x: auto; border: 1px solid var(--pg-rule); border-radius: 10px; }
.pgd table { border-collapse: collapse; width: 100%; min-width: 720px; }
.pgd th, .pgd td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--pg-rule); vertical-align: top; }
.pgd th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--pg-muted); font-weight: 600; }
.pgd td.num, .pgd th.num { font-variant-numeric: tabular-nums; text-align: right; }
.pgd td.late { color: var(--pg-critical); font-weight: 600; }
.pgd tr:last-child td { border-bottom: 0; }
.pgd td button.linkish { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pgd td button.linkish:focus-visible { outline: 2px solid var(--pg-focus); outline-offset: 2px; }
.pg .small { font-size: 12.5px; color: var(--pg-muted); }
/* Inside the site shell the viewer is a block, not a full-screen app. */
.pg .app { height: auto; grid-template-rows: none; grid-auto-rows: auto; padding: 14px 0 0; }
.pg .stage { height: min(76vh, 820px); min-height: 420px; }
@media (max-width: 760px) {
  .pg .app { gap: 8px; padding-block: 10px 8px; }
  .pg .sub { display: none; }
  .pg .toolbar select { min-width: 0; flex: 1 1 160px; }
  .pg .part span { display: none; }
  .pg .inspector { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-width: none; max-height: 58%; }
  .pg .hint { display: none; }
  .pg .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pg .notes { grid-template-columns: minmax(0, 1fr); }
}
/* Viewer v2 (R66): area and color controls, the year control, legend keys per color mode, the keyboard layer over
   the map, the inspector's later-treatment line, treatment groups and chain, and the no-JavaScript state. Series
   colors are the site palette (PALETTE-SPEC section 2) with its hex values as fallbacks. */
.pg, .pgd {
  --pg-none: #4f6d8f; --pg-other: #3a3a37; --pg-chain: #fab219;
  --pg-g0: var(--c0, #3b82f6); --pg-g1: var(--c1, #f87171); --pg-g2: var(--c2, #14b8a6); --pg-g3: var(--c3, #f2b90e);
  --pg-g4: var(--c4, #ec4899); --pg-g5: var(--c5, #8b5cf6); --pg-g6: var(--c6, #f97316); --pg-g7: var(--c7, #10b981);
  --pg-g8: var(--c8, #06b6d4); --pg-g9: var(--c9, #84cc16); --pg-g10: var(--c10, #6366f1); --pg-g11: var(--c11, #f59e0b);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .pg, :root:not([data-theme="dark"]) .pgd { --pg-none: #a9bfd8; --pg-other: #e4e3dc; --pg-chain: #d98b00; }
}
:root[data-theme="light"] .pg, :root[data-theme="light"] .pgd { --pg-none: #a9bfd8; --pg-other: #e4e3dc; --pg-chain: #d98b00; }
/* The prototype's page carried [hidden]{display:none!important}; the port into the shell lost it, so the loading
   overlay and the empty inspector (display: grid) covered the map after it drew. Scoped to the viewer. */
.pg[hidden], .pg [hidden], .pgd [hidden] { display: none !important; }
.pg .nojs { margin: 12px 0 0; color: var(--pg-ink-2); }
.pg.js .nojs { display: none; }
.pg:not(.js) .app, .pg:not(.js) .links { display: none; }
.pg .ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; min-width: 0; }
.pg .seg { display: inline-flex; align-items: center; gap: 2px; margin: 0; padding: 2px; border: 0; border-radius: 8px; background: var(--pg-panel); min-width: 0; flex-wrap: wrap; }
.pg .seg legend { float: left; padding: 0 8px 0 6px; font-size: 12.5px; color: var(--pg-muted); }
.pg .seg label { position: relative; display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 6px; font-size: 13px; color: var(--pg-ink-2); cursor: pointer; user-select: none; }
.pg .seg label:hover { color: var(--pg-ink); }
.pg .seg input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.pg .seg label:has(input:checked) { background: var(--pg-surface); color: var(--pg-ink); box-shadow: 0 0 0 1px var(--pg-axis); }
.pg .seg label:has(input:focus-visible) { outline: 2px solid var(--pg-focus); outline-offset: 1px; }
.pg .seg label.off { opacity: .45; cursor: not-allowed; }
.pg .asof { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--pg-ink-2); min-width: 0; }
.pg .asof input[type="range"] { width: 170px; max-width: 40vw; accent-color: var(--pg-focus); }
.pg .asof output { min-width: 88px; font-variant-numeric: tabular-nums; color: var(--pg-ink); font-weight: 600; }
.pg.asof-on .asof output { color: var(--pg-warning); }
.pg .mini { height: 26px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--pg-axis); background: var(--pg-surface); color: var(--pg-ink-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.pg .mini:hover { color: var(--pg-ink); background: var(--pg-panel); }
.pg .legend .keys { display: inline-flex; flex-wrap: wrap; gap: 6px 16px; min-width: 0; }
.pg .legend .keys span { overflow-wrap: anywhere; }
.pg .lnote { margin: -4px 0 0; font-size: 12.5px; color: var(--pg-muted); max-width: 110ch; }
.pg .lnote:empty { display: none; }
.pg .k-none, .pgd .k-none { background: var(--pg-none); }
.pg .k-other, .pgd .k-other { background: var(--pg-other); }
.pg .k-faded { background: var(--pg-cited); opacity: .3; }
.pg .g0 { background: var(--pg-g0); } .pg .g1 { background: var(--pg-g1); } .pg .g2 { background: var(--pg-g2); }
.pg .g3 { background: var(--pg-g3); } .pg .g4 { background: var(--pg-g4); } .pg .g5 { background: var(--pg-g5); }
.pg .g6 { background: var(--pg-g6); } .pg .g7 { background: var(--pg-g7); } .pg .g8 { background: var(--pg-g8); }
.pg .g9 { background: var(--pg-g9); } .pg .g10 { background: var(--pg-g10); } .pg .g11 { background: var(--pg-g11); }
.pg .kbd { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.pg .kbd .kb { position: absolute; margin: 0; padding: 0; border: 0; border-radius: 2px; background: transparent; pointer-events: none; }
.pg .kbd .kb:focus { outline: none; }
.pg .kbd .kb:focus-visible { outline: 3px solid var(--pg-focus); outline-offset: -3px; box-shadow: inset 0 0 0 5px var(--pg-ring); }
.pg .tline { border-left: 3px solid var(--pg-axis); padding: 7px 10px; background: var(--pg-panel); border-radius: 0 6px 6px 0; display: grid; gap: 4px; }
.pg .tline p { margin: 0; font-size: 13px; color: var(--pg-ink); }
.pg .tline .small { color: var(--pg-muted); }
.pg .tline.t-negative { border-left-color: var(--pg-critical); }
.pg .tline.t-questioned { border-left-color: var(--pg-warning); }
.pg .tgrid { display: grid; gap: 2px; }
.pg .tg { display: block; border-radius: 6px; }
.pg div.tg, .pg .tg > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px; font-size: 13px; }
.pg .tg > summary { cursor: pointer; list-style: none; border-radius: 6px; }
.pg .tg > summary::-webkit-details-marker { display: none; }
.pg .tg > summary:hover { background: var(--pg-panel); }
.pg .tg > summary::after { content: "+"; color: var(--pg-muted); margin-left: 6px; }
.pg .tg[open] > summary::after { content: "\2212"; }
.pg .tg .tl { display: inline-flex; align-items: center; gap: 7px; text-transform: capitalize; color: var(--pg-ink-2); }
.pg .tg .tl i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.pg .tg b { margin-left: auto; font-variant-numeric: tabular-nums; }
.pg .chain { border-left: 3px solid var(--pg-chain); padding: 6px 10px; background: var(--pg-panel); border-radius: 0 6px 6px 0; display: grid; gap: 6px; }
.pg .row .lb { margin-right: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--pg-muted); }
.pg .inspector .linkish { all: unset; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pg .inspector .linkish:focus-visible { outline: 2px solid var(--pg-focus); outline-offset: 2px; }
@media (max-width: 760px) {
  .pg .ctl { gap: 6px 10px; }
  .pg .seg legend { display: none; }
  .pg .asof input[type="range"] { width: 120px; }
}

/* The /precedent/ hub: one tile per state (R37). */
.pg-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pg-tile { border: 1px solid var(--hairline, #2c313b); border-radius: 8px; padding: 10px 12px; background: var(--surface, transparent); min-width: 0; }
.pg-tile p { margin: 0; font-size: var(--fs-sm, .875rem); color: var(--muted, inherit); overflow-wrap: anywhere; }
.pg-tile .pg-tn { font-size: var(--fs-base, 1rem); font-weight: 600; color: var(--ink, inherit); margin-bottom: 2px; }
.pg-tile.pg-live { border-color: var(--accent, #8ab4ff); }
.pg-tile.pg-building .pg-ts { color: var(--warn, inherit); }
.pg-tile.pg-queued { opacity: .72; }

/* R58 knowledge graph pages (state, hub, case, lookup): the lookup box, the later-treatment line, treatment
   badges and the paid card. Site tokens only; negative treatment is red, questioned amber, everything else neutral
   (a case with nothing found is not shown as good). */
.kg-find { margin: 12px 0 4px; }
.kg-find label { display: block; font-weight: 600; margin-bottom: 6px; }
.kg-row { display: flex; gap: 8px; flex-wrap: wrap; max-width: 760px; }
.kg-row input[type="search"] { flex: 1 1 260px; min-width: 0; padding: 8px 10px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
.kg-row select { padding: 8px; border: 1px solid var(--hairline); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; max-width: 100%; }
.kg-open { font: inherit; font-weight: 600; color: var(--bg); background: var(--ink); border: 0; padding: .55rem 1rem; border-radius: 6px; cursor: pointer; }
.kg-open[disabled] { opacity: .6; cursor: default; }
.kg-line { border-left: 3px solid var(--hairline); padding: .55rem .9rem; background: var(--surface); margin: .6rem 0; }
.kg-line.kg-negative { border-left-color: var(--neg); }
.kg-line.kg-questioned { border-left-color: var(--warn); }
.kg-ev { margin: .4rem 0; padding-left: 20px; }
.kg-t.kg-overruled { color: var(--neg); background: var(--neg-bg); }
.kg-t.kg-questioned { color: var(--warn); background: var(--warn-bg); }
.kg-card p { margin: .3rem 0; }
.kg-jobs { margin-bottom: 8px; }
.kg-xl ul { margin: .3rem 0; padding-left: 20px; }

.pg-card { display: block; color: inherit; text-decoration: none; }
.pg-card:hover .pg-tn, .pg-card:focus .pg-tn { text-decoration: underline; }

/* R58 hub map: built states lighter to darker by citations (five steps), building and checking quality amber,
   queued neutral; a focused or hovered state gets an ink outline. */
.usm { position: relative; margin: 10px 0 6px; }
.usm-svg { display: block; width: 100%; height: auto; max-width: 980px; }
.usm-s { fill: var(--hairline); stroke: var(--bg); stroke-width: .8; }
.usm-q1, .usm-q2, .usm-q3, .usm-q4, .usm-q5 { fill: var(--accent); }
.usm-q1 { fill-opacity: .28; } .usm-q2 { fill-opacity: .42; } .usm-q3 { fill-opacity: .56; } .usm-q4 { fill-opacity: .72; } .usm-q5 { fill-opacity: .9; }
.usm-build, .usm-held { fill: var(--warn); fill-opacity: .45; }
.usm-queued { fill: var(--hairline); }
.usm-svg a { cursor: pointer; outline: none; }
.usm-svg a:hover .usm-s, .usm-svg a:focus .usm-s { stroke: var(--ink); stroke-width: 1.6; }
.usm-card { position: absolute; z-index: 5; pointer-events: none; max-width: 260px; padding: 8px 10px; border: 1px solid var(--hairline);
  border-radius: 6px; background: var(--surface); color: var(--ink); font-size: 13px; line-height: 1.35; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.usm-card strong, .usm-card span { display: block; }
.usm-key { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: -1px; margin: 0 4px 0 10px; }
.usm-key.usm-q5 { background: var(--accent); } .usm-key.usm-build { background: var(--warn); opacity: .6; } .usm-key.usm-queued { background: var(--hairline); }
.usm-list { columns: 4 160px; list-style: none; padding: 0; margin: 8px 0 14px; font-size: 13px; }
.usm-list li { break-inside: avoid; margin: 2px 0; }

