/* ==========================================================================
   SMU CGI — TBC Live Monitor — Sprint 5 overlay
   Source disclaimer · Editor reconciliation chips · Corrected-opinion badges
   Doctrinal tag chips (5 families) · Cross-case thread ribbon
   --------------------------------------------------------------------------
   Loaded AFTER sprint1.css / sprint2.css / sprint34.css so the cascade wins.
   All numeric values use rem; all colors tokenized.
   No hard-coded counts — chips render from data/opinions.json + data/tags.json.
   ========================================================================== */

:root {
  /* Sprint 5 tokens (additive to existing cgi tokens) */
  --s5-disclaimer-bg: #FFF8E7;
  --s5-disclaimer-border: #C7A646;
  --s5-disclaimer-fg: #4A3B0E;

  --s5-notice-bg: #EEF4FA;
  --s5-notice-border: #5B7FB5;
  --s5-notice-fg: #1F3B66;

  --s5-chip-bg: #F4F6F8;
  --s5-chip-border: #CDD3DA;
  --s5-chip-fg: #2B3138;

  /* Five family colors */
  --s5-family-jurisdiction-removal: #C44A1A;
  --s5-family-jurisdiction-removal-soft: #FBEEE5;
  --s5-family-procedure: #1A4FC4;
  --s5-family-procedure-soft: #E6ECFA;
  --s5-family-substantive-entity: #2E7D32;
  --s5-family-substantive-entity-soft: #E3F1E5;
  --s5-family-substantive-contract: #6A3FA0;
  --s5-family-substantive-contract-soft: #EEE6F7;
  --s5-family-substantive-other: #5E6470;
  --s5-family-substantive-other-soft: #ECEEF1;

  --s5-corrected-bg: #FFE9E0;
  --s5-corrected-border: #B23A1A;
  --s5-corrected-fg: #6A1C08;

  --s5-recon-bg: #FEF7E6;
  --s5-recon-border: #A86F0E;
  --s5-recon-fg: #5C3C04;
}

/* --------------------------------------------------------------------------
   A. Source disclaimer banner (Tier 1.3)
   -------------------------------------------------------------------------- */
.s5-source-disclaimer {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin: 1.25rem 0 1rem 0;
  padding: 0.85rem 1rem;
  background: var(--s5-disclaimer-bg);
  border: 1px solid var(--s5-disclaimer-border);
  border-left-width: 4px;
  border-radius: 4px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--s5-disclaimer-fg);
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
}
.s5-source-disclaimer__icon {
  flex: 0 0 1.5rem;
  font-weight: 700;
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--s5-disclaimer-border);
}
.s5-source-disclaimer__body p {
  margin: 0 0 0.4rem 0;
}
.s5-source-disclaimer__body p:last-child {
  margin-bottom: 0;
}
.s5-source-disclaimer__body strong {
  font-weight: 700;
}
.s5-source-disclaimer__body a {
  color: #6A4A08;
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   B. Paragraph-pin preference notice (Tier 1.4)
   -------------------------------------------------------------------------- */
.s5-pin-pref {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0 1rem 0;
  padding: 0.55rem 0.85rem;
  background: var(--s5-notice-bg);
  border: 1px solid var(--s5-notice-border);
  border-left-width: 3px;
  border-radius: 3px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--s5-notice-fg);
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
}
.s5-pin-pref__pill {
  flex: 0 0 auto;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--s5-notice-border);
  border-radius: 999px;
  background: #FFF;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   C. Editor reconciliation chips (Tier 1.2)
   Surface court_display vs PDF caption mismatches + court typos
   -------------------------------------------------------------------------- */
.s5-recon-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.25rem 0.25rem 0.25rem 0;
  padding: 0.15rem 0.55rem 0.15rem 0.4rem;
  background: var(--s5-recon-bg);
  border: 1px solid var(--s5-recon-border);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--s5-recon-fg);
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: help;
  white-space: nowrap;
  vertical-align: middle;
}
.s5-recon-chip::before {
  content: "\26A0";  /* warning sign */
  font-size: 0.75rem;
  line-height: 1;
  color: var(--s5-recon-border);
}
.s5-recon-chip[data-type="reviewer_refuted"] {
  background: var(--s5-family-substantive-entity-soft);
  border-color: var(--s5-family-substantive-entity);
  color: #1A4E1E;
}
.s5-recon-chip[data-type="reviewer_refuted"]::before {
  content: "\2713";  /* check mark */
  color: var(--s5-family-substantive-entity);
}

/* Hover panel */
.s5-recon-detail {
  position: absolute;
  z-index: 200;
  max-width: 28rem;
  margin-top: 0.5rem;
  padding: 0.85rem 1rem;
  background: #FFF;
  border: 1px solid var(--s5-recon-border);
  border-top-width: 3px;
  border-radius: 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #2B3138;
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  display: none;
}
.s5-recon-detail--open {
  display: block;
}
.s5-recon-detail__head {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  color: var(--s5-recon-fg);
  margin-bottom: 0.4rem;
}
.s5-recon-detail__row {
  display: flex;
  gap: 0.5rem;
  margin: 0.2rem 0;
}
.s5-recon-detail__label {
  flex: 0 0 8rem;
  font-weight: 600;
  color: #5E6470;
}
.s5-recon-detail__value {
  flex: 1 1 auto;
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
}
.s5-recon-detail__evidence {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed #CDD3DA;
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-style: italic;
  color: #4A535E;
}

/* --------------------------------------------------------------------------
   D. Corrected-opinion badges (Tier 1.5)
   -------------------------------------------------------------------------- */
.s5-corrected-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.25rem 0.25rem 0.25rem 0;
  padding: 0.15rem 0.55rem 0.15rem 0.4rem;
  background: var(--s5-corrected-bg);
  border: 1px solid var(--s5-corrected-border);
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--s5-corrected-fg);
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
  cursor: help;
}
.s5-corrected-badge::before {
  content: "\270D";  /* writing hand */
  font-size: 0.7rem;
}

/* --------------------------------------------------------------------------
   E. Doctrinal tag chips (Tier 2)
   22-tag controlled vocabulary, 5 family colors
   -------------------------------------------------------------------------- */
.s5-doctrine-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.2rem 0.25rem 0.2rem 0;
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--s5-chip-border);
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--s5-chip-fg);
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  letter-spacing: 0.02em;
  cursor: help;
  white-space: nowrap;
  background: var(--s5-chip-bg);
  vertical-align: middle;
  transition: filter 0.15s ease;
}
.s5-doctrine-tag:hover {
  filter: brightness(0.97);
}
.s5-doctrine-tag--primary {
  font-weight: 700;
}
.s5-doctrine-tag[data-family="jurisdiction-removal"] {
  background: var(--s5-family-jurisdiction-removal-soft);
  border-color: var(--s5-family-jurisdiction-removal);
  color: #6E260E;
}
.s5-doctrine-tag[data-family="procedure"] {
  background: var(--s5-family-procedure-soft);
  border-color: var(--s5-family-procedure);
  color: #0E2A6B;
}
.s5-doctrine-tag[data-family="substantive-entity"] {
  background: var(--s5-family-substantive-entity-soft);
  border-color: var(--s5-family-substantive-entity);
  color: #1A4E1E;
}
.s5-doctrine-tag[data-family="substantive-contract"] {
  background: var(--s5-family-substantive-contract-soft);
  border-color: var(--s5-family-substantive-contract);
  color: #3E2562;
}
.s5-doctrine-tag[data-family="substantive-other"] {
  background: var(--s5-family-substantive-other-soft);
  border-color: var(--s5-family-substantive-other);
  color: #2B3138;
}
.s5-doctrine-tag--secondary {
  opacity: 0.78;
  font-weight: 500;
}

/* Filter chip strip (above the opinions list) */
.s5-filter-strip {
  margin: 1.25rem 0 0.5rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid #E6E9EE;
  border-bottom: 1px solid #E6E9EE;
}
.s5-filter-strip__title {
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5E6470;
  margin: 0 0 0.5rem 0;
}
.s5-filter-strip__family-block {
  margin-bottom: 0.5rem;
}
.s5-filter-strip__family-label {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.5rem;
  margin-bottom: 0.25rem;
  vertical-align: middle;
}
.s5-filter-strip__family-label[data-family="jurisdiction-removal"] { color: var(--s5-family-jurisdiction-removal); }
.s5-filter-strip__family-label[data-family="procedure"] { color: var(--s5-family-procedure); }
.s5-filter-strip__family-label[data-family="substantive-entity"] { color: var(--s5-family-substantive-entity); }
.s5-filter-strip__family-label[data-family="substantive-contract"] { color: var(--s5-family-substantive-contract); }
.s5-filter-strip__family-label[data-family="substantive-other"] { color: var(--s5-family-substantive-other); }

.s5-filter-strip__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.15rem 0.2rem 0.15rem 0;
  padding: 0.2rem 0.55rem;
  background: #FFF;
  border: 1px solid var(--s5-chip-border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--s5-chip-fg);
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.s5-filter-strip__chip:hover {
  background: #F4F6F8;
}
.s5-filter-strip__chip[aria-pressed="true"] {
  font-weight: 700;
  background: #2B3138;
  border-color: #2B3138;
  color: #FFF;
}
.s5-filter-strip__chip-count {
  display: inline-block;
  min-width: 1.4rem;
  padding: 0 0.35rem;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 999px;
  font-size: 0.625rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #5E6470;
}
.s5-filter-strip__chip[aria-pressed="true"] .s5-filter-strip__chip-count {
  background: rgba(255, 255, 255, 0.2);
  color: #FFF;
}

.s5-filter-strip__active-summary {
  margin: 0.5rem 0 0 0;
  font-size: 0.75rem;
  color: #5E6470;
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
}
.s5-filter-strip__active-summary a {
  color: #1A4FC4;
  text-decoration: underline;
  margin-left: 0.5rem;
}

/* --------------------------------------------------------------------------
   F. Cross-case thread ribbon (Tier 3)
   -------------------------------------------------------------------------- */
.s5-threads {
  margin: 1.5rem 0 1rem 0;
  padding: 1rem 1.1rem;
  background: #F8F9FB;
  border: 1px solid #E0E5EC;
  border-left: 4px solid #1F3B66;
  border-radius: 4px;
}
.s5-threads__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.6rem 0;
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1F3B66;
}
.s5-threads__title-count {
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  background: #FFF;
  border: 1px solid #1F3B66;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  color: #1F3B66;
}
.s5-threads__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.s5-thread-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.65rem 0.85rem;
  background: #FFF;
  border: 1px solid #DDE1E8;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.s5-thread-card:hover {
  border-color: #1F3B66;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}
.s5-thread-card__title {
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #1F3B66;
  line-height: 1.3;
}
.s5-thread-card__count {
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5E6470;
}
.s5-thread-card__blurb {
  margin: 0;
  font-family: "Source Serif 4", "Source Serif Pro", Georgia, serif;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: #2B3138;
}

/* Highlight cards belonging to active thread */
.s5-thread-highlight {
  outline: 2px solid #1F3B66;
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   G. Doctrinal tag dock (in-card)
   -------------------------------------------------------------------------- */
.s5-tag-dock {
  margin: 0.4rem 0 0.2rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}

/* --------------------------------------------------------------------------
   Two-tier tagging (added 2026-06-13)
   Tier 1 = CERTIFIED doctrinal chips (.s5-doctrine-tag, filled, family color).
   Tier 2 = METADATA event chips (.s6-event-tag, neutral/outlined). Always
   present so no card is ever blank. Visually distinct: outlined, no fill,
   muted text — so a reader never mistakes a metadata-inferred chip for a
   certified holding.
   -------------------------------------------------------------------------- */
.s6-event-dock {
  margin: 0.3rem 0 0.2rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}
.s6-event-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0.2rem 0.25rem 0.2rem 0;
  padding: 0.16rem 0.5rem;
  background: transparent;            /* no fill — distinct from doctrinal */
  border: 1px dashed var(--s5-chip-border);
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--s5-family-substantive-other, #5E6470);
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: help;
}
.s6-event-tag[data-event-kind="case_type"] {
  border-style: solid;
  border-color: #B9C2CC;
}
.s6-event-tag[data-event-kind="caption"] {
  border-style: solid;
  border-color: #C7A646;
  color: #6A5410;
}
/* Inline tier labels — tiny, italic, low-emphasis source-status markers. */
.s6-tier-label {
  font-size: 0.625rem;
  font-style: italic;
  font-weight: 500;
  letter-spacing: 0.01em;
  margin-left: 0.15rem;
  white-space: nowrap;
  cursor: help;
}
.s6-tier-label--certified {
  color: #1A4E1E;
}
.s6-tier-label--metadata {
  color: #6B7280;
}
@media (max-width: 640px) {
  .s6-event-tag { font-size: 0.65rem; }
  .s6-tier-label { font-size: 0.6rem; }
}

/* --------------------------------------------------------------------------
   H. Print + reduced-motion + small viewports
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .s5-source-disclaimer { padding: 0.7rem 0.85rem; font-size: 0.8125rem; }
  .s5-threads__list { grid-template-columns: 1fr; }
  .s5-filter-strip__chip { font-size: 0.6875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .s5-doctrine-tag, .s5-filter-strip__chip, .s5-thread-card { transition: none; }
}
@media print {
  .s5-filter-strip, .s5-threads, .s5-recon-detail { display: none !important; }
}


/* =============== Dropdown filter (added 2026-05-29, prominence boost 2026-05-29 PM) ================ */
/* Goal: make it obvious filters are present, and put all dropdowns side-by-side  */
/* in one row regardless of tab. Soft green tint + 4px green left rail + beefier  */
/* dropdown border (replaces the near-invisible #FFFCF6 / #CDD3DA combo).         */
.s5-filter-strip--dropdown {
  margin: 1.25rem 0 1rem 0;
  padding: 0.85rem 1rem 0.75rem;
  background: #F0F7F2;             /* soft green tint */
  border: 1px solid #C7DDC9;
  border-left: 4px solid #2E7D32;  /* green accent rail */
  border-radius: 4px;
}
.s5-filter-strip--dropdown .s5-filter-strip__title {
  margin: 0 0 0.55rem 0;
  color: #1A4E1E;                  /* darker green to match rail */
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}
.s5-filter-strip__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin: 0;
}
.s5-dropdown__label {
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #1A4E1E;                  /* match the green accent */
  margin-right: 0.35rem;
}
.s5-dropdown {
  appearance: none;
  -webkit-appearance: none;
  background: #FFF;
  border: 2px solid #2E7D32;        /* prominent green border */
  border-radius: 4px;
  padding: 0.45rem 2rem 0.45rem 0.7rem;
  font-family: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1F3B66;
  cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%232E7D32' d='M0 0l5 6 5-6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 9px;
  min-width: 14rem;
  max-width: 24rem;
  box-shadow: 0 1px 2px rgba(46,125,50,0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.s5-dropdown:hover {
  border-color: #1A4E1E;
  background-color: #F8FCF9;
  box-shadow: 0 2px 4px rgba(46,125,50,0.18);
}
.s5-dropdown:focus {
  outline: 3px solid rgba(46,125,50,0.35);
  outline-offset: 1px;
  border-color: #1A4E1E;
}
.s5-dropdown optgroup { font-weight: 700; color: #1F3B66; font-style: normal; }
.s5-dropdown option { font-weight: 400; color: #2B3138; }
.s5-filter-strip--dropdown .s5-filter-strip__active-summary {
  margin: 0.6rem 0 0 0;
  color: #1A4E1E;
  font-weight: 500;
}
.s5-filter-strip--dropdown .s5-filter-strip__active-summary a {
  color: #2E7D32;
}
@media (max-width: 640px) {
  .s5-filter-strip__row { gap: 0.5rem 1rem; }
  .s5-dropdown { min-width: 100%; max-width: 100%; }
}
