:root {
  --ink: #142a4a;
  --ink-2: #23406b;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --line: #e3dfd3;
  --line-2: #efece3;
  --text: #1d2330;
  --muted: #6b7180;
  --gold: #b88a2c;
  --gold-soft: #f4ead2;
  --red: #b3261e;
  --yellow: #c88a04;
  --green: #2f7a3d;
  --blue: #2a5ea8;
  --mark: #fde68a;
  --serif: "Iowan Old Style", "Charter", "Palatino Linotype", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(20, 42, 74, .06), 0 4px 16px rgba(20, 42, 74, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #12161d; --panel: #1a1f28; --line: #2b313d; --line-2: #222833; --text: #e6e3da; --muted: #9aa0ab;
    --ink: #0d1b30; --ink-2: #9fb8e0; --gold-soft: #3a3222; --mark: #6b5a17; --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); color: var(--text); font: 15px/1.5 var(--sans); }
a { color: var(--ink-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
mark { background: var(--mark); color: inherit; padding: 0 1px; border-radius: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 28px; margin: 0 0 6px; }
h2 { font-size: 20px; margin: 22px 0 10px; }
h3 { font-size: 16px; margin: 16px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }

/* ---------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 22px;
  background: var(--ink); color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; white-space: nowrap; }
.brand .mark { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; background: #e9d8a6; color: var(--ink);
  font-family: var(--serif); font-weight: 700; font-size: 15px; }
.brand .wordmark { font-family: var(--serif); font-size: 19px; letter-spacing: .01em; }
.brand .wordmark em { font-style: normal; color: #e9d8a6; }
.topsearch { flex: 1; display: flex; gap: 0; max-width: 760px; position: relative; }
.topsearch select { border: 0; border-radius: var(--radius) 0 0 var(--radius); padding: 0 8px; background: #e9eef6; color: #142a4a; font-size: 13px; }
.topsearch input { flex: 1; border: 0; padding: 9px 12px; font-size: 15px; background: #fff; color: #1d2330; min-width: 0; }
.topsearch .btn { border-radius: 0 var(--radius) var(--radius) 0; }
.topnav { display: flex; gap: 14px; font-size: 14px; white-space: nowrap; }
.topnav a { color: #d7deea; }
.topnav a:hover { color: #fff; text-decoration: none; }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--gold); color: #fff; font-size: 11px; text-align: center; }
.suggest { position: absolute; top: 100%; left: 96px; right: 70px; background: var(--panel); color: var(--text); border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); z-index: 30; }
.suggest a { display: block; padding: 7px 12px; color: var(--text); border-bottom: 1px solid var(--line-2); }
.suggest a:hover, .suggest a.on { background: var(--gold-soft); text-decoration: none; }
.suggest small { color: var(--muted); margin-left: 6px; }

/* ---------------------------------------------------------------- layout */
.app { max-width: 1380px; margin: 0 auto; padding: 22px; }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.cols { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 26px; }
.cols3 { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 26px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
.btn { border: 1px solid var(--line); background: var(--panel); padding: 7px 13px; border-radius: var(--radius); cursor: pointer; font-size: 14px; color: var(--text); }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn.link { border: 0; background: none; color: var(--ink-2); padding: 0; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 12px; background: var(--line-2); font-size: 12px; margin: 2px 4px 2px 0; color: var(--text); }
a.chip:hover { background: var(--gold-soft); text-decoration: none; }
.chip.gold { background: var(--gold-soft); }
.tag { display: inline-block; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; border: 1px solid var(--line); color: var(--muted); margin-left: 6px; vertical-align: 1px; }
.tag.bind { border-color: var(--green); color: var(--green); }
.tag.cite { border-color: var(--line); }
input[type=text], input[type=email], input[type=password], input[type=date], textarea, .field select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
label.f { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------------------------------------------------------------- home */
.hero { padding: 40px 0 26px; text-align: center; }
.hero h1 { font-size: 40px; color: var(--ink-2); }
.hero p { color: var(--muted); margin: 4px 0 22px; }
.bigsearch { max-width: 860px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 14px; }
.modes { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.modes button { border: 0; background: none; padding: 6px 12px; border-radius: 16px; cursor: pointer; color: var(--muted); font-size: 14px; }
.modes button.on { background: var(--ink); color: #fff; }
.bigsearch .q { display: flex; gap: 8px; }
.bigsearch input { flex: 1; font-size: 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.bigsearch .hint { text-align: left; font-size: 13px; color: var(--muted); margin-top: 8px; }
.juris { display: flex; gap: 14px; margin-top: 10px; font-size: 14px; flex-wrap: wrap; }
.stats { display: flex; justify-content: center; gap: 34px; margin: 26px 0 8px; flex-wrap: wrap; }
.stats div { text-align: center; }
.stats b { display: block; font-family: var(--serif); font-size: 26px; color: var(--ink-2); }
.stats span { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.home-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-top: 24px; }
.mini-list a { display: block; padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.mini-list .meta { font-size: 12px; color: var(--muted); }

/* ---------------------------------------------------------------- results */
.facets h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 16px 0 6px; }
.facets h4:first-child { margin-top: 0; }
.facet a { display: flex; justify-content: space-between; gap: 8px; padding: 3px 6px; border-radius: 4px; color: var(--text); font-size: 13.5px; }
.facet a:hover { background: var(--line-2); text-decoration: none; }
.facet a.on { background: var(--gold-soft); font-weight: 600; }
.facet a span:last-child { color: var(--muted); }
.facet .more { font-size: 12px; padding-left: 6px; }
.resbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.resbar .count { font-family: var(--serif); font-size: 20px; }
.filters-on .chip { background: var(--gold-soft); }
.result { padding: 16px 2px 16px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 34px 1fr; gap: 6px; }
.result .num { color: var(--muted); font-size: 13px; padding-top: 3px; }
.result .title { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.result .title a { color: var(--ink-2); }
.result .cite { font-size: 13px; color: var(--muted); margin: 2px 0 6px; }
.result .snip { font-family: var(--serif); font-size: 15px; line-height: 1.55; }
.result .hn { margin: 6px 0 0; padding: 6px 10px; border-left: 3px solid var(--gold); background: var(--gold-soft); font-size: 13.5px; border-radius: 0 4px 4px 0; }
.result .topics { margin-top: 6px; }
.result .acts { margin-top: 6px; display: flex; gap: 12px; font-size: 13px; }
.notes-box { font-size: 13px; color: var(--muted); }
.pager { display: flex; gap: 6px; justify-content: center; margin: 22px 0; }
.within { display: flex; gap: 6px; }
.within input { width: 220px; padding: 6px 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.info-note { font-size: 13px; color: var(--muted); padding: 8px 12px; background: var(--line-2); border-radius: var(--radius); margin-bottom: 12px; }
.err { color: var(--red); padding: 10px 12px; border: 1px solid var(--red); border-radius: var(--radius); margin-bottom: 12px; }

/* ---------------------------------------------------------------- flags */
.flag { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 6px; }
.flag.red { color: var(--red); } .flag.yellow { color: var(--yellow); } .flag.green { color: var(--green); } .flag.blue { color: var(--blue); }
.flagline { display: flex; align-items: center; gap: 6px; font-size: 13.5px; padding: 8px 12px; border-radius: var(--radius); margin: 10px 0; }
.flagline.red { background: rgba(179, 38, 30, .08); color: var(--red); }
.flagline.yellow { background: rgba(200, 138, 4, .1); color: #8a5f00; }
.flagline.green { background: rgba(47, 122, 61, .08); color: var(--green); }
.flagline.blue { background: rgba(42, 94, 168, .08); color: var(--blue); }

/* ---------------------------------------------------------------- document */
.dochead { padding-bottom: 12px; border-bottom: 2px solid var(--ink); margin-bottom: 0; }
.dochead h1 { font-size: 30px; line-height: 1.2; }
.dochead .cite { color: var(--muted); font-size: 14px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 0 0 18px; overflow-x: auto; position: sticky; top: 56px; background: var(--paper); z-index: 5; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; font-size: 14px; }
.tabs a.on { color: var(--ink-2); border-bottom-color: var(--gold); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs .n { font-size: 12px; color: var(--muted); margin-left: 3px; }
.synopsis { font-family: var(--serif); font-size: 16px; line-height: 1.6; }
.attrib { font-size: 12px; color: var(--muted); margin-top: 6px; }
.headnotes { counter-reset: hn; }
.headnote { display: grid; grid-template-columns: 34px 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.headnote .hnn { font-family: var(--serif); font-weight: 700; color: var(--gold); font-size: 18px; text-align: center; }
.headnote .key { font-size: 12px; color: var(--muted); margin-top: 3px; }
.opinion { font-family: var(--serif); font-size: 17px; line-height: 1.7; max-width: 46em; }
.opinion p { margin: 0 0 1em; position: relative; }
.opinion p .pn { position: absolute; left: -46px; width: 36px; text-align: right; font: 11px var(--sans); color: var(--muted); top: 6px; opacity: 0; cursor: pointer; }
.opinion p:hover .pn { opacity: 1; }
.opinion p.noted { background: rgba(253, 230, 138, .35); box-shadow: -8px 0 0 rgba(253, 230, 138, .35), 8px 0 0 rgba(253, 230, 138, .35); }
.opinion p.hnjump { animation: flash 2s ease; }
@keyframes flash { 0% { background: var(--gold-soft); } 100% { background: transparent; } }
.opinion a.cx { border-bottom: 1px dotted var(--ink-2); }
.opinion .hnref { font: 600 11px var(--sans); color: var(--gold); margin-right: 4px; vertical-align: 2px; }
.side h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.side .panel { position: sticky; top: 112px; }
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 4px 10px; font-size: 13.5px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.reflist .ref { padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.reflist .ref .t { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.reflist .ref .m { font-size: 12.5px; color: var(--muted); }
.reflist .ref .ctx { font-family: var(--serif); font-size: 14.5px; margin-top: 5px; color: var(--text); border-left: 2px solid var(--line); padding-left: 10px; }
.treat { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 3px; background: var(--line-2); }
.treat.negative { background: rgba(179, 38, 30, .1); color: var(--red); }
.treat.caution { background: rgba(200, 138, 4, .12); color: #8a5f00; }
.treat.positive { background: rgba(47, 122, 61, .1); color: var(--green); }
.depth { color: var(--gold); letter-spacing: 1px; font-size: 12px; }
.histtree { border-left: 2px solid var(--line); margin-left: 8px; padding-left: 16px; }
.histtree .node { position: relative; padding: 8px 0; }
.histtree .node::before { content: ""; position: absolute; left: -22px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.histtree .node.self::before { background: var(--ink-2); }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th { text-align: left; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); padding: 6px 8px; }
table.grid td { border-bottom: 1px solid var(--line-2); padding: 8px; vertical-align: top; }

/* ---------------------------------------------------------------- topics / statutes */
.tree .root { margin-bottom: 18px; }
.tree .root > a { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.tree .kids { columns: 2; column-gap: 30px; margin-top: 6px; }
.tree .kids a { display: block; padding: 3px 0; font-size: 14px; break-inside: avoid; }
.keyno { font-family: var(--mono); font-size: 12px; color: var(--gold); margin-right: 6px; }
.codegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.codegrid a { padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); font-size: 13.5px; }
.codegrid a .c { color: var(--muted); font-size: 11px; display: block; }
.codegrid a.full { border-color: var(--gold); }

/* ---------------------------------------------------------------- auth */
.authwrap { max-width: 420px; margin: 50px auto; }
.authwrap .panel { padding: 28px; }
.authwrap h1 { text-align: center; color: var(--ink-2); }
.authwrap .sub { text-align: center; color: var(--muted); margin-bottom: 16px; }

/* ---------------------------------------------------------------- misc */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 20px; font-size: 14px; z-index: 50; }
.modal { position: fixed; inset: 0; background: rgba(10, 20, 35, .45); display: grid; place-items: center; z-index: 40; }
.modal-card { background: var(--panel); border-radius: 10px; padding: 22px; width: min(520px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.helpdoc { max-width: 900px; }
.helpdoc code { font-family: var(--mono); background: var(--line-2); padding: 1px 5px; border-radius: 3px; font-size: 13px; }
.helpdoc table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; }
.helpdoc td, .helpdoc th { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; font-size: 14px; vertical-align: top; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

@media (max-width: 1000px) {
  .topnav { display: none; }
  .cols, .cols3, .home-grid { grid-template-columns: 1fr; }
  .side .panel { position: static; }
  .tree .kids { columns: 1; }
}
@media print {
  .topbar, .tabs, .side, .acts, .noprint { display: none !important; }
  .cols3 { display: block; }
  body { background: #fff; }
  .opinion { max-width: none; }
}

.wordmark .beta{font:600 9px/1 system-ui,sans-serif;letter-spacing:.14em;text-transform:uppercase;background:var(--gold);color:#142a4a;border-radius:99px;padding:3px 6px;vertical-align:middle;margin-left:4px}
