/* Legal DB — document page (RTL). Palette aligned with docs/legal-db-style-guide.md. */

:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --border: #E7E7E7;
  --border-light: #F0F0F0;
  --text: #0E1013;
  --text-muted: #616368;
  --text-dim: #ABABAC;
  --accent: #25A7FF;
  --accent-light: #E9F6FF;
  --accent-dark: #1991DC;
  /* Rating pills moved to lizzy per the guide; keep --gold aliased so any
     leftover gold call sites render in the new color until migrated. */
  --gold: #8A21C4;
  --gold-light: #F3E9F9;
  --lizzy: #8A21C4;

  /* Citation pill palette — subtle lavender, gets bolder on hover/click */
  --ref-bg: #f3e9f9;
  --ref-text: #8a21c4;
  --ref-bg-hover: #e9d5f5;
  --ref-active: #6b1599;

  --header-h: 48px;
  --footer-h: 32px;

  /* Default split — summary occupies 40% of the viewport width, PDF gets 60%.
     The drag handle overrides this to a pixel value during interactive resize. */
  --summary-w: 40vw;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; }
body {
  font-family: "Heebo", -apple-system, BlinkMacSystemFont, "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  font-size: 14px; line-height: 1.65; color: var(--text); background: var(--bg);
  /* Rows: header, breadcrumb bar, content (.split — takes the rest), footer.
     It was "auto 1fr auto" from before the breadcrumb bar existed: with four
     children the BREADCRUMB BAR landed in the 1fr row and stretched to fill the
     screen, its contents centred in a tall empty band under the header.
     Fixed-position children (#par-popover, #toast) take no row. */
  display: grid; grid-template-rows: auto auto 1fr auto; min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.dim, .muted { color: var(--text-dim); }

/* ---------- header — brand (visual RIGHT) + nav (visual LEFT) ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  /* Same box as the home page header (landing.css: 56 px, 0 24px), so the logo
     and nav sit at the same height on every page. */
  padding: 0 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 56px;
}
.site-header .top-nav {
  display: inline-flex; align-items: center; gap: 20px;
  font-family: var(--font-body, "Noto Sans Hebrew", sans-serif);
  /* Identical to the home page nav (landing.css: 13px, normal weight, 20px between
     the brand and the first link) so the top bar does not shift between pages.
     It was 13.5px / 500 with no padding: the nav sat closer to the brand and
     looked larger and bolder. */
  font-size: 13px; font-weight: 400;
  padding-right: 20px;
}
.site-header .top-nav a { color: var(--text-muted); text-decoration: none; transition: color 0.12s; }
.site-header .top-nav a:hover { color: var(--accent); text-decoration: none; }
.site-header .top-nav .ext-mark { color: var(--accent); margin-inline-start: 2px; }
@media (max-width: 720px) {
  .site-header .top-nav { gap: 12px; font-size: 12.5px; }
}
/* Header cluster (visual RIGHT in RTL):
   Lizzy logo (DOM first → RTL visual right) → Legal DB wordmark → top-nav links,
   all packed tight as one unit. Matches the landing-page layout. */
.header-cluster {
  display: inline-flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.header-cluster .top-nav { margin-inline-end: 16px; }

.header-lizzy {
  display: inline-flex; align-items: center; text-decoration: none; flex-shrink: 0;
}
.header-lizzy:hover { text-decoration: none; opacity: 0.92; }
.header-lizzy-logo { height: 22px; width: auto; display: block; }

.brand.brand-legal-db {
  display: inline-flex; align-items: center;
  font-family: var(--font-body, "Noto Sans Hebrew", sans-serif);
  font-size: 18px; font-weight: 700; color: var(--text);
  text-decoration: none; letter-spacing: -0.2px;
}
.brand.brand-legal-db:hover { text-decoration: none; }
/* "BETA" next to the wordmark: small, outlined, part of the same link. */
.brand-beta {
  margin-inline-start: 8px; padding: 1px 6px;
  font-size: 10px; font-weight: 700; line-height: 1.4; letter-spacing: 0.06em;
  color: var(--accent-dark); border: 1px solid var(--accent); border-radius: 5px;
}

/* ---------- breadcrumb bar — second row.
   Visual RIGHT (RTL start): back-btn + breadcrumb path together (.breadcrumb-right)
   Visual LEFT  (RTL end):  meta strip — materiality + doc-type + view count + bookmark icon. */
.breadcrumb-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  min-height: 48px;
  gap: 18px;
}

/* Right cluster: back-btn first, breadcrumbs after — in RTL the back-btn
   appears at the visual START (right edge) of the cluster. */
.breadcrumb-right {
  display: inline-flex; align-items: center; gap: 14px;
  min-width: 0; flex: 1;
}

.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 14px;
  color: var(--text-muted);
  font-family: var(--font-body, "Noto Sans Hebrew", sans-serif);
  font-size: 13px; font-weight: 500;
  text-decoration: none; cursor: pointer; flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.back-btn:hover {
  color: var(--accent); border-color: var(--accent-soft, #71C6FF);
  background: var(--accent-light);
  text-decoration: none;
}
.back-arrow { font-size: 15px; line-height: 1; }

.breadcrumbs {
  list-style: none; padding: 0; margin: 0;
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-body, "Noto Sans Hebrew", sans-serif);
  font-size: 13px; color: var(--text-muted);
  flex: 1; overflow: hidden; min-width: 0;
}
.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs a {
  color: var(--text-muted); text-decoration: none;
  transition: color 0.12s;
}
.breadcrumbs a:hover { color: var(--accent); text-decoration: none; }
.breadcrumbs .sep {
  color: var(--text-dim); font-weight: 300; padding: 0 2px;
}
.breadcrumbs .current {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text); max-width: 60%; min-width: 0;
}
/* Inner span ellipsizes the case_desc + case_name so the materiality badge
   sits to its left at full size (badge is on the visual LEFT in RTL because
   the .current flex container fills row-left-to-end). */
.breadcrumbs .current .current-text {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.breadcrumbs .current .case-desc { color: var(--accent); font-weight: 600; }
.breadcrumbs .current .dot { color: var(--text-dim); margin: 0 6px; }
.breadcrumbs .current .case-name { color: var(--text); font-weight: 400; }

@media (max-width: 720px) {
  .breadcrumb-bar { padding: 8px 14px; flex-wrap: wrap; gap: 8px; }
  .breadcrumbs .current { max-width: 100%; }
}

.materiality-badge {
  background: var(--lizzy-light, #F3E9F9); color: var(--lizzy);
  border: 1px solid var(--lizzy-border, #D0A6E7);
  padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}

/* Meta strip on the left of the breadcrumb bar (RTL end).
   Items inside flow right-to-left in DOM order: materiality first → bookmark last. */
.doc-meta {
  display: inline-flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.doc-meta .doc-type-pill {
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 500;
  white-space: nowrap;
}
.doc-meta .view-count {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-dim);
  font-size: 12.5px; font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.doc-meta .view-count svg { color: currentColor; }
.doc-meta .bookmark-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 0; cursor: not-allowed;
  color: var(--text-muted);
  transition: color 0.12s, border-color 0.12s;
}
.doc-meta .bookmark-btn:not(:disabled):hover {
  color: var(--accent); border-color: var(--accent-soft, #71C6FF);
}

@media (max-width: 720px) {
  .doc-meta { gap: 6px; }
  .doc-meta .view-count { display: none; }
}

/* ---------- thin overlay scrollbars ----------
   Default: thumb is transparent → scrollbar takes no visual space when idle.
   On hover (or while scrolling) the thumb fades in. Tracks stay invisible.
   Applies to the two scroll containers on this page: the summary pane (right)
   and the PDF viewer container (left). */
.summary-pane,
#viewerContainer {
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
  transition: scrollbar-color 0.2s ease;
}
.summary-pane:hover,
#viewerContainer:hover {
  scrollbar-color: rgba(0, 0, 0, 0.28) transparent;
}
.summary-pane::-webkit-scrollbar,
#viewerContainer::-webkit-scrollbar { width: 8px; height: 8px; }
.summary-pane::-webkit-scrollbar-track,
#viewerContainer::-webkit-scrollbar-track { background: transparent; }
.summary-pane::-webkit-scrollbar-thumb,
#viewerContainer::-webkit-scrollbar-thumb {
  background: transparent; border-radius: 8px;
  transition: background 0.2s ease;
}
.summary-pane:hover::-webkit-scrollbar-thumb,
#viewerContainer:hover::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.28); }
.summary-pane::-webkit-scrollbar-thumb:hover,
#viewerContainer::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.45); }

/* The PDF viewer's scrollbar is always visible, and light: the viewer's background is dark
   grey (#525659) in both themes, where the dark thumb above could not be seen even on
   hover, so the document looked like it had no scrollbar. Full width, so it is easy to grab. */
#viewerContainer,
#viewerContainer:hover {
  scrollbar-width: auto;
  scrollbar-color: rgba(255, 255, 255, 0.6) rgba(0, 0, 0, 0.18);
}
#viewerContainer::-webkit-scrollbar { width: 12px; height: 12px; }
#viewerContainer::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.18); }
#viewerContainer::-webkit-scrollbar-thumb,
#viewerContainer:hover::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.6); }
#viewerContainer::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.85); }

/* ---------- split layout ----------
   DOM order is summary, resizer, pdf. With dir="rtl" the visual order flips,
   so col 1 (the FIRST DOM child = summary) renders on the visual RIGHT and col 3
   renders on the LEFT. Sizes:
       col 1   var(--summary-w)   summary (right side, ~40vw default)
       col 2   8px                resizer
       col 3   1fr                pdf (fills remaining ~60vw)
   The drag math (--summary-w = vw - clientX) then makes the boundary track
   the mouse: drag right → summary (right) shrinks, PDF (left) grows. */
.split {
  display: grid;
  grid-template-columns: var(--summary-w) 8px 1fr;
  height: 100%; overflow: hidden;
  /* A grid item will not shrink below its content by default; without this the
     1fr row grows with a long summary and the panes stop scrolling inside. */
  min-height: 0;
}
.summary-pane {
  background: var(--bg); border-inline-start: 1px solid var(--border);
  overflow-y: auto; height: 100%;
}
.summary-inner { padding: 16px 20px 24px; max-width: 720px; }

/* ---------- "Ask Lizzy about this document" — pill-shaped white bar with
   up-arrow button (visual left, RTL end) + input + Lizzy logo (visual right).
   Disabled until the per-doc Q&A backend lands. ---------- */
.doc-ask {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px 6px 6px;
  margin-bottom: 10px;
  cursor: not-allowed;
  box-shadow: 0 4px 14px rgba(17, 17, 17, 0.03);
}
.doc-ask-go {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--surface-2);
  border: 0; border-radius: 50%;
  color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: not-allowed; padding: 0;
}
.doc-ask-input {
  flex: 1; border: 0; background: transparent;
  font-family: var(--font-body, "Noto Sans Hebrew", sans-serif);
  font-size: 15px; line-height: 20px;
  padding: 0; outline: 0;
  color: var(--text); min-width: 0;
  cursor: not-allowed;
  text-align: right;
}
.doc-ask-input::placeholder { color: var(--text-dim); }
.doc-ask-logo {
  flex-shrink: 0;
  width: 28px; height: 28px;
  display: block;
}

/* ---------- AI summary disclaimer — small muted text right under the ask bar.
   Required transparency since the entire summary block (Facts, Ratio, Obiter,
   Q&A) is LLM-derived from .summary. ---------- */
.ai-disclaimer {
  font-family: var(--font-body, "Noto Sans Hebrew", sans-serif);
  font-size: 12.5px; line-height: 19px; font-weight: 400;
  color: var(--text-dim);
  margin: 0 0 16px; padding: 0 4px;
  text-align: right;
}
.ai-disclaimer a {
  color: var(--lizzy); font-weight: 600; text-decoration: none;
}
.ai-disclaimer a:hover { text-decoration: underline; }

.pdf-pane {
  display: flex; flex-direction: column; height: 100%;
  background: var(--surface-2); min-width: 0;
}
/* PDF toolbar, right to left: Ask Lizzy · search · page N of M · zoom · actions (far left). */
.pdf-toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 8px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
  font-family: var(--font-body, "Noto Sans Hebrew", sans-serif);
  font-size: 12.5px; color: var(--text-muted);
}
.pdf-toolbar button { font: inherit; cursor: pointer; }

/* Ask Lizzy — the purple pill; disabled until the feature ships ("soon" tooltip on the wrapper). */
.pdf-ask-wrap { display: inline-flex; cursor: default; }
.pdf-ask {
  display: inline-flex; align-items: center; gap: 6px;
  padding-block: 5px; padding-inline: 10px 14px; border-radius: 999px;
  background: var(--lizzy-light, #F3E9F9); color: var(--lizzy);
  border: 1px solid var(--lizzy-border, #D0A6E7);
  font-weight: 500;
}
.pdf-ask:disabled { opacity: 0.6; cursor: default; pointer-events: none; }
/* As a link (opens the Lizzy app with this ruling's PDF attached). */
.pdf-ask { font-size: 12.5px; }   /* its own size, whatever the toolbar's text size is */
a.pdf-ask { text-decoration: none; }
a.pdf-ask:hover { opacity: 0.85; text-decoration: none; }
.pdf-ask img { display: block; }

/* ---- The rest of the toolbar, from the "מציג מסמך – סרגל כלים" design: its layout, grouping,
   icons and 8px corners, in this site's own colours and font, and at THIS PAGE's scale:
   13px text and 32px controls, like the bar above it (the back button, the breadcrumbs).
   The design's 14px / 44px looked like a different, larger page next to them. Ask Lizzy above is not part
   of it and keeps its own look. Right to left: search · pages · size · fit · (space) ·
   source, download, print, full screen. It wraps onto a second row when the pane is narrow. */
.pdf-toolbar { gap: 8px 10px; font-size: 13px; color: var(--text-muted); }
.pdf-toolbar :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pdf-sep { width: 1px; height: 22px; background: var(--border); flex: none; }

/* Search in the document. */
.pdf-search {
  flex: 1 1 130px; max-width: 220px; min-width: 0; height: 32px; box-sizing: border-box;
  display: flex; align-items: center; gap: 6px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text-muted);
}
.pdf-search svg { flex: none; width: 14px; height: 14px; }
.pdf-search:focus-within { border-color: var(--accent); }
.pdf-search input {
  flex: 1 1 0; min-width: 0; height: 28px; padding: 0;
  border: 0; outline: 0; background: transparent; color: var(--text);
  font: inherit;
}
.pdf-find-count { font-size: 12px; color: var(--text-dim); white-space: nowrap; }

/* A 32px square button with only an icon: page arrows and the actions. */
.pdf-btn {
  width: 32px; height: 32px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: transparent; border: 0; border-radius: 8px;
  text-decoration: none;
}
.pdf-btn svg { width: 16px; height: 16px; }
.pdf-btn:hover { background: var(--surface-2); color: var(--accent); text-decoration: none; }

/* Pages: previous · "עמוד N מתוך M" · next. */
.pdf-nav { display: inline-flex; align-items: center; gap: 2px; }
.pdf-page { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--text-muted); }
.pdf-page input {
  width: 36px; height: 26px; box-sizing: border-box; padding: 0 4px; text-align: center;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
}
.pdf-page input:focus { outline: 0; border-color: var(--accent); }

/* Size: − | 100% | + as one bordered control (always left to right). */
.pdf-zoom {
  display: inline-flex; align-items: stretch; height: 32px; box-sizing: border-box; flex: none;
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.pdf-zoom button {
  width: 32px; padding: 0; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); background: var(--surface); border: 0;
}
.pdf-zoom button:hover { background: var(--surface-2); color: var(--accent); }
.pdf-zoom button:first-child { border-right: 1px solid var(--border); }
.pdf-zoom button:last-child  { border-left: 1px solid var(--border); }
.pdf-zoom .pdf-zoom-value {
  width: auto; min-width: 52px; padding: 0 8px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Fit to width / to page: one button that says what the next click does. */
.pdf-fit-wrap { display: inline-flex; }
.pdf-fit {
  height: 32px; box-sizing: border-box; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; white-space: nowrap;
  color: var(--text-muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px;
}
.pdf-fit:hover { border-color: var(--accent); color: var(--accent); }
.pdf-fit svg[hidden] { display: none; }

/* Actions at the far end: source, download, print, full screen. */
.pdf-actions { display: inline-flex; align-items: center; margin-inline-start: auto; }

/* Fullscreen: the pane fills the screen; the viewer takes the space under the toolbar. */
.pdf-pane:fullscreen { background: var(--bg); display: flex; flex-direction: column; }
.pdf-pane:fullscreen #document-view { flex: 1; min-height: 0; }

#document-view { flex: 1; position: relative; min-height: 0; }
.pdf-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 14px; text-align: center; padding: 20px;
}

/* ---------- resizer (8 px hit area, 1 px center line) ---------- */
.resizer { position: relative; cursor: col-resize; background: transparent; }
.resizer::before {
  content: ""; position: absolute; inset: 0 3px;
  background: var(--border); transition: background 0.15s, inset 0.15s;
}
.resizer:hover::before, .resizer.dragging::before {
  background: var(--accent); inset: 0 2px;
}

/* ---------- summary sections (each one a card) — pixel-perfect per spec ---------- */
section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
/* Facts card carries a soft purple tint per the style guide. It's the only
   section visually distinguished — all the others are neutral white cards. */
#facts {
  border-color: var(--lizzy-border, #D0A6E7);
}
section.high-importance {
  background: var(--lizzy-light);
  border-color: var(--lizzy-border, #D0A6E7);
}
section h2 {
  font-family: var(--font-body, "Noto Sans Hebrew", sans-serif);
  font-size: 15px; font-weight: 700;
  margin: 0 0 12px 0; color: var(--text);
  display: flex; align-items: center; gap: 6px;
  letter-spacing: -0.1px;
}
section h2 .count { font-weight: 400; color: var(--text-muted); font-size: 12.5px; }
section p { margin: 0 0 10px; font-size: 14px; line-height: 1.7; }
section p:last-child { margin-bottom: 0; }

/* Natural RTL grid flow: dt (first child) → column 1 → visual RIGHT (start);
   dd (second child) → column 2 → visual LEFT (end). Labels read from the
   right edge of the card, values fill toward the left. */
dl.meta-grid {
  display: grid; grid-template-columns: auto 1fr;
  column-gap: 16px; row-gap: 8px; margin: 0;
  font-family: var(--font-body, "Noto Sans Hebrew", sans-serif);
}
dl.meta-grid dt {
  color: var(--text-muted);
  font-size: 13px; font-weight: 400; line-height: 18px;
  text-align: right;
  white-space: nowrap;
}
dl.meta-grid dd {
  margin: 0;
  color: var(--text);
  font-size: 13px; font-weight: 400; line-height: 18px;
  text-align: right;
}
dl.meta-grid dd a { color: var(--accent); }
dl.meta-grid dd a:hover { color: var(--accent-dark); text-decoration: underline; }

/* "מספר תיק" → case-aggregate link. The line shows the case_desc as a link
   (when siblings exist) followed by a small "+N" badge so the reader can see
   at a glance how many other docs belong to the case. Same treatment is
   applied in the breadcrumb so the case-desc there is also clickable. */
.case-list-link {
  text-decoration: none; border-bottom: 1px dashed var(--accent);
}
.case-list-link:hover { text-decoration: none; border-bottom-color: var(--accent-dark); }
.case-sibling-count {
  margin-inline-start: 6px;
  font-size: 11.5px; font-weight: 500;
  color: var(--text-dim); font-variant-numeric: tabular-nums;
  cursor: default;
}
/* Inline +N inside the breadcrumb's case-desc link — smaller, kept on the
   same baseline as the case identifier. */
.case-sibling-count-inline {
  font-size: 10.5px; font-weight: 500;
  color: var(--text-dim); font-variant-numeric: tabular-nums;
  margin-inline-start: 4px;
}

/* Hover card on the case number: the case's other documents, date + type.
   Fixed-position like #par-popover (the breadcrumb and the panes clip their
   overflow); js/document.js places it under the hovered link. */
#case-pop {
  position: fixed; z-index: 1000;
  min-width: 210px; max-width: 320px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  font-size: 13px; line-height: 1.5;
  opacity: 0; visibility: hidden;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
#case-pop.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.case-pop-title { padding: 4px 8px 6px; font-size: 11px; color: var(--text-muted); }
#case-pop ul { list-style: none; margin: 0; padding: 0; }
.case-pop-row {
  display: flex; align-items: baseline; gap: 12px;
  padding: 5px 8px; border-radius: 6px;
  color: var(--text); text-decoration: none;
}
a.case-pop-row:hover, a.case-pop-row:focus-visible { background: var(--accent-light); text-decoration: none; }
.case-pop-date { color: var(--text-muted); font-variant-numeric: tabular-nums; }
/* the document being read: bold, not a link */
.case-pop-current { font-weight: 700; }
.case-pop-current .case-pop-date { color: var(--text); }
.case-pop-here { font-weight: 400; font-size: 12px; color: var(--text-muted); }
.case-pop-more {
  display: block; margin-top: 4px; padding: 6px 8px 2px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
}

ul.ratio, ul.citations, ul.prec-list { margin: 0; padding-inline-start: 20px; }
ul.ratio li, ul.citations li, ul.prec-list li {
  margin-bottom: 6px; line-height: 1.6;
}
ul.citations li {
  border-bottom: 1px dashed var(--border); padding: 4px 0;
}
ul.citations li:last-child { border-bottom: 0; }

.qa-item {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 6px;
  background: var(--bg);
  transition: background 0.15s;
}
.qa-item:last-child { margin-bottom: 0; }
.qa-item[open] { background: var(--accent-light); }

.qa-item summary {
  cursor: pointer; font-weight: 500; color: var(--text);
  list-style: none; outline: none;
  padding-inline-start: 26px; position: relative;
  line-height: 1.55;
}
.qa-item summary::-webkit-details-marker { display: none; }
.qa-item summary::before {
  content: "ש"; position: absolute; inset-inline-start: 0; top: 0;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff;
  border-radius: 4px; font-size: 11px; font-weight: 700;
}

.qa-answer {
  margin-top: 8px; padding-inline-start: 26px;
  color: var(--text); font-size: 13px; line-height: 1.6;
  position: relative;
}
.qa-answer::before {
  content: "ת"; position: absolute; inset-inline-start: 0; top: 0;
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--gold-light); color: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 4px; font-size: 11px; font-weight: 700;
}

ul.tag-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
ul.tag-list li a {
  display: inline-block;
  padding: 4px 12px;
  background: var(--accent-light); color: var(--accent);
  border-radius: 12px; font-size: 12px;
  transition: background 0.15s, color 0.15s;
}
ul.tag-list li a:hover { background: var(--accent); color: #fff; text-decoration: none; }

.party-block {
  margin-bottom: 8px; padding: 8px 12px;
  background: var(--surface-2); border-radius: 6px;
}
.party-role { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.anon-name { color: var(--text-muted); font-style: italic; }
.anon-badge {
  background: var(--accent-light); color: var(--accent);
  padding: 1px 8px; border-radius: 8px; font-size: 11px;
  margin-inline-start: 6px;
}
.counsel { color: var(--text-muted); font-size: 12px; margin-inline-start: 4px; }

.citation-group, .prec-group { margin-bottom: 12px; }
.citation-group h3, .prec-group h3 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 500; color: var(--text-muted); margin: 8px 0 4px;
}

/* ---------- inline case-id references ----------
   .case-link    → resolved (we have that doc) → clickable, dashed underline,
                   solid on hover
   .case-ref     → unresolved (cited doc not yet in our DB) → same accent color
                   so the reader instantly recognizes it as a case identifier,
                   but no underline/cursor → not interactive. Tooltip explains.
   When the cited doc gets ingested, the very next page render upgrades the
   span to an <a> automatically.
*/
.case-link, .case-ref {
  color: var(--accent); font-weight: 600;
}
.case-link {
  text-decoration: none;
  border-bottom: 1px dashed var(--accent-light);
  transition: color 0.15s, border-color 0.15s;
}
.case-link:hover {
  color: var(--accent-dark);
  border-bottom-color: var(--accent);
  text-decoration: none;
}
.case-ref {
  cursor: default;
  /* dotted, dimmer underline → "this is a case id, but not yet a link" */
  border-bottom: 1px dotted var(--border);
}

/* ---------- legislation chips (green link, no background) ----------
   The chip is a real <a> with href → aggregate page (lands later). Plain link styling:
   green color + dashed underline so it reads as "interactive citation" without
   competing with the prose. Tooltip via title attr is the discoverable hint.
   Inferred (antecedent-resolved) → dotted underline. */
.leg-ref {
  color: #2d7d4f;                                /* deep green */
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
  background: none;
  padding: 0;
  border: 0;
  transition: color 0.15s, text-decoration-style 0.15s;
}
.leg-ref:hover {
  color: #1f6b40;
  text-decoration-style: solid;
}
.leg-ref.inferred {
  text-decoration-style: dotted;
  color: #4f8c6a;                                /* slightly dimmer for inferred */
}

/* ---------- citation pills (lavender) ---------- */
.par-ref {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; padding: 1px 6px; margin: 0 2px;
  font-size: 11px; font-weight: 600;
  background: var(--ref-bg); color: var(--ref-text);
  border-radius: 3px; cursor: pointer;
  user-select: none; white-space: nowrap;
  transition: background 0.15s, color 0.15s, transform 0.1s;
  vertical-align: baseline; line-height: 1.4;
}
.par-ref:hover { background: var(--ref-bg-hover); color: var(--ref-active); }
.par-ref.active { background: var(--ref-active); color: #fff; transform: scale(1.05); }

/* ---------- citation tooltip (hover-only preview) ----------
   Click on the pill jumps to the PDF directly — no buttons in the tooltip.
   Backdrop blur + soft shadow give it the floating "card" look without
   competing with the document content. */
#par-popover {
  position: fixed; z-index: 1000;
  max-width: 380px; min-width: 240px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  backdrop-filter: blur(6px);
  font-size: 13px; line-height: 1.6;
  opacity: 0; pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
#par-popover.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }

.pop-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  border-radius: 10px 10px 0 0;
  font-size: 11px;
}
.pop-num { color: var(--text-muted); font-weight: 500; }
.pop-id {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  font-size: 10px; font-weight: 600;
  color: var(--ref-text); background: var(--ref-bg);
  padding: 2px 8px; border-radius: 4px;
  margin-inline-start: auto;
}

.pop-body {
  padding: 10px 12px; color: var(--text);
  max-height: 220px; overflow-y: auto;
  /* Tooltip uses the same thin overlay scrollbar treatment as the panes */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}
.pop-body::-webkit-scrollbar { width: 6px; }
.pop-body::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.25); border-radius: 6px; }
.pop-body::-webkit-scrollbar-track  { background: transparent; }

/* ---------- toast (small flash for actions) ---------- */
#toast {
  position: fixed; top: calc(var(--header-h) + 16px);
  left: 50%; transform: translateX(-50%) translateY(-20px);
  background: var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 6px;
  font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1100;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- footer ---------- */
.site-footer {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 6px;
  padding: 6px 20px; background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.site-footer .footer-legal {
  display: inline-flex; align-items: center; gap: 10px;
  margin-inline-start: 4px;
}
.site-footer .footer-legal a {
  color: var(--text-muted);
}
.site-footer .footer-legal a:hover { color: var(--accent); text-decoration: underline; }

/* The "אזכורים" row of the details grid: the count links to the citing rulings; hovering
   the row shows the count per year (title). */
.cite-dd { cursor: default; }
.cite-dd a { font-weight: 700; }
