/* policies: Policies (#/cover) and a policy page (#/cover/<id>). Spec: ../old/explore/DIRECTION-v4.md 3.6
   (the spend bar), 3.13 (policy cards), 3.14 (dashed slots), 4.10, 4.11, and ../old/explore/DIRECTION-v6.md 6.1
   and 6.2 (the simpler cards, "Am I covered?" first). The fit bar and version 3's fit rows (.fit-bar, .fit-row,
   .fit-verdict) live in insights.css and serve the policy page; the cards no longer draw them. */

/* =================================================================
   Policies (4.10)
   ================================================================= */
/* Groups 48 apart (3.1); a group's title 16 above its containers. Active has its line at the right.
   Version 6: "Am I covered?" (covered.js) sits 32 under the head, then Active 48 under it; the spend bar opens Active, 16 under
   its title and 32 above the cards. Without "Am I covered?", Active sits 32 under the head, as the spend bar did */
.pol-grp { margin-top: var(--s-7); }
.page-in > .head + .pol-grp { margin-top: var(--s-6); }
.pol-gh + .spend { margin-top: 0; }
.spend + .pcards-wrap { margin-top: var(--s-6); }
.pol-grp:focus { outline: none; }
.pol-grp > .sec-head + * { margin-top: var(--s-4); }
.pol-gh { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin-bottom: var(--s-4); }
.pol-gh .aside { color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); }

/* The spend bar (3.6): one bar 12 high, one share per policy (largest first, its flex set inline, its
   color a .pol-<id> class), 3px white gaps, radius 3 on the outer ends. Under each share, left-aligned
   to it: the amount (Label, tabular) and the short name (Small). role="img" with the sentence.
   Under a 560 container the labels become two columns, each led by a swatch (.sw). */
.spend { container-type: inline-size; }
.spend-bar { display: flex; gap: 3px; height: 12px; }
.spend-bar > i { display: block; height: 100%; min-width: 3px; }
.spend-bar > i:first-child { border-radius: 3px 0 0 3px; }
.spend-bar > i:last-child { border-radius: 0 3px 3px 0; }
.spend-lbls { display: flex; gap: 3px; margin-top: var(--s-2); }
.spend-lbls > div { min-width: 0; }
.spend-lbls b { display: block; font-weight: 700; line-height: var(--lh-ui); font-variant-numeric: tabular-nums; white-space: nowrap; }
.spend-lbls span { display: block; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); }
.spend-lbls .sw { display: none; }
@container (max-width: 559px) {
  .spend-lbls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-4); }
  .spend-lbls .sw { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; vertical-align: 1px; }
}
/* Wider, the same list when a share is too narrow for its label (policies.js measures after each render) */
.spend.tight .spend-lbls { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: var(--s-3) var(--s-4); }
.spend.tight .spend-lbls .sw { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; vertical-align: 1px; }

/* The policy card (version 6, 6.1): .box.edged.pcard. The name is the stretched .cover link to #/cover/<id> (the edge
   hovers green, the name underlines); a fix, Cancel or "Open the claim" inside carries .above. Four parts, each in the
   text column 64 in from the edge (the 48 tile and 16): the head (name, number, price), one sentence of what it pays
   for (Body --ink-2), at most one line that needs her (Small --ink, a 16 verdict icon or the lime chip; a quiet one in
   --ink-2 with a green checkBadge for today's order), and the renewal at the foot, which the grid's rows line up */
.pcards-wrap { container-type: inline-size; }
.pcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-cards); }
.pcard { display: flex; flex-direction: column; }
.pcard .ph { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s-4); align-items: start; }
.pcard .ph h3 { font-size: var(--fs-section); line-height: var(--lh-section); font-weight: 700; }
.pcard .ph h3 a { color: var(--ink); text-decoration: none; }
.pcard:hover .ph h3 a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.pcard .ph .no { margin-top: 2px; color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); }
.pcard .ph .price-pair { padding-top: 2px; }   /* the month's 22 line on the name's 26 */
.pcard .pwhat { margin-top: var(--s-4); padding-left: 64px; max-width: calc(64px + 56ch); color: var(--ink-2); }
.pcard .pline { display: flex; align-items: flex-start; gap: var(--s-2); margin-top: var(--s-4); padding-left: 64px; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink); }
.pcard .pline > svg.i { width: 16px; height: 16px; flex: none; margin-top: 2px; stroke-width: 1.5; color: var(--ink); }
.pcard .pline.quiet { color: var(--ink-2); }
.pcard .pline.quiet > svg.i { color: var(--green); }
.pcard .pline:has(> .chip) { flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); }
.pcard .pline .link { display: inline; font-size: inherit; line-height: inherit; padding-block: 2px; }
.pcard .pline .pl-fix { display: block; margin-top: 2px; }   /* the fix and its price on a line of their own, under the problem */
.pcard .pfoot { display: flex; align-items: center; gap: 6px; margin-top: auto; padding: var(--s-5) 0 0 64px; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); }
.pcard .pfoot svg.i { width: 16px; height: 16px; flex: none; }
.pcard .pfoot > span.go { margin-left: auto; }   /* touch only (styles.css): the card opens its policy */
@container (max-width: 1023px) { .pcards { grid-template-columns: minmax(0, 1fr); } }
@container (max-width: 559px) { .pcard .pwhat, .pcard .pline, .pcard .pfoot { padding-left: 0; } }
@container (max-width: 479px) { .pcard .ph { grid-template-columns: 48px minmax(0, 1fr); row-gap: var(--s-2); } .pcard .ph .price-pair { grid-column: 2; justify-items: start; padding-top: 0; } }

/* The dashed slot, "Not covered yet" (3.14): <a class="box dashed wash addcard"> to Check and buy. A 48
   ghost tile with the area icon; the name (Label) with its tier tag 8 after it; one line of why; at the
   right the price and under it the word "Buy", styled as a text action but part of the link. Hover
   washes and the dashed edge stays. Two per row, one column under the policy card breakpoint (put
   .addcards in a .pcards-wrap) */
.addcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-cards); }
.addcard { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s-4); align-items: start; }
.addcard .nm { font-weight: 700; line-height: var(--lh-ui); }
/* The tag rides on the name's last word (policies.js polSlotName), 8 after it: when the name is too long for
   the line, the name wraps and the tag stays with it, so no slot shows its tag on a line of its own */
.addcard .nm .tag, .addcard .nm .chip, .addcard .nm .ok { margin-left: var(--s-2); }
.addcard .why { margin-top: 4px; max-width: 44ch; font-size: var(--fs-small); line-height: var(--lh-small); color: var(--ink-2); }
.addcard .pr { display: grid; justify-items: end; gap: 2px; text-align: right; white-space: nowrap; }
.addcard .pr b { font-weight: 700; font-variant-numeric: tabular-nums; }
.addcard .buy { color: var(--green-text); }
.addcard .nm .chip, .addcard .nm .ok { font-weight: 400; }
.addcard:hover .nm .n, .addcard:hover .buy { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.addcard:hover .buy { color: var(--green-strong); }
@container (max-width: 1023px) { .addcards { grid-template-columns: minmax(0, 1fr); } }
@container (max-width: 479px) { .addcard { grid-template-columns: 48px minmax(0, 1fr); } .addcard .pr { grid-column: 2; justify-items: start; text-align: left; } }

/* Ended policies: the accordion, between two hairlines, 48 under the groups */
.pol-ended { margin-top: var(--s-7); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* =================================================================
   A policy (4.11)
   ================================================================= */
/* The head: back button, the 48 tile centered on the title's 36 line, the name; under it the number and the chip */
.polhead .ht > .it { margin-top: calc((var(--lh-title) - 48px) / 2); }
.chip.mint { background: var(--g-10); }
/* Facts: four tiles, no links, no notes; the value in Lead, its label under it. Two by two under a 1023
   container, one column under 560. Each tile takes two rows of the list's grid (subgrid): the values share
   the first, so when one value wraps to two lines, every label in that row still starts on the same line */
.pfacts-wrap { container-type: inline-size; }
.pfacts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap-cards); margin: 0; padding: 0; list-style: none; }
.pfact { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: var(--s-1); height: auto; }
.pfact .v { display: block; font-size: var(--fs-lead); line-height: var(--lh-lead); font-variant-numeric: tabular-nums; }
.pfact .l { display: block; color: var(--ink-2); font-size: var(--fs-small); line-height: var(--lh-small); }
@container (max-width: 1023px) { .pfacts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 559px) { .pfacts { grid-template-columns: minmax(0, 1fr); } }
/* Zones 48 apart; two columns (2fr 1fr) from 1280, one under it, where the right column's two boxes sit side by side when they fit */
.page-in > .pol-sec { margin-top: var(--s-7); }
.pol-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--col-gap); align-items: start; }
.pol-main > * + * { margin-top: var(--s-7); }
.pol-side { display: grid; gap: var(--gap-cards); align-items: start; }
@media (max-width: 1279px) {
  .pol-cols { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
  .pol-side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
}
/* push: also answers to the page area's width (branch ai-drawer README, the push layout) */
@container app (max-width: 1279px) {
  .pol-cols { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
  .pol-side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }}
/* What it pays for and What it doesn't: two boxes side by side, one column under a 560 container */
.pol-terms-wrap { container-type: inline-size; }
.pol-terms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-cards); }
.pol-terms h2 + .covers { margin-top: var(--s-4); }
@container (max-width: 559px) { .pol-terms { grid-template-columns: minmax(0, 1fr); } }
/* Claims on this policy, Questions about this policy? */
.pol-side .box-head + * { margin-top: var(--s-4); }
.pol-side .pol-claims .box-head + .rows { margin-top: var(--s-2); }
.pol-acts { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3) var(--s-5); margin-top: var(--s-5); }

/* The checks and crosses in the two boxes: --green checks, --ink-2 crosses */
.covers { display: grid; gap: var(--s-3); }
.covers li { display: grid; grid-template-columns: var(--icon) minmax(0, 1fr); gap: var(--s-3); align-items: start; }
.covers .y { color: var(--green); }
.covers .y svg.i { stroke-width: 1.75; }
.covers .n { color: var(--ink-2); }
