/* insights: the overview's sub-pages (Your coverage, How you compare, Lower your risk). */

/* Coverage fit rows. Version 4 keeps them on the policy page ("Is it the right size?", 4.11) and their bar on the policy cards (.pfit, 3.13):
   policies depends on .fit-bar and the rows here. The band reads the chart tokens (3.6). */
/* A named container, so its queries never reach the policy cards (.pcards-wrap is a container too) */
.fit { container: fit / inline-size; }
.fit > .fit-row + .fit-row { border-top: 1px solid var(--line); }
.fit-row { position: relative; }
.fit-grid { display: grid; grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) 250px 20px; gap: var(--s-5) var(--s-6); align-items: start; padding: var(--row-y) 0; }
.fit-toggle { display: block; text-align: left; line-height: var(--lh-ui); color: var(--ink); }
.fit-toggle::after { content: ""; position: absolute; inset: 0; z-index: 0; cursor: pointer; }
.fit-toggle:focus-visible { outline: none; }
.fit-toggle:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }   /* a disclosure (3.3) */
.fit-row:has(.fit-toggle:hover) .fit-chev { color: var(--ink); }
.fit-row:has(.fit-toggle:focus-visible) { outline: var(--v8-focus); outline-offset: 0; border-radius: var(--r-md); box-shadow: var(--v8-focus-glow); }
.fit-name .s { display: block; margin-top: 2px; color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); }
.fit-bar { position: relative; height: 48px; }
/* With its labels (the policy page's rows), the bar is a container 28 of padding above the labels' line, so under 400 wide
   (phones, and the wide row between about 1230 and 1280) "Fits …" drops to a second line instead of printing over "You: …" */
.fit-bar:has(> .lbls) { height: auto; padding-top: 28px; container: fbar / inline-size; }
.fit-bar .trk { position: absolute; left: 0; right: 0; top: 10px; height: 4px; border-radius: 2px; background: var(--line); }
.fit-bar .band { position: absolute; top: 2px; height: 20px; border-radius: var(--r-sm); background: var(--data-target-fill); box-shadow: inset 0 0 0 1px var(--data-target-edge); }
.fit-bar .you { position: absolute; left: 0; top: 10px; height: 4px; border-radius: 2px; background: var(--data-you); }
/* Your mark is a 2 wide tick the band's height, not a round dot: a dot at the end of a green fill is the needs finder's
   slider thumb, and this bar can't be dragged. "You: nothing" is the same tick at 0 in --field */
.fit-bar .you::after { content: ""; position: absolute; right: -1px; top: -8px; width: 2px; height: 20px; border-radius: 1px; background: var(--data-you); }
.fit-bar .none { position: absolute; left: 0; top: 2px; width: 2px; height: 20px; border-radius: 1px; background: var(--field); }
.fit-bar .lbls { position: relative; display: block; height: var(--lh-small); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); white-space: nowrap; }
.fit-bar .lbls .yl { position: absolute; left: clamp(0px, calc(var(--x) - 1px), calc(100% - 10em)); }
.fit-bar .lbls .yl.r { left: auto; right: clamp(0px, calc(100% - var(--x) - 1px), calc(100% - 10em)); }
.fit-bar .lbls .fl { position: absolute; right: 0; }
.fit-bar .lbls .fl.l { right: auto; left: 0; }
@container fbar (max-width: 399px) {
  .fit-bar .lbls { height: calc(2 * var(--lh-small)); }
  .fit-bar .lbls .fl { top: var(--lh-small); }
}
.fit-verdict { position: relative; z-index: 1; pointer-events: none; }
.fit-verdict > * { pointer-events: auto; }
.fit-verdict .vw { display: flex; align-items: center; gap: var(--s-2); font-weight: 700; line-height: var(--lh-ui); pointer-events: none; }
.fit-verdict .vw.right { font-weight: 400; color: var(--ink-2); }
.fit-verdict .vw svg.i { color: var(--ink); }
.fit-verdict .vw.right svg.i { color: var(--green); stroke-width: 1.5; }
.fit-verdict .fix { margin-top: 4px; display: block; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); }
.fit-verdict .fix .link { display: inline; font-size: var(--fs-small); line-height: var(--lh-small); padding-block: 2px; }
.fit-chev { display: grid; justify-items: end; color: var(--ink-2); padding-top: 1px; pointer-events: none; }
.fit-chev svg.i { transition: transform .2s var(--ease); }
.fit-row.open .fit-chev svg.i { transform: rotate(180deg); }
.fit-more { position: relative; z-index: 1; margin: 0 0 var(--row-y) calc(min(200px, 25%) + var(--s-6)); padding: var(--s-4) 20px; border-radius: var(--r-md); background: var(--sunk); }
.fit-more[hidden] { display: none; }
.fit-more p { max-width: 70ch; }
.fit-more .acts { margin-top: var(--s-3); display: flex; gap: var(--s-5); flex-wrap: wrap; }
@container fit (max-width: 879px) {
  .fit-grid { grid-template-columns: minmax(0, 1fr) auto 20px; gap: var(--s-3) var(--s-4); }
  .fit-name { grid-column: 1; grid-row: 1; }
  .fit-verdict { grid-column: 2; grid-row: 1; justify-self: end; text-align: right; }
  .fit-verdict .vw { justify-content: flex-end; }
  .fit-chev { grid-column: 3; grid-row: 1; }
  .fit-bar { grid-column: 1 / -1; grid-row: 2; }
  .fit-more { margin-left: 0; }
}
@container fit (max-width: 479px) {
  .fit-grid { grid-template-columns: minmax(0, 1fr) 20px; }
  .fit-verdict { grid-column: 1; grid-row: 2; justify-self: start; text-align: left; }
  .fit-verdict .vw { justify-content: flex-start; }
  .fit-chev { grid-column: 2; grid-row: 1; }
  .fit-bar { grid-row: 3; }
}

/* ---------- Shared bars: How you compare's claim causes and the invoice's "What it's for" (invoices.js) ---------- */
.hbars { display: grid; gap: var(--s-4); list-style: none; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px var(--s-4); align-items: center; }
.hbar .name { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.hbar .fill { height: 8px; border-radius: 0 4px 4px 0; background: var(--data-other); min-width: 2px; }
.hbar.you .fill { background: var(--data-you); }
.hbar .val { font-variant-numeric: tabular-nums; text-align: right; min-width: 48px; }
.hbar .act { grid-column: 1 / -1; }
/* =================================================================
   Your coverage (4.7): If something went wrong tomorrow
   ================================================================= */
.cov .sec-head .case-legend { padding-top: 3px; }               /* on the h2's middle */
.cases { container: cov / inline-size; }
.case { position: relative; display: grid; grid-template-columns: 40px minmax(200px, 280px) minmax(0, 1fr) 220px 20px;
  gap: var(--s-4) var(--s-5); align-items: start; padding: var(--row-y) 0; }
.case + .case, .case + .case-fold { border-top: 1px solid var(--line); }
.case > .it { grid-column: 1; grid-row: 1; }
.case-t { grid-column: 2; grid-row: 1; min-width: 0; padding-top: 9px; }       /* the name on the tile's middle */
.case-bar { grid-column: 3; grid-row: 1; min-width: 0; padding-top: 9px; }
.case-vs { grid-column: 4; grid-row: 1; display: grid; gap: var(--s-3); align-content: start; padding-top: 9px; }
.case-chev { grid-column: 5; grid-row: 1; display: grid; justify-items: end; padding-top: 10px; color: var(--ink-2); pointer-events: none; }
.case-chev svg.i { width: 20px; height: 20px; transition: transform .2s var(--ease); }
.case.open .case-chev svg.i { transform: rotate(180deg); }

/* The disclosure (3.3): the name is the button, its overlay makes the whole row one target; no wash, which would hide the lime and the bar's outline */
.case-h { margin: 0; font: inherit; letter-spacing: inherit; }   /* the case's name is a heading holding the button (APG Accordion) */
.case-toggle { display: block; text-align: left; font-weight: 700; line-height: var(--lh-ui); color: var(--ink); }
.case-toggle::after { content: ""; position: absolute; inset: 0; z-index: 0; cursor: pointer; }
.case-toggle:focus-visible { outline: none; }
.case:has(.case-toggle:focus-visible) { outline: var(--v8-focus); outline-offset: 0; border-radius: var(--r-md); box-shadow: var(--v8-focus-glow); }
.case-toggle:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.case:has(.case-toggle:hover) .case-chev { color: var(--ink); }
.case .above { position: relative; z-index: 1; }
.case .link { display: inline; font-size: inherit; line-height: inherit; }    /* inline in its sentence (3.9) */

.case-c { margin-top: 2px; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); }
.case-step { margin-top: var(--s-2); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); }
.case-step.is-done { display: flex; align-items: flex-start; gap: 6px; }
.case-step.is-done svg.i { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--green); stroke-width: 1.5; }

/* The bar at its cost's width, the figure 12 after it. The figure's room is set aside first, so every row shares one scale */
.case-bar { container: cbar / inline-size; }
.case-line { --fig: 144px; display: flex; align-items: center; gap: var(--s-3); min-height: var(--lh-ui); }
.case-bw { flex: none; width: calc((100% - var(--fig) - var(--s-3)) * var(--w)); min-width: var(--s-2); }
.case-left { white-space: nowrap; line-height: var(--lh-ui); font-variant-numeric: tabular-nums; }
.case-left b { font-weight: 700; }
.case-pay { margin-top: var(--s-2); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); font-variant-numeric: tabular-nums; }
/* A bar column under 360 (the wide row between 880 and about 1000, and every phone) would leave the longest bar a stub
   beside the figure's 144: the figure goes to its own line under the bar, and the bars take the column's full width */
@container cbar (max-width: 359px) {
  .case-line { flex-wrap: wrap; row-gap: var(--s-2); }
  .case-bw { width: calc(100% * var(--w)); }
  .case-left { flex-basis: 100%; }
}

/* The verdict per item: a problem in Label ink, "Right size" in Body gray with the green check; the change under it */
.case-v .vw { display: flex; align-items: flex-start; gap: var(--s-2); font-weight: 700; line-height: var(--lh-ui); color: var(--ink); }
.case-v .vw svg.i { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.case-v.right .vw { font-weight: 400; color: var(--ink-2); }
.case-v.right .vw svg.i { color: var(--green); }
.case-fix { margin-top: 2px; padding-left: 28px; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); }
.case-fix .pr { display: block; font-variant-numeric: tabular-nums; }
.case-fix .chip { margin-top: 2px; }

/* The open row: the arithmetic, one paragraph, two text actions */
.case-more.box { grid-column: 2 / -1; grid-row: 2; z-index: 1; padding: var(--s-4) 20px; border-radius: var(--r-md); }
.case-more[hidden] { display: none; }
.case-math { border-collapse: collapse; width: 100%; max-width: 560px; font-variant-numeric: tabular-nums; }
.case-math th { padding: 3px var(--s-5) 3px 0; text-align: left; font-weight: 400; line-height: var(--lh-ui); }
.case-math td { padding: 3px 0; text-align: right; white-space: nowrap; line-height: var(--lh-ui); }
.case-math tr.pay > * { padding-top: var(--s-2); border-top: 1px solid var(--line-2); font-weight: 700; }
.case-txt { margin-top: var(--s-3); max-width: 70ch; }
.case-more .acts { margin-top: var(--s-3); display: flex; flex-wrap: wrap; gap: 0 var(--s-5); }
.case-more .acts .link { min-height: 44px; align-items: center; }
.case-more .acts .link { display: inline-flex; }
/* The open card's changes and step: one per line, the link first and its price after it (17 October 2026: moved here from the
   closed card, which is one target) */
.case-do { margin-top: var(--s-2); padding: 0; list-style: none; display: grid; gap: 0; }   /* each line a 44 target, so no extra gap */
.case-do + .acts { margin-top: 0; }
.case-do li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--s-3); }
.case-do .link { display: inline-flex; align-items: center; min-height: 44px; }
.case-do .pr, .case-do span { color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* Phones: the right-sized rows fold into one line at the end */
.case-fold { display: none; }
.cov-foot { padding-top: var(--s-4); border-top: 1px solid var(--line); font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); }

@container cov (max-width: 879px) {
  .case { grid-template-columns: 40px minmax(0, 1fr) 20px; gap: var(--s-3) var(--s-4); }
  .case-t { grid-column: 2; grid-row: 1; }
  .case-chev { grid-column: 3; grid-row: 1; }
  .case-bar { grid-column: 2; grid-row: 2; padding-top: 0; }
  .case-vs { grid-column: 2; grid-row: 3; padding-top: 0; }
  .case-more.box { grid-column: 2 / -1; grid-row: 4; }
}
@container cov (max-width: 559px) {
  .cases.folding .case.quiet { display: none; }
  .cases.folding .case-fold { display: block; padding: var(--row-y) 0; }
  .case-more.box { grid-column: 1 / -1; }
}

/* Something changed? */
.page-in > .cov + .cov-changed { margin-top: var(--s-7); }
.page-in > .cov + .tip2 { margin-top: var(--gap-section); }   /* "Something changed?" is the tip card, its own section (17 October 2026) */
.cov-changed { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s-4) var(--s-5); align-items: center; }
.cov-changed .cc-t p { margin-top: var(--s-1); color: var(--ink-2); max-width: 62ch; }
@media (max-width: 639px) {
  .cov-changed { grid-template-columns: 48px minmax(0, 1fr); align-items: start; }
  .cov-changed .btn { grid-column: 1 / -1; justify-self: start; }
}

/* =================================================================
   How you compare (4.8)
   ================================================================= */
.cmp { grid-template-columns: minmax(0, 1fr); }
/* push: also answers to the page area's width (branch ai-drawer README, the push layout) */
@media (min-width: 1280px) { @container app (min-width: 1280px) { .cmp { grid-template-columns: repeat(2, minmax(0, 1fr)); } } }
.cmp .box { display: flex; flex-direction: column; }
.peer-lead { margin-top: var(--s-2); font-size: var(--fs-body); line-height: var(--lh-body); max-width: 34ch; }   /* reading text 16 under the 20 card title, 8 below it */
.peer-line { margin-top: var(--s-2); color: var(--ink-2); max-width: 62ch; }
.cmp .chart { margin-top: auto; padding-top: var(--s-5); }          /* the two charts share a baseline */
.page-in > .cmp + .cmp-causes { margin-top: var(--gap-section); }   /* a section with a 28 title: the section gap */
.cmp-cap { margin-top: var(--s-2); color: var(--ink-2); text-align: center; }
.cmp-cap[hidden] { display: none; }
.cmp-causes .hbars { max-width: 720px; }
.cmp-causes .hbar .act .link { font-size: var(--fs-small); line-height: var(--lh-small); }

/* =================================================================
   Lower your risk (4.9)
   ================================================================= */
.steps-wrap { container: steps / inline-size; }
.steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-cards); }
/* The top row sits at the card's top in every card (a card stretched to its neighbour's height keeps its rows at the top):
   the title's first line and the Done box center on the 48 tile, and a two-line title runs on under it */
.step-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s-2) var(--s-4); align-items: start; align-content: start; }
.step-card > .it { grid-column: 1; grid-row: 1; }
.step-card h3 { grid-column: 2; grid-row: 1; padding-top: calc((48px - var(--lh-ui)) / 2); }
.step-done { grid-column: 3; grid-row: 1; display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; margin-top: 2px; padding: 0 var(--s-2); margin-right: calc(-1 * var(--s-2)); line-height: var(--lh-ui); cursor: pointer; }   /* a 44 target, on the 48 tile's middle */   /* 24 high, 12 down: on the tile's middle */
.step-b { grid-column: 2 / -1; grid-row: 2; align-self: start; }
.step-why { font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); max-width: 60ch; }
.step-meta { margin-top: var(--s-3); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); font-size: var(--fs-small); line-height: var(--lh-small); }
.step-meta .pv { color: var(--ink); }
.step-meta .cs { color: var(--ink-2); }
@container steps (max-width: 1023px) { .steps { grid-template-columns: minmax(0, 1fr); } }
@container steps (max-width: 479px) { .step-b { grid-column: 1 / -1; } }
.steps-all { display: flex; align-items: center; gap: var(--s-4); }

.page-in > * + .steps-done { margin-top: var(--s-7); }
.done-list { margin-top: var(--s-3); max-width: 720px; list-style: none; }
.done-list li { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; line-height: var(--lh-ui); }
.done-list li + li { border-top: 1px solid var(--line); }
.done-list li > svg.i { width: 16px; height: 16px; flex: none; color: var(--green); }
.done-list .t { flex: 1 1 auto; min-width: 0; color: var(--ink-2); }
.done-list li:focus { outline: none; }
.done-list li:focus-visible { outline: var(--v8-focus); outline-offset: 0; border-radius: var(--r-sm); box-shadow: var(--v8-focus-glow); }
