/* ══════════════════════════════════════════════════════════
   styles-v3.css  —  D4H RADV Coder v3 layout & design
══════════════════════════════════════════════════════════ */

/* ══════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════ */
.app-shell {
  display: flex;
  flex-direction: row;
  height: 100vh;
  overflow: hidden;
}

/* ══════════════════════════════════════════
   NAV TREE — left sidebar
══════════════════════════════════════════ */
.nav-tree {
  width: 220px;
  height: 100vh;
  background: #1E293B;
  color: #CBD5E1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width .2s ease;
  z-index: 10;
}

.nav-tree.collapsed {
  width: 60px;
}

/* Keep the home logo accessible below the toggle while the content is collapsed. */
.nav-tree.collapsed .nt-scroll,
.nav-tree.collapsed .nt-footer,
.nav-tree.collapsed .nt-root-label {
  display: none;
}

.nav-tree.collapsed .nt-topbar {
  height: 108px;
  border-bottom-color: transparent;
}

.nav-tree.collapsed .nt-title {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.nav-tree.collapsed .nt-toggle-btn {
  right: 13px;
  top: 12px;
  transform: none;
}

.nav-tree.collapsed .nt-brand-home {
  left: 50%;
  top: 62px;
  transform: translateX(-50%);
}

.nt-topbar {
  position: relative;
  height: 58px;
  border-bottom: 1px solid #334155;
  flex-shrink: 0;
  transition: height .2s ease, border-color .2s ease;
}

.nt-brand-home {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: left .2s ease, top .2s ease, transform .2s ease, background .12s ease;
}
.nt-brand-home:hover { background: rgba(255,255,255,0.08); }
.nt-brand-home:focus-visible { outline: 2px solid #93C5FD; outline-offset: 2px; }
.nt-brand-logo { display: block; height: 22px; width: auto; }

.nt-title {
  position: absolute;
  left: 58px;
  right: 58px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  font-weight: 700;
  color: #F1F5F9;
  cursor: default;
  white-space: nowrap;
  letter-spacing: -0.01em;
  transition: opacity .12s ease;
}

.nt-toggle-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #CBD5E1;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
  transition: right .2s ease, top .2s ease, transform .2s ease, color .12s, background .12s;
}
.nt-toggle-btn:hover { color: #FFFFFF; background: rgba(255,255,255,0.08); }

.nt-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0;
}
.nt-scroll::-webkit-scrollbar { width: 4px; }
.nt-scroll::-webkit-scrollbar-thumb { background: #334155; border-radius: 2px; }

.nt-root-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #475569;
  padding: 6px 14px 8px;
  cursor: pointer;
  white-space: nowrap;
}
.nt-root-label:hover { color: #94A3B8; }

.nt-empty {
  font-size: 12px;
  color: #475569;
  padding: 16px 14px;
  line-height: 1.6;
}
.nt-empty strong { color: #64748B; }

.nt-project {
  border-left: 2px solid transparent;
  transition: border-color .1s;
}
.nt-project--active { border-left-color: #2563EB; }

.nt-project-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  cursor: pointer;
}
.nt-project-row:hover { background: rgba(255,255,255,0.04); }

.nt-chevron {
  font-size: 8px;
  color: #475569;
  flex-shrink: 0;
  width: 12px;
  text-align: center;
  transition: color .1s;
  cursor: pointer;
}
.nt-project-row:hover .nt-chevron { color: #94A3B8; }

.nt-proj-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: #CBD5E1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  min-width: 0;
}
.nt-proj-name:hover { color: #F1F5F9; }

.nt-proj-type {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #334155;
  background: #0F172A;
  padding: 1px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}

.nt-project-children { padding-left: 22px; }

.nt-no-members {
  font-size: 11px;
  color: #334155;
  padding: 4px 8px;
  font-style: italic;
}

.nt-member {
  margin-bottom: 2px;
}

.nt-member-row {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 6px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .1s;
}
.nt-member-row:hover { background: rgba(255,255,255,0.05); }

.nt-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #1D4ED8;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.nt-member-name {
  font-size: 12px;
  color: #94A3B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nt-charts { padding-left: 27px; }

.nt-chart {
  font-size: 11px;
  color: #475569;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background .1s, color .1s;
  white-space: nowrap;
  min-width: 0;
}
.nt-chart-label {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; color: #FFFFFF;
}
.nt-chart:hover { background: rgba(255,255,255,0.06); color: #94A3B8; }
.nt-chart.nt-cur { color: #93C5FD; background: rgba(37,99,235,0.15); }

.nt-chart-icon { font-size: 10px; }
.nt-chart-icon.vi-pass  { color: #4ADE80; }
.nt-chart-icon.vi-fail  { color: #F87171; }
.nt-chart-icon.vi-mixed { color: #FBBF24; }

.nt-footer {
  padding: 10px 12px;
  border-top: 1px solid #1E293B;
  flex-shrink: 0;
}

.nt-create-btn {
  width: 100%;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid #334155;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap;
}
.nt-create-btn:hover {
  background: rgba(255,255,255,0.05);
  border-color: #475569;
  color: #94A3B8;
}

/* ══════════════════════════════════════════
   MAIN PANE
══════════════════════════════════════════ */
.main-pane {
  flex: 1;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* ══════════════════════════════════════════
   PROJECTS SCREEN
══════════════════════════════════════════ */
#projects-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #F1F5F9;
}

.ps-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 24px;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ps-hdr-title {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.02em;
}

.ps-btn-create {
  padding: 7px 16px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s;
  white-space: nowrap;
}
.ps-btn-create:hover { background: #1D4ED8; }

.ps-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ps-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  flex: 1;
  gap: 14px;
  text-align: center;
  color: #64748B;
}
.ps-empty-icon { font-size: 40px; }
.ps-empty p { font-size: 14px; margin: 0; }

/* breadcrumb */
.ps-breadcrumb {
  font-size: 11px;
  color: #94A3B8;
  margin-bottom: 1px;
}

/* search bar */
.ps-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px 10px;
  flex-shrink: 0;
  position: relative;
}
.ps-search-ico {
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
  color: #94A3B8;
  margin-top: 2px;
}
.ps-search-input {
  flex: 1;
  padding: 8px 14px 8px 34px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 13px;
  color: #334155;
  background: #fff;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.ps-search-input:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

/* card list */
.ps-card-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ps-proj-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s;
  flex-shrink: 0;
}
.ps-proj-card:hover {
  border-color: #93C5FD;
  box-shadow: 0 2px 10px rgba(37,99,235,.08);
}

.ps-card-body {
  display: flex;
  align-items: stretch;
  padding: 16px 20px;
  gap: 0;
  height: 118px;
  box-sizing: border-box;
}

.ps-card-left {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ps-card-title-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
}
.ps-card-name {
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
}
.ps-tag-py  { background: #DBEAFE; color: #1D4ED8; }
.ps-tag-v28 { background: #DCFCE7; color: #15803D; }

.ps-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: #64748B;
  max-height: 40px;
  overflow: hidden;
}
.ps-meta-item { display: flex; align-items: center; gap: 5px; }
.ps-meta-ico  { font-size: 13px; line-height: 1; }
.ps-type-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: #F1F5F9;
  color: #64748B;
  padding: 2px 6px;
  border-radius: 4px;
}

/* progress side panel */
.ps-card-export {
  width: 108px;
  flex: 0 0 108px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  border-left: 1px solid #F1F5F9;
  padding: 2px 0 0 18px;
  margin-left: 18px;
}
.ps-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 82px;
  padding: 7px 10px;
  border: 1px solid #BFDBFE;
  border-radius: 7px;
  background: #EFF6FF;
  color: #1D4ED8;
  font: 700 12px/1 inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
}
.ps-export-btn:hover,
.ps-export-btn:focus-visible {
  background: #DBEAFE;
  border-color: #60A5FA;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  outline: none;
}
.ps-card-export--empty { visibility: hidden; }

.ps-card-right {
  width: 190px;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-left: 1px solid #F1F5F9;
  padding-left: 18px;
  margin-left: 18px;
  justify-content: center;
}
.ps-prog-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.ps-prog-pct { color: #2563EB; }
.ps-prog-bar {
  height: 6px;
  background: #E2E8F0;
  border-radius: 3px;
  overflow: hidden;
}
.ps-prog-fill {
  height: 100%;
  background: #2563EB;
  border-radius: 3px;
  transition: width .4s ease;
}
.ps-status-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: #64748B;
  font-variant-numeric: tabular-nums;
}
.ps-status-list span { display: flex; align-items: center; gap: 5px; }
.ps-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ps-dot-pending   { background: #F59E0B; }
.ps-dot-inprog    { background: #3B82F6; }
.ps-dot-submitted { background: #22C55E; }
.ps-dot-blocked   { background: #EF4444; }

/* action buttons */
.ps-card-actions {
  width: 34px;
  flex: 0 0 34px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-left: 10px;
  justify-content: center;
  opacity: .28;
  transition: opacity .15s;
}
.ps-card-actions--empty { visibility: hidden; }
.ps-proj-card:hover .ps-card-actions,
.ps-card-actions:focus-within { opacity: 1; }
.ps-act-btn {
  background: none;
  border: none;
  font-size: 15px;
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  color: #94A3B8;
  transition: background .12s, color .12s;
}
.ps-act-delete:hover { background: #FEE2E2; color: #DC2626; }

/* Compact project/member overflow menus. Destructive choices stay behind an
   explicit ellipsis and the browser confirmation in app-v3.js. */
.entity-menu { position: relative; flex-shrink: 0; }
.entity-menu[open] { z-index: 30; }
.entity-menu-trigger {
  width: 28px;
  height: 28px;
  border: 1px solid transparent;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748B;
  font: 700 19px/1 system-ui, sans-serif;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.entity-menu-trigger::-webkit-details-marker { display: none; }
.entity-menu-trigger:hover,
.entity-menu-trigger:focus-visible,
.entity-menu[open] > .entity-menu-trigger {
  background: #F1F5F9;
  border-color: #E2E8F0;
  color: #334155;
  outline: none;
}
.entity-menu-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 150px;
  padding: 5px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
}
.entity-menu-action {
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
  font: 600 12px/1.2 inherit;
  cursor: pointer;
}
.entity-menu-delete { color: #B91C1C; }
.entity-menu-delete:hover,
.entity-menu-delete:focus-visible { background: #FEF2F2; color: #991B1B; outline: none; }
.entity-menu-action:disabled { opacity: .55; cursor: wait; }

/* ══════════════════════════════════════════
   PROJECT DETAIL
══════════════════════════════════════════ */
#project-detail {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #F1F5F9;
}

.pd-hdr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px 11px 16px;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.pd-btn-back {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid #E2E8F0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.pd-btn-back:hover { background: #F8FAFC; border-color: #CBD5E1; }

.pd-hdr-center { flex: 1; min-width: 0; }

.pd-hdr-name {
  font-size: 14px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-hdr-meta {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pd-btn-upload {
  padding: 6px 16px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s;
  white-space: nowrap;
  flex-shrink: 0;
}
.pd-btn-upload:hover { background: #1D4ED8; }

.pd-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.pd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  gap: 12px;
  text-align: center;
}
.pd-empty-icon { font-size: 36px; }
.pd-empty p { font-size: 14px; color: #64748B; line-height: 1.6; margin: 0; }

.pd-members { display: flex; flex-direction: column; gap: 14px; max-width: 840px; }

.pd-member-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pd-member-card.is-focused {
  border-color: #60A5FA;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}
.pd-member-card:focus-visible { outline: 2px solid #2563EB; outline-offset: 3px; }

.pd-member-top { display: flex; align-items: center; gap: 12px; }
.pd-member-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.pd-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #EFF6FF; color: #2563EB;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.pd-member-info { flex: 1; min-width: 0; }
.pd-member-name { font-size: 14px; font-weight: 700; color: #0F172A; letter-spacing: -0.01em; }
.pd-member-meta { font-size: 12px; color: #64748B; margin-top: 2px; }

.pd-member-upload {
  padding: 6px 12px;
  border: 1px solid #BFDBFE;
  border-radius: 7px;
  background: #EFF6FF;
  color: #1D4ED8;
  font: 600 12px/1.2 inherit;
  cursor: pointer;
  white-space: nowrap;
}
.pd-member-upload:hover { background: #DBEAFE; border-color: #93C5FD; }
.cp-btn-create:disabled { opacity: .55; cursor: wait; }

.pd-target-hccs {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.pd-target-label {
  font-size: 10px; font-weight: 600; color: #94A3B8;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.pd-hcc-chip {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  background: #FEF3C7; color: #92400E; cursor: default;
}
.pd-hcc-chip:hover { background: #FDE68A; }

.pd-chart-list {
  display: flex; flex-direction: column; gap: 5px;
  border-top: 1px solid #F1F5F9; padding-top: 12px;
}
.pd-chart-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 7px;
  background: #F8FAFC; cursor: pointer;
  transition: background .12s;
}
.pd-chart-row:hover { background: #EFF6FF; }
.pd-chart-row--stored { cursor: default; }
.pd-chart-row--stored:hover { background: #F8FAFC; }

.pd-chart-identity { display: flex; flex-direction: column; gap: 2px; min-width: 150px; }
.pd-chart-name { color: #0F172A; font-size: 12px; font-weight: 700; }
.pd-chart-dates { color: #64748B; font-size: 10.5px; white-space: nowrap; }
.pd-chart-hccs { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.pd-chart-open-btn { font-size: 12px; font-weight: 600; color: #2563EB; white-space: nowrap; margin-left: auto; }
.pd-chart-storage-only { color: #64748B; }

.pd-no-chart {
  font-size: 12px; color: #94A3B8; padding: 10px 12px;
  border-radius: 7px; background: #F8FAFC;
  border: 1px dashed #E2E8F0;
}

/* ══════════════════════════════════════════
   LANDING — dashboard
══════════════════════════════════════════ */
#landing {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: #F1F5F9;
}

.ld-hdr {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 28px;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ld-hdr-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.02em;
}

.ld-hdr-meta {
  font-size: 11px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ld-btn-upload {
  padding: 7px 18px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.01em;
  transition: background .14s;
  white-space: nowrap;
}
.ld-btn-upload:hover { background: #1D4ED8; }

.ld-body {
  flex: 1;
  padding: 22px 28px 32px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

/* ── KPI cards ─────────────────────── */
.ld-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.ld-kpi {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition: box-shadow .15s;
}
.ld-kpi:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.07); }
.ld-kpi.green { border-color: #86EFAC; background: linear-gradient(145deg,#F0FDF4,#DCFCE7 80%); }
.ld-kpi.blue  { border-color: rgba(37,99,235,.22); background: linear-gradient(145deg,#EFF6FF,#DBEAFE 80%); }
.ld-kpi-icon { font-size: 16px; line-height: 1; }
.ld-kpi-val  { font-size: 30px; font-weight: 800; letter-spacing: -0.05em; color: #0F172A; line-height: 1.1; }
.ld-kpi-lbl  { font-size: 10.5px; font-weight: 600; color: #64748B; text-transform: uppercase; letter-spacing: 0.4px; }
.ld-kpi.green .ld-kpi-val { color: #16A34A; }
.ld-kpi.blue  .ld-kpi-val { color: #2563EB; }

/* ── Chart row ─────────────────────── */
.ld-charts-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.ld-chart-card {
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.ld-chart-title {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ld-chart-wrap { display: flex; justify-content: center; max-height: 145px; }
.ld-chart-legend { display: flex; flex-direction: column; gap: 4px; }
.ld-legend-item { display: flex; align-items: center; gap: 6px; }
.ld-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.ld-legend-lbl { font-size: 11px; color: #64748B; flex: 1; }
.ld-legend-val { font-size: 12px; font-weight: 700; color: #0F172A; }

/* ── List section ─────────────────── */
.ld-list-section { margin-bottom: 20px; }

.ld-list-hdr {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}

.ld-list-title {
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.01em;
}

.ld-list-count {
  background: #2563EB;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.ld-table-wrap {
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  overflow: hidden;
  overflow-x: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.ld-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  background: #fff;
}

.ld-table thead tr {
  background: #F8FAFC;
  border-bottom: 1px solid #E2E8F0;
}

.ld-table th {
  padding: 9px 14px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #64748B;
  white-space: nowrap;
}

.ld-table tbody tr { border-bottom: 1px solid #E2E8F0; }
.ld-table tbody tr:last-child { border-bottom: none; }
.ld-table tbody tr:hover { background: #F8FAFC; }
.ld-table td { padding: 10px 14px; vertical-align: middle; }

.ld-verdict-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.ld-verdict-pill.pass  { background: #DCFCE7; color: #16A34A; border: 1px solid #86EFAC; }
.ld-verdict-pill.fail  { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.ld-verdict-pill.mixed { background: #FEF3C7; color: #B45309; border: 1px solid #FCD34D; }
.ld-verdict-pill.stored { background: #E0F2FE; color: #0369A1; border: 1px solid #7DD3FC; }

.ld-pt-name { font-size: 13px; font-weight: 700; color: #0F172A; line-height: 1.3; }
.ld-pt-id   { font-size: 10.5px; color: #94A3B8; margin-top: 1px; }
.ld-document-name { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 700; color: #0F172A; }
.ld-document-id { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; color: #94A3B8; font: 500 9.5px/1.3 'JetBrains Mono', monospace; }

.document-name-edit {
  border: 0; padding: 0; background: transparent; color: inherit;
  font: inherit; text-align: left; cursor: text;
}
.document-name-edit:hover { color: #2563EB; text-decoration: underline; text-underline-offset: 2px; }
.document-name-edit:focus-visible { outline: 2px solid #93C5FD; outline-offset: 2px; border-radius: 3px; }
.document-name-editing {
  min-width: 90px; padding: 2px 5px; background: #fff; color: #0F172A;
  border: 1px solid #2563EB; border-radius: 4px; outline: 3px solid rgba(37,99,235,.12);
  text-decoration: none !important;
}
.document-name-saving { opacity: .6; cursor: wait; }

.ld-cell-muted { font-size: 12px; color: #64748B; white-space: nowrap; }

/* Document type chips */
.ld-doc-types { display: flex; gap: 4px; flex-wrap: wrap; }

/* HCC code tags in dashboard table */
.ld-hcc-codes { display: flex; gap: 3px; flex-wrap: wrap; }
.ld-hcc-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

.ld-doc-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}
.ld-doc-pill.ok  { background: #DCFCE7; color: #15803D; border: 1px solid #86EFAC; }
.ld-doc-pill.bad { background: #FEE2E2; color: #B91C1C; border: 1px solid #FECACA; }

.ld-doc-none { font-size: 11.5px; color: #94A3B8; }

/* Action column */
.ld-action-cell { display: flex; gap: 5px; white-space: nowrap; }

.ld-open-btn {
  padding: 5px 14px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.ld-open-btn:hover { background: #1D4ED8; }

.ld-remove-btn {
  background: none;
  border: 1px solid #E2E8F0;
  color: #94A3B8;
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all .12s;
  font-family: inherit;
}
.ld-remove-btn:hover { color: #DC2626; background: #FEF2F2; border-color: #FECACA; }

/* Storage note */
.ld-storage-note {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 12px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
}

/* Empty state */
.ld-empty {
  text-align: center;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.ld-empty-icon  { font-size: 44px; opacity: .28; }
.ld-empty-title { font-size: 16px; font-weight: 700; color: #0F172A; margin: 0; }
.ld-empty-sub   { font-size: 13px; color: #64748B; margin: 0 0 8px; }

/* ══════════════════════════════════════
   BACK BUTTON  (review header)
══════════════════════════════════════ */
.btn-back-dash {
  padding: 5px 12px;
  background: transparent;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all .12s;
  flex-shrink: 0;
}
.btn-back-dash:hover { background: #F1F5F9; color: #0F172A; }

/* ══════════════════════════════════════
   PDF no-file placeholder
══════════════════════════════════════ */
.pdf-no-file {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 300px;
  gap: 10px;
  padding: 40px 24px;
  text-align: center;
}
.pdf-no-file-icon  { font-size: 44px; opacity: .25; }
.pdf-no-file-title { font-size: 15px; font-weight: 700; color: #0F172A; margin: 0; }
.pdf-no-file-sub   { font-size: 12.5px; color: #64748B; margin: 0; max-width: 280px; line-height: 1.5; }
.pdf-no-file-btn {
  margin-top: 6px;
  display: inline-block;
  padding: 8px 20px;
  background: #2563EB;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
.pdf-no-file-btn:hover { background: #1D4ED8; }

/* Generic document viewer adapters */
.document-viewer-placeholder {
  width: min(420px, calc(100% - 40px));
  height: auto;
  min-height: 240px;
  margin: auto;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 6px 32px rgba(0,0,0,.28);
}

.document-text-surface {
  width: min(900px, calc(100% - 12px));
  min-height: 100%;
  padding: 26px 0;
  background: #fff;
  color: #172033;
  box-shadow: 0 6px 32px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.18);
  font-family: 'JetBrains Mono', Consolas, monospace;
  line-height: 1.55;
  box-sizing: border-box;
}

.document-text-line {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  min-height: 1.55em;
  padding: 0 24px 0 0;
  border-left: 3px solid transparent;
  transition: background .12s, border-color .12s;
  cursor: pointer;
}

.document-text-line:hover { background: rgba(37,99,235,.05); }

.document-text-line-number {
  padding-right: 14px;
  color: #94A3B8;
  text-align: right;
  user-select: none;
}

.document-text-line-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.document-text-line.is-evidence {
  border-left-color: #EAB308;
  background: rgba(250,204,21,.28);
}

.document-text-line.is-note-reference {
  border-left-color: #2563EB;
  background: rgba(37,99,235,.12);
  cursor: pointer;
}

.document-text-line.is-evidence.is-note-reference {
  background: linear-gradient(rgba(37,99,235,.12), rgba(37,99,235,.12)), rgba(250,204,21,.28);
}

.document-preview-truncated {
  margin: 20px 24px 0 54px;
  padding: 10px 12px;
  border: 1px solid #FDE68A;
  border-radius: 6px;
  background: #FFFBEB;
  color: #92400E;
  font: 600 11px/1.4 Inter, sans-serif;
}

.document-image-stage {
  position: relative;
  flex: 0 0 auto;
  padding: 8px;
  background: #fff;
  box-shadow: 0 6px 32px rgba(0,0,0,.35), 0 2px 6px rgba(0,0,0,.18);
  transition: box-shadow .15s;
}

.document-image-stage.has-selected-evidence {
  box-shadow: 0 0 0 3px rgba(234,179,8,.7), 0 6px 32px rgba(0,0,0,.35);
}

.document-image-preview {
  display: block;
  max-width: none;
  user-select: none;
}

/* ══════════════════════════════════════════════════════════
   v3 RIGHT PANEL  — full-height accordion bodies with docked section tabs
══════════════════════════════════════════════════════════ */

.v3-panel {
  flex: 1 1 0;
  min-width: 260px;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
  background-color: #F8FAFC;
  background-image:
    radial-gradient(circle at 50% 82%, rgba(59, 130, 246, .15) 0%, rgba(96, 165, 250, .06) 30%, transparent 62%),
    radial-gradient(circle, rgba(71, 85, 105, .22) 1px, transparent 1.15px);
  background-size: 100% 100%, 20px 20px;
  background-position: center, 0 0;
  background-repeat: no-repeat, repeat;
  border-left: 1px solid #E2E8F0;
}
.v3-panel::-webkit-scrollbar { width: 6px; }
.v3-panel::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }

/* ── Resize handle ── */
.panel-resize {
  flex: 0 0 6px;
  background: #E2E8F0;
  cursor: col-resize;
  position: relative;
  transition: background .15s;
  z-index: 10;
}
.panel-resize:hover,
.panel-resize.prs-dragging { background: #3B82F6; }
.panel-resize::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 2px; height: 24px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
}

/* ── Each section ── */
.v3-sec {
  display: contents;
}

/* The last (or only) open body fills the usable pane. Earlier open bodies use
   their full natural content height so opening a lower section never traps
   them inside a second, fixed-height scrolling region. */

/* ── Section header ── */
.v3-sec-hdr {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  position: sticky;
  z-index: 20;
  background: #123B63;
  cursor: pointer;
  user-select: none;
  transition: background .16s, box-shadow .18s, border-color .16s;
  min-height: 48px;
  border-bottom: 1px solid #0A2947;
}
#v3-sec-coding .v3-sec-hdr { top: 0; bottom: 0; }
.v3-sec-hdr:hover { background: #184D7C; }

/* Active header gets a luminous blue halation without changing its size. */
.v3-sec.active .v3-sec-hdr {
  z-index: 24;
  background: #174F83;
  border-left: 3px solid #93C5FD;
  padding-left: 13px;
  box-shadow:
    inset 0 0 22px rgba(96, 165, 250, .48),
    inset 0 1px 0 rgba(255, 255, 255, .18),
    0 0 14px rgba(59, 130, 246, .65);
}

.v3-sec-title {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

.v3-sec.active .v3-sec-title {
  color: #FFFFFF;
  text-shadow: 0 0 8px rgba(191, 219, 254, .75);
}

.v3-sec-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 11px;
  color: #DBEAFE;
  overflow: hidden;
}

.v3-sec-chev {
  font-size: 9px;
  color: rgba(255, 255, 255, .8);
  flex-shrink: 0;
  margin-left: auto;
}
.v3-sec.active .v3-sec-chev { color: #FFFFFF; }

/* ── Section body ── */
.v3-sec-body {
  display: none;           /* hidden when collapsed */
  flex: 1 0 auto;
  min-height: 0;
  overflow: visible;
  flex-direction: column;
}

.v3-sec.active .v3-sec-body {
  display: flex;
  min-height: calc(100% - 48px);
  border-bottom: 1px solid #E2E8F0;
}

.v3-sec.active.has-open-section-after .v3-sec-body {
  min-height: 0;
}

/* ── Verdict pill ── */
.v3-verdict-pill {
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}
.v3-verdict-pill.pass  { background: #DCFCE7; color: #16A34A; }
.v3-verdict-pill.fail  { background: #FEE2E2; color: #DC2626; }
.v3-verdict-pill.mixed { background: #FEF3C7; color: #B45309; }

/* Count badges in Insights header */
.v3-cnt-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.v3-cnt-badge.error { background: #FEE2E2; color: #B91C1C; }
.v3-cnt-badge.warn  { background: #FEF3C7; color: #A16207; }

/* HCC tags + code count in Coding header */
.v3-hcc-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  flex-shrink: 0;
}
.v3-code-cnt {
  font-size: 10.5px;
  color: #DBEAFE;
  font-weight: 500;
  flex-shrink: 0;
}
.hcc-unlock-panel {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 62px;
  padding: 13px 16px;
  border-top: 2px solid #CBD5E1;
  border-bottom: 1px solid #E2E8F0;
  background: #F1F5F9;
}
.hcc-unlock-panel-label {
  flex: 1;
  min-width: 0;
  color: #0F172A;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.hcc-unlock-all-slot {
  position: relative;
  flex: 0 0 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hcc-unlock-note-spacer { flex: 0 0 34px; width: 34px; }
.hcc-unlock-all {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  padding: 8px 14px;
  border: 1px solid #16A34A;
  border-radius: 999px;
  background: #16A34A;
  color: #FFFFFF;
  cursor: pointer;
  font: 700 12px/1.2 'Inter', system-ui, sans-serif;
  white-space: nowrap;
  box-shadow: 0 2px 7px rgba(22, 163, 74, .24);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.hcc-unlock-all:hover { background: #15803D; border-color: #15803D; box-shadow: 0 3px 9px rgba(22, 163, 74, .30); }

/* ── Filter bar inside Coding body ── */
.v3-filter-bar {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #E2E8F0;
  background: #FAFBFC;
  flex-shrink: 0;
}
.v3-filter-bar .filter-tabs { padding: 7px 12px 5px; border-bottom: 1px solid #E2E8F0; }
.v3-filter-bar .gi-filter   { padding: 5px 12px 6px; }

/* Code list inside coding section body — no own scroll (parent scrolls) */
.v3-sec-body .code-list {
  flex: 1;
  overflow-y: visible;
  max-height: none;
  padding: 0;
  border: none;
}

/* ══ Chart Insights checklist ══ */
:is(.v3-sec-body, .doc-insights-pop) .dab-checklist { display: flex; flex-direction: column; }

:is(.v3-sec-body, .doc-insights-pop) .dab-check-hdr {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748B;
  padding: 9px 16px 4px;
  flex-shrink: 0;
}

:is(.v3-sec-body, .doc-insights-pop) .dab-check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid #F1F5F9;
  transition: background .1s;
}
:is(.v3-sec-body, .doc-insights-pop) .dab-check-row:last-child { border-bottom: none; }
:is(.v3-sec-body, .doc-insights-pop) .dab-check-row:hover { background: #F9FAFB; }
:is(.v3-sec-body, .doc-insights-pop) .dab-check-row.pass { background: #FAFFFE; }
:is(.v3-sec-body, .doc-insights-pop) .dab-check-row.fail { background: #FFF9F9; }
:is(.v3-sec-body, .doc-insights-pop) .dab-check-row.warn { background: #FFFDF6; }

:is(.v3-sec-body, .doc-insights-pop) .dab-ci-icon {
  font-size: 11px;
  font-weight: 800;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  margin-top: 2px;
}
:is(.v3-sec-body, .doc-insights-pop) .dab-check-row.pass .dab-ci-icon { color: #16A34A; }
:is(.v3-sec-body, .doc-insights-pop) .dab-check-row.fail .dab-ci-icon { color: #DC2626; }
:is(.v3-sec-body, .doc-insights-pop) .dab-check-row.warn .dab-ci-icon { color: #B45309; }

:is(.v3-sec-body, .doc-insights-pop) .dab-ci-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
:is(.v3-sec-body, .doc-insights-pop) .dab-ci-label { font-size: 12px; color: #0F172A; font-weight: 500; line-height: 1.4; }
:is(.v3-sec-body, .doc-insights-pop) .dab-ci-note  { font-size: 10.5px; color: #64748B; line-height: 1.35; }

/* ══ Summary content ══ */
.sum-body { display: flex; flex-direction: column; }

.sum-sec {
  padding: 12px 16px;
  border-bottom: 1px solid #E2E8F0;
}
.sum-sec:last-child { border-bottom: none; }

.sum-sec-title {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #64748B;
  margin-bottom: 9px;
}

.sum-insight-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.sum-insight-text { font-size: 11.5px; color: #64748B; line-height: 1.5; flex: 1; }
.sum-provider-line { font-size: 11.5px; margin-top: 2px; }
.sum-prov-ok   { color: #16A34A; font-weight: 600; }
.sum-prov-fail { color: #DC2626; font-weight: 600; }
.sum-prov-warn { color: #B45309; font-weight: 600; }

.sum-risk-txt { font-size: 11.5px; color: #64748B; line-height: 1.65; margin: 0; }
/* CMS-HCC V24/V28 comparison */
.model-compare-option {
  width: 100%; max-width: 600px; margin: 18px 0 0; padding: 13px 15px;
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  background: rgba(255,255,255,.88); border: 1px solid #DBEAFE; border-radius: 11px;
  box-shadow: 0 1px 4px rgba(15,23,42,.05); cursor: pointer;
}
.model-compare-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.model-compare-title { color: #1E3A8A; font-size: 12.5px; font-weight: 750; }
.model-compare-sub { color: #64748B; font-size: 10.5px; line-height: 1.4; }
.model-switch { position: relative; width: 42px; height: 24px; flex: 0 0 42px; }
.model-switch input { position: absolute; opacity: 0; pointer-events: none; }
.model-switch-track {
  position: absolute; inset: 0; border-radius: 99px; background: #CBD5E1;
  transition: background .18s; box-shadow: inset 0 0 0 1px rgba(15,23,42,.08);
}
.model-switch-track::after {
  content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(15,23,42,.25);
  transition: transform .18s;
}
.model-switch input:checked + .model-switch-track { background: #2563EB; }
.model-switch input:checked + .model-switch-track::after { transform: translateX(18px); }
.model-switch input:focus-visible + .model-switch-track { outline: 3px solid rgba(37,99,235,.22); outline-offset: 2px; }

.model-compare-badge {
  font-size: 9px; font-weight: 750; padding: 2px 7px; border-radius: 20px;
  background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE;
}
.model-delta { margin-left: 4px; font-size: 10px; font-weight: 800; }
.model-delta.up { color: #15803D; }
.model-delta.down { color: #B91C1C; }
.model-delta.flat { color: #64748B; }
.exp-tog--model { color: #1E40AF; background: #F8FAFF; }
.exp-body--model { background: #F8FAFF; border-top: 1px dashed #BFDBFE; }
.model-compare-body { padding: 10px 12px 12px; }
.model-pair { display: grid; grid-template-columns: minmax(0,1fr) 20px minmax(0,1fr); gap: 7px; align-items: stretch; }
.model-box { border: 1px solid #DBEAFE; border-radius: 8px; background: #fff; padding: 8px; min-width: 0; }
.model-box-version { font-size: 9px; font-weight: 800; color: #64748B; text-transform: uppercase; letter-spacing: .45px; }
.model-box-hcc { display: block; margin-top: 3px; font-size: 12px; font-weight: 800; color: #0F172A; }
.model-box-label { display: block; margin-top: 2px; font-size: 9.5px; line-height: 1.3; color: #64748B; }
.model-box-coef { display: block; margin-top: 6px; font: 700 11px/1 'JetBrains Mono', monospace; color: #1D4ED8; }
.model-pair-arrow {
  display: flex; align-items: center; justify-content: center; align-self: center;
  width: 28px; height: 28px; margin-left: -4px; border: 1px solid #BFDBFE; border-radius: 50%;
  background: #EFF6FF; color: #2563EB; font: 800 16px/1 sans-serif; cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.model-pair-arrow:hover { background: #DBEAFE; border-color: #93C5FD; color: #1D4ED8; }
.model-pair-arrow:focus-visible { outline: 3px solid rgba(37,99,235,.24); outline-offset: 2px; }
.model-explanation { margin-top: 9px; color: #334155; font-size: 10.5px; line-height: 1.45; }
.model-explanation + .model-explanation { margin-top: 4px; }
.model-mismatch { margin-top: 8px; padding: 7px 8px; border-radius: 6px; background: #FEF2F2; color: #991B1B; font-size: 10px; line-height: 1.4; }
.model-caveat { margin-top: 8px; color: #64748B; font-size: 9px; line-height: 1.4; }

.sum-model-card { margin-top: 10px; padding: 10px; border: 1px solid #BFDBFE; border-radius: 9px; background: #F8FAFF; }
.sum-model-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.sum-model-stat { display: flex; flex-direction: column; gap: 3px; }
.sum-model-stat:last-child { text-align: right; }
.sum-model-label { font-size: 9px; font-weight: 800; letter-spacing: .4px; color: #64748B; text-transform: uppercase; }
.sum-model-value { font: 800 15px/1.2 'JetBrains Mono', monospace; color: #1E3A8A; }
.sum-model-shift { font-size: 11px; font-weight: 800; }
.sum-model-note { margin-top: 8px; color: #475569; font-size: 9.5px; line-height: 1.4; }

@media (max-width: 620px) {
  .model-compare-option { max-width: 504px; }
  .model-pair { grid-template-columns: 1fr; }
  .model-pair-arrow { justify-self: center; margin: -2px 0; }
}

/* ══════════════════════════════════════════
   CLAUDE API — upload screen additions
══════════════════════════════════════════ */
.upload-top-bar {
  width: 100%;
  max-width: 600px;
  padding: 0 2px 4px;
}

.btn-back-upload {
  background: transparent;
  border: 1px solid #CBD5E1;
  border-radius: 7px;
  padding: 5px 13px;
  font-size: 12px;
  font-weight: 500;
  color: #64748B;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-back-upload:hover { background: #F1F5F9; color: #1E293B; }

.upload-zone-row--solo { justify-content: center; }
.upload-card--wide { max-width: 400px; width: 100%; }

.document-name-field {
  width: 100%; max-width: 400px; margin-top: 14px;
  display: flex; flex-direction: column; gap: 5px;
}
.document-name-label {
  color: #334155; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .35px;
}
.document-name-label span { color: #94A3B8; font-size: 9px; font-weight: 600; }
.document-name-input {
  width: 100%; height: 38px; box-sizing: border-box; padding: 0 12px;
  border: 1px solid #CBD5E1; border-radius: 8px; outline: none;
  background: #fff; color: #0F172A; font: 500 13px/1 inherit;
  transition: border-color .15s, box-shadow .15s;
}
.document-name-input:focus {
  border-color: #2563EB; box-shadow: 0 0 0 3px rgba(37,99,235,.11);
}
.document-name-hint { color: #94A3B8; font-size: 10.5px; line-height: 1.4; }

/* Claude overlay — full-screen loading state */
.claude-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.60);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  gap: 16px;
  backdrop-filter: blur(2px);
}

.claude-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: claude-spin 0.75s linear infinite;
}

@keyframes claude-spin { to { transform: rotate(360deg); } }

.claude-msg {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  max-width: 320px;
  line-height: 1.55;
  padding: 0 24px;
}

/* Claude error banner */
.claude-error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: 8px;
  color: #991B1B;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  max-width: 480px;
  width: 100%;
  margin-bottom: 6px;
  word-break: break-word;
}

/* ══════════════════════════════════════
   CREATE PROJECT MODAL
══════════════════════════════════════ */
.cp-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.cp-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}

.cp-dialog {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 28px 28px 24px;
  width: 420px;
  max-width: 94vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: cp-in .18s ease;
}

@keyframes cp-in {
  from { opacity: 0; transform: scale(.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)  translateY(0); }
}

.cp-dialog-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cp-dialog-title {
  font-size: 16px;
  font-weight: 700;
  color: #0F172A;
  letter-spacing: -0.02em;
}

.cp-close-btn {
  background: transparent;
  border: none;
  font-size: 14px;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 5px;
  line-height: 1;
  transition: background .1s, color .1s;
}
.cp-close-btn:hover { background: #F1F5F9; color: #475569; }

.cp-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cp-label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.cp-req { color: #EF4444; margin-left: 2px; }
.cp-opt { color: #94A3B8; font-weight: 400; }

.cp-input, .cp-select {
  padding: 9px 12px;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: #0F172A;
  background: #F8FAFC;
  outline: none;
  transition: border-color .12s, background .12s;
  width: 100%;
  box-sizing: border-box;
}
.cp-input:focus, .cp-select:focus {
  border-color: #2563EB;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.cp-error {
  font-size: 12px;
  color: #DC2626;
  background: #FEF2F2;
  border: 1px solid #FECACA;
  border-radius: 6px;
  padding: 8px 10px;
}

.cp-btns {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.cp-btn-cancel {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748B;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
.cp-btn-cancel:hover { background: #F8FAFC; color: #334155; }

.cp-btn-create {
  padding: 8px 22px;
  background: #2563EB;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: background .14s;
}
.cp-btn-create:hover { background: #1D4ED8; }

/* Reviewer-access messages remain noticeable without presenting the missing
   session identity as a dangerous or destructive error. */
.decision-auth-modal .cp-overlay {
  background: rgba(15, 23, 42, 0.55);
}

.decision-auth-dialog {
  width: 500px;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border: 1px solid #BFDBFE;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3), 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.decision-auth-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  padding: 22px 56px 20px 24px;
  background: #EFF6FF;
  border-bottom: 1px solid #DBEAFE;
}

.decision-auth-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2563EB;
  color: #FFFFFF;
}

.decision-auth-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.decision-auth-eyebrow {
  margin-bottom: 3px;
  color: #64748B;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decision-auth-heading h2 {
  margin: 0;
  color: #1E3A5F;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.decision-auth-x {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #475569;
  cursor: pointer;
}

.decision-auth-x:hover,
.decision-auth-x:focus-visible {
  background: #DBEAFE;
  outline: none;
}

.decision-auth-message {
  margin: 22px 24px 8px;
  color: #0F172A;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

.decision-auth-detail,
.decision-auth-guidance {
  margin: 0 24px;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.decision-auth-guidance {
  margin-top: 8px;
}

.decision-auth-actions {
  display: flex;
  justify-content: flex-end;
  padding: 20px 24px 24px;
}

.decision-auth-close {
  min-width: 104px;
  padding: 10px 20px;
  border: 0;
  border-radius: 8px;
  background: #2563EB;
  color: #FFFFFF;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.decision-auth-close:hover { background: #1D4ED8; }
.decision-auth-close:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.25); outline-offset: 2px; }

/* Human-readable project exports. The dialog reuses the project-modal shell
   while the two fixed format choices remain visually distinct. */
.project-export-dialog {
  width: 390px;
  gap: 14px;
}

.project-export-name {
  margin: -4px 0 2px;
  color: #475569;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.project-export-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.project-export-option {
  min-height: 92px;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  background: #F8FAFC;
  color: #0F172A;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 700 14px/1 inherit;
  cursor: pointer;
  transition: transform .12s, border-color .12s, background .12s, box-shadow .12s;
}

.project-export-option:hover,
.project-export-option:focus-visible {
  transform: translateY(-1px);
  border-color: #60A5FA;
  background: #EFF6FF;
  box-shadow: 0 6px 18px rgba(37,99,235,.12);
  outline: none;
}

.project-export-option:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

.project-export-format {
  min-width: 50px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #173B64;
  color: #fff;
  font: 800 11px/1 'JetBrains Mono', monospace;
  letter-spacing: .05em;
}

.project-export-option--excel .project-export-format { background: #15803D; }

.project-export-status {
  min-height: 18px;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 840px) {
  .ps-card-export { width: 92px; flex-basis: 92px; padding-left: 10px; margin-left: 10px; }
  .ps-card-right { width: 160px; padding-left: 12px; margin-left: 12px; }
}

/* ══ Document Insights button + popover (replaces Summary / Chart Insights sections) ══ */
#v3-sec-coding .v3-sec-hdr { cursor: default; }
.doc-insights-btn {
  margin-left: auto; height: 28px; padding: 0 10px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #EEF2FF; border: 1px solid #C7D2FE; border-radius: 99px;
  color: #4338CA; font-family: inherit; font-size: 11px; font-weight: 700; line-height: 1;
  cursor: pointer; white-space: nowrap; transition: background .13s, border-color .13s;
}
.doc-insights-btn:hover { background: #E0E7FF; border-color: #A5B4FC; }
.doc-insights-btn[aria-expanded="true"] { background: #E0E7FF; border-color: #818CF8; }
.doc-insights-btn .v3-verdict-pill { font-size: 8.5px; padding: 1px 6px; }
.doc-insights-btn + .audit-notes-toggle { margin-left: 0; }

.doc-insights-pop {
  position: absolute; z-index: 13; top: 48px; right: 14px;
  width: min(400px, calc(100% - 28px)); max-height: calc(100% - 62px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid #C7D2FE; border-radius: 9px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
}
.doc-insights-pop[hidden] { display: none; }
.doc-insights-hdr {
  display: flex; align-items: center; gap: 6px; padding: 9px 10px 9px 14px;
  background: #EEF2FF; border-bottom: 1px solid #E0E7FF;
}
.doc-insights-title { font-size: 12px; font-weight: 700; color: #3730A3; margin-right: auto; }
.doc-insights-scroll { overflow-y: auto; min-height: 0; }
.doc-insights-sub {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: #4338CA; padding: 10px 16px 2px; border-top: 1px solid #E2E8F0;
}
.doc-insights-empty { font-size: 11.5px; color: #64748B; padding: 10px 16px 12px; }

/* ══ Code view bar: Encounters / By HCC / By ICD + list/grid ══ */
.code-view-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px 7px; border-bottom: 1px solid #E2E8F0; background: #FFFFFF;
  position: sticky; top: 48px; z-index: 18; flex-shrink: 0;
}
.code-view-seg, .code-layout-seg {
  display: inline-flex; padding: 2px; gap: 2px;
  background: #F1F5F9; border: 1px solid #E2E8F0; border-radius: 8px;
}
.cv-btn, .cl-btn {
  border: 0; background: transparent; color: #64748B; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 600; line-height: 1; border-radius: 6px;
  transition: background .12s, color .12s, box-shadow .12s;
}
.cv-btn { padding: 6px 10px; }
.cl-btn { width: 28px; height: 24px; display: inline-flex; align-items: center; justify-content: center; }
.cv-btn:hover, .cl-btn:hover { color: #0F172A; }
.cv-btn.active, .cl-btn.active {
  background: #FFFFFF; color: #123B63; box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

/* Claims are a member-scoped, post-inference comparison layer. */
.claims-view { display: grid; gap: 12px; padding-bottom: 18px; }
.claims-upload-panel { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 13px; border: 1px solid #BFDBFE; border-radius: 10px; background: #EFF6FF; }
.claims-upload-panel > div:first-child { display: grid; gap: 3px; }
.claims-upload-panel span { color: #475569; font-size: 11px; line-height: 1.4; }
.claims-upload-button, .claims-member-choice button { cursor: pointer; border: 0; border-radius: 7px; padding: 8px 11px; background: #1D4ED8; color: #fff; font-size: 11px; font-weight: 700; }
.claims-upload-message { grid-column: 1 / -1; min-height: 14px; color: #334155; font-size: 11px; }
.claims-member-choice { display: flex; align-items: end; gap: 10px; padding: 12px; border: 1px solid #F59E0B; border-radius: 9px; background: #FFFBEB; }
.claims-member-choice label { display: grid; flex: 1; gap: 5px; color: #78350F; font-size: 11px; font-weight: 700; }
.claims-member-choice select { width: 100%; padding: 7px; border: 1px solid #D97706; border-radius: 6px; background: #fff; }
.claims-column-mapping { display: grid; gap: 10px; padding: 12px; border: 1px solid #60A5FA; border-radius: 9px; background: #F8FBFF; }
.claims-column-mapping > div:first-child { display: grid; gap: 3px; color: #123B63; font-size: 11px; }
.claims-column-mapping > div:first-child span { color: #475569; font-weight: 400; }
.claims-column-mapping-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 8px; }
.claims-column-mapping-grid label { display: grid; gap: 4px; color: #334155; font-size: 10px; font-weight: 700; }
.claims-column-mapping-grid select { min-width: 0; width: 100%; padding: 6px; border: 1px solid #CBD5E1; border-radius: 6px; background: #fff; color: #0F172A; font-size: 10px; }
.claims-column-mapping > button { justify-self: end; cursor: pointer; border: 0; border-radius: 7px; padding: 8px 11px; background: #1D4ED8; color: #fff; font-size: 11px; font-weight: 700; }
.claims-import-list { display: grid; gap: 6px; }
.claims-import-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border: 1px solid #CBD5E1; border-radius: 8px; background: #fff; }
.claims-import-item span { display: grid; gap: 2px; color: #0F172A; font-size: 11px; }
.claims-import-item small { color: #64748B; }
.claims-import-item button { cursor: pointer; border: 0; background: transparent; color: #64748B; font-size: 10px; }
.claims-import-item button:hover { color: #B91C1C; }
.claims-scope { padding: 8px 10px; border-radius: 7px; background: #E2E8F0; color: #334155; font-size: 11px; }
.claims-section { overflow: hidden; border: 1px solid #CBD5E1; border-radius: 10px; background: #fff; }
.claims-section-heading { display: grid; grid-template-columns: auto auto 1fr; gap: 7px; align-items: baseline; padding: 9px 11px; background: #E8EEF6; color: #0F2745; }
.claims-section-heading strong { font-size: 12px; }
.claims-section-heading > span { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: #C7D2FE; text-align: center; font-size: 10px; }
.claims-section-heading small { color: #64748B; font-weight: 400; }
.claims-row { display: grid; grid-template-columns: auto auto minmax(120px, 1fr); gap: 7px 9px; align-items: center; width: 100%; padding: 9px 11px; border: 0; border-top: 1px solid #E2E8F0; background: #fff; color: #0F172A; text-align: left; }
.claims-row-button { cursor: pointer; }
.claims-row-button:hover { background: #F8FAFC; }
.claims-row-code { color: #0F2745; font-size: 12px; font-weight: 800; }
.claims-row-description { min-width: 0; font-size: 11px; }
.claims-row-related { grid-column: 2 / -1; color: #64748B; font-size: 10px; }
.claims-line-list { grid-column: 2 / -1; display: grid; gap: 6px; }
.claims-line-detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; padding: 7px 8px; border: 1px solid #E2E8F0; border-radius: 7px; background: #F8FAFC; color: #475569; font-size: 9.5px; font-weight: 400; }
.claims-line-detail strong { color: #334155; font-weight: 750; }
.claims-line-description { grid-column: 1 / -1; color: #334155; }
.claims-line-description code { margin-right: 5px; color: #0F2745; font-weight: 800; }
.claims-section-empty { padding: 12px; border-top: 1px solid #E2E8F0; color: #94A3B8; font-size: 11px; }
.claims-status-pill, .claims-card-badge { display: inline-flex; align-items: center; border-radius: 999px; font-weight: 800; white-space: nowrap; }
.claims-status-pill { padding: 3px 7px; font-size: 9px; }
.claims-card-badge { justify-content: center; width: 16px; height: 16px; padding: 0; font-size: 9px; }
.claims-status-pill.exact, .claims-card-badge.exact { background: #DCFCE7; color: #166534; }
.claims-status-pill.hcc, .claims-card-badge.hcc { background: #DBEAFE; color: #1D4ED8; }
.claims-status-pill.family, .claims-card-badge.family { background: #EDE9FE; color: #6D28D9; }
.claims-status-pill.model, .claims-card-badge.model { background: #F1F5F9; color: #475569; }
.claims-status-pill.only, .claims-card-badge.only { background: #FEF3C7; color: #92400E; }
.target-reconciliation {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  padding: 7px 12px; border-bottom: 1px solid #DBEAFE;
  background: linear-gradient(90deg, #F8FAFF 0%, #F8FAFC 100%);
  flex-shrink: 0;
}
.target-reconciliation[hidden] { display: none; }
.target-reconciliation-label {
  flex-shrink: 0; font-size: 9.5px; font-weight: 750; line-height: 1;
  color: #475569; text-transform: uppercase; letter-spacing: .55px;
}
.target-reconciliation-items {
  display: flex; align-items: center; gap: 6px; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.target-reconciliation-items::-webkit-scrollbar { display: none; }
.target-reconciliation-chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 3px 7px; border: 1px solid #CBD5E1; border-radius: 999px;
  background: #FFFFFF; color: #475569; cursor: pointer;
  font: inherit; text-align: left;
}
.target-reconciliation-chip:hover { border-color: #93C5FD; background: #F8FAFF; }
.target-reconciliation-chip.active {
  border-color: #2563EB; background: #EFF6FF;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .12);
}
.target-reconciliation-chip.active::after {
  content: '\00d7'; color: #1D4ED8; font-size: 12px; font-weight: 700; line-height: 1;
}
.target-reconciliation-chip::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #94A3B8;
}
.target-reconciliation-code { font-size: 10px; font-weight: 700; color: #1E3A5F; }
.target-reconciliation-state { font-size: 9.5px; color: #64748B; }
.target-status-unreviewed { border-color: #BFDBFE; background: #F8FAFF; }
.target-status-unreviewed::before { background: #64748B; }
.target-status-in_progress { border-color: #FDE68A; background: #FFFBEB; }
.target-status-in_progress::before { background: #D97706; }
.target-status-validated { border-color: #93C5FD; background: #EFF6FF; }
.target-status-validated::before { background: #2563EB; }
.target-status-no_findings { border-color: #E2E8F0; background: #F8FAFC; }
.target-status-no_findings::before { background: #CBD5E1; }
.target-hcc-badge, .eg-target-flag {
  display: inline-flex; align-items: center; flex-shrink: 0;
  border: 1px solid #93C5FD; border-radius: 999px; background: #EFF6FF;
  color: #1D4ED8; font-size: 8.5px; font-weight: 750; line-height: 1;
  text-transform: uppercase; letter-spacing: .35px;
}
.target-hcc-badge { padding: 3px 6px; font-family: inherit; }
.eg-target-flag { padding: 2px 5px; }
.target-filter-control { cursor: pointer; }
button.target-filter-control { appearance: none; }
.target-filter-control:hover { border-color: #60A5FA; background: #DBEAFE; }
.target-filter-control.active {
  border-color: #1D4ED8; background: #2563EB; color: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, .13);
}
.target-filter-control:focus-visible,
.target-reconciliation-chip:focus-visible {
  outline: 2px solid #2563EB; outline-offset: 2px;
}
.ccard.target-hcc-card {
  border-color: #BFDBFE;
  background: linear-gradient(105deg, rgba(239, 246, 255, .72) 0, #FFFFFF 38%);
}
.ccard.target-hcc-card:hover { border-color: #93C5FD; }
.eg-row.target-hcc-row .eg-code-th { background: #F8FAFF; }
.eg-row.target-hcc-row .eg-code { box-shadow: inset 3px 0 0 #2563EB; }
.mg-group:has(.target-hcc-badge) { border-color: #BFDBFE; }
.code-view-layer {
  display: flex;
  flex: 1 0 auto;
  min-height: 0;
  flex-direction: column;
  background: rgba(248, 250, 252, .96);
}
.encounter-only-sections { display: contents; }
.encounter-only-sections[hidden],
#encounter-view-controls[hidden] { display: none; }

/* ══ MEAT mini indicator ══ */
.meat-mini { display: inline-flex; gap: 2px; flex-shrink: 0; }
.meat-mini .mm {
  width: 14px; height: 14px; border-radius: 3px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700; line-height: 1;
  background: #F1F5F9; color: #CBD5E1;
}
.meat-mini .mm.on { background: #DCFCE7; color: #15803D; }

/* ══ Encounter groups (list view) ══ */
.enc-group {
  margin: 8px 10px 0; border: 1px solid #E2E8F0; border-radius: 10px;
  background: #FFFFFF; overflow: hidden;
  box-shadow: inset 3px 0 0 var(--enc-color, #94A3B8);
}
.enc-group:last-child { margin-bottom: 10px; }
.enc-group.current { border-color: var(--enc-band, #CBD5E1); }
.enc-group-hdr {
  width: 100%; display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 9px 10px 9px 13px; border: 0; background: transparent; cursor: pointer;
  font-family: inherit; text-align: left; color: #0F172A;
}
.enc-group-hdr:hover, .enc-group.open .enc-group-hdr { background: var(--enc-bg, #F8FAFC); }
.enc-swatch { width: 8px; height: 8px; border-radius: 50%; background: var(--enc-color); flex-shrink: 0; }
.enc-group-title { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.enc-group-date { font-size: 11.5px; font-weight: 600; color: var(--enc-color); white-space: nowrap; }
.enc-group-prov {
  font-size: 11.5px; color: #475569; min-width: 0; flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.enc-group-pages { font-size: 11px; color: #94A3B8; white-space: nowrap; }
.enc-issue-dot { width: 7px; height: 7px; border-radius: 50%; background: #DC2626; flex-shrink: 0; }
.enc-group-count {
  margin-left: auto; font-family: 'JetBrains Mono', monospace; font-size: 10.5px; font-weight: 600;
  line-height: 1; color: #64748B; padding: 3px 6px; border-radius: 10px; background: #F1F5F9; flex-shrink: 0;
}
.enc-chev { color: #94A3B8; flex-shrink: 0; transition: transform .15s; }
.enc-group.open > .enc-group-hdr .enc-chev,
.mg-group.open > .mg-group-hdr .enc-chev { transform: rotate(90deg); }
.enc-group-body {
  display: none; flex-direction: column; gap: 8px; padding: 8px;
  border-top: 1px solid #F1F5F9; background: #F8FAFC;
}
.enc-group.open .enc-group-body { display: flex; }
.enc-group-empty { font-size: 12px; color: #94A3B8; padding: 6px 4px; }

/* ══ Code × encounter grid ══ */
.enc-grid-wrap {
  margin: 10px; overflow: auto; max-height: 70vh;
  border: 1px solid #E2E8F0; border-radius: 10px; background: #FFFFFF;
  scrollbar-width: thin; scrollbar-color: #CBD5E1 transparent;
}
.enc-grid { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 12px; }
.enc-grid th, .enc-grid td { border-bottom: 1px solid #F1F5F9; padding: 0; }
.enc-grid thead th {
  position: sticky; top: 0; z-index: 2; background: #F8FAFC; border-bottom: 1px solid #E2E8F0;
}
.enc-grid thead th.eg-corner {
  left: 0; z-index: 3; text-align: left; padding: 8px 10px;
  font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: #64748B;
  border-right: 1px solid #E2E8F0;
}
.enc-grid thead th.eg-col-th.this-chart, .eg-cell-td.this-chart { background: #F8FAFF; }
.enc-grid thead th.eg-col-th.current { background: var(--enc-bg, #EFF6FF); }
.eg-cell-td.current { background: #F5F8FF; }
.eg-col {
  width: 100%; min-width: 58px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 6px 6px; border: 0; background: transparent; cursor: pointer; font-family: inherit;
  border-bottom: 2px solid var(--enc-color, #94A3B8);
}
.eg-col:hover { background: var(--enc-bg, #F1F5F9); }
.eg-col-lbl { font-size: 11px; font-weight: 700; color: var(--enc-color); white-space: nowrap; }
.eg-col-date { font-family: 'JetBrains Mono', monospace; font-size: 10px; line-height: 1; color: #64748B; white-space: nowrap; }
.eg-code-th {
  position: sticky; left: 0; z-index: 1; background: #FFFFFF; text-align: left;
  border-right: 1px solid #E2E8F0;
}
.eg-code {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 10px;
  border: 0; background: transparent; cursor: pointer; font-family: inherit; white-space: nowrap;
  box-shadow: inset 3px 0 0 var(--hcc-color, #94A3B8);
}
.eg-code code { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; font-weight: 600; color: #0F172A; }
.eg-code--static { cursor: default; }
.eg-hcc { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; }
.eg-status, .mg-status { width: 7px; height: 7px; border-radius: 50%; background: #CBD5E1; flex-shrink: 0; }
.eg-status { margin-left: auto; }
.eg-status.st-approved, .mg-status.st-approved { background: #16A34A; }
.eg-status.st-declined, .mg-status.st-declined { background: #DC2626; }
.eg-cell-td { text-align: center; }
.eg-cell {
  display: inline-flex; padding: 6px 7px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; cursor: pointer;
}
.eg-cell:hover { border-color: #CBD5E1; background: #FFFFFF; }
.eg-none { display: inline-block; width: 10px; height: 2px; border-radius: 1px; background: #E2E8F0; vertical-align: middle; }
.eg-row.sel .eg-code-th, .eg-row.sel .eg-cell-td { background: #EFF6FF; }
.eg-row.dim { opacity: .55; }
.eg-row:hover .eg-code-th { background: #F8FAFC; }
.enc-grid-legend { font-size: 11px; color: #94A3B8; padding: 0 12px 10px; }
.member-scope { font-size: 11px; color: #64748B; padding: 9px 12px 0; }

/* ══ Member views: grouped by HCC / ICD ══ */
.mg-group {
  margin: 8px 10px 0; border: 1px solid #E2E8F0; border-radius: 10px; background: #FFFFFF; overflow: hidden;
}
.mg-group:last-child { margin-bottom: 10px; }
.mg-group.in-current { box-shadow: inset 3px 0 0 #2563EB; }
.mg-group-hdr {
  width: 100%; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 10px 9px 13px;
  border: 0; background: transparent; cursor: pointer; font-family: inherit; text-align: left;
}
.mg-group-hdr:hover, .mg-group.open .mg-group-hdr { background: #F8FAFC; }
.mg-codes, .mg-desc {
  font-size: 11.5px; color: #475569; min-width: 0; flex: 1 1 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mg-codes { font-family: 'JetBrains Mono', monospace; }
.mg-icd-key { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: #0F172A; flex-shrink: 0; }
.mg-count { margin-left: auto; font-size: 10.5px; color: #64748B; white-space: nowrap; flex-shrink: 0; }
.mg-group-body { display: none; flex-direction: column; border-top: 1px solid #F1F5F9; }
.mg-group.open .mg-group-body { display: flex; }
.mg-row {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 12px 7px 14px;
  border: 0; border-bottom: 1px solid #F1F5F9; background: #FFFFFF; cursor: pointer;
  font-family: inherit; text-align: left; font-size: 11.5px; color: #0F172A;
}
.mg-row:last-child { border-bottom: 0; }
.mg-row:hover { background: var(--enc-bg, #F8FAFC); }
.mg-row.here { background: #F8FAFF; }
.mg-swatch { width: 6px; height: 6px; border-radius: 50%; background: var(--enc-color); flex-shrink: 0; }
.mg-date { font-weight: 600; white-space: nowrap; min-width: 86px; }
.mg-where { color: #475569; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mg-icd { font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 600; color: #334155; }

/* ══ Encounter strip above the document ══ */
.enc-strip {
  flex-shrink: 0; display: flex; flex-direction: column; gap: 5px;
  padding: 6px 14px 7px; background: #FFFFFF; border-bottom: 1px solid var(--border);
}
.enc-strip[hidden] { display: none; }
.enc-strip-top { display: flex; align-items: center; gap: 10px; min-width: 0; }
.enc-timeline {
  display: flex; align-items: center; min-width: 0; flex: 1 1 auto;
  overflow-x: auto; scrollbar-width: none;
}
.enc-timeline::-webkit-scrollbar { display: none; }
.enc-node {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 3px 8px 3px 6px; border: 1px solid transparent; border-radius: 99px;
  background: transparent; cursor: pointer; font-family: inherit;
}
.enc-node:hover { background: var(--enc-bg); border-color: var(--enc-band); }
.enc-node.current { background: var(--enc-bg); border-color: var(--enc-color); }
.enc-node-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #FFFFFF;
  border: 2px solid var(--enc-color); box-sizing: border-box;
}
.enc-node.current .enc-node-dot { background: var(--enc-color); }
.enc-node-lbl { font-size: 11px; font-weight: 700; color: var(--enc-color); }
.enc-node-date { font-family: 'JetBrains Mono', monospace; font-size: 10.5px; line-height: 1; color: #475569; }
.enc-node-link { flex: 1 0 12px; max-width: 40px; height: 1px; background: #CBD5E1; }
.enc-node-empty { font-size: 11px; color: #94A3B8; }
.enc-follow {
  flex-shrink: 0; height: 24px; padding: 0 9px; border-radius: 99px;
  border: 1px solid #E2E8F0; background: #FFFFFF; color: #64748B;
  font-family: inherit; font-size: 10.5px; font-weight: 600; cursor: pointer;
}
.enc-follow.on { background: #EEF2FF; border-color: #C7D2FE; color: #4338CA; }
.enc-bands { display: flex; gap: 1px; height: 8px; }
.enc-bands[hidden] { display: none; }
.enc-band {
  flex: 1 1 0; min-width: 3px; height: 100%; padding: 0; border: 0; border-radius: 2px;
  background: var(--enc-band); opacity: .55; cursor: pointer; transition: opacity .12s, transform .12s;
}
.enc-band.starts { margin-left: 3px; }
.enc-band:hover, .enc-band.in-current { opacity: 1; }
.enc-band.current { opacity: 1; background: var(--enc-color); transform: scaleY(1.35); }

/* ══ Hover info card ══ */
.hover-card {
  position: fixed; z-index: 1000; max-width: 300px; padding: 9px 11px;
  background: #FFFFFF; border: 1px solid #E2E8F0; border-radius: 9px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16); pointer-events: none;
  font-size: 11.5px; color: #0F172A; line-height: 1.4;
}
.hover-card[hidden] { display: none; }
.hc-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-weight: 700; font-size: 12px; }
.hc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hc-hcc { font-size: 10px; font-weight: 700; color: #1D4ED8; background: #DBEAFE; padding: 1px 6px; border-radius: 10px; }
.hc-sub { color: #64748B; margin-top: 2px; }
.hc-row { display: flex; gap: 10px; margin-top: 4px; }
.hc-k { color: #64748B; min-width: 78px; flex-shrink: 0; }
.hc-v { color: #0F172A; min-width: 0; overflow-wrap: anywhere; }
.hc-bad { color: #DC2626; font-weight: 600; }
.hc-note { margin-top: 6px; padding-top: 6px; border-top: 1px solid #F1F5F9; color: #475569; }

/* ══ Other charts for this member (inside a code card) ══ */
.oc-badges { display: inline-flex; align-items: center; gap: 6px; }
.oc-open {
  margin-top: 6px; padding: 4px 10px; border-radius: 6px; border: 1px solid #BAE6FD;
  background: #F0F9FF; color: #0369A1; font-family: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
}
.oc-open:hover { background: #E0F2FE; }
