/* ==========================================================================
   CRIZANT SHIELD — PLAIN-LANGUAGE DESIGN LAYER
   --------------------------------------------------------------------------
   Purpose: make every screen understandable by a non-specialist on first read.
   Principles applied throughout:
     1. Every number is paired with a word ("918 / 1000 — Very high risk").
     2. Every panel answers: What happened? Why it matters? What do I do now?
     3. Jargon is never the primary label; it lives behind a tap-to-explain link.
     4. Sentences, not noun-stacks. Verbs on every button.
   ========================================================================== */

:root {
  --plain-ink:       #0A2240; /* navy-900 */
  --plain-body:      #0A2240; /* navy-900 */
  --plain-soft:      #5A6675; /* slate-600 */
  --plain-line:      #C7D0DA; /* slate-300 */
  --plain-tint:      #F3F6F9; /* mist-100 */
  --plain-focus:     0 0 0 3px rgba(0, 87, 217, 0.22);
}

/* --------------------------------------------------------------------------
   1. READING MODE SWITCH  (Simple is the default; Expert restores the codes)
   -------------------------------------------------------------------------- */
.mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--crizant-slate-100);
  border: 1px solid var(--plain-line);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.mode-switch button {
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--plain-soft);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.mode-switch button.on {
  background: #FFFFFF;
  color: var(--crizant-navy-900);
  box-shadow: var(--shadow-sm);
}
.mode-switch button:focus-visible { outline: none; box-shadow: var(--plain-focus); }

/* Elements that belong to only one reading mode */
body[data-mode="simple"] .expert-only { display: none !important; }
body[data-mode="expert"] .simple-only { display: none !important; }

/* --------------------------------------------------------------------------
   2. TAP-TO-EXPLAIN GLOSSARY
   -------------------------------------------------------------------------- */
.term {
  border-bottom: 1.5px dotted var(--crizant-blue-600);
  cursor: help;
  color: inherit;
  font-weight: inherit;
}
.term:hover { background: var(--crizant-ice-050); }

.glossary-pop {
  position: absolute;
  z-index: 4000;
  width: 310px;
  max-width: calc(100vw - 32px);
  background: #FFFFFF;
  border: 1px solid var(--plain-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 16px 18px;
  font-family: var(--font-sans);
}
.glossary-pop .gp-term {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--crizant-navy-900);
  margin-bottom: 2px;
}
.glossary-pop .gp-also {
  font-size: 11.5px;
  color: var(--plain-soft);
  margin-bottom: 9px;
}
.glossary-pop .gp-def {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--plain-body);
}
.glossary-pop .gp-why {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--plain-line);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--plain-body);
}
.glossary-pop .gp-why b { color: var(--crizant-navy-900); }

/* --------------------------------------------------------------------------
   3. "IN PLAIN ENGLISH" CALLOUT
   -------------------------------------------------------------------------- */
.plain-note {
  background: var(--crizant-ice-050);
  border: 1px solid var(--crizant-ice-200);
  border-left: 4px solid var(--crizant-blue-600);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px 24px;
}
.plain-note-label {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crizant-blue-600);
  margin-bottom: 6px;
}
.plain-note p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--plain-body);
}
.plain-note p + p { margin-top: 8px; }
.plain-note strong { color: var(--crizant-navy-900); font-weight: 650; }

/* --------------------------------------------------------------------------
   4. RISK METER — a number is never shown without its scale
   -------------------------------------------------------------------------- */
.risk-meter { display: block; }
.risk-meter-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}
.risk-meter-score {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.02em;
}
.risk-meter-of {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--plain-soft);
}
.risk-meter-word {
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid;
}
.risk-meter-track {
  position: relative;
  height: 8px;
  border-radius: var(--radius-pill);
  /* Band edges match RISK_BANDS exactly: 400 / 650 / 850 out of 1000 */
  background: linear-gradient(90deg,
    #D1FADF 0%,  #D1FADF 40%,
    #FEF0C7 40%, #FEF0C7 65%,
    #FED7AA 65%, #FED7AA 85%,
    #FECDCA 85%, #FECDCA 100%);
  overflow: visible;
}
.risk-meter-pin {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 16px;
  border-radius: 3px;
  transform: translateX(-2px);
  box-shadow: 0 0 0 2.5px #FFFFFF;
}
/* Each label sits under its own band, not evenly spaced, so the words and
   the colours always agree. */
.risk-meter-scale {
  display: flex;
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--plain-soft);
}
.risk-meter-scale span { text-align: center; }
.risk-meter-scale span:nth-child(1) { width: 40%; }
.risk-meter-scale span:nth-child(2) { width: 25%; }
.risk-meter-scale span:nth-child(3) { width: 20%; }
.risk-meter-scale span:nth-child(4) { width: 15%; }

.tier-low      { color: var(--crizant-green);  border-color: var(--crizant-green-border);  background: var(--crizant-green-bg); }
.tier-medium   { color: var(--crizant-amber);  border-color: var(--crizant-amber-border);  background: var(--crizant-amber-bg); }
.tier-high     { color: #C2410C;               border-color: #FED7AA;                      background: #FFF7ED; }
.tier-critical { color: var(--crizant-red);    border-color: var(--crizant-red-border);    background: var(--crizant-red-bg); }

.score-low      { color: var(--crizant-green); }
.score-medium   { color: var(--crizant-amber); }
.score-high     { color: #C2410C; }
.score-critical { color: var(--crizant-red); }

/* --------------------------------------------------------------------------
   5. TODAY SCREEN — headline, action queue, outcome cards
   -------------------------------------------------------------------------- */
.today-hero {
  border: 1px solid var(--plain-line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--crizant-navy-900) 0%, var(--crizant-navy-700) 100%);
  color: #FFFFFF;
  padding: 24px 32px;
  margin-bottom: 24px;
}
.today-hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--crizant-cyan-400); /* 6.02:1 AA on navy-900 */
  margin-bottom: 10px;
}
.today-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 0 0 12px;
  max-width: 50ch;
}
.today-hero p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--crizant-ice-200); /* 11.81:1 AAA on navy-900 */
  max-width: 72ch;
}
.today-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}
.today-hero-stat {
  background: rgba(255, 255, 255, .09);
  border: 1px solid rgba(185, 228, 250, .28);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-width: 150px;
}
.today-hero-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: #FFFFFF;
}
.today-hero-stat span {
  font-size: 12px;
  color: var(--crizant-ice-200);
  line-height: 1.4;
  display: block;
  margin-top: 4px;
}

.section-head { margin: 36px 0 16px; }
.section-head h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--crizant-navy-900);
  margin: 0 0 5px;
  letter-spacing: -.01em;
}
.section-head p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--plain-soft);
  max-width: 78ch;
}

/* Prioritised action queue */
.queue { display: flex; flex-direction: column; gap: 12px; }
.queue-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 18px;
  align-items: center;
  background: #FFFFFF;
  border: 1px solid var(--plain-line);
  border-left: 4px solid var(--crizant-slate-300);
  border-radius: var(--radius-lg);
  padding: 17px 20px;
  transition: box-shadow .16s ease, border-color .16s ease;
}
.queue-item:hover { box-shadow: var(--shadow-hover); }
.queue-item.urgency-critical { border-left-color: var(--crizant-red); }
.queue-item.urgency-high     { border-left-color: #EA580C; }
.queue-item.urgency-medium   { border-left-color: var(--crizant-amber); }
.queue-rank {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  background: var(--crizant-slate-100);
  color: var(--crizant-navy-900);
}
.queue-item.urgency-critical .queue-rank { background: var(--crizant-red-bg);  color: var(--crizant-red); }
.queue-item.urgency-high     .queue-rank { background: #FFF7ED;                color: #C2410C; }
.queue-item.urgency-medium   .queue-rank { background: var(--crizant-amber-bg); color: var(--crizant-amber); }
.queue-title {
  font-size: 15.5px;
  font-weight: 650;
  color: var(--crizant-navy-900);
  line-height: 1.45;
  margin-bottom: 4px;
}
.queue-why {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--plain-body);
}
.queue-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 12px;
  color: var(--plain-soft);
  font-weight: 500;
}
.queue-meta span { display: inline-flex; align-items: center; gap: 5px; }
.queue-action { white-space: nowrap; }

/* Outcome cards — "what the system did for you" */
.outcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 16px;
}
.outcome-card {
  background: #FFFFFF;
  border: 1px solid var(--plain-line);
  border-radius: var(--radius-lg);
  padding: 20px 22px 18px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow .16s ease, transform .16s ease;
}
.outcome-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.outcome-card:focus-visible { outline: none; box-shadow: var(--plain-focus); }
.outcome-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.025em;
  color: var(--crizant-navy-900);
  margin-bottom: 6px;
}
.outcome-head {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--crizant-navy-900);
  line-height: 1.45;
  margin-bottom: 8px;
}
.outcome-body {
  font-size: 13px;
  line-height: 1.62;
  color: var(--plain-body);
  flex: 1;
}
.outcome-link {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 650;
  color: var(--crizant-blue-600);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   6. CASE CARDS — the simple-mode replacement for the dense table
   -------------------------------------------------------------------------- */
.case-cards { display: flex; flex-direction: column; gap: 16px; }
.case-card {
  background: #FFFFFF;
  border: 1px solid var(--plain-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .16s ease;
}
.case-card:hover { box-shadow: var(--shadow-hover); }
.case-card-top {
  display: grid;
  grid-template-columns: 1fr 232px;
  gap: 26px;
  padding: 22px 24px 18px;
}
.case-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 9px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--plain-soft);
}
.case-headline {
  font-family: var(--font-heading);
  font-size: 18.5px;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -.01em;
  color: var(--crizant-navy-900);
  margin: 0 0 10px;
  max-width: 54ch;
}
.case-found-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--plain-soft);
  margin: 14px 0 7px;
}
.case-found { margin: 0; padding: 0; list-style: none; }
.case-found li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--plain-body);
  margin-bottom: 6px;
}
.case-found li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--crizant-red);
}
.case-risk-pane {
  border-left: 1px solid var(--plain-line);
  padding-left: 24px;
}
.case-stake {
  margin-top: 16px;
  background: var(--plain-tint);
  border-radius: var(--radius-md);
  padding: 11px 13px;
}
.case-stake-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--plain-soft);
  margin-bottom: 3px;
}
.case-stake-value {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  color: var(--crizant-navy-900);
  line-height: 1.2;
}
.case-stake-note {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--plain-soft);
  margin-top: 4px;
}

.case-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--plain-tint);
  border-top: 1px solid var(--plain-line);
  padding: 14px 24px;
}
.case-next {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--plain-body);
}
.case-next b { color: var(--crizant-navy-900); font-weight: 650; }

/* Plain progress tracker: where this case has reached */
.track { display: flex; align-items: flex-start; gap: 0; margin-top: 4px; }
.track-step { flex: 1; text-align: center; position: relative; min-width: 0; }
.track-step::before {
  content: "";
  position: absolute;
  top: 9px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--crizant-slate-200);
}
.track-step:first-child::before { display: none; }
.track-dot {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin: 0 auto 7px;
  background: #FFFFFF;
  border: 2px solid var(--crizant-slate-300);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--plain-soft);
  z-index: 1;
}
.track-step.done .track-dot { background: var(--crizant-green); border-color: var(--crizant-green); color: #FFFFFF; }
.track-step.done::before { background: var(--crizant-green); }
.track-step.now .track-dot {
  background: var(--crizant-blue-600);
  border-color: var(--crizant-blue-600);
  color: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(0, 87, 217, .16);
}
.track-step.now::before { background: var(--crizant-green); }
.track-label {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--plain-soft);
  padding: 0 4px;
}
.track-step.now .track-label { color: var(--crizant-blue-600); font-weight: 700; }
.track-step.done .track-label { color: var(--plain-body); }

/* --------------------------------------------------------------------------
   7. PLAIN-ENGLISH RULE CARDS (replaces raw regression output in simple mode)
   -------------------------------------------------------------------------- */
.rule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 16px;
}
.rule-card {
  background: #FFFFFF;
  border: 1px solid var(--plain-line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
}
.rule-when {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--plain-soft);
  margin-bottom: 6px;
}
.rule-if {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.5;
  color: var(--crizant-navy-900);
  margin-bottom: 14px;
}
.rule-then {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--crizant-red-bg);
  border: 1px solid var(--crizant-red-border);
  margin-bottom: 13px;
}
.rule-multiplier {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  color: var(--crizant-red);
  line-height: 1;
}
.rule-then-text {
  font-size: 13px;
  line-height: 1.5;
  color: #7A271A;
  font-weight: 600;
}
.rule-detail {
  font-size: 13px;
  line-height: 1.62;
  color: var(--plain-body);
  flex: 1;
}
.rule-confidence {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--plain-line);
  font-size: 12px;
  color: var(--plain-soft);
  line-height: 1.55;
}
.rule-confidence b { color: var(--crizant-navy-900); }

/* --------------------------------------------------------------------------
   8. FIRST-RUN GUIDE STRIP
   -------------------------------------------------------------------------- */
.guide-strip {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #FFFBEB;
  border: 1px solid var(--crizant-amber-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 22px;
}
.guide-strip-icon { font-size: 20px; line-height: 1.2; }
.guide-strip-body { flex: 1; }
.guide-strip-body h3 {
  font-family: var(--font-heading);
  font-size: 14.5px;
  font-weight: 700;
  color: #7A4A08;
  margin: 0 0 5px;
}
.guide-strip-body p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.62;
  color: #78350F;
}
.guide-dismiss {
  border: 0;
  background: transparent;
  color: #92400E;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}

/* --------------------------------------------------------------------------
   9. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1023px) {
  .case-card-top { grid-template-columns: 1fr; gap: 18px; }
  .case-risk-pane { border-left: 0; border-top: 1px solid var(--plain-line); padding-left: 0; padding-top: 18px; }
}
@media (max-width: 767px) {
  .today-hero { padding: 24px 20px; border-radius: var(--radius-lg); }
  .today-hero-stat { flex: 1 1 140px; min-width: 0; }
  .queue-item { grid-template-columns: 36px 1fr; row-gap: 12px; padding: 16px; }
  .queue-action { grid-column: 1 / -1; }
  .queue-action .btn { width: 100%; justify-content: center; }
  .case-card-top { padding: 18px 16px 14px; }
  .case-card-foot { padding: 14px 16px; }
  .case-card-foot .btn { width: 100%; justify-content: center; }
  .case-headline { font-size: 17px; }
  .track-label { font-size: 9.5px; }
  .section-head { margin: 28px 0 14px; }
}

/* Mobile preview frame inherits the phone layout */
.mobile-frame-mode .case-card-top { grid-template-columns: 1fr; gap: 18px; }
.mobile-frame-mode .case-risk-pane { border-left: 0; border-top: 1px solid var(--plain-line); padding-left: 0; padding-top: 18px; }
.mobile-frame-mode .queue-item { grid-template-columns: 36px 1fr; row-gap: 12px; }
.mobile-frame-mode .queue-action { grid-column: 1 / -1; }
.mobile-frame-mode .outcome-grid { grid-template-columns: 1fr; }
.mobile-frame-mode .rule-grid { grid-template-columns: 1fr; }

/* --------------------------------------------------------------------------
   10. TOP BAR FITS FIVE PLAIN-LANGUAGE TABS
   -------------------------------------------------------------------------- */
/* Five plain-language tabs plus the reading-mode switch need more room than
   four short codes did, so the tab rail shrinks and scrolls instead of
   pushing the page sideways. */
.topbar-inner { min-width: 0; }
.nav-pills {
  min-width: 0;
  flex-wrap: wrap;
}
.nav-pill { white-space: nowrap; flex-shrink: 0; }

@media (max-width: 1500px) {
  /* The mobile-preview toggle is a demo control; it yields first. */
  #mobileToggleBtn { display: none; }
}
@media (max-width: 860px) {
  .mode-switch button { padding: 6px 10px; font-size: 11.5px; }
}
@media (max-width: 767px) {
  .topbar-right { gap: 8px; }
  .mode-switch { order: -1; }
}

@media (max-width: 767px) {
  /* Give the reading-mode switch room on a phone: the tagline and the long
     button labels are the first things to go. */
  .brand-text-lockup { display: none; }
  .ms-long { display: none; }
  .brand { min-width: 0; flex-shrink: 0; }
  .brand-mark-svg { width: 30px; height: 30px; }
  .topbar-right { flex-shrink: 0; }
  .topbar-inner { gap: 10px; }
}

/* Drawer tabs & header unified with styles.css */
.drawer-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}
.drawer-tabs::-webkit-scrollbar { display: none; }
.drawer-tab { white-space: nowrap; flex-shrink: 0; }

/* --------------------------------------------------------------------------
   11. THE RISK CHECKER COLLAPSES INSTEAD OF OVERFLOWING
   -------------------------------------------------------------------------- */
.eci-sim-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) { .eci-sim-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .eci-sim-grid { grid-template-columns: 1fr; } }
.mobile-frame-mode .eci-sim-grid { grid-template-columns: 1fr; }

/* Long option text in the graph toolbar should wrap the bar, not the page. */
.kg-toolbar { flex-wrap: wrap; }
.kg-toolbar > div { min-width: 0; max-width: 100%; flex-wrap: wrap; }
.kg-toolbar .input-field { min-width: 0; max-width: 100%; }
@media (max-width: 900px) {
  .kg-toolbar > div { width: 100%; }
  .kg-toolbar .input-field { flex: 1 1 180px; }
}

/* Some status pills carry a full sentence; let them wrap rather than poke
   out of their card on a narrow screen. */
.pill { max-width: 100%; }
@media (max-width: 900px) {
  .pill { white-space: normal; }
}

/* --------------------------------------------------------------------------
   12. HEAD — FRAUD RISK MONITORING UNIT COMMAND CENTER & RISK TIERS
   -------------------------------------------------------------------------- */
.head-hero-bar {
  background: linear-gradient(135deg, var(--crizant-navy-900) 0%, var(--crizant-navy-700) 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(10, 34, 64, 0.15);
  border: 1px solid rgba(185, 228, 250, 0.18);
}
.head-filter-toolbar {
  background: #FFFFFF;
  border: 1px solid var(--plain-line);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.head-filter-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.head-filter-row::-webkit-scrollbar {
  display: none;
}
.head-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--crizant-slate-100);
  padding: 3px 4px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--plain-line);
  flex-shrink: 0;
  white-space: nowrap;
}
.head-filter-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--plain-soft);
  letter-spacing: 0.05em;
  margin-right: 2px;
  padding-left: 6px;
}
.head-pill-btn {
  border: 0;
  background: transparent;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--plain-body);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.head-pill-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--crizant-navy-900);
}
.head-pill-btn.active {
  background: #0A2240;
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(10, 34, 64, 0.25);
}
.head-filter-reset-btn {
  font-size: 11.5px;
  padding: 4px 10px;
  color: #64748B;
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: auto;
}
.head-risk-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 1024px) {
  .head-risk-cards-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .head-risk-cards-grid { grid-template-columns: 1fr; }
}
.head-risk-card {
  background: #FFFFFF;
  border: 2px solid var(--plain-line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
}
.head-risk-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.head-risk-card.active {
  box-shadow: 0 0 0 3px rgba(10, 34, 64, 0.15), 0 10px 28px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}
.head-risk-card.tier-critical { border-color: #F87171; }
.head-risk-card.tier-critical.active { border-color: #DC2626; background: #FEF2F2; }
.head-risk-card.tier-high { border-color: #FB923C; }
.head-risk-card.tier-high.active { border-color: #EA580C; background: #FFF7ED; }
.head-risk-card.tier-medium { border-color: #FBBF24; }
.head-risk-card.tier-medium.active { border-color: #D97706; background: #FFFBEB; }
.head-risk-card.tier-low { border-color: #4ADE80; }
.head-risk-card.tier-low.active { border-color: #16A34A; background: #F0FDF4; }

.head-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.head-card-badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
}
.head-card-count {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--crizant-navy-900);
  font-family: var(--font-heading);
}
.head-card-stake {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--plain-body);
  margin-top: 4px;
}
.head-card-desc {
  font-size: 12px;
  line-height: 1.45;
  color: var(--plain-soft);
  margin-top: 8px;
  border-top: 1px dashed var(--plain-line);
  padding-top: 8px;
}

.head-ranked-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #FFFFFF;
  border: 1px solid var(--plain-line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.head-ranked-table th {
  background: #F8FAFC;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--plain-soft);
  border-bottom: 1px solid var(--plain-line);
  text-align: left;
  letter-spacing: 0.05em;
}
.head-ranked-table td {
  padding: 14px 14px;
  font-size: 12.5px;
  color: var(--plain-body);
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.head-ranked-table tr:last-child td { border-bottom: none; }
.head-ranked-table tr:hover td { background: #F8FAFC; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 12px;
  background: #0A2240;
  color: #FFFFFF;
}
.rank-badge.top-3 {
  background: #DC2626;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}

.governance-strip-banner {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* =============================================================================
   FIELD INVESTIGATOR VoIP DIALER & TRANSCRIPTION STYLES
   ============================================================================= */
@keyframes voipWave {
  0%, 100% { height: 6px; opacity: 0.45; }
  50% { height: 26px; opacity: 1; }
}

.voip-live-transcript-feed {
  background: #0B1120;
  border: 1px solid #1E293B;
  border-radius: 8px;
  padding: 12px;
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
}

.voip-turn-bubble {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  line-height: 1.45;
  animation: fadeInTurn 0.25s ease-in-out;
}

@keyframes fadeInTurn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.voip-turn-investigator {
  background: rgba(37, 99, 235, 0.15);
  border-left: 3px solid #38BDF8;
  color: #E2E8F0;
}

.voip-turn-callee {
  background: rgba(16, 185, 129, 0.15);
  border-left: 3px solid #10B981;
  color: #F8FAFC;
}

.voip-turn-flag {
  display: inline-block;
  background: #7F1D1D;
  color: #FCA5A5;
  border: 1px solid #DC2626;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  margin-top: 4px;
}

.voip-cert-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}


