/* Lexaeva: light, dense legal research interface. One accent; green and red only inside diffs. */
:root {
  --bg: #f7f6f2; --panel: #ffffff; --ink: #20211f; --muted: rgba(32, 33, 31, .64); --faint: rgba(32, 33, 31, .06);
  --line: rgba(32, 33, 31, .16); --accent: #2457a7; --accent-soft: rgba(36, 87, 167, .09);
  --deep: rgba(36, 87, 167, .92); --medium: rgba(36, 87, 167, .55); --light: rgba(36, 87, 167, .24);
  --ins: #1d6b40; --ins-bg: #ddf0e3; --del: #9b2f25; --del-bg: #fbe3df;
  --sans: "Source Sans 3", system-ui, -apple-system, sans-serif; --serif: "Source Serif 4", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--sans); font-variant-numeric: tabular-nums; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
.note { color: var(--muted); }
.pad { padding: 16px; }
h1 { font-size: 22px; line-height: 1.2; margin: 0; font-weight: 700; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 8px; font-weight: 600; }
h3 { font-size: 15px; margin: 0 0 4px; font-weight: 600; }

/* Header: one row, always visible. */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: 52px; padding: 0 16px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
.mark { font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; }
.crumbs { display: flex; gap: 6px; align-items: center; overflow-x: auto; white-space: nowrap; color: var(--muted); min-width: 0; flex: 1; scrollbar-width: none; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-current] { color: var(--ink); }
.crumbs .sep { opacity: .5; }
.find { flex: 0 1 360px; }
.find input { width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 4px; padding: 0 10px; background: var(--bg); }
@media (max-width: 720px) {
  .top { height: auto; flex-wrap: wrap; padding: 8px 16px; gap: 6px 12px; }
  .crumbs { order: 3; flex-basis: 100%; font-size: 13px; }
  .find { flex: 1; }
  .find input { height: 40px; }
}

.wrap { max-width: 1320px; margin: 0 auto; padding: 16px; }
.foot { max-width: 1320px; margin: 0 auto; padding: 8px 16px 32px; color: var(--muted); font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.card.pad, .box { padding: 12px; }
.ident { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: baseline; margin-bottom: 12px; }
.ident .facts { color: var(--muted); }
.ident .facts b { color: var(--ink); font-weight: 600; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 12px; align-items: start; }
.cols3 { display: grid; grid-template-columns: 260px minmax(0, 1fr) 260px; gap: 12px; align-items: start; }
@media (max-width: 1100px) { .cols3 { grid-template-columns: 240px minmax(0, 1fr); } .cols3 > .ctx { grid-column: 1 / -1; } }
@media (max-width: 860px) { .cols, .cols3 { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 64px; }
@media (max-width: 860px) { .sticky { position: static; } }
.chip { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 10px; background: var(--faint); color: var(--ink); text-decoration: none; margin: 2px 2px 0 0; }
a.chip:hover { background: var(--accent-soft); }
.btn { border: 1px solid var(--line); background: var(--panel); border-radius: 4px; padding: 0 12px; height: 34px; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--ink); }
.btn:hover:not(:disabled) { border-color: var(--ink); }
.btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
@media (max-width: 720px) { .btn { height: 44px; } }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
.seg .btn:last-child { border-radius: 0 4px 4px 0; }
table.t { width: 100%; border-collapse: collapse; }
.t th, .t td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--faint); vertical-align: top; }
.t th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.t td.num, .t th.num { text-align: right; }
.t tr:hover td { background: var(--faint); }
input.field { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 4px; padding: 0 10px; background: var(--panel); }

/* Map. */
.mapgrid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(280px, 4fr); gap: 12px; }
@media (max-width: 860px) { .mapgrid { grid-template-columns: 1fr; } .mapgrid > .listcol { order: -1; } }
#map svg { width: 100%; height: auto; display: block; }
#map path[data-fips] { stroke: rgba(32, 33, 31, .35); stroke-width: .6; cursor: pointer; }
#map path[data-fips]:hover, #map path[data-fips]:focus, #map path.sel { stroke: var(--ink); stroke-width: 1.8; outline: none; }
#map .borders { stroke: rgba(32, 33, 31, .35); stroke-width: .6; pointer-events: none; }
#map text { font: 600 10px var(--sans); pointer-events: none; fill: var(--ink); }
#map text.on-dark { fill: #fff; }
.d-deep { fill: var(--deep); } .d-medium { fill: var(--medium); } .d-light { fill: var(--light); }
.d-snapshot { fill: url(#hatch); } .d-none { fill: #fff; }
.sw { width: 14px; height: 14px; border-radius: 2px; border: 1px solid var(--line); flex: none; display: inline-block; }
.sw.deep { background: var(--deep); } .sw.medium { background: var(--medium); } .sw.light { background: var(--light); }
.sw.snapshot { background: repeating-linear-gradient(45deg, #fff 0 3px, rgba(36, 87, 167, .55) 3px 5px); } .sw.none { background: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: 13px; margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.tiles { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tile { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; background: var(--panel); text-decoration: none; color: var(--ink); }
.tile:hover, .tile:focus { border-color: var(--ink); outline: none; }
.jlist { max-height: 620px; overflow: auto; }
@media (max-width: 860px) { .jlist { max-height: none; } }
.jrow { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; padding: 6px; border-radius: 4px; text-decoration: none; color: var(--ink); min-height: 40px; }
.jrow:hover, .jrow:focus { background: var(--accent-soft); outline: none; }
.jrow small { color: var(--muted); display: block; }
.jrow .n { color: var(--muted); font-size: 13px; }
#hover { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 6px 8px; border-radius: 4px; display: none; max-width: 280px; z-index: 5; }

/* Jurisdiction timeline. */
.rail { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; position: sticky; top: 52px; z-index: 10; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 12px; }
.rail input[type=date] { height: 34px; border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; background: var(--panel); }
.rail input[type=range] { flex: 1 1 240px; accent-color: var(--accent); min-width: 160px; }
.rail .day { font-weight: 600; min-width: 11ch; }
@media (max-width: 720px) { .rail { top: 96px; } .rail input[type=range] { flex-basis: 100%; order: 9; height: 32px; } }
.hist { position: relative; display: grid; grid-template-columns: 190px minmax(0, 1fr); }
@media (max-width: 720px) { .hist { grid-template-columns: 104px minmax(0, 1fr); } }
.hist .labels a { display: flex; justify-content: space-between; gap: 6px; height: 22px; line-height: 22px; padding: 0 8px; font-size: 13px; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; }
.hist .labels a span:first-child { overflow: hidden; text-overflow: ellipsis; }
.hist .labels a span + span { color: var(--muted); font-size: 12px; }
@media (max-width: 720px) { .hist .labels a span + span { display: none; } }
.hist .labels a:nth-child(odd), .hist .labels a.hl { background: var(--faint); }
.hist .labels a.hl { background: var(--accent-soft); }
.hist .labels a:hover { text-decoration: underline; }
.hist canvas { display: block; width: 100%; cursor: crosshair; touch-action: pan-y; }
.axis { height: 22px; }
.lawlist { display: flex; flex-direction: column; }
.law { display: block; padding: 8px; border-radius: 4px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--faint); }
.law:hover, .law:focus { background: var(--accent-soft); outline: none; }
.law .ttl { color: var(--muted); font-size: 13px; display: block; }
.law .meta { color: var(--muted); font-size: 12px; }

/* Law and section pages. */
.secrail { max-height: calc(100vh - 140px); overflow: auto; }
@media (max-width: 860px) { .secrail { max-height: 50vh; } }
.secrail a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 4px; text-decoration: none; color: var(--ink); font-size: 14px; }
.secrail a:hover { background: var(--faint); }
.secrail a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.secrail .op { color: var(--muted); font-size: 12px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: 8px 0; }
.vers a { display: block; padding: 7px 8px; border-radius: 4px; text-decoration: none; color: var(--ink); border-left: 3px solid transparent; }
.vers a:hover { background: var(--faint); }
.vers a[aria-current] { border-left-color: var(--accent); background: var(--accent-soft); }
.vers .meta { color: var(--muted); font-size: 12px; display: block; }
.stat { font-size: 12px; color: var(--muted); }
.stat .p { color: var(--ins); } .stat .m { color: var(--del); }
.textbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.textbar .where { color: var(--muted); flex: 1 1 200px; }
.statute { font: 17px/1.65 var(--serif); max-width: 72ch; white-space: pre-wrap; overflow-wrap: anywhere; }
.statute ins, .statute del { text-decoration: none; border-radius: 2px; }
.statute ins { background: var(--ins-bg); color: var(--ins); box-shadow: inset 0 -2px 0 var(--ins); }
.statute del { background: var(--del-bg); color: var(--del); text-decoration: line-through; }
.statute ins a, .statute del a { color: inherit; text-decoration: none; }
.statute .cur { outline: 2px solid var(--accent); outline-offset: 1px; }
.key { display: inline-flex; gap: 10px; font-size: 13px; color: var(--muted); }
.key ins, .key del { padding: 0 4px; border-radius: 2px; text-decoration: none; }
.key ins { background: var(--ins-bg); color: var(--ins); box-shadow: inset 0 -2px 0 var(--ins); }
.key del { background: var(--del-bg); color: var(--del); text-decoration: line-through; }
details.m summary { cursor: pointer; padding: 8px 0; font-weight: 600; }
@media (min-width: 861px) { details.m > summary { display: none; } }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; margin: 8px 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.results h2 { margin-top: 16px; }
.hit { display: block; padding: 8px; border-bottom: 1px solid var(--faint); text-decoration: none; color: var(--ink); }
.hit:hover { background: var(--accent-soft); }
.hit small { color: var(--muted); display: block; }
.more { margin-top: 8px; }
/* Phones: the date bar scrolls with the page, and wide tables keep to the screen. */
@media (max-width: 720px) {
  .rail { position: static; }
  .t .wide { display: none; }
}
.tablewrap { overflow-x: auto; }
