/* Round 4 (Jayson, ONLINE IFA EDITS _ 3, 11/19): workstream d2 — results header, implementation dialog, results modules.
   Bavvy = brand navy fills; today / the group plan = grey fills (7.12). */
.bp { --r4-today-er: #6f7d8b; --r4-today-ee: #c3ccd5; --r4-bavvy-er: var(--brand-primary, #005893); --r4-bavvy-ee: #8bb8dc; }

/* ---------- blue header: exact totals + the two actions (7.1, 7.2, 7.13) */
.bp-hero.r4-hd { display: grid; grid-template-columns: 1fr auto; gap: 1rem 1.5rem; align-items: center; }
.bp-hero.r4-hd .r4-nums { display: flex; flex-wrap: wrap; gap: 1rem 2rem; }
.bp-hero.r4-hd .v { font-variant-numeric: tabular-nums; font-size: 1.55rem; }
.bp-hero.r4-hd .r4-save .v { font-size: 1.75rem; }
.bp-hero .r4-tip { font-size: .8rem; opacity: .85; cursor: help; margin-left: .2rem; }
.bp-hero .r4-acts { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; min-width: 15rem; }
.bp-hero .r4-btn-light { background: #fff; color: var(--brand-primary, #005893); border-radius: 999px; font-weight: 700; border: 0; padding: .55rem 1.1rem; }
.bp-hero .r4-btn-light:hover { background: var(--brand-accent-navy, #CCDEE9); color: var(--brand-primary, #005893); }
.bp-hero .r4-btn-go { background: var(--brand-secondary, #FF6400); color: #fff; border-radius: 999px; font-weight: 700; border: 0; padding: .55rem 1.1rem; }
.bp-hero .r4-btn-go:hover { filter: brightness(.95); color: #fff; }
.bp-hero .r4-sub { display: flex; gap: .9rem; justify-content: center; font-size: .8rem; flex-wrap: wrap; }
.bp-hero .r4-sub a { color: #d6e6f4; }
.bp-hero .r4-err { grid-column: 1 / -1; color: #ffd2c8; font-size: .85rem; }
@media (max-width: 900px) { .bp-hero.r4-hd { grid-template-columns: 1fr; } }

.r4-notes { display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: .85rem; margin: -.4rem 0 .6rem; color: #3c5872; }
.r4-notes .warn { color: var(--bp-warn, #b26a00); }

/* ---------- implementation review dialog (7.3–7.6, 7.9) */
.r4-modal { position: fixed; inset: 0; background: rgba(13, 30, 48, .45); z-index: 1050; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 1rem; overflow-y: auto; }
.r4-dialog { background: #fff; border-radius: 14px; max-width: 640px; width: 100%; padding: 1.3rem 1.5rem; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.r4-dlg-hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.r4-dlg-hd h3 { margin: 0; color: var(--brand-primary, #005893); font-size: 1.3rem; }
.r4-dialog h4 { font-size: .95rem; margin: .8rem 0 .35rem; font-family: var(--bp-font, inherit); font-weight: 700; }
.r4-sent td:first-child { color: var(--bp-muted); width: 38%; }
.r4-recip { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: .6rem; }
.r4-recip label { font-size: .8rem; color: var(--bp-muted); display: flex; flex-direction: column; gap: .2rem; }
.r4-dlg-ft { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
@media (max-width: 640px) { .r4-recip { grid-template-columns: 1fr; } }

/* ---------- module groups (8.17, 8.18) */
.r4-grp-hd { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .6rem; flex-wrap: wrap; }
.r4-grp-hd h3 { margin: 0; font-size: 1.1rem; color: var(--brand-primary, #005893); }
.r4-grp-hd span { font-size: .85rem; color: var(--bp-muted); }
.r4-edit .bp-tab.on { box-shadow: 0 1px 3px rgba(13,47,79,.16), inset 0 -2px 0 var(--brand-primary-2, #00989F); }
.r4-edit .bp-tab.on i { color: var(--brand-primary-2, #00989F); }

.r4-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; background: var(--c, #999); }
.r4-legend .today-er { --c: var(--r4-today-er); } .r4-legend .today-ee { --c: var(--r4-today-ee); }
.r4-legend .bavvy-er { --c: var(--r4-bavvy-er); } .r4-legend .bavvy-ee { --c: var(--r4-bavvy-ee); }
.r4-legend .today-line::before { height: 3px; width: 16px; vertical-align: 3px; --c: var(--r4-today-er); }
.r4-legend .bavvy-line::before { height: 3px; width: 16px; vertical-align: 3px; --c: var(--r4-bavvy-er); }

/* snapshot: grey for the group plan, navy for Bavvy (7.12) */
.r4-snap .row1.today .er { background: var(--r4-today-er); } .r4-snap .row1.today .ee { background: var(--r4-today-ee); }
.r4-snap .row1.today .ee span { color: #2b3845; }
.r4-snap .row1.bavvy .er { background: var(--r4-bavvy-er); } .r4-snap .row1.bavvy .ee { background: var(--r4-bavvy-ee); }
.r4-snap .row1.today .lbl { color: #55626f; }

/* projection line graph (8.4–8.6) */
.r4-chips { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .88rem; margin-bottom: .3rem; }
.r4-chips b.g { color: var(--bp-ok, #1f8a4c); } .r4-chips b.r { color: var(--bp-bad, #c0392b); }
.r4-sw { display: inline-block; width: 16px; height: 3px; border-radius: 2px; vertical-align: 3px; margin-right: .35rem; }
.r4-sw.today { background: var(--r4-today-er); } .r4-sw.bavvy { background: var(--r4-bavvy-er); }
.r4-line { width: 100%; max-width: 760px; height: auto; display: block; }
.r4-line .grid { stroke: #e6ebf0; stroke-width: 1; }
.r4-line .ax { font-size: 11px; fill: #7a8794; }
.r4-line .ln { fill: none; stroke-width: 3; stroke-linejoin: round; }
.r4-line .ln.today { stroke: var(--r4-today-er); stroke-dasharray: 6 4; } .r4-line .ln.bavvy { stroke: var(--r4-bavvy-er); }
.r4-line .pt.today { fill: var(--r4-today-er); } .r4-line .pt.bavvy { fill: var(--r4-bavvy-er); }
.r4-line .val { font-size: 12px; font-weight: 700; } .r4-line .val.today { fill: #55626f; } .r4-line .val.bavvy { fill: var(--r4-bavvy-er); }

/* metal levels: one row per option, employer part + employee part, dotted employer contribution (8.1–8.3) */
.r4-dash { display: inline-block; width: 18px; border-top: 2px dashed var(--brand-secondary, #FF6400); vertical-align: middle; }
.r4-metals { display: flex; flex-direction: column; gap: .4rem; margin-top: .6rem; }
.r4-mrow { display: grid; grid-template-columns: 1.2rem 18.5rem 1fr 8.5rem; gap: .7rem; align-items: center; padding: .45rem .6rem; border-radius: 10px; border: 1px solid transparent; cursor: pointer; margin: 0; }
.r4-mrow:hover { background: #f6f9fc; }
.r4-mrow.on { border-color: var(--brand-accent-navy, #CCDEE9); background: #f3f8fc; }
.r4-mrow .lbl { font-weight: 600; display: flex; align-items: center; gap: .45rem; font-size: .9rem; white-space: nowrap; }
.r4-mrow .track { position: relative; display: flex; height: 22px; background: #eef1f5; border-radius: 6px; overflow: visible; }
.r4-mrow .track .er { background: var(--r4-bavvy-er); border-radius: 6px 0 0 6px; }
.r4-mrow .track .ee { background: var(--r4-bavvy-ee); }
.r4-mrow .track .allow { position: absolute; top: -5px; bottom: -5px; left: var(--allow); border-left: 2px dashed var(--brand-secondary, #FF6400); }
.r4-mrow .tot { text-align: right; font-variant-numeric: tabular-nums; line-height: 1.1; }
.r4-mrow .tot small { display: block; font-size: .72rem; color: var(--bp-muted); }
@media (max-width: 900px) { .r4-mrow { grid-template-columns: 1.2rem 1fr 7rem; } .r4-mrow .track { grid-column: 2 / -1; } }

/* example employee (6.15–6.17, 8.7, 8.8) */
.r4-ex-hd { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.r4-ex-hd label { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .88rem; margin: 0; }
.r4-ex-hd select { min-width: 15rem; }
.r4-ex-hd .r4-who { color: #3c5872; font-size: .9rem; }
.bp-plancard .ttl { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.bp-plancard .r4-level { width: auto; padding-top: .1rem; padding-bottom: .1rem; font-size: .8rem; }
.r4-medicare summary { cursor: pointer; font-size: .88rem; }

/* classes: today vs with Bavvy, include boxes in the table (8.9–8.13) */
.r4-class th.today, .r4-class td.today { background: #f4f6f8; }
.r4-class th.bavvy, .r4-class td.bavvy { background: color-mix(in srgb, var(--brand-accent-navy, #CCDEE9) 35%, #fff); }
.r4-class tr.grp th { text-align: center; text-transform: uppercase; font-size: .7rem; letter-spacing: .06em; border-bottom: 0; }
.r4-class tr.grp th.bavvy { color: var(--brand-primary, #005893); }
.r4-class tr.off td { color: var(--bp-muted); }
.r4-delta { font-weight: 700; font-variant-numeric: tabular-nums; border-radius: 6px; padding: .1rem .4rem; }
.r4-delta.g { color: var(--bp-ok, #1f8a4c); background: #e7f5ec; } .r4-delta.r { color: var(--bp-bad, #c0392b); background: #fbe9e6; }

/* carrier mapping: Return to automatic mapping beside the mapping (8.16) */
.bp-loc .r4-map { display: inline-flex; align-items: center; }
