:root {
  --bg: #f4f6f8; --panel: #ffffff; --ink: #14202b; --muted: #5d6b78; --line: #e2e7ec;
  --brand: #1f5f8b; --brand-ink: #ffffff; --soft: #eef3f7;
  --ok: #1d7a4f; --ok-bg: #e5f4ec; --warn: #a15c00; --warn-bg: #fdf1e0;
  --bad: #b3261e; --bad-bg: #fbe9e7; --info: #2a5db0; --info-bg: #e8effb;
  --bar: #b8c7d4; --bar2: #1f5f8b; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f151b; --panel: #172029; --ink: #e6edf3; --muted: #93a1ad; --line: #26323d;
    --brand: #5aa3d6; --brand-ink: #0b1218; --soft: #1d2833;
    --ok: #5cc98f; --ok-bg: #16301f; --warn: #f0b45a; --warn-bg: #33270f;
    --bad: #f07f76; --bad-bg: #3a1a18; --info: #8fb4f0; --info-bg: #182a44;
    --bar: #33475a; --bar2: #5aa3d6; --shadow: none;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
button, select, input { font: inherit; color: inherit; }
button { background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 7px; padding: 7px 12px; cursor: pointer; font-weight: 600; }
button:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
button.toggle.on { background: var(--ok); }
select, input { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 12px; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.logo { color: var(--brand); }
.tag { font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-bg); padding: 2px 8px; border-radius: 99px; }
.controls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.clock { font-variant-numeric: tabular-nums; color: var(--muted); margin-right: 6px; }

/* Argus banner (same in light and dark mode) */
.top.banner { color: #fff; padding: 18px 24px; min-height: 92px; border-bottom: 0;
  background: linear-gradient(90deg, rgba(3,16,34,.94) 0%, rgba(3,16,34,.62) 38%, rgba(3,16,34,.62) 62%, rgba(3,16,34,.92) 100%),
              url(img/argus-peacock.jpg) center 40% / cover no-repeat, #061a33; }
.banner .brand { gap: 14px; }
.banner .brand-mark { width: 56px; height: 56px; border-radius: 12px; box-shadow: 0 0 0 1px rgba(120,230,220,.35), 0 0 18px rgba(60,220,210,.35); }
.banner .wordmark { font-size: 30px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; line-height: 1.05; color: #fff; }
.banner .brand-sub { font-size: 12px; font-weight: 500; color: rgba(255,255,255,.78); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.banner .tag { color: #ffe3a3; background: rgba(255,200,90,.16); }
.banner .clock { color: rgba(255,255,255,.82); }
.banner button, .banner select { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.banner button:hover { background: rgba(255,255,255,.2); filter: none; }
.banner select option { color: #111; }
.banner button.toggle.on { background: #1d7a4f; border-color: #3fae74; }
@media (max-width: 1200px) { .top.banner { position: static; } }
@media (max-width: 600px) { .top.banner { padding: 12px; } .banner .wordmark { font-size: 24px; } .banner .brand-mark { width: 44px; height: 44px; } }
.tabs { display: flex; gap: 2px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; color: var(--muted); border-radius: 0; border-bottom: 2px solid transparent; padding: 10px 14px; white-space: nowrap; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--brand); }
main { padding: 18px 20px 60px; max-width: 1400px; margin: 0 auto; }
.tab { display: none; } .tab.active { display: block; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card-h { font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { text-align: left; color: inherit; font-weight: inherit; cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12px; }
.kpi.good .v { color: var(--ok); }

.chart svg { width: 100%; height: 230px; display: block; }
.ak { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.ak div { background: var(--soft); border-radius: 8px; padding: 8px 10px; }
.ak b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.scen { display: grid; grid-template-columns: 1fr 120px 52px; gap: 6px 10px; align-items: center; font-size: 13px; }
.meter { height: 8px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ok); }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: none; color: var(--muted); border-radius: 0; padding: 5px 10px; font-weight: 500; }
.seg button.active { background: var(--soft); color: var(--ink); font-weight: 700; }
.table-wrap { overflow: auto; max-height: 560px; }
.table-wrap thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr { cursor: pointer; } tbody tr:hover { background: var(--soft); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.link { color: var(--brand); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.s-approved, .s-approved_verified { background: var(--ok-bg); color: var(--ok); }
.s-pending_verification, .s-insurer_review { background: var(--warn-bg); color: var(--warn); }
.s-held_investigation, .s-denied_fraud, .s-reported_paid, .s-denied_unverified { background: var(--bad-bg); color: var(--bad); }
.p-normal { background: var(--ok-bg); color: var(--ok); } .p-new { background: var(--info-bg); color: var(--info); } .p-outside { background: var(--warn-bg); color: var(--warn); }
.t-fraud { background: var(--bad-bg); color: var(--bad); } .t-legit { background: var(--soft); color: var(--muted); }
.score { display: inline-block; min-width: 30px; text-align: center; border-radius: 6px; font-weight: 700; padding: 1px 4px; font-variant-numeric: tabular-nums; }
.sc-lo { background: var(--ok-bg); color: var(--ok); } .sc-mid { background: var(--warn-bg); color: var(--warn); } .sc-hi { background: var(--bad-bg); color: var(--bad); }

/* drawer */
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(560px, 100%); background: var(--panel); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .2s; z-index: 20; overflow-y: auto; }
.drawer.open { transform: none; }
.drawer-inner { padding: 18px 20px 40px; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.25); display: none; z-index: 15; }
.scrim.open { display: block; }
.drawer h3 { margin: 0 0 4px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 4px 12px; margin: 12px 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.sig { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sig .pts { font-weight: 700; color: var(--bad); font-variant-numeric: tabular-nums; text-align: right; }
.sig .pts.neg { color: var(--ok); }
.sig small { color: var(--muted); display: block; }
.note { background: var(--soft); border-radius: 8px; padding: 10px 12px; font-size: 13px; margin: 10px 0; }
.timeline { font-size: 12.5px; border-left: 2px solid var(--line); margin: 8px 0 0 4px; padding-left: 12px; }
.timeline div { margin-bottom: 8px; }
.x { float: right; background: none; color: var(--muted); font-size: 20px; padding: 0 6px; }

/* physician app */
.phys-layout { display: grid; grid-template-columns: 280px 380px 1fr; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .phys-layout { grid-template-columns: 1fr; } .phone-col { justify-self: center; } }
.doc { padding: 9px 10px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; display: flex; justify-content: space-between; gap: 8px; }
.doc:hover { background: var(--soft); }
.doc.active { border-color: var(--brand); background: var(--soft); }
.doc .n { font-weight: 600; }
.doc .badge { background: var(--bad); color: #fff; border-radius: 99px; font-size: 11px; font-weight: 700; padding: 1px 7px; align-self: center; }
.phone { width: 360px; max-width: 100%; height: 720px; border-radius: 46px; background: #0b0f13; padding: 14px; position: relative; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.notch { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 120px; height: 26px; background: #0b0f13; border-radius: 0 0 16px 16px; z-index: 2; }
.screen { background: #f2f4f7; color: #14202b; height: 100%; border-radius: 34px; overflow-y: auto; padding: 40px 14px 20px; }
.app-h { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 4px; }
.app-h .logo { font-size: 18px; color: #1f5f8b; }
.app-h .logo-img { width: 24px; height: 24px; border-radius: 6px; vertical-align: -6px; }
.shield { background: #1f5f8b; color: #fff; border-radius: 14px; padding: 12px 14px; margin: 10px 0 14px; }
.shield b { font-size: 15px; } .shield small { display: block; opacity: .85; }
.alert { background: #fff; border-radius: 14px; padding: 12px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.08); border-left: 4px solid #a15c00; }
.alert.hi { border-left-color: #b3261e; }
.alert .t { font-size: 11px; color: #5d6b78; display: flex; justify-content: space-between; }
.alert .item { font-weight: 700; margin: 4px 0; }
.alert .meta { font-size: 12.5px; color: #33414d; }
.alert .patient { font-size: 13.5px; margin: 2px 0 3px; }
.alert .q { font-weight: 700; margin: 10px 0 8px; }
.alert .btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.alert .yes { background: #1d7a4f; color: #fff; } .alert .no { background: #b3261e; color: #fff; }
.alert .spot { font-size: 11px; background: #e8effb; color: #2a5db0; border-radius: 99px; padding: 1px 7px; }
.hist { font-size: 12px; background: #fff; border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 8px; }
.empty { text-align: center; color: #5d6b78; padding: 30px 10px; }
.screen h4 { margin: 16px 0 6px; font-size: 12px; color: #5d6b78; text-transform: uppercase; letter-spacing: .04em; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 10px; }
.chip { font-size: 12px; background: var(--soft); border-radius: 99px; padding: 2px 9px; }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.ok { background: var(--ok-bg); color: var(--ok); }
.bars .row { display: grid; grid-template-columns: 1fr 160px 44px; gap: 8px; align-items: center; font-size: 13px; margin: 3px 0; }
.bars .meter i { background: var(--brand); }
.search { display: flex; gap: 6px; }
.prose { max-width: 820px; } .prose li { margin-bottom: 8px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--panel); padding: 9px 16px; border-radius: 8px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 30; }
.toast.show { opacity: 1; }
.factor-up { color: var(--bad); font-weight: 700; } .factor-down { color: var(--ok); font-weight: 700; }
@media (max-width: 600px) { main { padding: 12px 12px 60px; } .top { padding: 10px 12px; } .kv { grid-template-columns: 1fr; } }

/* government records */
.gov { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin: 4px 0 12px; }
.govrow { display: flex; justify-content: space-between; gap: 12px; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.govrow:first-child { border-top: 0; }
.govrow.ok b { color: var(--ok); font-weight: 600; }
.govrow.bad { background: var(--bad-bg); } .govrow.bad b { color: var(--bad); }
.govrow > span:last-child { text-align: right; }

/* fraud referrals */
pre.report { white-space: pre-wrap; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--soft);
  border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 50vh; overflow: auto; }
#referrals tr[data-case] { cursor: pointer; }

.demo-banner { background: var(--warn-bg); color: var(--ink); border: 1px solid var(--warn); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
.demo-banner b { color: var(--warn); }
.demo-banner.live { background: var(--bad-bg); border-color: var(--bad); } .demo-banner.live b { color: var(--bad); }
/* NPI profiles: national CMS data and "Score a test claim" */
.card-sub { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 6px; }
.scoreform { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 10px; align-items: end; margin: 8px 0 12px; }
.scoreform label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); }
.scoreform input { min-width: 0; }
@media (max-width: 760px) { .scoreform { grid-template-columns: 1fr 1fr; } .scoreform button { grid-column: 1 / -1; } }
.scorehead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
/* NPI search: claims ranked by fraud risk */
.rankfilter { margin: 4px 0 10px; }
.rankfilter .chip { cursor: pointer; border: 1px solid var(--line); background: var(--soft); color: inherit; font-weight: 600; padding: 4px 11px; }
.rankfilter .chip.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
table.ranked td { vertical-align: top; }
table.ranked .reason { line-height: 1.35; margin-bottom: 2px; }
table.ranked .reason b { color: var(--bad); font-variant-numeric: tabular-nums; margin-right: 4px; }
button.link { background: none; padding: 4px 0; font-weight: 600; }
table.results tbody tr { cursor: pointer; } table.results tbody tr:hover { background: var(--soft); }
/* Medicare billing: year buttons and sort */
.cmstools { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.cmstools .chip { cursor: pointer; border: 1px solid var(--line); background: var(--soft); color: inherit; font-weight: 600; padding: 4px 11px; }
.cmstools .chip.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.cmstools .chip.on .muted { color: inherit; opacity: .8; }
/* Provider risk list */
.riskfilters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.riskfilters input { flex: 1; min-width: 200px; }
.riskfilters .chip { cursor: pointer; border: 1px solid var(--line); background: var(--soft); color: inherit; font-weight: 600; padding: 4px 11px; }
.riskfilters .chip.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.riskfilters .chip.on .muted { color: inherit; opacity: .8; }
.pager { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
/* Overall fraud risk box (physician / supplier lookup): the whole box is colored by level, green / yellow / red,
   with a solid colored square for the score so the level reads at a glance */
:root { --risk-low: #1d7a4f; --risk-low-bg: #e3f3ea; --risk-mid: #b38600; --risk-mid-ink: #5c4500; --risk-mid-bg: #fff3c4;
        --risk-high: #b3261e; --risk-high-bg: #fbe1de; }
@media (prefers-color-scheme: dark) {
  :root { --risk-low: #3fae74; --risk-low-bg: #15301f; --risk-mid: #d9b13b; --risk-mid-ink: #f3dc8f; --risk-mid-bg: #352c0c;
          --risk-high: #e0574d; --risk-high-bg: #3d1916; }
}
.provscore { display: flex; gap: 14px; align-items: stretch; padding: 12px 14px; border-radius: 10px; margin: 4px 0 12px;
  border: 1px solid; border-left-width: 6px; }
.provscore .scorebadge { min-width: 74px; border-radius: 8px; color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 8px 6px; text-align: center; }
.provscore .big { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.provscore .of { font-size: 11px; opacity: .9; }
.provscore .lvl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; margin-top: 4px; }
.provscore .title { font-size: 15px; }
.provscore.low { background: var(--risk-low-bg); border-color: var(--risk-low); }
.provscore.low .scorebadge { background: var(--risk-low); }
.provscore.low .title { color: var(--risk-low); }
.provscore.medium { background: var(--risk-mid-bg); border-color: var(--risk-mid); }
.provscore.medium .scorebadge { background: var(--risk-mid); color: #1f1700; }
.provscore.medium .title { color: var(--risk-mid-ink); }
.provscore.high { background: var(--risk-high-bg); border-color: var(--risk-high); }
.provscore.high .scorebadge { background: var(--risk-high); }
.provscore.high .title { color: var(--risk-high); }
.provscore .muted { color: inherit; opacity: .75; }
/* the overall risk banner: one level for the physician, colored; click to show the scores behind it */
.overall { display: flex; width: 100%; gap: 14px; align-items: center; text-align: left; padding: 12px 14px; margin: 4px 0 10px;
  border-radius: 10px; border: 1px solid; border-left-width: 6px; cursor: pointer; font: inherit; color: inherit; }
.overall .ovlvl { min-width: 74px; padding: 10px 6px; border-radius: 8px; color: #fff; font-weight: 800; font-size: 15px;
  text-transform: uppercase; letter-spacing: .04em; text-align: center; }
.overall .ovtxt { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.overall .ovtxt b:first-child { font-size: 16px; }
.overall .ovchev { font-size: 13px; font-weight: 600; white-space: nowrap; }
.overall.low { background: var(--risk-low-bg); border-color: var(--risk-low); } .overall.low .ovlvl { background: var(--risk-low); }
.overall.low .ovtxt b:first-child, .overall.low .ovchev { color: var(--risk-low); }
.overall.medium { background: var(--risk-mid-bg); border-color: var(--risk-mid); } .overall.medium .ovlvl { background: var(--risk-mid); color: #1f1700; }
.overall.medium .ovtxt b:first-child, .overall.medium .ovchev { color: var(--risk-mid-ink); }
.overall.high { background: var(--risk-high-bg); border-color: var(--risk-high); } .overall.high .ovlvl { background: var(--risk-high); }
.overall.high .ovtxt b:first-child, .overall.high .ovchev { color: var(--risk-high); }
.overall:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ovparts { margin: -4px 0 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ovpart { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; }
#riskDetail.collapsed { display: none; }

/* insurer's riskiest physicians and suppliers */
.rr-intro { margin: 0 0 10px; }
.rrtools { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.rrtools input { flex: 0 1 240px; min-width: 0; }
.rk { display: inline-block; min-width: 34px; text-align: center; font-weight: 700; border-radius: 6px; padding: 3px 6px; color: #fff; }
.rk.high { background: var(--risk-high); } .rk.medium { background: var(--risk-mid); color: #1f1700; } .rk.low { background: var(--risk-low); }
#rrLevels .chip, #erLevels .chip { cursor: pointer; border: 1px solid var(--line); background: var(--soft); color: inherit; font-weight: 600; padding: 4px 11px; }
#rrLevels .chip.on, #erLevels .chip.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
#rrLevels .chip.on .muted, #erLevels .chip.on .muted { color: inherit; opacity: .8; }
#rrLevels { margin: 0; }
#rrTable td.why { min-width: 200px; font-size: 12px; }
#rrTable td.why div + div { margin-top: 3px; }
#rrTable td.who { min-width: 150px; }
#rrTable tr.watched td:first-child { box-shadow: inset 4px 0 0 var(--risk-high); }
.watchbtn { font-size: 12px; padding: 5px 9px; border: 1px solid transparent; min-width: 76px; line-height: 1.25; }
.watchbtn.on { background: var(--risk-high-bg); color: var(--risk-high); border-color: var(--risk-high); }
.provscore .watchrow { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* insurer dashboard: four squares (activity | riskiest billers / totals | lookup) */
.dash { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 660px 640px; gap: 16px;
  grid-template-areas: "chart risk" "stats lookup"; margin-bottom: 16px; }
.dash .q { margin: 0; min-height: 0; }
.q-chart { grid-area: chart; display: flex; flex-direction: column; }
.q-chart .chart { flex: 1; min-height: 0; }
.q-chart .chart svg { height: 100%; }
.q-risk { grid-area: risk; display: flex; flex-direction: column; }
.q-risk .q-scroll { flex: 1; min-height: 0; overflow: auto; }
.q-risk .q-scroll thead th { position: sticky; top: 0; background: var(--panel); z-index: 1; }
.q-stats { grid-area: stats; display: flex; flex-direction: column; gap: 16px; }
.q-stats .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; flex: 1; margin: 0; }
.q-stats .kpi { display: flex; flex-direction: column; justify-content: center; padding: 16px 20px; }
.q-stats .kpi .v { font-size: 34px; }
.q-stats .kpi .l { font-size: 14px; }
.q-lookup { grid-area: lookup; overflow: auto; padding-top: 0; }
.q-lookup > .card-h { position: sticky; top: 0; background: var(--panel); z-index: 2; padding-top: 14px; padding-bottom: 8px; margin-bottom: 4px; }
@media (max-width: 1000px) {
  .dash { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-template-areas: "chart" "stats" "risk" "lookup"; }
  .q-chart .chart svg { height: 230px; }
  .q-risk .q-scroll { max-height: 640px; }
  .q-lookup { max-height: none; overflow: visible; }
  .q-lookup > .card-h { position: static; }
}
@media (max-width: 1000px) { .q-stats .kpi .v { font-size: 26px; } }

/* simulation page */
.sim-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sim-main > .card:last-child { margin-bottom: 0; }
.sim-side { position: sticky; top: 12px; margin: 0; }
@media (max-width: 1000px) { .sim-layout { grid-template-columns: minmax(0, 1fr); } .sim-side { position: static; } }
.orderform { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; align-items: end; margin-bottom: 8px; }
.orderform label, .picker { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; min-width: 0; }
.orderform input, .orderform .pk-select { min-width: 0; font-weight: 400; }
.orderform label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.orderform label.check input { width: auto; }
.orderform .expect { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.orderform button[type=submit] { grid-column: 1 / -1; justify-self: start; padding: 9px 22px; }
@media (max-width: 600px) { .orderform { grid-template-columns: minmax(0, 1fr); } }
.picker { position: relative; align-self: start; }
.pk-list { position: absolute; top: 100%; left: 0; right: 0; z-index: 20; margin-top: 2px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: var(--shadow); max-height: 300px; overflow: auto; font-weight: 400; }
.pk-list button { display: block; width: 100%; text-align: left; background: none; color: inherit; border-radius: 0; padding: 7px 10px; font-weight: 400; border-bottom: 1px solid var(--line); }
.pk-list button:hover { background: var(--soft); filter: none; }
.pk-msg { padding: 8px 10px; }
.pk-chosen { min-height: 1.2em; font-weight: 400; }
.testtag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 5px; border-radius: 4px;
  background: var(--risk-mid-bg); color: var(--risk-mid-ink); white-space: nowrap; }
.orderres { border-radius: 8px; padding: 10px 12px; margin: 10px 0; border: 1px solid; border-left-width: 6px; }
.orderres.good { background: var(--risk-low-bg); border-color: var(--risk-low); }
.orderres.bad { background: var(--risk-high-bg); border-color: var(--risk-high); }
.orderclaim { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin-bottom: 8px; cursor: pointer; }
.orderclaim:hover { background: var(--soft); }
.oc-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.oc-dec { margin-left: auto; }
.oc-sig { margin-top: 6px; font-size: 12px; }
.res-ok { color: var(--risk-low); font-weight: 600; } .res-bad { color: var(--risk-high); font-weight: 600; }
#toTable tbody tr { cursor: pointer; }

/* simulation controls (moved from the banner) */
.simbar .simcontrols { justify-content: flex-start; }
.simbar .clock { font-weight: 600; color: var(--ink); margin-right: 10px; }
/* period switch label over the totals */
.kpi-h { display: flex; align-items: baseline; gap: 8px; padding: 0 2px; }
#periodSeg button { padding: 4px 9px; }

.chart-note { min-height: 1.3em; margin-top: 4px; }
.chart svg rect[fill=transparent]:hover + rect { opacity: .8; }

/* demo phone: Horkos dashboard */
.app-h { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.app-tabs { margin-left: auto; display: flex; gap: 2px; }
.app-tabs button { font-size: 11px; padding: 4px 8px; background: transparent; color: #5d6b78; border: 1px solid #d8e0e7; border-radius: 99px; font-weight: 600; }
.app-tabs button.on { background: #1f5f8b; color: #fff; border-color: #1f5f8b; }
.pbadge { background: #b3261e; color: #fff; border-radius: 99px; padding: 0 5px; font-size: 10px; }
.prisk { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 12px; padding: 10px; margin: 8px 0; border-left: 5px solid #ccc; }
.prisk b { display: block; font-size: 13px; } .prisk small { color: #5d6b78; font-size: 11px; line-height: 1.3; display: block; }
.pr-badge { min-width: 52px; text-align: center; border-radius: 9px; padding: 5px 2px; color: #fff; }
.pr-badge b { font-size: 21px; line-height: 1.1; } .pr-badge small { color: inherit; opacity: .85; font-size: 10px; }
.prisk.low { border-color: #1d7a4f; } .prisk.low .pr-badge { background: #1d7a4f; }
.prisk.medium { border-color: #b38600; } .prisk.medium .pr-badge { background: #b38600; color: #1f1700; }
.prisk.high { border-color: #b3261e; } .prisk.high .pr-badge { background: #b3261e; }
/* the overall risk banner in the demo phone (matches web/m/m.css .ovrisk) */
.povr { width: 100%; display: flex; flex-direction: column; gap: 6px; text-align: left; border: 0; border-left: 5px solid; border-radius: 12px;
  padding: 10px; margin: 8px 0; font: inherit; cursor: pointer; color: #1b2733; }
.povr-top { display: flex; gap: 10px; align-items: flex-start; }
.povr-top b { display: block; font-size: 13px; } .povr-top small { font-size: 11px; line-height: 1.3; display: block; color: #3d4954; }
.povr-lvl { min-width: 52px; border-radius: 10px; padding: 8px 2px; text-align: center; color: #fff; font-weight: 800; font-size: 11px; text-transform: uppercase; }
.povr-more { font-size: 11px; font-weight: 600; align-self: flex-end; }
.povr.low { background: #e5f4ec; border-color: #1d7a4f; } .povr.low .povr-lvl { background: #1d7a4f; } .povr.low b, .povr.low .povr-more { color: #1d7a4f; }
.povr.medium { background: #fdf1e0; border-color: #b38600; } .povr.medium .povr-lvl { background: #b38600; color: #1f1700; } .povr.medium b, .povr.medium .povr-more { color: #a15c00; }
.povr.high { background: #fbe9e7; border-color: #b3261e; } .povr.high .povr-lvl { background: #b3261e; } .povr.high b, .povr.high .povr-more { color: #b3261e; }
.povr-row { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 5px 0; border-bottom: 1px solid #e8ecef; font-size: 12px; }
.povr-row small { display: block; color: #5d6b78; font-size: 10.5px; }
.povr-score { min-width: 30px; text-align: center; font-weight: 700; border-radius: 7px; padding: 2px 5px; color: #fff; font-size: 12px; }
.povr-score.low { background: #1d7a4f; } .povr-score.medium { background: #b38600; color: #1f1700; } .povr-score.high { background: #b3261e; }
.povr-note { display: block; color: #5d6b78; font-size: 10.5px; margin-top: 6px; }
.psign { width: 100%; display: flex; justify-content: space-between; align-items: center; text-align: left; border-radius: 12px; padding: 10px 12px;
  margin-bottom: 8px; background: #fbe9e7; color: #b3261e; font-weight: 400; border: 0; }
.psign.calm { background: #fff; color: #14202b; }
.psign small { font-size: 11px; }
.pcard { background: #fff; border-radius: 12px; padding: 10px; color: #14202b; }
.pcard-h { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.pseg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; background: #eef3f7; border-radius: 8px; padding: 2px; margin-bottom: 8px; }
.pseg.two { grid-template-columns: 1fr 1fr; margin: 6px 0; }
.pseg button { background: transparent; color: #5d6b78; font-size: 11px; padding: 4px 2px; border-radius: 6px; font-weight: 600; }
.pseg button.on { background: #1f5f8b; color: #fff; }
.ptot { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; text-align: center; }
.ptot b { display: block; font-size: 16px; font-variant-numeric: tabular-nums; } .ptot b.good { color: #1d7a4f; }
.ptot small { font-size: 10px; color: #5d6b78; }
.pchart { height: 160px; --line: #e2e7ec; --muted: #5d6b78; --bar: #9db9cf; --bar2: #1f5f8b; }
.pnote { font-size: 10px; color: #5d6b78; margin-top: 4px; line-height: 1.4; }
.plegend { display: flex; gap: 10px; margin-bottom: 3px; color: #14202b; font-size: 11px; }
.plegend span { display: flex; align-items: center; gap: 4px; } .plegend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

/* warning signs as insurers see them (no points) */
.stag { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 1px 6px;
  border-radius: 4px; background: var(--risk-mid-bg); color: var(--risk-mid-ink); white-space: nowrap; vertical-align: 1px; }
.stag.strong { background: var(--risk-high-bg); color: var(--risk-high); }
.stag.factor { background: var(--soft); color: var(--muted); }
.sig .stag { margin-top: 2px; min-width: 76px; text-align: center; }

/* dashboard totals open the claims behind them */
button.kpi:hover { border-color: var(--brand); filter: none; }
.kpi .kgo { color: var(--brand); font-weight: 700; opacity: .7; }
.cfilter { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--soft);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }

/* demo phone: totals open the orders behind them */
.ptot button { background: transparent; border: 0; color: inherit; font: inherit; padding: 3px 2px; border-radius: 8px; cursor: pointer; font-weight: 400; }
.ptot button:hover { background: #eef3f7; filter: none; }
.pback { background: transparent; color: #1f5f8b; border: 0; padding: 6px 0; font-weight: 700; font-size: 12px; }
.plrow { display: flex; justify-content: space-between; gap: 6px; align-items: center; padding: 7px 0; border-top: 1px solid #e2e7ec; font-size: 12px; cursor: pointer; }
.plrow small { color: #5d6b78; font-size: 10px; } .plst .pill { font-size: 10px; white-space: nowrap; }

.app-h .bname { display: flex; flex-direction: column; line-height: 1.1; }
.app-h .tagline { font-size: 9px; font-weight: 600; color: #5d6b78; margin-top: 1px; }

/* yearly calibration (internal) */
.calbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; }
.caltable td { vertical-align: top; } .caltable tr.calmove td:first-child { box-shadow: inset 3px 0 0 var(--brand); }

.caldet { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 10px 0; }
.caldet > div { background: var(--soft); border-radius: 8px; padding: 8px 10px; }
.caldet b { display: block; font-size: 20px; }
.invset .chip { cursor: pointer; border: 1px solid var(--line); background: var(--soft); color: inherit; font-weight: 600; padding: 4px 11px; }
.invset .chip.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }

/* enterprise dashboard (a healthcare organization's compliance officer) */
.ent-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.ent-head b { font-size: 18px; }
.ent-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; margin-bottom: 16px; }
.ent-alert { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--risk-mid); border-radius: 10px; padding: 10px 14px; box-shadow: var(--shadow); }
.ent-alert.critical { border-left-color: var(--risk-high); background: var(--bad-bg); }
.ent-alert-act { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.ent-dash { grid-template-rows: 560px 560px; }
.ent-patterns { padding-top: 0; }
.ent-pat { border: 1px solid var(--line); border-left: 4px solid var(--risk-mid); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.ent-pat.critical { border-left-color: var(--risk-high); }
.ent-pat-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.ent-pat-h .rk:last-child { margin-left: auto; }
.ent-pat-docs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.repbtn { font-size: 12px; padding: 5px 9px; background: var(--soft); color: var(--ink); border: 1px solid var(--line); white-space: nowrap; }
.repbtn.urgent { background: var(--risk-high); color: #fff; border-color: transparent; }
.reptag { font-size: 11px; font-weight: 600; color: var(--risk-high); margin-top: 3px; max-width: 118px; line-height: 1.25; }
.reptag.soft { font-weight: 400; opacity: .75; color: inherit; }
#erTable tr.reported td:first-child { box-shadow: inset 4px 0 0 var(--risk-high); }
#erTable td.why { min-width: 200px; font-size: 12px; }
#erTable td.who { min-width: 150px; }
#entCmdTable tr { cursor: pointer; }
#entCmdTable tr.susp td:first-child { box-shadow: inset 4px 0 0 var(--risk-high); }
#entCmdTable td.acts { white-space: nowrap; }
#entCmdTable td.why { min-width: 180px; }
#entClaims tbody tr { cursor: pointer; }
.ent-reportbar { display: flex; gap: 10px; align-items: center; margin: 0 0 10px; padding: 8px 12px; background: var(--info-bg); border-radius: 8px; }
.ent-reportbar span { flex: 1; font-weight: 600; }
.dest { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.reptext { width: 100%; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 8px; }
#drawerBody textarea { width: 100%; display: block; margin-top: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; }
#drawerBody label { display: block; margin: 10px 0; }
table.mini { font-size: 12px; }
.btnlink { display: inline-block; background: var(--brand); color: var(--brand-ink); border-radius: 7px; padding: 7px 12px; font-weight: 600; text-decoration: none; }
@media (max-width: 1000px) { .ent-dash { grid-template-rows: none; } .ent-patterns { max-height: none; } }

/* procedure-billing score (web/procedure.js) */
.procscore { margin-top: 10px; }
#rrTable caption, #erTable caption { caption-side: top; text-align: left; padding: 0 0 6px; }

/* claims-file audit (web/audit.js) */
.audit-top { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.audit-top .card { margin-bottom: 16px; }
.audit-upload { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.audit-upload input:not([type=file]) { flex: 1 1 180px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.audit-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 8px 0 0; }
.kpi.bad .v { color: var(--risk-high); } .kpi.warn .v { color: var(--warn); }
.audit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; align-items: start; }
#auProv td:last-child { min-width: 220px; }
#auProv { max-height: 520px; overflow: auto; }
.audit-grid .card { margin-bottom: 16px; }
#auMap select { min-width: 220px; }
.req { color: var(--risk-high); font-size: 11px; font-weight: 600; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--soft); }
#auClaims td { vertical-align: top; }
@media (max-width: 1000px) { .audit-top, .audit-grid { grid-template-columns: minmax(0, 1fr); } .audit-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* sign-in and users (web/users.js) */
.signin { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: var(--bg); overflow: auto; }
.signin-card { width: min(420px, 100%); display: flex; flex-direction: column; gap: 10px; margin: 0; }
.signin-card h2 { margin: 0; }
.signin-card label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13px; }
.signin-card input, .adduser input, .adduser select, .stackform input, .pwinline { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); }
.signin-logo { width: 48px; height: 48px; border-radius: 10px; }
.pwrow { display: flex; gap: 6px; } .pwrow input { flex: 1; min-width: 0; }
.userbox { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: #fff; font-size: 13px; }
.userbox .muted-ink { opacity: .8; }
button.ghost.light { color: #fff; border-color: rgba(255,255,255,.5); }
.adduser { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.adduser input, .adduser select { flex: 1 1 160px; }
.stackform { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.totpkey { font-size: 16px; letter-spacing: 1px; }
.warnline { color: var(--warn); }
tr.inactive td { opacity: .5; }
.logwrap { max-height: 420px; overflow: auto; }
[hidden] { display: none !important; }
.up { color: var(--risk-high); font-weight: 600; } .down { color: var(--ok); font-weight: 600; }

/* score history (web/history.js): the arrow next to a score and the History graph */
/* the arrow: a white pill inside the coloured score box, so it stands out on red, amber or green */
.trend { display: inline-flex; align-items: center; justify-content: center; gap: 3px; align-self: center; margin-top: 6px;
  background: #fff; border-radius: 999px; padding: 2px 9px 2px 7px; line-height: 1; font-weight: 800;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); font-variant-numeric: tabular-nums; }
.trend .tri { font-size: 20px; } .trend .delta { font-size: 14px; }
.trend.up { color: #c62828; } .trend.down { color: #1b7f3b; } 
.hband.high { fill: var(--risk-high-bg); } .hband.medium { fill: var(--warn-bg); } .hband.low { fill: var(--ok-bg); }
.hgrid { stroke: var(--line); } .hlabel { font-size: 11px; fill: var(--muted); }
.hline { fill: none; stroke: var(--ink); stroke-width: 2; }
.hdot { stroke: var(--panel); stroke-width: 2; } .hdot.high { fill: var(--risk-high); } .hdot.medium { fill: var(--risk-mid); } .hdot.low { fill: var(--risk-low); }
.scorecol { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.scorecol .scorebadge { flex: 1; }
.histbtn { font-size: 12px; padding: 4px 8px; white-space: nowrap; }
.hist button.undo { font-size: 11px; padding: 0; margin-top: 3px; border: 0; background: none; color: var(--accent, #2563eb); text-decoration: underline; cursor: pointer; }

/* Admin tab (web/admin.js) */
.adpick { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.adpick button { text-align: left; color: inherit; }
.adname { margin: 14px 0 6px; }
.adgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.adscore { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.adscore.high { border-color: var(--risk-high); } .adscore.medium { border-color: var(--risk-mid); }
.adscore-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 15px; }
.adscore-h .trend { margin-top: 0; }
.rulecode { font-size: 11px; background: var(--soft); border-radius: 4px; padding: 1px 5px; color: var(--muted); }
.okline { color: var(--ok); font-weight: 600; }
@media (max-width: 1100px) { .adgrid { grid-template-columns: minmax(0, 1fr); } }

.histchart { max-height: 240px; max-width: 640px; display: block; }

/* sign-in screen: the guest demo box */
.guestbox { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.guestbox p { margin: 0 0 6px; }
.guestbox button { width: 100%; }

/* the guest demo: made-up names notes */
body:not(.guest) .guest-only { display: none; }
body.guest .staff-only { display: none; }

/* Horkos tab: "Get Horkos on your phone" QR code */
.getapp { display: flex; gap: 12px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.getapp img { width: 116px; height: 116px; border-radius: 6px; background: #fff; flex: none; }

/* Admin overview, rank list and inline detail */
.adov-ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.adov-ctl select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: inherit; max-width: 260px; }
#adChart { min-height: 160px; }
.adacc { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 8px 0; }
.adacc > div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.adacc b { font-size: 22px; font-variant-numeric: tabular-nums; } .adacc span { font-size: 12px; color: var(--muted); }
.adacc .sim { background: var(--soft); }
.adranktbl tr.adrow { cursor: pointer; } .adranktbl tr.adrow:hover, .adranktbl tr.adrow.on { background: var(--soft); }
.adinline { border-left: 3px solid var(--brand); margin: 6px 0 12px; padding: 4px 0 4px 12px; }
.adinline-row > td { background: var(--panel); }
.adpick button.on { border-color: var(--brand); background: var(--soft); }

/* Professional services: kind-of-provider filter */
.kindchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; flex-basis: 100%; }
.kindchips .chip { font-size: 12px; padding: 4px 10px; cursor: pointer; border: 1px solid var(--line); background: var(--soft); color: var(--ink, #14202b); font-weight: 600; }
.kindchips .chip.on { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
#adRankKinds .kindchips { margin: 0 0 8px; }

/* Potential Victim banner (engine/victim.py) */
.victimbanner { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid #7aa7e0; background: rgba(70, 130, 220, .10); }
.victimbanner b { color: #2c62b0; }
.victimbanner ul { margin: 6px 0 0; padding-left: 18px; }
.victimtag { display: inline-block; margin-left: 6px; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: rgba(70, 130, 220, .14); color: #2c62b0; border: 1px solid #7aa7e0; white-space: nowrap; vertical-align: middle; }
td .victimtag { display: block; margin: 4px 0 0; width: max-content; }
.advictim { margin: 6px 0 10px; padding: 8px 10px; border-radius: 8px; border: 1px dashed var(--line); }
.advictim.on { border: 1px solid #7aa7e0; background: rgba(70, 130, 220, .08); }
@media (prefers-color-scheme: dark) { .victimbanner b, .victimtag { color: #8fb8f0; } }

.adhist { margin: 4px 0 10px; }

.kindchips .victimchip { border-color: #7aa7e0; color: #2c62b0; }
.kindchips .victimchip.on { background: rgba(70, 130, 220, .16); }
/* the highest-risk filter box reads as a text box, not another button */
#rrFilter, #adRankQ, #erSearch, .rrtools input { font-style: italic; font-weight: 400; }
#rrFilter:not(:placeholder-shown), #adRankQ:not(:placeholder-shown), #erSearch:not(:placeholder-shown) { font-style: normal; }

/* high-risk total (top of the Highest risk box) and potential fraud networks (web/networks.js) */
.risktotal { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 8px 12px; margin: 6px 0 8px;
  border-radius: 8px; background: var(--bad-bg, rgba(220, 38, 38, .07)); border: 1px solid var(--bad-line, rgba(220, 38, 38, .25)); }
.risktotal .rt-main { font-size: 15px; }
.risktotal .rt-main b { font-size: 18px; }
.risktotal .rt-parts b { color: var(--text, inherit); }
.nettbl tr.netrow { cursor: pointer; }
.nettbl tr.netrow.on, .nettbl tr.netrow:hover { background: var(--hover, rgba(0, 0, 0, .04)); }
.nettbl .netname { font-weight: 600; }
.netdetail > td { background: var(--panel2, rgba(0, 0, 0, .02)); }
.netcols { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; max-height: 420px; overflow: auto; }
.netcols table { width: 100%; margin-top: 4px; }
@media (max-width: 760px) { .netcols { grid-template-columns: 1fr; } }

/* Riskiest billers box: keep the fixed parts short so the list gets the room (2026-11-13) */
#riskRankCard > .card-h { flex-wrap: nowrap; margin-bottom: 8px; }
#riskRankCard > .card-h #rrFilter { flex: 0 1 230px; min-width: 120px; font-weight: 400; }
.rrbar { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; margin-bottom: 6px; }
.linkbtn { background: none; border: 0; padding: 2px 4px; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.linkbtn:hover, .linkbtn[aria-expanded="true"] { color: var(--brand); }
#riskRankCard:not(.show-about) .rr-intro { display: none; }
#rrTotal .risktotal { padding: 4px 10px; margin: 0 0 6px; gap: 2px 10px; }
#rrTotal .risktotal .rt-main { font-size: 13px; }
#rrTotal .risktotal .rt-main b { font-size: 15px; }
#riskRankCard .rrtools { margin-bottom: 4px; }
#rrLevels { gap: 4px; }
#rrLevels .chip { padding: 2px 8px; font-size: 12px; }
#rrLevels .kindchips { margin: 2px 0 0; gap: 4px; }

/* "Potential fraud network" note under a provider's name, and its banner on the lookup (web/procedure.js) */
.nettag { display: block; width: max-content; margin-top: 4px; font-size: 11px; padding: 2px 7px; border-radius: 999px;
  background: rgba(200, 120, 20, .12); color: #9a5a00; border: 1px solid #e0a650; white-space: nowrap; cursor: help; }
.netbanner { margin: 10px 0 4px; padding: 10px 12px; border-radius: 10px; border: 1px solid #e0a650; background: rgba(200, 120, 20, .08); }
.netbanner b { color: #9a5a00; }
.netbanner .linkbtn { padding: 4px 0 0; color: #9a5a00; text-decoration: underline; }
@media (prefers-color-scheme: dark) { .nettag, .netbanner b, .netbanner .linkbtn { color: #f0b860; } }
.netsearch { flex: 0 1 300px; min-width: 140px; font-weight: 400; font-style: italic; }
.netsearch:not(:placeholder-shown) { font-style: normal; }
#netCard > .card-h, #adNet > .card-h { flex-wrap: nowrap; }
/* sortable columns on the fraud networks list: ▲ low to high, ▼ high to low (web/networks.js) */
.nettbl th.sorth { cursor: pointer; user-select: none; white-space: nowrap; }
.nettbl th.sorth:hover { color: var(--brand); }
.sortarrows { display: inline-flex; flex-direction: column; margin-left: 5px; font-size: 11px; line-height: 10px; vertical-align: middle; }
.sortarrows span { opacity: .4; }
.sortarrows span.on { opacity: 1; color: var(--brand); }

.certbox { margin-top: 10px; }
.certbox h4 { margin: 6px 0; }

/* weights sandbox (Sandbox tab) */
.sbx-cand { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.sbx-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sbx-head > span:last-child { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.sbx-verdict { border-radius: 8px; padding: 10px 12px; margin: 10px 0; }
.sbx-verdict.pass { background: var(--ok-bg); } .sbx-verdict.pass b:first-child { color: var(--ok); }
.sbx-verdict.fail { background: var(--bad-bg); } .sbx-verdict.fail b:first-child { color: var(--bad); }
.sbx-verdict .small { display: block; margin-top: 4px; }
.sbx-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; margin: 8px 0; }
.sbx-stat { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.sbx-stat-h { font-weight: 600; margin-bottom: 6px; }
.sbx-duo { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 4px; }
.sbx-duo > div { display: flex; flex-direction: column; }
.sbx-big { font-size: 30px; font-weight: 700; line-height: 1.1; }
.sbx-big.good { color: var(--ok); } .sbx-big.bad { color: var(--bad); }
.sbx-cap { font-size: 12px; color: var(--muted, #667); }
.sbx-arrow { font-size: 22px; align-self: center; color: var(--muted, #667); }
.sbx-set { margin: 8px 0 12px; }
.sbx-set ul { margin: 6px 0 8px 18px; }
.sbx-way { margin: 8px 0 0; }
.sbx-way > summary { cursor: pointer; }
.sbx-way .sbx-checks { margin: 4px 0 0 14px; }
.sbx-checks { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.sbx-checks li.ok { color: inherit; } .sbx-checks li.no { color: var(--bad); }
.sbx-checks li.no .muted, .sbx-checks li.no b { color: inherit; }
.sbx-test { margin: 10px 0; } .sbx-test h4 { margin: 10px 0 2px; }
.sbx-cand details { margin: 8px 0; } .sbx-cand summary { cursor: pointer; }
/* simulated / real tag on each test set's result */
.sbx-kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-right: 4px; }
.sbx-kind.real { background: var(--ok-bg); color: var(--ok); }
.sbx-measures button { margin: 2px 0; }
.sbx-testall { margin: 10px 0 4px; }
.sbx-testall button { margin-right: 6px; }
.sbx-testall button:disabled { opacity: .4; cursor: default; }
/* the engine in use, large and bold at the top of each sandbox */
.sbx-engine { display: flex; flex-direction: column; gap: 2px; background: var(--soft); border-left: 4px solid var(--brand); border-radius: 8px; padding: 10px 14px; margin: 6px 0 12px; }
.sbx-engine-cap { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #667); font-weight: 600; }
.sbx-engine-name { font-size: 22px; font-weight: 700; line-height: 1.25; }
/* candidate test engines: closed by default, the summary lists each candidate with its state */
.sbx-cands { margin: 14px 0 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.sbx-cands > summary { cursor: pointer; display: list-item; }
.sbx-cands-one { display: inline-flex; gap: 6px; align-items: center; margin: 4px 0 0 12px; }
.sbx-run { background: var(--soft); border-radius: 8px; padding: 10px 12px; margin: 10px 0; display: grid; gap: 8px; }
.sbx-run .meter { width: 100%; background: var(--line); }
/* why providers were excluded (web/exclusions.js) */
.ex-item { border-top: 1px solid var(--line, #e3e6ea); padding: 8px 0; }
.ex-item select { max-width: 100%; }
.sbx-manual { margin: 8px 0; }
.sbx-pts { width: 70px; text-align: right; }
.sbx-why { width: 100%; max-width: 420px; display: block; margin-top: 4px; }
.sbx-ai { border: 1px solid var(--line, #ddd); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.sbx-ai ol { padding-left: 18px; margin: 4px 0 8px; }
.sbx-ai li { margin: 4px 0; }
.sbx-paste { width: 100%; box-sizing: border-box; font: inherit; }
.sbx-reason { font-size: 12px; }
.sbx-codes { width: 160px; margin-right: 10px; }
.sbx-aimode { margin-left: .75rem; }
.sbx-aimode label { margin-right: .75rem; font-weight: normal; cursor: pointer; }
.sbx-ai button:disabled { opacity: .5; cursor: not-allowed; }

/* Admin -> Roster watch (web/roster.js) */
.rst-text { width: 100%; display: block; margin: 4px 0 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; font: inherit; }
.rst-next { margin: 6px 0 0; max-width: 46em; }
.rst-act, .rst-date { white-space: nowrap; }
#adRoster .card-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
#adRoster h4 .seg { margin-left: 8px; vertical-align: middle; }
