/* The public case page (blackacreresearch.com/cases/<citation>/): WestGreg's reading view without the search.
   Adapted from WestGreg/westgreg.html at its commit eac0387 (Nov 17, 2026): the same colors, type and reader, so a
   case reads here as it does in WestGreg. Left out: the search box, filters, result list, rules outline and statute
   styles. Added: the Blackacre Research logo, the line for lawyers, the footer, a phone layout and printing. */
:root {
  --bg: #faf8f3; --panel: #fffefb; --ink: #1c1c1c; --muted: #6b6b6b; --line: #ddd8cc; --accent: #6b1f1f;
  --accent-fill: #6b1f1f; --accent-soft: #f2e4e1; --sel: #fbf3d6; --red: #c4183c; --red-soft: #fbe7ea; --yellow: #8a6d00;
  --yellow-soft: #fdf6d8; --chip: #f0ece2; --flash: #ffe58a; --dissent: #c9c2b0;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18181a; --panel: #1f1f22; --ink: #e9e7e1; --muted: #9a9890; --line: #34333a; --accent: #c98277;
    --accent-fill: #862828; --accent-soft: #3a2222; --sel: #33301f; --red: #ff6b8b; --red-soft: #3d1d27; --yellow: #e6c35c;
    --yellow-soft: #352f1a; --chip: #2a292e; --flash: #6b5a12; --dissent: #4a473f;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.4 var(--sans); display: flex; flex-direction: column;
  height: 100dvh; -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }

/* top bar: the logo, and the line for lawyers */
header.top { display: flex; align-items: center; gap: 14px; padding: 9px 16px; background: var(--panel);
  border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; flex: none; }
.brand svg { display: block; height: 30px; width: auto; }
.brand:hover { opacity: .75; }
header.top .sp { flex: 1; }
.pitch { font-size: 13px; color: var(--muted); text-decoration: none; text-align: right; }
.pitch b { color: var(--accent); font-weight: 600; white-space: nowrap; }
.pitch:hover b { text-decoration: underline; }
.iconbtn { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.iconbtn:hover { background: var(--chip); }

/* reader */
main { flex: 1; display: flex; min-height: 0; }
#reader { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 7px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel); font-size: 13px; }
.bar .sp { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.seg button, .seg a { border: 0; background: transparent; padding: 3px 9px; cursor: pointer; color: var(--ink);
  text-decoration: none; line-height: inherit; }
.seg button + button, .seg button + a { border-left: 1px solid var(--line); }
.seg .on { background: var(--accent-fill); color: #fff; }
.seg a[aria-disabled="true"] { opacity: .45; cursor: default; }
.btn { border: 1px solid var(--line); background: transparent; border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.btn:hover { background: var(--chip); }
.btn kbd, .seg kbd { font: 10px var(--sans); opacity: .55; margin-left: 3px; }
.seg.act button:hover { background: var(--chip); }
/* Export: one button, a menu with the clean PDF (one or two columns) and the Markdown copies */
.menuwrap { position: relative; }
.btn .ico { width: 14px; height: 14px; vertical-align: -2px; stroke: currentColor; fill: none; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; margin-right: 2px; }
.btn .caret { font-size: 10px; margin-left: 4px; opacity: .7; }
.menu { position: absolute; top: calc(100% + 5px); left: 0; z-index: 25; width: 268px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 5px; }
.menu .mhead { font: 600 11px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  padding: 6px 8px 4px; }
.menu .mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 3px 8px 6px;
  color: var(--muted); font-size: 12.5px; }
.menu [role=menuitem] { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent;
  padding: 6px 8px; border-radius: 6px; cursor: pointer; text-align: left; color: var(--ink); text-decoration: none; }
.menu [role=menuitem]:hover, .menu [role=menuitem]:focus-visible { background: var(--chip); outline: none; }
.menu small { color: var(--muted); }
.menu .msep { height: 1px; background: var(--line); margin: 5px 2px; }
.badge { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 31px; height: 19px;
  border-radius: 4px; font: 700 9.5px var(--sans); letter-spacing: .05em; }
.badge.pdf { border: 1.5px solid var(--accent); color: var(--accent); }
.badge.md { color: var(--ink); }
.badge.md svg { width: 31px; height: 19px; fill: currentColor; stroke: currentColor; }
#scroller { flex: 1; overflow-y: auto; outline: none; scroll-padding-top: 12px; }
#pdfbox { flex: 1; display: none; flex-direction: column; min-height: 0; }
#pdfbox iframe { flex: 1; width: 100%; border: 0; background: #525659; }
.filenote { font: 12.5px/1.45 var(--sans); padding: 6px 16px; background: var(--yellow-soft); color: var(--yellow);
  border-bottom: 1px solid var(--line); }
body.pdf #pdfbox { display: flex; } body.pdf #scroller { display: none; }
.doc { max-width: 760px; margin: 0 auto; padding: 22px 28px 60px; font: 17px/1.62 var(--serif); }
.doc h1.title { font: italic 600 26px/1.25 var(--serif); margin: 0 0 4px; }
.cite-line { font-size: 18px; margin-bottom: 6px; }
.meta { font: 13px/1.5 var(--sans); color: var(--muted); }
.meta b { color: var(--ink); font-weight: 600; }
.meta.gap { margin-top: 5px; }
.star-eg { font: 600 11.5px var(--sans); color: var(--accent); }
.notice { font: 13px/1.45 var(--sans); padding: 8px 11px; border-radius: 7px; margin: 10px 0; }
.notice.red { background: var(--red-soft); color: var(--red); }
.notice.yellow { background: var(--yellow-soft); color: var(--yellow); }
.notice small { display: block; opacity: .8; margin-top: 4px; }
.notice ul { margin: 4px 0 0; padding-left: 18px; }
.tabs { display: flex; gap: 2px; margin: 16px 0 6px; border-bottom: 1px solid var(--line); font: 13px var(--sans); }
.tabs button { border: 0; background: transparent; padding: 6px 12px; cursor: pointer; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
/* without the script every part shows, one under the other, each under its name */
html:not(.js) .tabs { display: none; }
html.js .nojs { display: none; }
.body h2 { font: 600 13px/1.3 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  margin: 30px 0 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.body h3 { font: 600 16px/1.35 var(--serif); margin: 22px 0 8px; }
.body h4, .body h5 { font: 600 15px var(--serif); margin: 18px 0 6px; }
.body p { margin: 0 0 13px; }
.body blockquote { margin: 0 0 13px; padding: 2px 0 2px 16px; border-left: 3px solid var(--line); color: var(--muted); }
.body pre { font: 11.5px/1.35 ui-monospace, Menlo, Consolas, monospace; background: var(--bg); border: 1px solid var(--line);
  border-radius: 7px; padding: 10px 12px; overflow-x: auto; color: var(--muted); }
.body ul { padding-left: 20px; font-size: 15px; }
.body section.sep { border-left: 3px solid var(--dissent); padding-left: 16px; margin-left: -19px; }
.body > p.meta { margin: 12px 0 2px; }
a.pn { font: 600 13px var(--sans); color: var(--accent); text-decoration: none; cursor: copy; padding: 1px 3px;
  border-radius: 4px; scroll-margin-top: 80px; }
a.pn:hover { background: var(--accent-soft); }
[data-p] { scroll-margin-top: 14px; }
/* star pages: the official reporter's page begins here (*240). The number is drawn by CSS, so it is never part of
   selected or copied text */
.pg { cursor: copy; scroll-margin-top: 90px; }
.pg::before { content: "*" attr(data-pg); font: 600 11.5px/1 var(--sans); color: var(--accent); background: var(--accent-soft);
  padding: 1px 3px; margin: 0 3px 0 1px; border-radius: 3px; vertical-align: 1px; white-space: nowrap; }
.pg:hover::before { background: var(--accent-fill); color: #fff; }
.pg.flash { animation: none; }
.pg.flash::before { animation: flash 1.8s ease-out; }
.flash { animation: flash 1.8s ease-out; }
@keyframes flash { 0%, 30% { background: var(--flash); } 100% { background: transparent; } }
/* a link that names the cited passage (…#pg240:~:text=first words,last words): the browser marks the words itself */
::target-text { background: var(--flash); color: inherit; }
.authlist .item { padding: 9px 0; border-bottom: 1px solid var(--line); font: 15px/1.35 var(--serif); }
.authlist .sub { font: 12px/1.4 var(--sans); color: var(--muted); }
.blank { padding: 60px 30px; color: var(--muted); text-align: center; font: 15px/1.6 var(--sans); max-width: 620px; margin: 0 auto; }
.blank .big { font: italic 30px var(--serif); color: var(--ink); margin-bottom: 8px; }

/* the foot of the page: where it is discussed, where the text comes from, what the page is not */
.docfoot { margin-top: 44px; padding-top: 14px; border-top: 1px solid var(--line); font: 12.5px/1.55 var(--sans); color: var(--muted); }
.docfoot p { margin: 0 0 9px; }
.docfoot h2 { font: 600 13px/1.3 var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; }
.discussed { margin-bottom: 16px; }
.discussed ul { margin: 0; padding-left: 18px; font: 15px/1.45 var(--serif); }
.docfoot .colophon { margin-top: 14px; }

#quotebtn { position: fixed; display: none; z-index: 20; background: var(--ink); color: var(--panel); border: 0;
  border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; box-shadow: 0 3px 12px rgba(0,0,0,.25); }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--panel);
  padding: 8px 14px; border-radius: 8px; font-size: 13px; max-width: 80vw; opacity: 0; transition: opacity .2s;
  pointer-events: none; z-index: 30; }
#toast.on { opacity: 1; }
#help { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: none; align-items: center; justify-content: center; z-index: 40; }
#help.on { display: flex; }
#help .card { background: var(--panel); border-radius: 12px; padding: 20px 26px; max-width: 520px; width: calc(100% - 32px);
  box-shadow: 0 10px 40px rgba(0,0,0,.3); }
#help h3 { margin: 0 0 10px; }
#help p { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
#help code { background: var(--chip); padding: 1px 5px; border-radius: 4px; color: var(--ink); font-size: 12px; }
#help table { border-collapse: collapse; width: 100%; font-size: 13px; }
#help td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
#help td:first-child { white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--accent); }

/* a phone: no keyboard letters on the buttons, bigger targets, the line for lawyers under the logo's row if it must */
@media (max-width: 760px) {
  .doc { padding: 16px 16px 48px; }
  header.top { gap: 8px; padding: 8px 12px; }
  .brand svg { height: 26px; }
  .pitch { font-size: 12px; line-height: 1.3; }
  .bar { padding: 7px 12px; }
  .btn kbd, .seg kbd, #help table { display: none; }
  .seg button, .seg a, .btn, .iconbtn { padding: 6px 11px; }
  .body section.sep { margin-left: -12px; padding-left: 9px; }
  .menu { width: min(268px, calc(100vw - 24px)); }
}
@media (max-width: 420px) {
  .pitch { max-width: 11.5em; }
}
/* printing: the whole decision, not the part in view; no buttons */
@media print {
  html, body { height: auto; }
  body { display: block; background: #fff; }
  header.top .pitch, .bar, .tabs, #quotebtn, #toast, #help, #pdfbox, #cites, #citing { display: none !important; }
  #scroller { overflow: visible; }
  #docbody { display: block !important; }
  .doc { max-width: none; padding: 0; }
}
