/* ============================================================
   Blackjack Hand Calculator (/blackjack-calculator/, page 9230):
   the [blackjack_calculator] React plugin mounted on the shared
   .mpg- article shell (free-games.css). Loaded after free-games.css
   via the $is_hcalc_v2 gate in bjinfo_scripts().

   The calculator is a LIGHT, self-isolated widget (its bundle sets its
   own #root/.calculator-wrapper reset: white surfaces, #232838 ink,
   #0366D6 action), so the stage is a light framed card here, NOT the
   dark .bjt-frame the trainer app uses. We only style the theme-side
   stage/frame and harmonise the app's system font to the site Inter;
   the plugin bundle and its shortcode/asset gating are untouched.
   ============================================================ */

/* Give the tool more room than the trainer's 66rem breakout so the
   calculator sits in its full desktop layout (its bundle switches to a
   compact layout at =<1024px). min() keeps it inside the viewport. */
.hcalc-stage.mpg-breakout {
  width: min(72rem, calc(100vw - 2 * var(--bji-gutter)));
}

/* light framed stage; matches the calculator's own white surface so no
   colour band shows around it */
.hcalc-frame {
  background: var(--bji-surface);
  border: 1px solid var(--bji-border);
  border-radius: var(--bji-radius-xl);
  box-shadow: var(--bji-shadow-lg);
  padding: var(--bji-space-4);
  overflow: hidden;
}

/* the React app fills its container (#root { width: 100% }); bring its
   system-font stack into line with the site's Inter without editing the
   plugin bundle. Scoped to the frame so nothing else is affected. */
.hcalc-frame #root,
.hcalc-frame .calculator-wrapper { font-family: var(--bji-font-sans); }

/* usage note under the tool */
.hcalc-under { display: block; }
.hcalc-under p { margin: 0; }

/* Mobile: run the stage full-bleed edge-to-edge like the sibling tool
   pages, so the calculator gets the whole viewport width. Reset the
   breakout transform (a transformed ancestor would also trap any
   position:fixed UI the app raises on small screens). */
@media (max-width: 820px) {
  .hcalc-stage.mpg-breakout {
    position: static;
    left: auto;
    transform: none;
    width: auto;
    margin-inline: calc(-1 * var(--bji-gutter));
  }
  .hcalc-frame {
    border-radius: 0;
    border-inline: 0;
    padding: var(--bji-space-3);
  }
  .hcalc-under { padding-inline: var(--bji-gutter); }
}

/* ============================================================
   NATIVE tool (.hc-*) -- replaces the React bundle inside the frame.
   Consumes tokens.css; matches the efficiency-calculator control idiom.
   Action colour map is scoped to .hc so it never leaks to the page.
   ============================================================ */
.hc {
  font-family: var(--bji-font-sans);
  color: var(--bji-text);
  --act-hit: var(--bji-blue-500);   --act-hit-tint: var(--bji-blue-050);   --act-hit-ink: var(--bji-blue-700);
  --act-stand: var(--bji-green-500); --act-stand-tint: var(--bji-green-100); --act-stand-ink: var(--bji-green-700);
  --act-double: var(--bji-amber-500);--act-double-tint: var(--bji-amber-100);--act-double-ink: var(--bji-amber-700);
  --act-split: var(--bji-blue-700);  --act-split-tint: var(--bji-blue-100);  --act-split-ink: var(--bji-blue-800);
  --act-surr: var(--bji-red-500);    --act-surr-tint: var(--bji-red-100);    --act-surr-ink: var(--bji-red-700);
}
.hc svg { display: block; }
.hc .ico { width: 1em; height: 1em; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- rule panel (native <details>) ---- */
.hc-rules { border: 1px solid var(--bji-border); border-radius: var(--bji-radius-md); background: var(--bji-surface-sunken); margin-bottom: var(--bji-space-4); }
.hc-rules > summary { list-style: none; display: flex; align-items: center; gap: var(--bji-space-3); padding: var(--bji-space-3) var(--bji-space-4); cursor: pointer; font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); font-size: var(--bji-text-sm); }
.hc-rules > summary::-webkit-details-marker { display: none; }
.hc-rules .gear { color: var(--bji-blue-600); font-size: 1.05rem; }
.hc-rules-title { flex: none; }
.hc-rules-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; margin-right: var(--bji-space-2); }
.hc-rules-summary span { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-semibold); color: var(--bji-navy-800); background: var(--bji-surface); border: 1px solid var(--bji-border); border-radius: var(--bji-radius-pill); padding: 2px 9px; }
.hc-rules .chev { color: var(--bji-text-faint); font-size: 1rem; margin-left: auto; transition: transform var(--bji-duration) var(--bji-ease); }
.hc-rules-summary + .chev { margin-left: 0; }
.hc-rules[open] .chev { transform: rotate(180deg); }
.hc-rules[open] .hc-rules-summary { display: none; }
.hc-rules-body { padding: var(--bji-space-4); border-top: 1px solid var(--bji-border); display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--bji-space-4) var(--bji-space-5); }
.hc-field { min-width: 0; }
.hc-field > .lbl { display: block; font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: .05em; color: var(--bji-text-muted); margin-bottom: var(--bji-space-2); }
.hc-seg { display: inline-flex; border: 1px solid var(--bji-border-strong); border-radius: var(--bji-radius-md); overflow: hidden; background: var(--bji-surface); }
.hc-seg button { border: 0; background: none; padding: 6px 12px; font: inherit; font-size: var(--bji-text-sm); font-weight: var(--bji-weight-semibold); color: var(--bji-navy-800); cursor: pointer; border-right: 1px solid var(--bji-border); }
.hc-seg button:last-child { border-right: 0; }
.hc-seg button[aria-pressed="true"] { background: var(--bji-navy-900); color: #fff; }
.hc-seg button:focus-visible { outline: 2px solid var(--bji-blue-500); outline-offset: -2px; }
.hc-toggle { display: flex; align-items: center; gap: var(--bji-space-2); font: inherit; font-size: var(--bji-text-sm); font-weight: var(--bji-weight-semibold); color: var(--bji-navy-900); cursor: pointer; padding: 4px 0; border: 0; background: none; text-align: left; width: 100%; }
.hc-sw { width: 38px; height: 22px; border-radius: var(--bji-radius-pill); background: var(--bji-gray-300); position: relative; flex: none; transition: background var(--bji-duration) var(--bji-ease); }
.hc-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--bji-shadow-sm); transition: transform var(--bji-duration) var(--bji-ease); }
.hc-toggle.on .hc-sw { background: var(--bji-green-500); }
.hc-toggle.on .hc-sw::after { transform: translateX(16px); }
.hc-toggle:focus-visible { outline: 2px solid var(--bji-blue-500); outline-offset: 2px; border-radius: var(--bji-radius-sm); }
.hc-select { width: 100%; font: inherit; font-size: var(--bji-text-sm); font-weight: var(--bji-weight-semibold); color: var(--bji-navy-900); border: 1px solid var(--bji-border-strong); border-radius: var(--bji-radius-md); padding: 7px 10px; background: var(--bji-surface); }

/* ---- pickers ---- */
.hc-pick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--bji-space-4); margin-bottom: var(--bji-space-4); }
.hc-panel { border: 1px solid var(--bji-border); border-radius: var(--bji-radius-md); padding: var(--bji-space-3) var(--bji-space-4) var(--bji-space-4); background: var(--bji-surface); min-width: 0; }
.hc-panel > .hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--bji-space-3); }
.hc-panel .hd h3 { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: .07em; color: var(--bji-navy-900); margin: 0; }
.hc-clear { border: 0; background: none; font: inherit; font-size: var(--bji-text-xs); font-weight: var(--bji-weight-semibold); color: var(--bji-text-muted); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.hc-clear:hover { color: var(--bji-red-500); }
.hc-hand { display: flex; align-items: center; gap: var(--bji-space-3); min-height: 78px; }
.hc-cards { display: flex; gap: 6px; flex-wrap: wrap; }
.card-face { width: 52px; height: 74px; border-radius: 8px; background: #fff; border: 1px solid var(--bji-gray-300); box-shadow: var(--bji-shadow-sm); position: relative; font-weight: var(--bji-weight-black); color: var(--bji-navy-900); flex: none; }
.card-face .r { position: absolute; top: 5px; left: 7px; font-size: 1.05rem; line-height: 1; }
.card-face .p { position: absolute; bottom: 5px; right: 7px; font-size: 1.05rem; line-height: 1; }
.card-face .mid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.card-face.red { color: var(--bji-red-500); }
.card-face.empty { background: var(--bji-surface-sunken); border: 1px dashed var(--bji-border-strong); box-shadow: none; }
.hc-total { margin-left: auto; text-align: right; flex: none; }
.hc-total .n { font-size: var(--bji-text-3xl); font-weight: var(--bji-weight-black); color: var(--bji-navy-900); line-height: 1; font-variant-numeric: tabular-nums; }
.hc-total .t { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: .06em; color: var(--bji-text-muted); }
.hc-total .t.soft { color: var(--bji-blue-600); }
.hc-ranks { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 5px; margin-top: var(--bji-space-3); }
.rank { border: 1px solid var(--bji-border-strong); background: var(--bji-surface); border-radius: var(--bji-radius-sm); padding: 8px 0; font: inherit; font-size: var(--bji-text-sm); font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); cursor: pointer; text-align: center; transition: all var(--bji-duration-fast, 120ms) var(--bji-ease); }
.rank:hover { border-color: var(--bji-blue-400); background: var(--bji-blue-050); }
.rank.sel { background: var(--bji-navy-900); border-color: var(--bji-navy-900); color: #fff; }
.rank:focus-visible { outline: 2px solid var(--bji-blue-500); outline-offset: 1px; }

/* ---- result (reserved height, no layout shift) ---- */
.hc-result { min-height: 300px; margin-top: var(--bji-space-2); }
.hc-empty { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--bji-space-3); text-align: center; border: 1px dashed var(--bji-border-strong); border-radius: var(--bji-radius-md); background: var(--bji-surface-sunken); color: var(--bji-text-muted); padding: var(--bji-space-5); }
.hc-empty .big { width: 44px; height: 44px; color: var(--bji-gray-400); }
.hc-empty p { margin: 0; font-size: var(--bji-text-sm); max-width: 34ch; }
.hc-result-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: var(--bji-space-4); }

.hc-hero { border: 1px solid var(--bji-border); border-left: 5px solid var(--act, var(--bji-green-500)); border-radius: var(--bji-radius-md); background: var(--bji-surface); padding: var(--bji-space-4) var(--bji-space-5); box-shadow: var(--bji-shadow-sm); }
.hc-hero.act-hit { --act: var(--act-hit); --act-tint: var(--act-hit-tint); --act-ink: var(--act-hit-ink); }
.hc-hero.act-stand { --act: var(--act-stand); --act-tint: var(--act-stand-tint); --act-ink: var(--act-stand-ink); }
.hc-hero.act-double { --act: var(--act-double); --act-tint: var(--act-double-tint); --act-ink: var(--act-double-ink); }
.hc-hero.act-split { --act: var(--act-split); --act-tint: var(--act-split-tint); --act-ink: var(--act-split-ink); }
.hc-hero.act-surr { --act: var(--act-surr); --act-tint: var(--act-surr-tint); --act-ink: var(--act-surr-ink); }
.hc-hero .cap { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: .08em; color: var(--bji-text-faint); margin-bottom: var(--bji-space-2); }
.hc-hero .verdict { display: flex; align-items: center; gap: var(--bji-space-3); }
.hc-badge { width: 52px; height: 52px; border-radius: var(--bji-radius-md); display: flex; align-items: center; justify-content: center; background: var(--act-tint, var(--bji-green-100)); color: var(--act, var(--bji-green-600)); flex: none; }
.hc-badge svg { width: 28px; height: 28px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hc-hero .word { font-size: var(--bji-text-3xl); font-weight: var(--bji-weight-black); color: var(--act-ink, var(--bji-green-700)); line-height: 1; letter-spacing: -.01em; }
.hc-hero .say { font-size: var(--bji-text-base); color: var(--bji-text); margin: var(--bji-space-3) 0 0; }

.hc-alts { margin-top: var(--bji-space-4); }
.hc-alts .h { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: .07em; color: var(--bji-text-muted); margin-bottom: var(--bji-space-2); }
.alt { display: grid; grid-template-columns: 104px 1fr auto; align-items: center; gap: var(--bji-space-3); padding: 6px 0; }
.alt + .alt { border-top: 1px dashed var(--bji-border); }
.alt .name { display: flex; align-items: center; gap: 7px; font-size: var(--bji-text-sm); font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); }
.alt .name .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--bji-gray-400)); flex: none; }
.alt .bar { height: 8px; border-radius: var(--bji-radius-pill); background: var(--bji-gray-100); position: relative; overflow: hidden; }
.alt .bar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c, var(--bji-gray-400)); border-radius: var(--bji-radius-pill); }
.alt .ev { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); text-align: right; min-width: 84px; text-transform: uppercase; letter-spacing: .03em; }
.alt.best .ev { color: var(--bji-green-700); }
.alt.na { opacity: .55; }
.alt.na .ev { color: var(--bji-text-faint); }

.hc-side { display: flex; flex-direction: column; gap: var(--bji-space-4); }
.hc-mini { border: 1px solid var(--bji-border); border-radius: var(--bji-radius-md); background: var(--bji-surface-sunken); padding: var(--bji-space-3) var(--bji-space-4); }
.hc-mini h4 { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: .07em; color: var(--bji-navy-900); margin: 0 0 var(--bji-space-3); display: flex; align-items: center; gap: .5em; }
.hc-mini h4 .up { background: var(--bji-navy-900); color: #fff; border-radius: 5px; padding: 1px 7px; font-size: var(--bji-text-sm); font-weight: var(--bji-weight-black); }
.dbar { display: grid; grid-template-columns: 64px 1fr 40px; align-items: center; gap: 8px; font-size: var(--bji-text-xs); margin: 5px 0; }
.dbar .k { color: var(--bji-text-muted); font-weight: var(--bji-weight-semibold); }
.dbar .track { height: 9px; background: var(--bji-gray-200); border-radius: var(--bji-radius-pill); overflow: hidden; }
.dbar .track > i { display: block; height: 100%; border-radius: var(--bji-radius-pill); background: var(--bji-blue-400); }
.dbar.bust .track > i { background: var(--bji-green-500); }
.dbar .v { text-align: right; font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); font-variant-numeric: tabular-nums; }
.hc-edge { display: flex; align-items: baseline; gap: 8px; }
.hc-edge .n { font-size: var(--bji-text-2xl); font-weight: var(--bji-weight-black); color: var(--bji-navy-900); font-variant-numeric: tabular-nums; }
.hc-edge .u { font-size: var(--bji-text-xs); color: var(--bji-text-muted); }
.hc-src { margin-top: 6px; font-size: 11px; color: var(--bji-text-faint); }

.hc-why { margin-top: var(--bji-space-4); border-top: 1px solid var(--bji-border); padding-top: var(--bji-space-4); }
.hc-why h4 { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: .07em; color: var(--bji-navy-900); margin: 0 0 var(--bji-space-2); }
.hc-why p { margin: 0 0 var(--bji-space-3); font-size: var(--bji-text-sm); color: var(--bji-text); line-height: var(--bji-leading-snug); }
.hc-why .rulenote { display: flex; flex-wrap: wrap; gap: 6px; }
.hc-why .rulenote span { font-size: var(--bji-text-xs); background: var(--bji-blue-050); border: 1px solid var(--bji-blue-200); color: var(--bji-blue-800); border-radius: var(--bji-radius-pill); padding: 2px 10px; font-weight: var(--bji-weight-semibold); }

/* ---- crawlable reference table (below the stage) ---- */
.hc-refwrap { max-width: var(--bji-prose-width); margin: var(--bji-space-6) auto 0; }
.hc-ref-h { font-size: var(--bji-text-2xl); font-weight: var(--bji-weight-bold); margin: 0 0 var(--bji-space-2); }
.hc-ref-intro { margin: 0 0 var(--bji-space-4); font-size: var(--bji-text-base); color: var(--bji-text-muted); }
.hc-ref-scroll { min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hc-ref-table { width: 100%; border-collapse: collapse; font-size: var(--bji-text-sm); }
.hc-ref-table caption { caption-side: bottom; text-align: left; padding: var(--bji-space-2) 0 0; font-size: var(--bji-text-xs); color: var(--bji-text-muted); }
.hc-ref-table thead th { text-align: center; font-size: var(--bji-text-xs); text-transform: uppercase; letter-spacing: .03em; color: var(--bji-text-muted); font-weight: var(--bji-weight-bold); padding: var(--bji-space-2); border-bottom: 2px solid var(--bji-border-strong); white-space: nowrap; }
.hc-ref-table thead th:first-child { text-align: left; }
.hc-ref-table tbody td, .hc-ref-table tbody th { padding: var(--bji-space-2); border-bottom: 1px solid var(--bji-border); text-align: center; vertical-align: middle; font-variant-numeric: tabular-nums; color: var(--bji-text); }
.hc-ref-table tbody th { text-align: left; font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); }
.hc-ref-table .hc-ref-bust { color: var(--bji-green-700); font-weight: var(--bji-weight-semibold); }

/* ---- responsive ---- */
@media (max-width: 720px) {
  .hc-result-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hc-pick { grid-template-columns: 1fr; }
  .hc-ranks { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}

/* ---- click-to-remove: card faces are real <button>s (hand + dealer) ----
   Reset the button chrome back to the .card-face look, add a subtle lift on
   hover/focus, and reveal an "x" badge in the free top-right corner. On touch
   devices (no hover) the badge stays visible so the affordance is discoverable. */
button.card-face {
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: transform var(--bji-duration-fast) var(--bji-ease),
              box-shadow var(--bji-duration-fast) var(--bji-ease),
              border-color var(--bji-duration-fast) var(--bji-ease);
}
button.card-face:hover,
button.card-face:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--bji-shadow-md);
  border-color: var(--bji-red-500);
}
button.card-face:focus-visible {
  outline: 2px solid var(--bji-blue-500);
  outline-offset: 2px;
}
.card-face .rm {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bji-red-500);
  color: #fff;
  box-shadow: var(--bji-shadow-sm);
  opacity: 0;
  transform: scale(.6);
  transition: opacity var(--bji-duration-fast) var(--bji-ease),
              transform var(--bji-duration-fast) var(--bji-ease);
  pointer-events: none;
}
.card-face .rm svg {
  width: 9px;
  height: 9px;
  stroke: currentColor;
  stroke-width: 2.6;
  fill: none;
  stroke-linecap: round;
}
button.card-face:hover .rm,
button.card-face:focus-visible .rm {
  opacity: 1;
  transform: scale(1);
}
@media (hover: none) {
  .card-face .rm { opacity: 1; transform: scale(1); }
}

/* ============================================================
   PHASE-2 EV ENGINE UI (.hc-odds / .hc-cmp / insurance / computing)
   Real per-action win/push/lose + expected value from js/hand-odds-engine.js
   (window.BJIOdds). v2 tokens only; action colour map inherited from .hc.
   ============================================================ */

/* positive / negative EV text */
.hc .up { color: var(--bji-green-700); }
.hc .dn { color: var(--bji-red-600); }

/* ---- "Your odds" headline for the recommended play ---- */
.hc-odds { margin-top: var(--bji-space-4); border: 1px solid var(--bji-border); border-left: 5px solid var(--act, var(--bji-green-500)); border-radius: var(--bji-radius-md); background: var(--bji-surface-sunken); padding: var(--bji-space-4) var(--bji-space-5); }
.hc-odds.act-hit { --act: var(--act-hit); } .hc-odds.act-stand { --act: var(--act-stand); }
.hc-odds.act-double { --act: var(--act-double); } .hc-odds.act-split { --act: var(--act-split); }
.hc-odds.act-surr { --act: var(--act-surr); }
.hc-odds .cap { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: .07em; color: var(--bji-text-muted); margin-bottom: var(--bji-space-3); }
.hc-odds .odds3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--bji-space-3); }
.hc-odds .od { text-align: center; border-radius: var(--bji-radius-sm); padding: var(--bji-space-2) 4px; background: var(--bji-surface); border: 1px solid var(--bji-border); }
.hc-odds .od .n { display: block; font-size: var(--bji-text-2xl); font-weight: var(--bji-weight-black); line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--bji-navy-900); }
.hc-odds .od .l { display: block; font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: .05em; color: var(--bji-text-muted); margin-top: 3px; }
.hc-odds .od.win .n { color: var(--bji-green-700); } .hc-odds .od.lose .n { color: var(--bji-red-600); } .hc-odds .od.push .n { color: var(--bji-navy-700); }
.hc-odds .evline { display: flex; align-items: baseline; justify-content: space-between; margin-top: var(--bji-space-3); padding-top: var(--bji-space-3); border-top: 1px solid var(--bji-border); }
.hc-odds .evline .k { font-size: var(--bji-text-sm); font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); }
.hc-odds .evline .v { font-size: var(--bji-text-xl); font-weight: var(--bji-weight-black); font-variant-numeric: tabular-nums; }
.hc-odds .evline .per { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-semibold); color: var(--bji-text-muted); }

/* ---- comparison table (every legal action, real EV) ---- */
.hc-cmp { margin-top: var(--bji-space-4); }
.hc-cmp .h { font-size: var(--bji-text-xs); font-weight: var(--bji-weight-bold); text-transform: uppercase; letter-spacing: .07em; color: var(--bji-text-muted); margin-bottom: var(--bji-space-2); }
.hc-cmp .h .sub { display: block; font-weight: var(--bji-weight-semibold); text-transform: none; letter-spacing: 0; color: var(--bji-text-faint); font-size: 11px; margin-top: 2px; }
.hc-cmp-head, .cmp-row { display: grid; grid-template-columns: minmax(92px, 1.15fr) 46px 46px 46px 62px minmax(72px, 1.3fr); align-items: center; gap: var(--bji-space-2); }
.hc-cmp-head { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--bji-text-faint); font-weight: var(--bji-weight-bold); padding: 0 0 4px; border-bottom: 1px solid var(--bji-border); }
.hc-cmp-head span { text-align: right; } .hc-cmp-head span:first-child { text-align: left; } .hc-cmp-head .barh { text-align: left; }
.cmp-row { padding: 7px 0; border-bottom: 1px solid var(--bji-border); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row .nm { display: flex; align-items: center; gap: 7px; font-size: var(--bji-text-sm); font-weight: var(--bji-weight-bold); color: var(--bji-navy-900); }
.cmp-row .nm .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--bji-gray-400)); flex: none; }
.cmp-row .nm .tag { font-size: 9px; font-weight: var(--bji-weight-black); text-transform: uppercase; letter-spacing: .04em; color: #fff; background: var(--bji-green-600); border-radius: var(--bji-radius-pill); padding: 1px 6px; }
.cmp-row .nm .approx { color: var(--bji-text-faint); font-weight: var(--bji-weight-bold); cursor: help; margin-left: 1px; }
.cmp-row .c { text-align: right; font-size: var(--bji-text-xs); font-variant-numeric: tabular-nums; color: var(--bji-text); }
.cmp-row .c.dim { color: var(--bji-text-faint); }
.cmp-row .ev { text-align: right; font-size: var(--bji-text-sm); font-weight: var(--bji-weight-black); font-variant-numeric: tabular-nums; }
.cmp-row.best { background: var(--bji-green-050, var(--bji-green-100)); border-radius: var(--bji-radius-sm); margin: 0 -8px; padding-inline: 8px; }
.cmp-row.na { opacity: .6; }
.cmp-row.na .na-reason { grid-column: 2 / -1; text-align: left; font-size: var(--bji-text-xs); font-style: italic; color: var(--bji-text-faint); }
/* diverging EV bar: centre = break-even, right = +EV (green), left = -EV (red) */
.cmp-row .bar { position: relative; height: 10px; background: var(--bji-gray-100); border-radius: var(--bji-radius-pill); overflow: hidden; }
.cmp-row .bar .zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--bji-border-strong); }
.cmp-row .bar > i { position: absolute; top: 1px; bottom: 1px; border-radius: var(--bji-radius-pill); }
.cmp-row .bar > i.pos { background: var(--bji-green-500); }
.cmp-row .bar > i.neg { background: var(--bji-red-400); }
.cmp-row .bar .reason { position: absolute; inset: 0; display: flex; align-items: center; font-size: 11px; font-style: italic; color: var(--bji-text-faint); }

/* ---- insurance ---- */
.hc-ins h4 svg { width: 1em; height: 1em; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; color: var(--bji-amber-600); }
.hc-ins p { margin: 0 0 4px; font-size: var(--bji-text-xs); color: var(--bji-text); line-height: var(--bji-leading-snug); }
.hc-ins p b.up { color: var(--bji-green-700); } .hc-ins p b.dn { color: var(--bji-red-600); }

/* ---- composition-dependent exception note ---- */
.hc-cdnote { margin-top: var(--bji-space-4); border: 1px solid var(--bji-amber-300, var(--bji-amber-500)); background: var(--bji-amber-050, var(--bji-amber-100)); border-radius: var(--bji-radius-md); padding: var(--bji-space-3) var(--bji-space-4); font-size: var(--bji-text-sm); color: var(--bji-navy-900); line-height: var(--bji-leading-snug); }
.hc-cdnote b { color: var(--bji-amber-700); }

/* ---- computing state (overlay; no layout shift) ---- */
.hc-result { position: relative; }
.hc-computing { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: var(--bji-space-3); background: color-mix(in srgb, var(--bji-surface) 78%, transparent); border-radius: var(--bji-radius-md); font-size: var(--bji-text-sm); font-weight: var(--bji-weight-semibold); color: var(--bji-text-muted); z-index: 3; }
.hc-result:not(.is-computing) .hc-computing { display: none; }
.hc-computing .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bji-border-strong); border-top-color: var(--bji-blue-500); animation: hc-spin .7s linear infinite; }
@keyframes hc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hc-computing .spin { animation-duration: 2s; } }

@media (max-width: 560px) {
  /* drop the bar column; keep the full win / push / lose / EV numbers */
  .hc-cmp-head, .cmp-row { grid-template-columns: minmax(74px, 1fr) 42px 42px 42px 58px; }
  .hc-cmp-head .barh, .cmp-row .bar { display: none; }
  .cmp-row.na .na-reason { grid-column: 2 / -1; }
}
