/*
 * base.css — DC Witness Safety & Justice Tracker
 * Apple × Notion design system
 * No overrides. Clean cascade. Every surface.
 */

/* ================================================================
   FONTS
   ================================================================ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,300;9..40,400;9..40,500;9..40,600;9..40,700&family=DM+Mono:wght@400;500&display=swap');

/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
  /* Notion warm neutral scale */
  --paper:    #FAFAF9;
  --paper-2:  #F4F4F2;
  --paper-3:  #EFEFED;
  --ink-1:    #1A1A1A;
  --ink-2:    #4A4A4A;
  --ink-3:    #7A7A7A;
  --ink-4:    #ABABAB;
  --line:     rgba(0,0,0,.08);
  --line-2:   rgba(0,0,0,.13);
  --white:    #FFFFFF;

  /* Brand blue */
  --blue-900: #091C38;
  --blue-800: #1E4D8C;
  --blue-700: #2960B0;
  --blue-600: #3B7DD8;
  --blue-400: #7AAEE8;
  --blue-200: #C8DEFA;
  --blue-100: #E1EEFB;
  --blue-50:  #EDF5FD;

  /* Semantic */
  --slate-900: var(--ink-1);
  --slate-800: var(--ink-2);
  --slate-700: #373737;
  --slate-600: var(--ink-3);
  --slate-500: #8A8A8A;
  --slate-400: var(--ink-4);
  --slate-300: #CACACA;
  --slate-200: var(--paper-3);
  --slate-150: var(--paper-3);
  --slate-100: var(--paper-2);
  --slate-50:  var(--paper);

  /* Alert */
  --rose-700: #B83232;
  --rose-600: #C04040;
  --rose-400: #E07070;
  --rose-200: #F5CCCC;
  --rose-100: #FEF0F0;
  --rose-50:  #FEF8F8;

  /* Green / amber for verdict colours */
  --green-600: #1A7A4A;
  --green-100: #DCFCE7;
  --amber-600: #B06820;
  --amber-100: #FEF3C7;

  /* Typography */
  --font:      'DM Sans', -apple-system, 'Helvetica Neue', sans-serif;
  --font-mono: 'DM Mono', 'SF Mono', monospace;

  /* Radii — Apple softness */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   16px;
  --radius-xl:   20px;
  --radius-pill: 9999px;

  /* Shadows — airy, not plastic */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.05);
  --shadow-xl: 0 24px 60px rgba(0,0,0,.14), 0 8px 20px rgba(0,0,0,.07);

  /* Transitions */
  --ease: cubic-bezier(.25,.46,.45,.94);

  /* Layout */
  --hdr-h: 96px;
}

/* ================================================================
   RESET
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-1);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ================================================================
   HEADER — Apple frosted glass
   ================================================================ */
#hdr {
  position: fixed; top: 0; left: 0; right: 0; z-index: 400;
  background: rgba(250,250,249,.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--line-2);
  display: flex; flex-direction: column;
}

#hdr-top {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 22px; min-height: 54px;
}

/* Brand */
#hdr-brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}
#brand-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 9px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-900);
}
#brand-logo-img { width: 26px; height: 26px; object-fit: contain; display: block; }
#brand-text {
  font-size: 13px; font-weight: 600;
  letter-spacing: -.02em; color: var(--ink-1); line-height: 1.2;
}
#brand-tagline { display: none; }

/* Search */
#srchwrap {
  display: flex; align-items: center; gap: 8px;
  padding: 0 10px; height: 34px;
  background: rgba(255,255,255,.75);
  border: 0.5px solid var(--line-2);
  border-radius: var(--radius-pill);
  flex: 1; min-width: 0;
  transition: box-shadow .18s var(--ease), background .18s;
}
#srchwrap:focus-within {
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(0,0,0,.07), var(--shadow-sm);
}
#srch-ico { color: var(--ink-4); flex-shrink: 0; display: flex; align-items: center; }
#srch {
  flex: 1; min-width: 0; border: none; background: none; outline: none;
  font-family: var(--font); font-size: 12.5px;
  color: var(--ink-1); letter-spacing: -.01em;
}
#srch::placeholder { color: var(--ink-4); }
#srch-clear {
  border: none; background: none; cursor: pointer;
  color: var(--ink-4); font-size: 14px; padding: 0;
  display: none; line-height: 1; transition: color .15s;
}
#srch-clear:hover { color: var(--ink-1); }
#srch-sug {
  display: none;
  position: fixed; z-index: 9999;
  background: rgba(250,250,249,.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(0,0,0,.12);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 28px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.07);
  overflow: hidden;
}
#srch-sug.open { display: block; }
.sug-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: pointer;
  border-bottom: 0.5px solid var(--line);
  transition: background .12s;
}
.sug-item:last-child { border-bottom: none; }
.sug-item:hover, .sug-item.active { background: var(--paper-2); }
.sug-ico { font-size: 14px; flex-shrink: 0; }
.sug-text { font-size: 12px; color: var(--ink-2); letter-spacing: -.01em; }
.sug-searching { padding: 8px 14px; font-size: 11px; color: var(--ink-4); }

/* View tabs */
#viewtabs {
  display: flex; gap: 2px;
  background: var(--paper-2);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.vtab {
  border: none; background: none; cursor: pointer;
  font-family: var(--font); font-size: 12px; font-weight: 500;
  letter-spacing: -.015em; color: var(--ink-3);
  padding: 5px 16px; border-radius: var(--radius-pill);
  transition: all .18s var(--ease); white-space: nowrap;
}
.vtab:hover { color: var(--ink-1); background: rgba(0,0,0,.04); }
.vtab.on {
  background: var(--ink-1); color: var(--white);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
}

/* Header right buttons */
#hdr-right { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.hbtn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0.5px solid var(--line-2);
  background: rgba(255,255,255,.65);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  font-family: var(--font); font-size: 11.5px; font-weight: 500;
  letter-spacing: -.01em; color: var(--ink-2);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  backdrop-filter: blur(8px);
  transition: all .18s var(--ease);
}
.hbtn:hover {
  background: var(--white); color: var(--ink-1);
  box-shadow: var(--shadow-sm);
}

/* ── Filter bar ── */
#fbar {
  display: flex; align-items: center; gap: 6px;
  padding: 0 22px; height: 42px;
  border-top: 0.5px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
#fbar::-webkit-scrollbar { display: none; }

.fdrop { position: relative; }
.fdrop-btn {
  display: flex; align-items: center; gap: 5px;
  border: 0.5px solid var(--line-2);
  background: rgba(255,255,255,.65);
  border-radius: var(--radius-pill);
  padding: 4px 13px; height: 30px;
  font-family: var(--font); font-size: 11.5px; font-weight: 500;
  letter-spacing: -.01em; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-xs);
  transition: all .18s var(--ease);
}
.fdrop-btn:hover { background: var(--white); color: var(--ink-1); box-shadow: var(--shadow-sm); }
.fdrop-btn.active { background: var(--ink-1); color: var(--white); border-color: var(--ink-1); }
.fchev { font-size: 8px; opacity: .5; }
.fdrop-btn.open .fchev { transform: rotate(180deg); }

/* Layer buttons */
.lbs {
  display: flex; gap: 2px;
  background: var(--paper-2);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.lb {
  border: none; background: none; cursor: pointer;
  font-family: var(--font); font-size: 11px; font-weight: 500;
  letter-spacing: -.01em; color: var(--ink-3);
  padding: 4px 12px; border-radius: var(--radius-pill);
  transition: all .18s var(--ease);
}
.lb:hover:not(.active) { color: var(--ink-1); background: rgba(0,0,0,.04); }
.lb.active {
  background: var(--white); color: var(--ink-1); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.13);
}

/* Active filter tags */
#ftags { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }

/* Filter summary — natural-language sentence describing the visible dots.
   Lives in the header row (after Subscribe) where it has plenty of
   horizontal space and room to expand downward. Layout: one continuous
   row of phrase fragments; multi-item filter values render as
   inline-vertical stacks within their horizontal slot. No container
   box — sits as pure text in the header, aligned with the tabs and
   Subscribe button. */
#fsum {
  display: none;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 11.5px;
  color: var(--ink-3, #6b7280);
  letter-spacing: -0.005em;
  font-family: var(--font, inherit);
  line-height: 1.45;
  max-width: 520px;
  margin-left: 4px;
}
#fsum.show { display: inline-flex; }
#fsum.show { display: inline-flex; }

/* "Total" label — uppercase small caps treatment */
.fsum-lbl {
  font-weight: 600;
  color: var(--ink-2, #374151);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}

/* Phrase fragments ("incidents", "in", "from 2019 to 2026") */
.fsum-q { color: var(--ink-2, #374151); }

/* Single-value scope items ("DC", "Ward 3", "PSA 405") */
.fsum-scope-item { color: var(--ink-2, #374151); }

/* Comma between scope components — sits inline with no space before */
.fsum-comma {
  color: var(--ink-3, #6b7280);
  margin-left: -4px;             /* cancel the parent's gap on the left */
  margin-right: -2px;            /* tighten spacing between , and next */
}

/* Colon before the count */
.fsum-sep {
  color: var(--ink-3, #6b7280);
  margin-left: -2px;
}

/* Count number — blue, bold, slightly larger */
.fsum-n {
  font-weight: 700;
  color: var(--blue-600, #1B4F8A);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

/* Inline-vertical stack: takes one horizontal slot in the sentence flow,
   but renders its items top-to-bottom within that slot. The first item
   sits on the sentence baseline so the rest of the sentence aligns with
   it; later items hang below. */
.fsum-stack {
  display: inline-flex;
  flex-direction: column;
  vertical-align: baseline;
  align-self: baseline;
}
.fsum-stack-i {
  color: var(--ink-1, #111827);
  font-weight: 500;
  line-height: 1.35;
  white-space: nowrap;
}
.ftag {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--paper-2); border: 0.5px solid var(--line-2);
  color: var(--ink-2); font-size: 11px; font-weight: 500;
  padding: 3px 9px 3px 11px; border-radius: var(--radius-pill);
  letter-spacing: -.01em; transition: background .12s;
}
.ftag:hover { background: var(--paper-3); }
.ftag-x {
  cursor: pointer; color: var(--ink-4); font-size: 12px;
  line-height: 1; padding: 0 1px; border-radius: 50%;
  transition: color .12s;
}
.ftag-x:hover { color: var(--ink-1); }

#clear-all {
  border: 0.5px solid var(--line-2); background: none;
  border-radius: var(--radius-pill); padding: 3px 10px;
  font-family: var(--font); font-size: 11px; font-weight: 500;
  color: var(--ink-3); cursor: pointer; transition: all .12s;
}
#clear-all:hover { color: var(--ink-1); border-color: var(--line-2); background: var(--paper-2); }

.bar-sep { width: 0.5px; background: var(--line-2); height: 18px; margin: 0 4px; flex-shrink: 0; }

/* ================================================================
   MAP
   ================================================================ */
#map {
  position: fixed; top: var(--hdr-h); left: 0; right: 0; bottom: 0;
  z-index: 0;
}

/* Legend */
#leg {
  position: fixed; bottom: 24px; left: 16px; z-index: 300;
  background: rgba(250,250,249,.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 0.5px solid rgba(0,0,0,.12);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 12px 14px; min-width: 152px;
  font-size: 11px;
}
.leg-title {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-4); margin-bottom: 8px;
}
.leg-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.leg-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.leg-label { font-size: 11px; color: var(--ink-2); letter-spacing: -.01em; }
.leg-n { font-size: 10px; color: var(--ink-4); margin-left: auto; font-family: var(--font-mono); }

#loc-btn {
  position: fixed; bottom: 24px; right: 16px; z-index: 300;
  width: 38px; height: 38px;
  background: rgba(250,250,249,.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 0.5px solid rgba(0,0,0,.12);
  border-radius: var(--radius-pill);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--blue-700);
  box-shadow: var(--shadow-sm);
  transition: all .2s var(--ease);
}
#loc-btn:hover { background: var(--white); box-shadow: var(--shadow-md); transform: scale(1.06); }

#loc-toast {
  position: fixed; bottom: 70px; right: 16px; z-index: 301;
  background: var(--ink-1); color: var(--white);
  font-size: 11px; font-weight: 500; letter-spacing: -.01em;
  padding: 7px 14px; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm); pointer-events: none;
  opacity: 0; transition: opacity .2s;
}

/* ================================================================
   TABLE VIEW
   ================================================================ */
#tblview {
  display: none; position: fixed;
  top: var(--hdr-h); left: 0; right: 0; bottom: 0;
  overflow-y: auto; background: var(--paper);
  scrollbar-width: thin; scrollbar-color: var(--paper-3) transparent;
}
#tblview table { width: 100%; border-collapse: separate; border-spacing: 0; }

#tblview thead th {
  position: sticky; top: 0; z-index: 2;
  background: rgba(250,250,249,.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 0.5px solid var(--line-2);
  padding: 12px 16px;
  font-size: 10px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase; color: var(--ink-4);
  text-align: left; white-space: nowrap; cursor: default;
}
.tbl-th { cursor: pointer; transition: color .15s; }
.tbl-th:hover { color: var(--ink-1); }
.tbl-sort-ico { font-size: 9px; color: var(--ink-4); }

#tblview tbody td {
  border-bottom: 0.5px solid var(--line);
  padding: 11px 16px;
  font-size: 12px; color: var(--ink-2); letter-spacing: -.005em;
  vertical-align: middle;
}
#tblview tbody tr { transition: background .12s; }
#tblview tbody tr.has-cases:hover td { background: var(--paper-2); cursor: pointer; }
#tblview tbody tr.is-open td { background: var(--paper-2); }
#tblview tbody tr:last-child td { border-bottom: none; }
.tbl-empty { text-align: center; padding: 48px; color: var(--ink-4); font-size: 13px; }

/* Table cells */
.tbl-td-chev   { width: 36px; padding: 0 10px; text-align: center; }
.tbl-td-mono   { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.tbl-td-sm     { white-space: nowrap; }
.tbl-td-nowrap { white-space: nowrap; }
.tbl-td-center { text-align: center; }
.tbl-td-cases  { }
.tbl-td-zoom   { width: 50px; text-align: center; }

/* Tag pills */
.tbl-tag {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 9px; border-radius: var(--radius-pill);
  letter-spacing: -.005em; white-space: nowrap;
}
/* Case pills */
.tbl-case-pill {
  display: inline-block; font-size: 10px; font-weight: 600;
  padding: 2px 8px; border-radius: var(--radius-pill);
  letter-spacing: -.005em; margin: 1px;
}
.tbl-more-cases { font-size: 10px; color: var(--ink-4); padding: 2px 4px; }
.tbl-no-case    { font-size: 11px; color: var(--ink-4); }
.tbl-verdict-summary { font-size: 9px; font-weight: 700; margin-left: 3px; }

/* Status colours */
.sta-res { background: #ECFDF5; color: #065F46; border: 0.5px solid #6EE7B7; }
.sta-ong { background: #EFF6FF; color: #1D4ED8; border: 0.5px solid #93C5FD; }
.sta-pen { background: #FFFBEB; color: #92400E; border: 0.5px solid #FCD34D; }
.sta-unk { background: var(--paper-2); color: var(--ink-3); border: 0.5px solid var(--line-2); }

/* Expand button */
.tbl-expand-btn {
  border: 0.5px solid var(--line-2); border-radius: 7px;
  background: none; color: var(--ink-4); font-size: 10px;
  width: 22px; height: 22px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s var(--ease);
}
.tbl-expand-btn:hover { background: var(--paper-2); color: var(--ink-1); }
.tbl-expand-empty { color: var(--ink-4); font-size: 11px; }
.tbl-zoom-ico {
  border: none; background: none; cursor: pointer;
  color: var(--ink-4); padding: 4px; border-radius: 6px;
  transition: all .15s;
}
.tbl-zoom-ico:hover { color: var(--ink-1); background: var(--paper-2); }
.tbl-zoom-conf { font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 5px; }
.tzc-yes, .tzc-no {
  border: 0.5px solid var(--line-2); border-radius: 6px;
  background: none; font-family: var(--font); font-size: 10px; font-weight: 500;
  padding: 2px 8px; cursor: pointer; transition: all .12s;
}
.tzc-yes { color: var(--blue-700); border-color: var(--blue-200); }
.tzc-yes:hover { background: var(--blue-50); }
.tzc-no  { color: var(--ink-3); }
.tzc-no:hover  { background: var(--paper-2); }

/* ── Pagination ── */
#tbl-pager {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 8px; padding: 14px 18px 16px;
  border-top: 0.5px solid var(--line); background: var(--paper);
}
.pager-info { font-size: 11px; color: var(--ink-4); letter-spacing: -.01em; }
.pager-btns { display: flex; align-items: center; gap: 3px; }
.pager-btn {
  background: var(--white); border: 0.5px solid var(--line-2);
  border-radius: 8px; padding: 5px 11px;
  font-family: var(--font); font-size: 11px; font-weight: 500;
  color: var(--ink-3); cursor: pointer; white-space: nowrap;
  box-shadow: var(--shadow-xs); transition: all .15s var(--ease);
}
.pager-btn:hover:not([disabled]):not(.on) { background: var(--paper-2); color: var(--ink-1); }
.pager-btn.on, .pager-num.on {
  background: var(--ink-1); border-color: var(--ink-1);
  color: var(--white); font-weight: 700;
}
.pager-btn[disabled] { opacity: .3; cursor: not-allowed; }
.pager-num { min-width: 32px; text-align: center; }
.pager-ellipsis { font-size: 12px; color: var(--ink-4); padding: 0 4px; }

/* ================================================================
   STATS VIEW
   ================================================================ */
#statview {
  display: none; position: fixed;
  top: var(--hdr-h); left: 0; right: 0; bottom: 0;
  overflow-y: auto; background: var(--paper);
  padding: 24px;
  scrollbar-width: thin; scrollbar-color: var(--paper-3) transparent;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.stat-card {
  background: var(--white); border: 0.5px solid var(--line-2);
  border-radius: 14px; padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.stat-num {
  font-size: 28px; font-weight: 700;
  letter-spacing: -.04em; line-height: 1.1;
}
.stat-lbl {
  font-size: 11px; color: var(--ink-3); margin-top: 5px;
  letter-spacing: -.01em; font-weight: 500; line-height: 1.4;
}

/* Stat bar panels */
.stat-bar-wrap {
  background: var(--white); border: 0.5px solid var(--line-2);
  border-radius: 14px; padding: 20px 22px; margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.stat-bar-title {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  color: var(--ink-4); text-transform: uppercase; margin-bottom: 14px;
}
.sbar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.sbar-lbl { font-size: 11px; color: var(--ink-2); width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0; }
.sbar-track { flex: 1; height: 5px; background: var(--paper-2); border-radius: 3px; overflow: hidden; }
.sbar-fill { height: 100%; border-radius: 3px; }
.sbar-val { font-size: 10px; font-family: var(--font-mono); color: var(--ink-4); width: 32px; text-align: right; flex-shrink: 0; }

/* ================================================================
   ACCORDION (table expanded case)
   ================================================================ */
.tbl-acc-row { display: none; }
.tbl-acc-cell { padding: 0; background: var(--paper); border-bottom: 1.5px solid var(--line-2); }
.acc-loading {
  display: flex; align-items: center; gap: 9px;
  padding: 16px 20px; font-size: 12px; color: var(--ink-4);
}
.acc-spinner {
  display: inline-block; width: 14px; height: 14px; flex-shrink: 0;
  border: 1.5px solid var(--paper-3); border-top-color: var(--blue-600);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.acc-empty { padding: 14px 20px; font-size: 12px; color: var(--ink-4); }
.acc-wrap  { display: flex; flex-wrap: wrap; gap: 14px; padding: 16px; }

.acc-case {
  background: var(--white); border: 0.5px solid var(--line-2);
  border-radius: 14px; padding: 16px 18px;
  min-width: 280px; flex: 1;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease);
}
.acc-case:hover { box-shadow: var(--shadow-md); }
.acc-case-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.acc-case-num { font-size: 13px; font-weight: 600; letter-spacing: -.02em; color: var(--ink-1); font-family: var(--font-mono); }
.acc-sta { font-size: 9px; font-weight: 700; padding: 2px 9px; border-radius: var(--radius-pill); white-space: nowrap; }
.acc-meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.acc-chip {
  display: flex; flex-direction: column;
  background: var(--paper-2); border: 0.5px solid var(--line);
  border-radius: 8px; padding: 4px 9px; min-width: 58px;
}
.acc-chip-lbl { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-4); font-weight: 600; margin-bottom: 2px; }
.acc-chip-val { font-size: 12px; font-weight: 600; color: var(--ink-1); }
.acc-verdict-row { margin-bottom: 8px; }
.acc-verdict { display: inline-block; font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); }
.acc-vg { background: #ECFDF5; color: #065F46; border: 0.5px solid #6EE7B7; }
.acc-vn { background: #FFFBEB; color: #92400E; border: 0.5px dashed #FCD34D; }
.acc-vd { background: var(--paper-2); color: var(--ink-3); border: 0.5px dotted var(--line-2); }
.acc-vp { background: #EFF6FF; color: #1D4ED8; border: 0.5px solid #93C5FD; }
.acc-flags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.acc-flag { font-size: 10px; color: var(--ink-3); background: var(--paper-2); border: 0.5px solid var(--line-2); padding: 2px 8px; border-radius: var(--radius-pill); }

/* Sections */
.acc-section { margin-top: 10px; padding-top: 10px; border-top: 0.5px solid var(--line); }
.acc-sec-hd {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-4);
  display: flex; align-items: center; gap: 7px; margin-bottom: 9px;
}
.acc-sec-n {
  background: var(--paper-2); color: var(--ink-3);
  font-size: 9px; padding: 1px 7px; border-radius: var(--radius-pill); font-weight: 700;
}
.acc-sec-note { font-size: 11px; color: var(--ink-4); }
.acc-hrg-held-note { font-size: 9px; color: var(--ink-4); font-weight: 400; margin-left: auto; text-transform: none; letter-spacing: 0; }
.acc-hrg-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; padding-bottom: 8px; border-bottom: 0.5px solid var(--line); }
.acc-hrg-foot { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 11px; color: var(--ink-2); }
.acc-hrg-next { color: var(--blue-700); }
.acc-hrg-foot-lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; background: var(--paper-2); color: var(--ink-4); padding: 1px 6px; border-radius: var(--radius-pill); }
.acc-sec-n-def { background: #FFFBEB; color: #92400E; }
.acc-sec-n-vic { background: #EFF6FF; color: #1D4ED8; }

/* Expand button */
.acc-expand-btn {
  border: 0.5px solid var(--line-2); border-radius: 8px;
  background: none; color: var(--ink-3); font-family: var(--font);
  font-size: 10px; font-weight: 500; cursor: pointer;
  padding: 4px 11px; margin-top: 6px; display: inline-block;
  transition: all .15s var(--ease);
}
.acc-expand-btn:hover { background: var(--paper-2); color: var(--ink-1); }

/* Charges */
.acc-charge-list { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.acc-charge-row {
  display: flex; flex-direction: column; gap: 0;
  padding: 7px 10px; border-radius: 8px;
  border-left: 2px solid var(--line-2);
  transition: background .12s;
}
.acc-charge-row:hover { background: var(--paper); }
.acc-charge-row.ch-is-dropped { opacity: .5; }
.acc-charge-main { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ch-kind {
  font-size: 10px; font-weight: 600; color: var(--ink-2);
  background: var(--paper-2); border: 0.5px solid var(--line-2);
  padding: 2px 8px; border-radius: var(--radius-pill); white-space: nowrap; flex-shrink: 0;
}
.ch-desc { font-size: 11px; color: var(--ink-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 80px; letter-spacing: -.005em; }
.ch-date { font-size: 9px; color: var(--ink-4); white-space: nowrap; flex-shrink: 0; }
.ch-badges { display: flex; gap: 3px; flex-wrap: wrap; }
.ch-badge { font-size: 9px; padding: 1px 6px; border-radius: 8px; font-weight: 600; white-space: nowrap; }
.ch-felony  { background: #F3E8FF; color: #7C3AED; border: 0.5px solid #DDD6FE; }
.ch-class   { background: var(--paper-2); color: var(--ink-3); border: 0.5px solid var(--line-2); }
.ch-drop    { background: var(--rose-50); color: var(--rose-700); border: 0.5px solid var(--rose-200); }
.ch-down    { background: #FFFBEB; color: #92400E; border: 0.5px dotted #FCD34D; }
.ch-up      { background: #ECFDF5; color: #065F46; border: 0.5px solid #6EE7B7; }
.ch-confinement { background: var(--rose-50); color: var(--rose-700); border: 0.5px solid var(--rose-200); }
.ch-outcome {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 4px; padding: 4px 8px;
  background: var(--paper); border-radius: 7px;
  border-left: 2px solid var(--line-2);
}
.ch-no-verdict { opacity: .6; }
.ch-verdict {
  font-size: 10px; font-weight: 700; padding: 2px 9px;
  border-radius: var(--radius-pill); flex-shrink: 0; letter-spacing: -.01em;
}
.ch-sentence { font-size: 11px; color: var(--ink-2); flex: 1; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; letter-spacing: -.005em; }
.ch-sent-date { font-size: 9px; color: var(--ink-4); }
.ch-is-dropped .ch-outcome { display: none; }

/* Hearing rows */
.acc-hrg-nested { background: none; border: none; padding: 0; margin-top: 0; }
.acc-hrg-nested-hd { display: none; }
.acc-hrg-nested-note { display: none; }
.acc-hrg-detail-list { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.acc-hrg-detail-row {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 5px 8px; border-radius: 8px; font-size: 11px;
  border-left: 2px solid transparent;
}
.hrg-row-held   { background: #EFF6FF; border-left-color: #93C5FD; }
.hrg-row-noheld { background: var(--paper); border-left-color: var(--line-2); }
.hrg-ico-held   { color: #2563EB; font-size: 11px; flex-shrink: 0; width: 14px; text-align: center; }
.hrg-ico-noheld { color: var(--ink-4); font-size: 11px; flex-shrink: 0; width: 14px; text-align: center; }
.hrg-date   { font-weight: 600; color: var(--ink-1); white-space: nowrap; flex-shrink: 0; letter-spacing: -.01em; }
.hrg-type   { color: var(--ink-3); flex: 1; min-width: 60px; }
.hrg-meta   { font-size: 10px; color: var(--ink-3); background: var(--white); border: 0.5px solid var(--line); padding: 1px 6px; border-radius: 6px; white-space: nowrap; }
.hrg-disp   { color: var(--blue-700); border-color: var(--blue-200); background: var(--blue-50); }
.hrg-judge  { color: var(--ink-3); }
.hrg-why    { color: var(--rose-700); border-color: var(--rose-200); background: var(--rose-50); }
.hrg-badges { display: flex; gap: 3px; flex-wrap: wrap; }
.hbadge-sm  { font-size: 9px; padding: 1px 5px; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.hby-sm { background: var(--blue-50); color: var(--blue-700); border: 0.5px solid var(--blue-200); }
.hbn-sm { background: var(--rose-50); color: var(--rose-700); border: 0.5px solid var(--rose-200); }

/* People */
.acc-people-group { margin-bottom: 8px; }
.acc-people-group-hd {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-4);
  margin-bottom: 5px; padding-bottom: 4px;
  border-bottom: 0.5px solid var(--line);
}
.acc-person-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 8px; border-radius: 8px; transition: background .1s;
}
.acc-person-row:hover { background: var(--paper); }
.person-role {
  font-size: 9px; font-weight: 700; padding: 2px 8px;
  border-radius: var(--radius-pill); white-space: nowrap; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: .04em; min-width: 68px; text-align: center;
}
.person-def { background: #FFFBEB; color: #92400E; border: 0.5px dotted #FCD34D; }
.person-vic { background: #EFF6FF; color: #1D4ED8; border: 0.5px solid #93C5FD; }
.person-name  { font-size: 12px; font-weight: 500; color: var(--ink-1); letter-spacing: -.01em; }
.person-meta  { font-size: 10px; color: var(--ink-4); }
.person-extra { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.person-date  { font-size: 10px; color: var(--ink-4); }
.person-cause { font-size: 10px; color: var(--ink-3); }
.person-badge { font-size: 9px; padding: 1px 6px; border-radius: var(--radius-pill); font-weight: 600; }
.person-juv   { background: #FFFBEB; color: #92400E; border: 0.5px dashed #FCD34D; }
.person-dec   { background: var(--rose-50); color: var(--rose-700); border: 0.5px solid var(--rose-200); }

/* Modal charge items */
.modal-charge-note {
  font-size: 11px; color: var(--ink-3); background: var(--paper-2);
  border-radius: 0 8px 8px 0; padding: 7px 12px; margin-bottom: 12px;
  border-left: 2px solid var(--line-2);
}
.modal-charge-list { display: flex; flex-direction: column; gap: 8px; }
.modal-charge-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--white); border: 0.5px solid var(--line);
  transition: border-color .12s;
}
.modal-charge-item:hover { border-color: var(--line-2); background: var(--paper); }
.modal-charge-item.ch-is-dropped { opacity: .5; }
.modal-charge-num {
  width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%;
  background: var(--paper-2); color: var(--ink-3); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.modal-charge-body { flex: 1; min-width: 0; }
.ch-no-verdict { opacity: .6; }

/* Buffer */
.buf-ctr-btns { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.buf-ctr-btn {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--white); border: 0.5px solid var(--line-2);
  color: var(--ink-3); font-family: var(--font); font-size: 11px; font-weight: 500;
  padding: 6px 8px; border-radius: 8px; cursor: pointer;
  white-space: nowrap; transition: all .15s var(--ease);
}
.buf-ctr-btn:hover { border-color: var(--line-2); color: var(--ink-1); background: var(--paper-2); }
.buf-ctr-btn-on { background: var(--ink-1); border-color: var(--ink-1); color: var(--white); }
.buf-ctr-btn-on:hover { background: var(--ink-2); border-color: var(--ink-2); }
.buf-ctr-lbl { font-size: 10px; color: var(--ink-4); min-height: 16px; margin-bottom: 10px; padding: 3px 0; line-height: 1.4; }
.buf-radius-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.buf-val-lbl { font-size: 12px; font-weight: 600; color: var(--blue-600); }
.buf-slider { width: 100%; accent-color: var(--ink-1); }

/* Loading spinner */
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 2px solid var(--paper-3); border-top-color: var(--ink-1);
  border-radius: 50%; animation: spin .7s linear infinite;
}
#loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
#loading-text { font-size: 13px; font-weight: 500; letter-spacing: -.02em; color: var(--ink-4); }

/* Verdict badges (modal) */
.vc { display: inline-block; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: var(--radius-pill); letter-spacing: -.01em; }
.vg { background: #ECFDF5; color: #065F46; border: 0.5px solid #6EE7B7; }
.vn { background: #FFFBEB; color: #92400E; border: 0.5px dashed #FCD34D; }
.vd { background: var(--paper-2); color: var(--ink-3); border: 0.5px dotted var(--line-2); }
.vp { background: #EFF6FF; color: #1D4ED8; border: 0.5px solid #93C5FD; }

/* Detail fields in modal */
.sec  { margin-bottom: 20px; }
.st {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  color: var(--ink-4); margin-bottom: 10px; letter-spacing: .07em;
  display: flex; align-items: center; gap: 6px;
}
.st::after { content: ''; flex: 1; height: 0.5px; background: var(--line); }
.dg  { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px 14px; margin-bottom: 8px; }
.dg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 14px; margin-bottom: 8px; }
.df .dl  { font-size: 9.5px; color: var(--ink-4); margin-bottom: 1px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.df .dv  { font-size: 12px; font-weight: 500; color: var(--ink-1); line-height: 1.4; letter-spacing: -.01em; }
.dfw     { margin-bottom: 7px; }
.dfw .dl { font-size: 9.5px; color: var(--ink-4); margin-bottom: 2px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.dfw .dv { font-size: 12px; font-weight: 500; color: var(--ink-1); line-height: 1.5; letter-spacing: -.01em; }
.nb {
  font-size: 11px; color: var(--ink-2);
  background: var(--paper-2); border-radius: 0 8px 8px 0;
  padding: 10px 12px; margin-top: 4px;
  line-height: 1.7; white-space: pre-wrap; word-break: break-word;
  border-left: 2px solid var(--line-2); letter-spacing: -.005em;
}
.bl {
  color: var(--blue-700); font-size: 11px; padding: 2px 9px; border-radius: var(--radius-pill);
  background: var(--blue-50); border: 0.5px solid var(--blue-200);
  cursor: pointer; font-family: var(--font); font-weight: 500; transition: all .12s;
}
.bl:hover { background: var(--blue-100); }
.bk {
  font-size: 11px; color: var(--ink-3); cursor: pointer;
  border: none; background: none; padding: 0 0 14px;
  display: block; font-family: var(--font); transition: color .12s; letter-spacing: -.01em;
}
.bk:hover { color: var(--ink-1); }
.nd { font-size: 12px; color: var(--ink-4); padding: 6px 0; }
.pr-item { border: 0.5px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; transition: border-color .12s; }
.pr-item:hover { border-color: var(--line-2); }
.pr-item a { color: var(--blue-700); font-size: 12px; font-weight: 600; text-decoration: none; letter-spacing: -.01em; }
.pr-item a:hover { text-decoration: underline; }
.pr-meta { font-size: 10px; color: var(--ink-4); margin-top: 4px; }
