/* The Litigation section's tools, in the private side's look (public-worker/src/pages/litigation.js, src/litcharts.js): the section tabs, the
 * court-system switch, sortable heads, chips, the case page's cite line, timeline and counsel, charts, maps, and find-in-text. On the site's tokens.
 * Every class starts with lit-. No inline style anywhere: widths and colours are SVG attributes and the classes below. */

/* chart colours: the hub's validated chart steps (database-worker/public/app/tdi-chart.css) */
:root {
  --lit-blue: #3987e5;  --lit-blue: light-dark(#2a78d6, #3987e5);
  --lit-teal: #1fa89c;  --lit-teal: light-dark(#01948a, #1fa89c);
  --lit-red:  #d95544;  --lit-red:  light-dark(#ba3728, #d95544);
  --lit-mid:  #8a8780;  --lit-mid:  light-dark(#9f9e9b, #8a8780);
}

/* the section's tabs and the court-system switch */
.lit-tabs, .lit-jur { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.lit-tabs a, .lit-jur a { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 2px 14px; font-size: 14px; color: var(--muted);
  text-decoration: none; background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); }
.lit-tabs a:hover, .lit-jur a:hover { color: var(--text); border-color: var(--control-border); }
.lit-tabs a[aria-current], .lit-jur a[aria-current] { background: var(--gold-fill); color: var(--on-gold); border-color: var(--gold-fill); font-weight: 600; }
.lit-jur-n { font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; }
.lit-count { color: var(--muted); font-size: 13px; margin: 4px 0; }
.lit-note-line { color: var(--muted); font-size: 13px; max-width: 80ch; margin: 6px 0 10px; }

/* sortable column heads */
.lit-sort { color: inherit; text-decoration: none; white-space: nowrap; }
.lit-sort:hover { color: var(--text); text-decoration: underline; }
.lit-sort-ar { font-size: 9px; margin-left: 4px; color: var(--gold); }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--text); }
.lit-cases .lit-c-level, .lit-cases .lit-c-circ { white-space: nowrap; }
.lit-cases .lit-c-issue { min-width: 150px; }
.lit-circ { font-variant-numeric: tabular-nums; }

/* chips: level, circuit, status and the coded outcome (the outcome colours read the coding; they are never a judge's lean) */
.lit-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.lit-chip { display: inline-block; padding: 1px 10px; border: 1px solid var(--control-border); border-radius: var(--radius-pill); font-size: 12.5px; color: var(--muted); }
.lit-oc-fav { border-color: var(--lit-teal); color: var(--pro); }
.lit-oc-adv { border-color: var(--lit-red); color: var(--anti-text); }
.lit-oc-mix { border-color: var(--gold); color: var(--gold); }
.lit-oc-proc, .lit-oc-none { border-color: var(--control-border); color: var(--muted); }
.lit-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); padding: 0 8px; white-space: nowrap; }

/* a case page: cite line, jump links, the dockets' own facts, the timeline and the recent activity */
.lit-citeas { font-size: 14px; margin: 6px 0; }
.lit-citeas > span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin-right: 6px; }
.lit-copy { font: inherit; font-size: 12px; padding: 1px 10px; margin-left: 6px; cursor: pointer; color: var(--gold); background: transparent;
  border: 1px solid var(--control-border); border-radius: var(--radius-md); }
.lit-copy:hover { border-color: var(--gold); }
.lit-copy[hidden] { display: none; }
.lit-jump ul { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.lit-jump a { display: inline-flex; align-items: center; min-height: 30px; padding: 2px 12px; font-size: 13.5px; color: var(--muted); text-decoration: none;
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); }
.lit-jump a:hover { color: var(--text); border-color: var(--control-border); }
.lit-dockets > li { padding: 12px 0; }
.lit-dkfacts { margin: 8px 0 0; font-size: 13.5px; }
.lit-timeline { list-style: none; margin: 8px 0; padding: 0 0 0 14px; border-left: 2px solid var(--border-strong); max-width: 70ch; }
.lit-timeline li { padding: 3px 0 3px 10px; font-size: 14px; position: relative; }
.lit-timeline li::before { content: ""; position: absolute; left: -19px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); border: 2px solid var(--bg); }
.lit-tl-date { display: inline-block; min-width: 110px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.lit-recent { list-style: none; margin: 6px 0; padding: 0; }
.lit-recent li { padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 14px; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.lit-recent li:last-child { border-bottom: 0; }
.lit-recent-t { flex: 1 1 320px; min-width: 0; overflow-wrap: anywhere; }
.lit-also { font-size: 14px; max-width: 90ch; }

/* counsel of record, grouped by the party each attorney appears for */
.lit-side { margin: 12px 0; padding: 10px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.lit-side-h { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.lit-cols { list-style: none; margin: 4px 0; padding: 0; columns: 3 220px; column-gap: 22px; font-size: 14px; }
.lit-cols li { break-inside: avoid; padding: 1px 0; }
.lit-more summary, .lit-amici > summary { cursor: pointer; color: var(--gold); min-height: 30px; display: inline-flex; align-items: center; font-size: 13.5px; }
.lit-amici { margin: 14px 0; }

/* the activity feed */
.lit-activity .lit-c-case { min-width: 220px; }
.lit-activity .lit-c-desc { overflow-wrap: anywhere; min-width: 260px; }
.lit-activity .lit-c-date { white-space: nowrap; }

/* documents: an attachment sits under its entry */
.lit-docs tr.lit-att td:first-child { padding-left: 22px; }
.lit-docs tr.lit-att .lit-c-desc { padding-left: 18px; box-shadow: inset 2px 0 0 var(--border-strong); }

/* bars (markup with a tiny SVG per row), columns and maps */
.lit-sec { margin-top: 30px; }
.lit-sec > h2 { margin-top: 0; }
.lit-chart { margin: 8px 0; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.lit-bars { list-style: none; margin: 0; padding: 0; }
.lit-bars li { display: grid; grid-template-columns: minmax(120px, 28%) 1fr minmax(70px, auto); gap: 10px; align-items: center; padding: 3px 0; font-size: 13.5px; }
.lit-bar-label { overflow-wrap: anywhere; }
.lit-bar-label a { color: var(--text); text-decoration: none; }
.lit-bar-label a:hover { color: var(--gold); text-decoration: underline; }
.lit-bar { width: 100%; height: 10px; display: block; border-radius: 2px; overflow: hidden; }
.lit-bar-track { fill: var(--panel2); }
.lit-bar rect { shape-rendering: crispEdges; }
.lit-bar-val { color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; font-size: 13px; }
.lit-c-bar { fill: var(--lit-blue); }
.lit-c-fav { fill: var(--lit-teal); }
.lit-c-adv { fill: var(--lit-red); }
.lit-c-mix { fill: var(--lit-mid); }
.lit-key { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--muted); }
.lit-key li { display: inline-flex; align-items: center; gap: 6px; }
.lit-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 2px; flex: none; }
.lit-swatch.lit-c-fav { background: var(--lit-teal); }
.lit-swatch.lit-c-adv { background: var(--lit-red); }
.lit-swatch.lit-c-mix { background: var(--lit-mid); }
.lit-colchart svg { display: block; width: 100%; height: auto; }
.lit-colchart .lit-svg-narrow { display: none; max-width: 480px; margin: 0 auto; }
@media (max-width: 600px) {
  .lit-colchart .lit-svg-wide { display: none; }
  .lit-colchart .lit-svg-narrow { display: block; }
  .lit-bars li { grid-template-columns: 1fr minmax(60px, auto); }
  .lit-bars li .lit-bar { grid-column: 1 / -1; grid-row: 2; }
}
.lit-grid { stroke: var(--border); stroke-width: 1; }
.lit-axis { stroke: var(--border-strong); stroke-width: 1; }
.lit-tick { fill: var(--muted); font: 11px var(--font-sans); font-variant-numeric: tabular-nums; }
.lit-hit { fill: transparent; }
.lit-hit:hover { fill: var(--text); fill-opacity: .1; }
.lit-map svg { display: block; width: 100%; height: auto; max-width: 900px; margin: 0 auto; }
.lit-state { stroke: var(--panel); stroke-width: 1.4; }
.lit-state-label { font: 700 17px "Segoe UI", system-ui, sans-serif; fill: var(--text); text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: var(--panel2); stroke-width: 3px; stroke-linejoin: round; }
.lit-map a:hover .lit-state, .lit-map a:focus-visible .lit-state { stroke: var(--text); stroke-width: 2.2; }
.lit-map a:focus-visible { outline: none; }
.lit-lvl-0 { fill: var(--panel2); background: var(--panel2); }
.lit-lvl-1 { fill: color-mix(in srgb, var(--gold) 20%, var(--panel2)); background: color-mix(in srgb, var(--gold) 20%, var(--panel2)); }
.lit-lvl-2 { fill: color-mix(in srgb, var(--gold) 38%, var(--panel2)); background: color-mix(in srgb, var(--gold) 38%, var(--panel2)); }
.lit-lvl-3 { fill: color-mix(in srgb, var(--gold) 56%, var(--panel2)); background: color-mix(in srgb, var(--gold) 56%, var(--panel2)); }
.lit-lvl-4 { fill: color-mix(in srgb, var(--gold) 76%, var(--panel2)); background: color-mix(in srgb, var(--gold) 76%, var(--panel2)); }
.lit-lvl-5 { fill: color-mix(in srgb, var(--gold) 95%, var(--panel2)); background: color-mix(in srgb, var(--gold) 95%, var(--panel2)); }
.lit-maplegend { color: var(--muted); font-size: 13px; text-align: center; margin: 6px 0 0; }
.lit-maplegend .lit-swatch { margin: 0 1px; vertical-align: -2px; }
.lit-details { margin: 8px 0 14px; }
.lit-details summary { cursor: pointer; color: var(--gold); min-height: 30px; display: inline-flex; align-items: center; font-size: 13.5px; }

/* find in an opinion or a transcript, and a transcript's numbered paragraphs */
.lit-find { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 10px 0 6px; }
.lit-find[hidden] { display: none; }
.lit-find button { font: inherit; font-size: 13px; padding: 4px 12px; cursor: pointer; color: var(--text); background: var(--panel); border: 1px solid var(--control-border); border-radius: var(--radius-md); }
.lit-find-n { color: var(--muted); font-size: 13px; }
.lit-find-q { min-width: 240px; }
.lit-find-prev, .lit-find-next { min-height: 32px; }
.lit-text mark { background: var(--gold-fill); color: var(--on-gold); border-radius: 2px; }
.lit-text mark.lit-cur { outline: 2px solid var(--text); }
.lit-tx { white-space: normal; }
.lit-tx-p { margin: 0 0 12px; padding-left: 38px; position: relative; }
.lit-tx-n { position: absolute; left: 0; top: 2px; width: 28px; text-align: right; color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
