/* redesign.css — modern, high-tech polish layer (loaded LAST so it wins).
   Light surfaces + glassy cards + subtle gradient/grid backdrop + compact tool
   headers + sleeker dropzones. "Linear/Vercel" feel, Juris purple/cyan accents. */

/* ── Backdrop: faint grid + corner glows on the content column ───────────── */
.app-main { position: relative; }
.app-main::before {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background:
    radial-gradient(1100px 560px at 100% -5%, rgba(6, 182, 212, 0.07), transparent 60%),
    radial-gradient(1000px 620px at -5% 105%, rgba(139, 92, 246, 0.08), transparent 60%);
}
.app-main::after {
  content: '';
  position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.045) 1px, transparent 1px);
  background-size: 34px 34px;
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 30%, transparent 78%);
}
.app-topbar, .app-tab-panels { position: relative; z-index: 1; }

/* ── Content rhythm: comfortable width + padding, fills the screen ───────── */
.app-tab-panels { background: transparent; }
.app-tab-panels > .tab-panel > main,
.app-tab-panels > .tab-panel > .dash { max-width: 1320px; margin: 0 auto; }
.app-tab-panels > .tab-panel > main { padding: 24px 24px 48px; }

/* ── Cards: glassy, crisp hairline border, soft lift on hover ───────────── */
.card {
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  backdrop-filter: blur(12px) saturate(125%);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.card:hover {
  border-color: rgba(99, 102, 241, 0.22);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 38px rgba(99, 102, 241, 0.10);
}
/* A thin gradient hairline at the top of each card — subtle "tech" detail. */
.card { position: relative; overflow: hidden; }
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.55), rgba(6, 182, 212, 0.55), transparent);
  opacity: 0.5;
}

/* ── Compact tool header: tame the giant two-tone stacked titles ─────────── */
.upload-hero-title {
  font-family: 'Inter', sans-serif !important;
  font-size: 1.4rem !important;
  letter-spacing: 0.4px !important;
  line-height: 1.12 !important;
  margin-bottom: 4px !important;
}
.upload-hero-title br { display: none; }
.upload-hero-accent { margin-left: 0.45ch; }

/* ── Dropzone: shorter, full-width "drop bar", crisper border ───────────── */
.drop-zone-hero {
  width: 100% !important;
  height: auto !important;
  min-height: 168px;
  padding: 26px 24px !important;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(243, 240, 255, 0.7)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 8px 24px rgba(99, 102, 241, 0.08) !important;
  transition: box-shadow 0.2s, transform 0.2s;
}
.drop-zone-hero:hover, .drop-zone-hero.drag-over {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 14px 34px rgba(139, 92, 246, 0.16) !important;
}
.dz-hero-logo { width: 60px !important; opacity: 0.42 !important; margin-bottom: 8px !important; }
.drop-zone-hero .dz-title { font-size: 0.98rem; }

/* ── Buttons: tighter, glossier primary ─────────────────────────────────── */
.btn-primary, .primary-btn {
  border-radius: 11px;
  box-shadow: 0 6px 18px rgba(139, 92, 246, 0.22);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.btn-primary:hover:not(:disabled), .primary-btn:hover:not(:disabled) {
  transform: translateY(-1px); filter: brightness(1.04);
  box-shadow: 0 10px 26px rgba(139, 92, 246, 0.30);
}

/* ── Card titles: a touch more refined ──────────────────────────────────── */
.card-title { padding-bottom: 14px; }
.card-title h2 { letter-spacing: -0.01em; }

/* ── Drop the marketing intro panels (static sales copy); tool card goes full-width ── */
.upload-brand-panel { display: none !important; }
.upload-split { gap: 0 !important; }
.upload-split > .upload-hero { width: 100% !important; flex: 1 1 100% !important; }

/* Upload/Case + Scan tool card: let the inner split breathe across the width */
.upload-hero-inner { gap: 28px; }
.upload-hero-left { flex: 1 1 auto; min-width: 0; }
.upload-hero-right { flex: 0 0 clamp(320px, 38%, 480px); display: flex; align-items: center; }
.upload-hero-right .drop-zone-hero { width: 100% !important; }

/* ── Modernize the old "hero-panel" cards (Intake / SIBTF / Future Medical) ──
   They predate the redesign (thick purple border, purple-tinted bg, forced full
   viewport height). Make them glassy like .card and drop the empty-space height. */
.hero-layout { min-height: auto !important; padding: 4px 0 0 !important; }
.hero-panel {
  max-height: none !important;
  overflow: visible !important;
  background: rgba(255, 255, 255, 0.74) !important;
  border: 1px solid rgba(99, 102, 241, 0.12) !important;
  border-radius: 18px !important;
  -webkit-backdrop-filter: blur(12px) saturate(125%);
  backdrop-filter: blur(12px) saturate(125%);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 30px rgba(15, 23, 42, 0.05) !important;
  position: relative;
}
.hero-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.55), rgba(6, 182, 212, 0.55), transparent);
  opacity: 0.5; border-radius: 18px 18px 0 0;
}
.hero-panel-body { overflow-y: visible !important; }

/* ════════════════ Per-page audit fixes ════════════════ */

/* Hide dev build badge from end users */
#scraper-version-badge { display: none !important; }

/* Unify the older tall dropzones (Record Extraction, Records Summary) with the sleek drop-bar look */
#panel-scraper .dropzone, #panel-records-summary .dropzone {
  padding: 26px 24px !important;
  border-radius: 16px !important;
  border: 1.5px dashed rgba(99, 102, 241, 0.35) !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(243,240,255,0.7)) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 8px 24px rgba(99,102,241,0.06) !important;
  transition: box-shadow 0.2s, transform 0.2s;
}
#panel-scraper .dropzone:hover, #panel-records-summary .dropzone:hover,
#panel-scraper .dropzone.drag-over, #panel-records-summary .dropzone.drag-over {
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 14px 34px rgba(139,92,246,0.16) !important;
}
#panel-scraper .dropzone .dz-logo, #panel-records-summary .dropzone .dz-logo { opacity: 0.5; }

/* Resources: fill the grid (auto-fit) + make the CA Labor Code reference a full-width hero */
#panel-resources .res-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important; }
#panel-resources .res-grid .res-card.lc-launch { grid-column: 1 / -1; }

/* QME Panel: glassy stat cards to match the app */
.qp-stat-card {
  background: rgba(255, 255, 255, 0.74) !important;
  border: 1px solid rgba(99, 102, 241, 0.12) !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 8px 22px rgba(15,23,42,0.05) !important;
  transition: transform 0.2s, box-shadow 0.2s;
}
.qp-stat-card:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(99,102,241,0.12) !important; }

/* Cost: glassy month pills */
.js-cost-month-btn { border-radius: 10px !important; transition: background 0.15s, border-color 0.15s; }
.js-cost-month-btn.active {
  background: var(--accent-soft, #f3f0ff) !important;
  color: var(--accent, #8b5cf6) !important;
  border-color: rgba(139, 92, 246, 0.4) !important;
}

/* QME stat-card SVG icons (swapped from emoji) — size + inherit the card accent color */
.qp-stat-icon svg { width: 26px; height: 26px; display: block; margin: 0 auto; }

/* Records Chat: once files are loaded, collapse the hero dropzone to a slim
   "add more records" bar so the conversation gets the space. */
#rec-chat-empty.rc-compact .rc-drop-hero {
  min-height: 0 !important;
  padding: 10px 16px !important;
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 12px;
}
#rec-chat-empty.rc-compact .rc-drop-hero .dz-hero-logo { width: 26px !important; margin: 0 !important; }
#rec-chat-empty.rc-compact .rc-drop-hero .dz-title { font-size: 0.82rem; margin: 0; }
#rec-chat-empty.rc-compact .rc-drop-hero .dz-types { display: none; }

/* Home: stat tiles are clickable (jump to day view / filtered tasks) — show it */
.dash-stat-tile { cursor: pointer; transition: transform 0.15s, box-shadow 0.2s; }
.dash-stat-tile:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(139, 92, 246, 0.25); }

/* Record Extraction: Economy/Premium radios → segmented control */
#scraper-mode-row { gap: 8px !important; }
#scraper-mode-row label {
  border: 1px solid var(--border); border-radius: 999px;
  padding: 7px 16px; background: var(--surface);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  font-weight: 500;
}
#scraper-mode-row label:hover { border-color: rgba(139, 92, 246, 0.4); }
#scraper-mode-row label:has(input:checked) {
  background: var(--accent-soft, #f3f0ff);
  border-color: rgba(139, 92, 246, 0.5);
  color: var(--accent, #8b5cf6);
  font-weight: 600;
}
#scraper-mode-row input[type="radio"] { accent-color: var(--accent, #8b5cf6); }

/* Case: the AI / 5+ / ∞ stats read as a quiet footer strip, not a hero block */
.upload-hero-stats { opacity: 0.75; transform: scale(0.92); transform-origin: left center; }

/* Reports: let the analyzer card breathe (was capped at 700px) */
#panel-reports .hero-panel { max-width: 1000px !important; }

/* Cost: per-tool share-of-spend bar */
.js-cost-share-track { height: 5px; border-radius: 3px; background: rgba(99, 102, 241, 0.10); margin-top: 7px; overflow: hidden; }
.js-cost-share-fill { height: 100%; border-radius: 3px; background: var(--gradient, linear-gradient(135deg, #8b5cf6, #06b6d4)); }

/* MTC: keep the Generate bar in reach while filling the long form */
#panel-mtc .card:has(#mtc-generate-btn) {
  position: sticky; bottom: 14px; z-index: 30;
  box-shadow: 0 -4px 24px rgba(99, 102, 241, 0.10), 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* Intake: profile rows behave like cards */
.lcs-card {
  transition: transform 0.15s, box-shadow 0.2s;
  border-radius: 14px;
}
.lcs-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(99, 102, 241, 0.12);
}

/* Home: taller month cells so the calendar uses the fold instead of cutting off */
.dash-cal-cell { min-height: 92px; }

/* Results skeleton shimmer (shown while FM / SIBTF analyses run) */
.js-skel { padding: 18px 4px; display: flex; flex-direction: column; gap: 12px; }
.js-skel-row {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, rgba(99,102,241,0.08) 25%, rgba(99,102,241,0.18) 50%, rgba(99,102,241,0.08) 75%);
  background-size: 200% 100%;
  animation: js-skel-shimmer 1.4s ease-in-out infinite;
}
@keyframes js-skel-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ════════════════ UNIFIED DARK GLOW DROPZONES ════════════════
   Every upload box app-wide uses the dark navy "tech" dropzone:
   deep radial background, purple/cyan dashed frame, glowing Juris
   infinity mark, and a neon glow on hover / drag-over.
   High-specificity selectors included so this beats the earlier
   per-panel light overrides (#panel-pd, #panel-scraper, …). */
.drop-zone-hero, .dropzone, .drop-zone,
#panel-scraper .dropzone, #panel-records-summary .dropzone,
#panel-pd .card .dropzone, #panel-pd .card .drop-zone, #panel-pd .card .drop-zone-hero,
#panel-pd .pd-card .dropzone, #panel-pd .pd-card .drop-zone,
#panel-pd .hero-panel .drop-zone-hero, #panel-pd .dropzone.drop-zone-hero {
  background: radial-gradient(circle at center, #2e2558 0%, #241d47 55%, #181232 100%) !important;
  border: 2px dashed rgba(139, 92, 246, 0.55) !important;
  border-radius: 16px !important;
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.18), inset 0 0 46px rgba(8, 6, 26, 0.40) !important;
  transition: box-shadow 0.25s ease, transform 0.2s ease, border-color 0.25s ease !important;
  cursor: pointer;
}
/* .drop-zone-hero draws its purple→cyan dashed frame via the ::after SVG — keep
   that richer frame and drop the plain dashed border on those. */
.drop-zone-hero, #panel-pd .hero-panel .drop-zone-hero, #panel-pd .dropzone.drop-zone-hero {
  border: none !important;
}

/* Hover / drag-over: neon glow */
.drop-zone-hero:hover, .dropzone:hover, .drop-zone:hover,
.drop-zone-hero.drag-over, .dropzone.drag-over, .drop-zone.drag-over,
#panel-scraper .dropzone:hover, #panel-records-summary .dropzone:hover,
#panel-scraper .dropzone.drag-over, #panel-records-summary .dropzone.drag-over,
#panel-pd .card .dropzone:hover, #panel-pd .card .dropzone.drag-over,
#panel-pd .card .drop-zone:hover, #panel-pd .card .drop-zone.drag-over,
#panel-pd .pd-card .dropzone:hover, #panel-pd .pd-card .dropzone.drag-over,
#panel-pd .hero-panel .drop-zone-hero:hover, #panel-pd .hero-panel .drop-zone-hero.drag-over {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.85) !important;
  box-shadow:
    0 0 22px rgba(139, 92, 246, 0.55),
    0 0 56px rgba(6, 182, 212, 0.30),
    inset 0 0 46px rgba(8, 6, 26, 0.40) !important;
}

/* Light text + dark chips inside every dropzone */
.dropzone .dz-title, .drop-zone .dz-title, .drop-zone-hero .dz-title,
#panel-pd .card .dropzone .dz-title, #panel-pd .card .drop-zone .dz-title,
#panel-pd .card .drop-zone-hero .dz-title,
#panel-pd .hero-panel .dz-title, #panel-pd .hero-panel .drop-zone-hero .dz-title {
  color: #ece9ff !important;
  font-weight: 600;
}
.dropzone .dz-sub, .drop-zone .dz-sub, .drop-zone-hero .dz-sub,
#panel-pd .card .dropzone .dz-sub, #panel-pd .card .drop-zone .dz-sub,
#panel-pd .hero-panel .dz-sub {
  color: rgba(236, 233, 255, 0.62) !important;
}
.dropzone .dz-tag, .drop-zone .dz-tag, .drop-zone-hero .dz-tag,
#panel-pd .card .dz-tag, #panel-pd .hero-panel .dz-tag {
  background: rgba(8, 6, 26, 0.55) !important;
  border: 1px solid rgba(139, 92, 246, 0.45) !important;
  color: #c4b5fd !important;
}

/* The wordmark reads as the centerpiece — no glow (logo carries its own color) */
.dropzone .dz-logo, .drop-zone-hero .dz-hero-logo, #panel-mtc .dropzone .dz-logo,
#panel-scraper .dropzone .dz-logo, #panel-records-summary .dropzone .dz-logo {
  opacity: 0.95 !important;
}

/* Hover: the background itself glows light purple (inner light + lighter fill) */
.drop-zone-hero:hover, .dropzone:hover, .drop-zone:hover,
.drop-zone-hero.drag-over, .dropzone.drag-over, .drop-zone.drag-over,
#panel-scraper .dropzone:hover, #panel-records-summary .dropzone:hover,
#panel-scraper .dropzone.drag-over, #panel-records-summary .dropzone.drag-over,
#panel-pd .card .dropzone:hover, #panel-pd .card .dropzone.drag-over,
#panel-pd .card .drop-zone:hover, #panel-pd .card .drop-zone.drag-over,
#panel-pd .pd-card .dropzone:hover, #panel-pd .pd-card .dropzone.drag-over,
#panel-pd .hero-panel .drop-zone-hero:hover, #panel-pd .hero-panel .drop-zone-hero.drag-over {
  background: radial-gradient(circle at center, #57469e 0%, #43358000 140%),
              radial-gradient(circle at center, #4a3b8c 0%, #382c6e 55%, #261e52 100%) !important;
  box-shadow:
    0 0 22px rgba(139, 92, 246, 0.55),
    0 0 56px rgba(6, 182, 212, 0.30),
    inset 0 0 70px rgba(167, 139, 250, 0.30) !important;
}

/* Dropzone logo = transparent Juris wordmark (matches sidebar brand), enlarged.
   The wordmark PNG is SQUARE, so we cap its HEIGHT (not width) and pin each
   dropzone's height to its pre-change footprint — the logo grows but the boxes
   stay the same size. Loaded last so it overrides the earlier per-panel rules. */

/* 1) Pin box heights so a bigger logo can't grow them. */
#panel-mtc .dropzone, #panel-snol .dropzone,
#panel-scraper .dropzone, #panel-records-summary .dropzone {
  height: 170px !important;
  min-height: 170px !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px 24px 16px !important;  /* slim padding = more room for the logo */
}
.drop-zone-hero, #panel-pd .dropzone.drop-zone-hero {
  min-height: 140px !important;
  max-height: 176px !important;
  overflow: hidden;
  padding: 8px 24px 16px !important;
}
/* Case/Scan upload hero — let the box fill the full card height */
.upload-hero-right .drop-zone-hero {
  min-height: unset !important;
  max-height: none !important;
  overflow: visible;
}
/* Records Chat hero keeps its taller frame (it's the showcase box). */
#panel-records .rc-drop-hero { max-height: none !important; min-height: 300px !important; }

/* 2) Logo fills the free space (flex-grow + object-fit), capped so boxes stay put.
   Text gets pushed to the bottom of the box automatically. */
.dropzone .dz-logo, .drop-zone-hero .dz-hero-logo,
#panel-mtc .dropzone .dz-logo,
#panel-scraper .dropzone .dz-logo,
#panel-records-summary .dropzone .dz-logo,
#panel-snol .dropzone .dz-logo,
#panel-pd .dropzone .dz-logo, #panel-pd .drop-zone-hero .dz-hero-logo {
  flex: 0 0 auto;
  width: auto !important;
  height: 92px !important;
  max-height: none !important;
  max-width: 80% !important;
  object-fit: contain;
  opacity: 0.95 !important;
  margin: 0 auto 2px !important;
}
/* Records Chat hero has room for an even larger mark. */
#panel-records .rc-drop-hero .dz-hero-logo { height: 128px !important; }

/* 3) Smaller text, tucked at the bottom of the box. */
.dropzone .dz-title, .drop-zone .dz-title, .drop-zone-hero .dz-title,
#panel-pd .card .dropzone .dz-title, #panel-pd .card .drop-zone-hero .dz-title,
#panel-pd .hero-panel .dz-title, #panel-pd .hero-panel .drop-zone-hero .dz-title {
  font-size: 0.82rem !important;
  margin: 0 0 1px !important;
}
.dropzone .dz-sub, .drop-zone .dz-sub, .drop-zone-hero .dz-sub,
#panel-pd .card .dropzone .dz-sub, #panel-pd .hero-panel .dz-sub {
  font-size: 0.66rem !important;
  margin: 0 0 2px !important;
}
.dropzone .dz-tag, .drop-zone .dz-tag, .drop-zone-hero .dz-tag,
#panel-pd .card .dz-tag, #panel-pd .hero-panel .dz-tag {
  font-size: 0.6rem !important;
  padding: 2px 9px !important;
}
.dz-types { margin-top: 6px !important; }

/* 4) Fatter, sparser dashes — the frame is an SVG stroke, so dash length/gap
   are controllable (a plain CSS dashed border isn't). stroke-width 4→7,
   dash 14/10 → 36/26 = bigger marks, fewer of them. */
.drop-zone-hero::after,
#panel-pd .hero-panel .drop-zone-hero::after, #panel-pd .dropzone.drop-zone-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='240' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%238b5cf6'/%3E%3Cstop offset='100%25' stop-color='%2306b6d4'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='3.5' y='3.5' width='593' height='233' rx='14' ry='14' fill='none' stroke='url(%23g)' stroke-width='6' stroke-dasharray='24 16'/%3E%3C/svg%3E") !important;
  background-size: 100% 100%;
  pointer-events: none;
}
.drop-zone-hero:hover::after, .drop-zone-hero.drag-over::after,
#panel-pd .hero-panel .drop-zone-hero:hover::after, #panel-pd .dropzone.drop-zone-hero:hover::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='240' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23a78bfa'/%3E%3Cstop offset='100%25' stop-color='%2322d3ee'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='3.5' y='3.5' width='593' height='233' rx='14' ry='14' fill='none' stroke='url(%23g)' stroke-width='6' stroke-dasharray='24 16'/%3E%3C/svg%3E") !important;
}
/* Generic dropzones (MTC/SNOL/scraper/records-summary): drop the plain dashed
   border and use the same fat SVG frame so every box matches. */
.dropzone:not(.drop-zone-hero),
#panel-scraper .dropzone, #panel-records-summary .dropzone,
#panel-mtc .dropzone, #panel-snol .dropzone,
#panel-pd .card .dropzone:not(.drop-zone-hero), #panel-pd .pd-card .dropzone:not(.drop-zone-hero) {
  border: none !important;
  position: relative;
}
.dropzone:not(.drop-zone-hero)::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='240' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%238b5cf6'/%3E%3Cstop offset='100%25' stop-color='%2306b6d4'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='3.5' y='3.5' width='593' height='233' rx='14' ry='14' fill='none' stroke='url(%23g)' stroke-width='6' stroke-dasharray='24 16'/%3E%3C/svg%3E");
  background-size: 100% 100%;
  pointer-events: none;
}
.dropzone:not(.drop-zone-hero):hover::after, .dropzone:not(.drop-zone-hero).drag-over::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='240' viewBox='0 0 600 240' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23a78bfa'/%3E%3Cstop offset='100%25' stop-color='%2322d3ee'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='3.5' y='3.5' width='593' height='233' rx='14' ry='14' fill='none' stroke='url(%23g)' stroke-width='6' stroke-dasharray='24 16'/%3E%3C/svg%3E");
}

/* Records Chat collapsed slim bar keeps its tiny inline mark. */
#rec-chat-empty.rc-compact .rc-drop-hero .dz-hero-logo { flex: 0 0 auto; height: 26px !important; width: auto !important; margin: 0 !important; }

/* Sidebar brand logo: bigger, but stays inside the 68px brand strip so the
   bottom divider still lines up with the topbar. */
.sidebar-brand { padding: 2px 10px !important; }
.sidebar-brand-full { height: 64px !important; }

/* Aspect-matched dash frames: the 600x240 SVG distorts on wide boxes (side
   dashes become slabs, top/bottom slivers). Wider panels get wider variants
   so dash size and stroke thickness stay uniform everywhere. */
#panel-futuremed .drop-zone-hero::after,
#panel-sibtf .drop-zone-hero::after, #panel-sibtf .dropzone.drop-zone-hero::after,
#panel-pd .drop-zone-hero::after, #panel-pd .dropzone.drop-zone-hero::after,
#panel-reports .drop-zone-hero::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='880' height='200' viewBox='0 0 880 200' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%238b5cf6'/%3E%3Cstop offset='100%25' stop-color='%2306b6d4'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='3.5' y='3.5' width='873' height='193' rx='14' ry='14' fill='none' stroke='url(%23g)' stroke-width='6' stroke-dasharray='24 16'/%3E%3C/svg%3E") !important;
}
#panel-futuremed .drop-zone-hero:hover::after, #panel-futuremed .drop-zone-hero.drag-over::after,
#panel-sibtf .drop-zone-hero:hover::after, #panel-sibtf .dropzone.drop-zone-hero:hover::after,
#panel-sibtf .drop-zone-hero.drag-over::after,
#panel-pd .drop-zone-hero:hover::after, #panel-pd .dropzone.drop-zone-hero:hover::after,
#panel-pd .drop-zone-hero.drag-over::after,
#panel-reports .drop-zone-hero:hover::after, #panel-reports .drop-zone-hero.drag-over::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='880' height='200' viewBox='0 0 880 200' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23a78bfa'/%3E%3Cstop offset='100%25' stop-color='%2322d3ee'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='3.5' y='3.5' width='873' height='193' rx='14' ry='14' fill='none' stroke='url(%23g)' stroke-width='6' stroke-dasharray='24 16'/%3E%3C/svg%3E") !important;
}
#panel-scraper .dropzone::after, #panel-records-summary .dropzone::after,
#panel-mtc #mtc-dd-dropzone::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1100' height='200' viewBox='0 0 1100 200' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%238b5cf6'/%3E%3Cstop offset='100%25' stop-color='%2306b6d4'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='3.5' y='3.5' width='1093' height='193' rx='14' ry='14' fill='none' stroke='url(%23g)' stroke-width='6' stroke-dasharray='24 16'/%3E%3C/svg%3E") !important;
}
#panel-scraper .dropzone:hover::after, #panel-scraper .dropzone.drag-over::after,
#panel-records-summary .dropzone:hover::after, #panel-records-summary .dropzone.drag-over::after,
#panel-mtc #mtc-dd-dropzone:hover::after, #panel-mtc #mtc-dd-dropzone.drag-over::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1100' height='200' viewBox='0 0 1100 200' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0%25' y1='0%25' x2='100%25' y2='100%25'%3E%3Cstop offset='0%25' stop-color='%23a78bfa'/%3E%3Cstop offset='100%25' stop-color='%2322d3ee'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect x='3.5' y='3.5' width='1093' height='193' rx='14' ry='14' fill='none' stroke='url(%23g)' stroke-width='6' stroke-dasharray='24 16'/%3E%3C/svg%3E") !important;
}

/* ════════════════ QME PANEL — modern polish ════════════════
   Aligns the new inline SVG icons + tightens the subnav, section
   titles, queue table, and action buttons to the app's glass look. */
.qp-ico { flex: none; }

/* Sub-nav: pill row, icon + label aligned, gradient active pill */
.qp-subnav { display: flex; gap: 6px; flex-wrap: wrap; padding: 6px; border-radius: 14px; }
.qp-subnav-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px !important; border-radius: 10px !important;
  font-weight: 600; font-size: 0.86rem; transition: background .15s, color .15s, box-shadow .15s;
}
.qp-subnav-btn.active { box-shadow: 0 4px 14px rgba(139,92,246,0.30); }
.qp-subnav-btn .qp-ico { opacity: 0.9; }

/* Section titles: icon in a soft tinted chip */
.qp-sec-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.02rem; letter-spacing: -0.01em;
}
.qp-sec-title .qp-ico {
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px; border-radius: 9px; box-sizing: content-box;
}

/* Queue table: cleaner header, roomier rows, glass action buttons */
.qp-queue-table { border-collapse: separate; border-spacing: 0; }
.qp-queue-table th {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 700; padding: 11px 12px;
}
.qp-queue-table td { padding: 11px 12px; vertical-align: middle; }
.qp-queue-actions { display: inline-flex; gap: 4px; }
.qp-action-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  border-radius: 8px; border: 1px solid rgba(99,102,241,0.14);
  background: rgba(255,255,255,0.7); color: var(--text-muted);
  cursor: pointer; transition: all .15s;
}
.qp-action-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.qp-action-btn.qp-action-danger:hover { color: #ef4444; border-color: #ef4444; background: rgba(239,68,68,0.08); }

/* Quick-action + form buttons: icon + label aligned */
.qp-quick-actions .btn-primary, .qp-quick-actions .btn-secondary,
.qp-form-actions-top button, .qp-form-footer button {
  display: inline-flex; align-items: center; gap: 7px;
}

/* Step indicator dots a touch more refined */
.qp-step-done { background: var(--accent-soft) !important; border-color: var(--accent) !important; }

/* ════════════════ QME PANEL DASHBOARD MODERNIZATION ════════════════
   The panel was triple-framed (page → 3px purple wrap → cards) with a dated
   lavender fill. Flatten the wrap — the glassy cards carry the structure. */
.qp-page-wrap {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* Sub-nav: clean segmented bar, no grey box around it */
.qp-page-wrap .qp-subnav {
  background: transparent !important;
  border: none !important;
  padding: 0 0 4px !important;
  margin-bottom: 18px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.12) !important;
  border-radius: 0 !important;
}

/* Stat grid: auto-fit so all 7 cards share one row on wide screens — no orphan */
.qp-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)) !important;
}
.qp-stat-card.qp-stat-zero { opacity: 0.72; }
.qp-stat-card.qp-stat-zero:hover { opacity: 1; }

/* Activity feed: hairline dividers instead of grey zebra rows */
.qp-page-wrap .qp-activity-item {
  background: transparent !important;
  border-radius: 0 !important;
  border-bottom: 1px solid rgba(99, 102, 241, 0.08);
  padding: 9px 4px !important;
}
.qp-page-wrap .qp-activity-item:last-child { border-bottom: none; }
.qp-page-wrap .qp-activity-item:hover { background: rgba(139, 92, 246, 0.04) !important; }
.qp-activity-time {
  font-variant-numeric: tabular-nums;
  flex: 0 0 110px;
  font-size: 0.74rem !important;
}
.qp-activity-msg {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* Queue: clamp long matter labels so one verbose row can't balloon the table */
.qp-queue-table td:nth-child(2) {
  max-width: 180px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ════════════════ TOPBAR USER BOX (EquiCopy-style) ════════════════ */
.topbar-user { align-items: center; gap: 12px; }
.topbar-user-id {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.84rem; font-weight: 700; color: var(--navy); letter-spacing: 0.2px;
}
.topbar-role-badge {
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.7px; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  padding: 2px 8px; border-radius: 999px; line-height: 1.5;
}
.topbar-icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 9px;
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; transition: all 0.15s; padding: 0;
}
.topbar-icon-btn svg { width: 17px; height: 17px; }
.topbar-icon-btn:hover { color: var(--accent); border-color: rgba(139,92,246,0.4); background: var(--accent-soft); }
.topbar-signout {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: 9px;
  background: #fff; border: 1px solid var(--border); color: var(--text-muted);
  font-size: 0.78rem; font-weight: 600; cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.topbar-signout svg { width: 15px; height: 15px; }
.topbar-signout:hover { color: #ef4444; border-color: rgba(239,68,68,0.35); background: rgba(239,68,68,0.05); }

/* ════════════════ LOGIN OVERLAY (modernized) ════════════════ */
#auth-overlay {
  display: flex; position: fixed; inset: 0; z-index: 9999;
  align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(6,182,212,0.18), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(139,92,246,0.22), transparent 60%),
    linear-gradient(135deg, #12082e 0%, #0f0a2e 40%, #0a1330 100%);
}
.auth-card {
  background: rgba(255,255,255,0.97);
  border: 1px solid rgba(139,92,246,0.18);
  border-radius: 20px;
  padding: 38px 40px 34px;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 70px rgba(8,6,26,0.5), 0 2px 8px rgba(8,6,26,0.3);
  position: relative; overflow: hidden;
}
.auth-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4);
}
.auth-brand { text-align: center; margin-bottom: 26px; }
.auth-logo { height: 90px; width: auto; object-fit: contain; display: block; margin: 0 auto 4px; }
.auth-subtitle {
  color: var(--text-muted); font-size: 0.74rem; margin: 0;
  letter-spacing: 1.5px; text-transform: uppercase; font-weight: 600;
}
.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block; font-size: 0.66rem; font-weight: 700; color: var(--navy);
  margin-bottom: 6px; letter-spacing: 0.8px; text-transform: uppercase;
}
.auth-field input {
  width: 100%; padding: 11px 13px; border-radius: 10px;
  border: 1.5px solid rgba(139,92,246,0.22); background: #fbfaff;
  color: var(--navy); font-size: 0.9rem; box-sizing: border-box; outline: none; font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(139,92,246,0.12);
}
.auth-pw-wrap { position: relative; }
.auth-pw-wrap input { padding-right: 42px; }
.auth-pw-eye {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; color: var(--text-muted);
  padding: 5px; display: inline-flex; border-radius: 6px; transition: color 0.15s;
}
.auth-pw-eye svg { width: 18px; height: 18px; }
.auth-pw-eye:hover { color: var(--accent); }
#auth-error { color: #ef4444; font-size: 0.78rem; min-height: 18px; margin: 4px 0 10px; text-align: center; font-weight: 500; }
#auth-submit {
  width: 100%; padding: 13px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #8b5cf6, #06b6d4); color: #fff;
  font-size: 0.9rem; font-weight: 700; cursor: pointer; letter-spacing: 0.5px; font-family: inherit;
  box-shadow: 0 8px 22px rgba(139,92,246,0.3); transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
#auth-submit:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 12px 28px rgba(139,92,246,0.4); }

/* ════════════════ "How do I use this?" inline helper ════════════════ */
.js-help { margin-bottom: 18px; }
.js-help-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-soft); border: 1px solid rgba(139,92,246,0.18);
  color: var(--accent); font-size: 0.8rem; font-weight: 600; font-family: inherit;
  padding: 7px 13px; border-radius: 10px; cursor: pointer; transition: all 0.15s;
}
.js-help-toggle:hover { border-color: rgba(139,92,246,0.4); background: rgba(139,92,246,0.1); }
.js-help-toggle svg { width: 15px; height: 15px; flex: 0 0 auto; }
.js-help-chev { transition: transform 0.2s; }
.js-help.open .js-help-chev { transform: rotate(180deg); }
.js-help-body {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.2s ease;
}
.js-help.open .js-help-body { max-height: 320px; opacity: 1; margin-top: 10px; }
.js-help-body ol {
  margin: 0; padding: 14px 18px 14px 34px;
  background: rgba(255,255,255,0.7); border: 1px solid rgba(99,102,241,0.12);
  border-radius: 12px; font-size: 0.84rem; color: var(--text); line-height: 1.55;
}
.js-help-body li { margin-bottom: 7px; }
.js-help-body li:last-child { margin-bottom: 0; }
.js-help-body b { color: var(--navy); font-weight: 700; }

/* ════════════════ Sortable + exportable tables ════════════════ */
.js-table-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.js-export-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--border); color: var(--text-muted);
  font-size: 0.76rem; font-weight: 600; font-family: inherit;
  padding: 6px 12px; border-radius: 9px; cursor: pointer; transition: all 0.15s;
}
.js-export-btn svg { width: 14px; height: 14px; }
.js-export-btn:hover { color: var(--accent); border-color: rgba(139,92,246,0.4); background: var(--accent-soft); }
th.js-sortable { cursor: pointer; user-select: none; position: relative; white-space: nowrap; }
th.js-sortable:hover { color: var(--accent) !important; }
th.js-sortable::after { content: '↕'; opacity: 0.3; margin-left: 5px; font-size: 0.85em; }
th.js-sortable[data-sort="asc"]::after { content: '↑'; opacity: 1; }
th.js-sortable[data-sort="desc"]::after { content: '↓'; opacity: 1; }

/* ════════════════ FM table: Mid-only by default (#4/#5) ════════════════ */
.fm-table .fm-col-detail, .fm-table .fm-col-range { display: none; }
.fm-table.fm-show-detail .fm-col-detail, .fm-table.fm-show-detail .fm-col-range { display: table-cell; }
.fm-table-toolbar { display: flex; justify-content: flex-end; margin: 4px 0 8px; }
.fm-range-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.78rem; color: var(--text-muted); cursor: pointer; user-select: none;
}
.fm-range-toggle input { accent-color: var(--accent); cursor: pointer; }
.fm-table td.fm-money[title] { cursor: help; }

/* ════════════════ Report Analyzer: bottom-line banner + warning cards (#2/#9) ════════════════ */
.rpt-banner { margin-bottom: 16px; }
.rpt-bottomline {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--accent-soft); border: 1px solid rgba(139,92,246,0.18);
  border-radius: 12px; padding: 12px 14px; font-size: 0.9rem; line-height: 1.5; color: var(--navy);
}
.rpt-bottomline-tag {
  flex: 0 0 auto; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase;
  color: #fff; background: linear-gradient(135deg,#8b5cf6,#06b6d4); padding: 3px 8px; border-radius: 999px; margin-top: 1px;
}
.rpt-atty-summary { margin-top: 8px; font-size: 0.85rem; color: var(--text); line-height: 1.5; padding: 0 4px; }
.rpt-atty-tag { font-size: 0.62rem; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--accent); }
.rpt-warnings { margin-top: 12px; }
.rpt-warnings-head { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #b45309; margin-bottom: 6px; }
.rpt-warn-card {
  display: flex; gap: 8px; font-size: 0.83rem; line-height: 1.45; color: #7c4a03;
  background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.25); border-left: 3px solid #f59e0b;
  border-radius: 8px; padding: 8px 12px; margin-bottom: 6px;
}
.rpt-warn-card::before { content: '⚠'; flex: 0 0 auto; }

/* ════════════════ SIBTF prong reasoning clamp (#6) ════════════════ */
.sibtf-clamp {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.sibtf-collapsible.open .sibtf-clamp { -webkit-line-clamp: unset; overflow: visible; }
.sibtf-more {
  margin-top: 5px; background: none; border: none; padding: 0; cursor: pointer;
  font-family: inherit; font-size: 0.74rem; font-weight: 700; color: inherit; opacity: 0.8;
}
.sibtf-more:hover { opacity: 1; text-decoration: underline; }

/* ════════════════ Records Chat: copy-answer button (#10) ════════════════ */
.cmsg-foot { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.cmsg.assistant .cmsg-foot { justify-content: flex-start; }
.cmsg.user .cmsg-foot { justify-content: flex-end; }
.rc-copy-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; padding: 2px 4px; cursor: pointer; font-family: inherit;
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted); opacity: 0; transition: opacity 0.15s, color 0.15s;
}
.cmsg:hover .rc-copy-btn { opacity: 0.75; }
.rc-copy-btn:hover { opacity: 1; color: var(--accent); }
.rc-copy-btn svg { width: 13px; height: 13px; }


/* EquiCopy-parity density: tighter card interior (was 32px) */
.card { padding: 22px 24px; }

/* ── Matched compact upload heroes (2026-06-10): Case Dashboard, Record
   Extraction, Records Summary, Scan Sync share one window height so their
   upload squares render identically (boxes stretch to fill). ── */
#panel-upload .upload-hero-inner, #panel-scraper .upload-hero-inner,
#panel-records-summary .upload-hero-inner, #panel-scan .upload-hero-inner {
  min-height: 248px;
}

/* PD Rating — From Report: roomier upload box + slightly wider panel so the
   tight fit relaxes (user request 2026-06-10). Double-id selector outguns the
   #panel-pd .dropzone.drop-zone-hero 140/176px pin above. */
#panel-pd #main-dropzone.drop-zone-hero {
  min-height: 235px !important;
  max-height: none !important;
}
#panel-pd .hero-panel--wide { max-width: 800px !important; }

/* QME: checkbox labels were full-row flex — clicking blank space anywhere on the
   row (e.g. under the CC Emails box) toggled them. Clamp to content width. */
.qp-checkbox-label { width: fit-content; }

/* QME "Load from MerusCase" prefill banner */
.qp-merus-card { margin: 12px 0 4px; border-radius: 12px; padding: 14px 16px;
  background: linear-gradient(180deg, rgba(139,92,246,0.06), rgba(6,182,212,0.04));
  border: 1px solid rgba(139,92,246,0.22); font-size: 0.82rem; color: var(--text); }
.qp-merus-card.loading { color: var(--text-muted); }
.qp-merus-card.err { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.3); color: #b91c1c; }
.qp-mb-head { font-weight: 700; font-size: 0.9rem; margin-bottom: 8px; position: relative; }
.qp-mb-x { position: absolute; right: 0; top: -2px; background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: var(--text-muted); line-height: 1; }
.qp-mb-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; line-height: 1.5; }
.qp-mb-row > b { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-right: 4px; }
.qp-mb-chip { font-size: 0.74rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.qp-mb-chip.ok   { color: #047857; background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.3); }
.qp-mb-chip.warn { color: #b45309; background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.35); }
.qp-mb-chip.mute { color: var(--text-muted); background: rgba(100,116,139,0.08); border: 1px solid var(--border); }
.qp-mb-doi { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; font-weight: 600;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 4px 10px; cursor: pointer; }

/* ════════════ Case Law Intelligence ════════════ */
#panel-caselaw { padding: 0; }
.cl-wrap { max-width: 1100px; margin: 0 auto; padding: 8px 4px 60px; }
.cl-head { margin-bottom: 18px; }
.cl-title { font-size: 1.7rem; font-weight: 800; letter-spacing: -0.01em; color: #1e1b4b; margin: 0; }
.cl-title span { background: linear-gradient(115deg, #8b5cf6, #06b6d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cl-sub { color: #64748b; font-size: 0.9rem; margin: 6px 0 0; max-width: 720px; line-height: 1.5; }
.cl-disclaimer { margin-top: 12px; font-size: 0.78rem; color: #92400e; background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3); border-radius: 10px; padding: 9px 13px; }
.cl-ask { padding: 16px !important; margin-bottom: 14px; }
.cl-ask-row { display: flex; gap: 10px; }
.cl-ask-row input { flex: 1; border: 1.5px solid rgba(139,92,246,0.3); border-radius: 10px; padding: 11px 14px; font-size: 0.9rem; font-family: inherit; }
.cl-ask-out:empty { display: none; }
.cl-answer { margin-top: 12px; font-size: 0.88rem; line-height: 1.6; color: #27224f; background: #faf9ff; border: 1px solid #eee9fb; border-radius: 10px; padding: 15px 17px; }
.cl-answer > :first-child { margin-top: 0; }
.cl-answer > :last-child { margin-bottom: 0; }
.cl-answer h3 { font-size: 0.98rem; font-weight: 800; color: #1e1b4b; margin: 15px 0 7px; }
.cl-answer h4 { font-size: 0.87rem; font-weight: 700; color: #4338ca; margin: 13px 0 5px; }
.cl-answer p { margin: 0 0 9px; }
.cl-answer ul { margin: 5px 0 11px; padding-left: 19px; }
.cl-answer li { margin: 4px 0; }
.cl-answer hr { border: none; border-top: 1px solid #e9e4f7; margin: 13px 0; }
.cl-answer strong { color: #1e1b4b; font-weight: 700; }
.cl-answer code { background: #f1edfb; padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }
.cl-answer a { color: #0891b2; text-decoration: underline; }
.cl-answer blockquote { margin: 9px 0; padding: 9px 13px; background: #fff; border-left: 3px solid #c4b5fd; border-radius: 6px; color: #475569; font-size: 0.85rem; }
.cl-answer blockquote p { margin: 0; }
.cl-cites { margin-top: 8px; font-size: 0.74rem; color: #64748b; }
.cl-cite { font-size: 0.74rem; background: #fff; border: 1px solid rgba(6,182,212,0.35); color: #0891b2; border-radius: 6px; padding: 3px 9px; margin: 3px 4px 0 0; cursor: pointer; }
.cl-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px !important; margin-bottom: 12px; }
.cl-controls #cl-search { flex: 1; min-width: 240px; border: 1.5px solid rgba(139,92,246,0.3); border-radius: 10px; padding: 10px 14px; font-size: 0.88rem; font-family: inherit; }
.cl-controls select { border: 1.5px solid rgba(139,92,246,0.3); border-radius: 10px; padding: 9px 12px; font-size: 0.82rem; font-family: inherit; background: #fff; }
.cl-lens { display: inline-flex; border: 1px solid #e3def5; border-radius: 9px; overflow: hidden; }
.cl-lens-btn { all: unset; padding: 8px 14px; font-size: 0.78rem; font-weight: 600; color: #64748b; cursor: pointer; }
.cl-lens-btn.cl-on { background: linear-gradient(120deg, #8b5cf6, #06b6d4); color: #fff; }
.cl-bubbles { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.cl-bubble { all: unset; cursor: pointer; font-size: 0.76rem; font-weight: 600; color: #5b21b6; background: #f3f0ff; border: 1px solid #e3def5; border-radius: 999px; padding: 6px 13px; }
.cl-bubble.cl-on { background: linear-gradient(120deg, #8b5cf6, #06b6d4); color: #fff; border-color: transparent; }
.cl-count { font-size: 0.74rem; color: #94a3b8; margin: 0 0 10px 4px; font-weight: 600; }
.cl-list { display: flex; flex-direction: column; gap: 10px; }
.cl-loading, .cl-empty { color: #94a3b8; font-size: 0.85rem; padding: 22px; text-align: center; }
.cl-card { background: rgba(255,255,255,0.85); border: 1px solid rgba(99,102,241,0.14); border-radius: 14px; padding: 15px 17px; cursor: pointer; transition: border-color .2s, box-shadow .2s; }
.cl-card:hover { border-color: rgba(139,92,246,0.35); box-shadow: 0 8px 24px rgba(99,102,241,0.08); }
.cl-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.cl-card-name { font-weight: 750; font-size: 0.95rem; color: #1e1b4b; }
.cl-card-meta { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.cl-badge { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.03em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.cl-badge-bind { color: #b91c1c; background: rgba(239,68,68,0.09); border: 1px solid rgba(239,68,68,0.3); }
.cl-badge-pers { color: #0891b2; background: rgba(6,182,212,0.08); border: 1px solid rgba(6,182,212,0.3); }
.cl-badge-info { color: #64748b; background: rgba(100,116,139,0.08); border: 1px solid #e2e8f0; }
.cl-risk { font-size: 0.66rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.cl-risk-high { color: #b91c1c; background: rgba(239,68,68,0.08); }
.cl-risk-medium { color: #b45309; background: rgba(245,158,11,0.1); }
.cl-risk-low { color: #15803d; background: rgba(16,185,129,0.08); }
.cl-date { font-size: 0.72rem; color: #94a3b8; }
.cl-card-summary { margin-top: 8px; font-size: 0.83rem; line-height: 1.55; color: #475569; }
.cl-card-tags { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.cl-tag { font-size: 0.68rem; color: #6d28d9; background: rgba(139,92,246,0.07); border: 1px solid rgba(139,92,246,0.2); border-radius: 6px; padding: 2px 8px; }
.cl-card-detail:empty { display: none; }
.cl-card-detail { margin-top: 12px; border-top: 1px solid #eef1f7; padding-top: 12px; cursor: default; }
.cl-binding { font-size: 0.72rem; font-weight: 700; color: #6d28d9; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.cl-sect { margin-bottom: 11px; }
.cl-sect h4 { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: #8b5cf6; margin: 0 0 3px; }
.cl-sect p { font-size: 0.84rem; line-height: 1.6; color: #334155; margin: 0; }
.cl-quote { margin: 10px 0; font-style: italic; font-size: 0.85rem; color: #1e1b4b; background: #faf9ff; border-left: 3px solid #8b5cf6; border-radius: 6px; padding: 10px 14px; }
.cl-quote-cite { display: block; font-style: normal; font-size: 0.7rem; color: #94a3b8; margin-top: 4px; }
.cl-flags { margin: 10px 0; font-size: 0.76rem; color: #92400e; background: rgba(245,158,11,0.07); border: 1px solid rgba(245,158,11,0.25); border-radius: 8px; padding: 9px 13px; }
.cl-flags ul { margin: 5px 0 0; padding-left: 18px; }
.cl-actions { margin-top: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cl-srcbtn { font-size: 0.8rem; font-weight: 700; color: #fff; background: linear-gradient(120deg, #8b5cf6, #06b6d4); border-radius: 9px; padding: 8px 15px; text-decoration: none; }
.cl-srchint { font-size: 0.72rem; color: #94a3b8; }

/* Case Law — full case-detail view (demo-matched) */
#cl-detail-view { max-width: 880px; margin: 0 auto; }
.cl-back { all: unset; cursor: pointer; font-weight: 700; color: #4338ca; font-size: 0.9rem; padding: 6px 2px; display: inline-block; margin-bottom: 12px; }
.cl-back:hover { color: #6d28d9; }
.cl-dv { background: #fff; border: 1px solid rgba(99,102,241,0.14); border-radius: 18px; padding: 30px 34px 22px; box-shadow: 0 10px 40px rgba(30,27,75,0.06); }
.cl-dv-auth { font-size: 0.82rem; font-weight: 700; color: #1e1b4b; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.cl-dv-bars { color: #6366f1; letter-spacing: -2px; font-size: 0.7rem; }
.cl-dv-bind .cl-dv-bars { color: #b91c1c; }
.cl-dv-meta { font-weight: 500; color: #94a3b8; font-size: 0.78rem; }
.cl-dv-name { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; color: #0f172a; margin: 12px 0 0; line-height: 1.15; }
.cl-vs { color: #94a3b8; font-weight: 600; }
.cl-dv-tags { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.cl-dv-tag { font-size: 0.72rem; font-weight: 600; color: #475569; background: #f1f5f9; border-radius: 999px; padding: 5px 12px; }
.cl-dv-holding { margin-top: 20px; background: #eef3fb; border-left: 5px solid #1e3a8a; border-radius: 6px; padding: 16px 20px; }
.cl-dv-hlabel { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #1e3a8a; margin-bottom: 6px; }
.cl-dv-holding p { margin: 0; font-size: 1rem; line-height: 1.55; color: #1e293b; }
.cl-dv-persprow { margin-top: 22px; display: flex; align-items: center; gap: 14px; }
.cl-dv-persplabel { font-size: 0.82rem; font-weight: 600; color: #64748b; }
.cl-dv-persp { display: inline-flex; background: #eef0f4; border-radius: 11px; padding: 3px; }
.cl-persp-btn { all: unset; cursor: pointer; padding: 7px 18px; font-size: 0.82rem; font-weight: 600; color: #475569; border-radius: 8px; }
.cl-persp-btn.cl-on { background: #fff; color: #0f172a; box-shadow: 0 1px 3px rgba(0,0,0,0.12); }
.cl-dv-cards { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cl-dv-cards.cl-p-applicant, .cl-dv-cards.cl-p-defense { grid-template-columns: 1fr; }
.cl-p-applicant .cl-uc-def, .cl-p-defense .cl-uc-app { display: none; }
.cl-uc { border: 1px solid #e8edf3; border-radius: 14px; overflow: hidden; }
.cl-uc-head { font-size: 0.82rem; font-weight: 800; letter-spacing: 0.03em; padding: 12px 18px; }
.cl-uc-head-app { background: #ecfdf3; color: #15803d; }
.cl-uc-head-def { background: #fdf0e8; color: #9a4d20; }
.cl-uc p { margin: 0; padding: 16px 18px 4px; font-size: 0.9rem; line-height: 1.55; color: #334155; }
.cl-uc-label { padding: 10px 18px 0; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #94a3b8; }
.cl-uc-chips { padding: 8px 18px 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.cl-uc-chip { font-size: 0.78rem; font-weight: 600; color: #334155; background: #fff; border: 1px solid #d8dee8; border-radius: 8px; padding: 7px 13px; }
.cl-dv-why { margin-top: 22px; }
.cl-dv-wlabel { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #94a3b8; margin-bottom: 5px; }
.cl-dv-why p { margin: 0; font-size: 0.92rem; line-height: 1.55; color: #64748b; }
.cl-dv-toggle { all: unset; cursor: pointer; margin-top: 20px; font-size: 0.82rem; font-weight: 700; color: #4338ca; padding: 9px 0; display: inline-block; }
.cl-dv-toggle:hover { color: #6d28d9; }
.cl-dv-more { margin-top: 6px; border-top: 1px solid #eef1f7; padding-top: 18px; }
.cl-dv-more[hidden] { display: none; }
.cl-dv-foot { margin-top: 20px; border-top: 1px solid #eef1f7; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cl-dv-status { font-size: 0.82rem; font-weight: 600; color: #15803d; background: #ecfdf3; border-radius: 9px; padding: 9px 15px; }
.cl-dv-srcbtn { font-size: 0.85rem; font-weight: 700; color: #1e293b; background: #fff; border: 1.5px solid #cbd5e1; border-radius: 10px; padding: 9px 17px; text-decoration: none; }
.cl-dv-srcbtn:hover { border-color: #6366f1; color: #4338ca; }
.cl-dv-foot-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-dv-copy { cursor: pointer; font-size: 0.85rem; font-weight: 700; color: #4338ca; background: #fff; border: 1.5px solid #cbd5e1; border-radius: 10px; padding: 9px 15px; font-family: inherit; }
.cl-dv-copy:hover { border-color: #6366f1; background: #f5f3ff; }
@media (max-width: 640px) { .cl-dv-cards { grid-template-columns: 1fr; } .cl-dv-name { font-size: 1.5rem; } .cl-dv { padding: 22px 20px; } }
