/* ============================================================================
   screens.css — per-screen layout only. Anything reusable lives in
   components.css; anything tokenised lives in tokens.css.
   ========================================================================== */

/* ── Screen header block: eyebrow + display title + support line ─────────── */
.shead { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-1); padding: var(--sp-2) 0 0; }
.shead__sub { color: var(--ink-soft); font-size: var(--fs-body-s); }

/* The one Figure XL per screen, with its label beneath */
.figblock { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.figblock__label { color: var(--text-3); font: 600 var(--fs-body-s)/1.4 var(--font-ui); }
.figblock--on-ink .figblock__label { color: var(--text-on-ink-2); }

/* ── 1 · Login ──────────────────────────────────────────────────────────── */
.login {
  display: flex; flex-direction: column; justify-content: center; gap: var(--sp-5);
  width: 100%; max-width: 348px; height: 100%; min-height: 0; flex: 1 1 auto; margin: 0 auto;
  position: relative; padding: var(--sp-7) 0 var(--sp-6);
  color: var(--text-on-ink);
}
.screen[data-screen="login"] {
  display: flex; flex-direction: column; align-items: center;
  padding: 0 var(--sp-5);
  background: var(--grad-login);
}
.screen[data-screen="login"] > .login { margin-bottom: 0; }
.login__brand { display: grid; justify-items: center; gap: var(--sp-3); text-align: center; }
.login__logo {
  width: 88px; height: 88px; border-radius: var(--r-pill);
  display: grid; place-items: center; background: var(--surface);
  box-shadow: 0 16px 32px -12px rgba(var(--ink-rgb), .28);
}
.login__proof { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.login__panel { display: grid; gap: var(--sp-3); width: 100%; }
.login__card {
  display: grid; gap: var(--sp-5); width: 100%; padding: var(--sp-7) var(--sp-5) var(--sp-6);
  margin-block: 0;
  border: 1px solid rgba(var(--surface-rgb), .72);
  border-radius: var(--r-xl);
  background: rgba(var(--surface-rgb), .16);
  box-shadow: var(--e1), inset 0 1px 0 rgba(var(--surface-rgb), .85);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
          backdrop-filter: blur(14px) saturate(1.2);
}
.login__brandmark {
  width: 76px; height: 86px; object-fit: contain; object-position: center;
  justify-self: center;
}
.login__heading { display: grid; gap: var(--sp-2); text-align: center; }
.login__heading .display-l { color: var(--text-on-ink); font-size: 28px; }
.login__heading .body-s { color: var(--text-on-ink-2); }
.login__fields { display: grid; gap: var(--sp-3); }
.login__card .btn--primary {
  background: var(--grad-login-cta);
  background-clip: border-box;
  color: var(--text-on-ink);
  min-height: 50px;
  border: 0;
  box-shadow: 0 10px 24px -12px rgba(var(--sky-deep-rgb), .7);
}
.login__card .btn--primary:hover,
.login__card .btn--primary:active {
  background: linear-gradient(105deg, var(--sky-deep) 0%, var(--violet) 100%);
  color: var(--text-on-ink);
}
.login__card .field__label { color: var(--text-on-ink-2); }
.login__card .field { background: rgba(var(--surface-rgb), .12); border-color: rgba(var(--surface-rgb), .46); color: var(--text-on-ink); }
.login__card .field:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(var(--sky-rgb), .28); }
.login__card .field::placeholder { color: rgba(var(--surface-rgb), .68); }
.login__or .divider { background: rgba(var(--surface-rgb), .28); }
.login__or .meta { color: var(--text-on-ink-2); }
.login__privacy, .login__powered { color: var(--text-on-ink-2); font-size: var(--fs-body-s); text-align: center; }
.login__powered { position: static; }
.login__powered span { color: var(--text-on-ink); font-weight: 700; letter-spacing: .04em; }

/* ── Profile ───────────────────────────────────────────────────────────── */
.profile-hero {
  position: relative; min-height: 264px; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr); align-content: end; gap: var(--sp-3);
  padding: var(--sp-5); border-radius: var(--r-xl); color: var(--text-on-ink);
  background: var(--ink); background-image: var(--grad-deep-veil);
  box-shadow: var(--e-hero);
}
.profile-notch { --nw: 108px; --nh: 48px; }
.profile-notch__badge { left: 0; right: auto; }
.profile-hero__avatar {
  position: absolute; z-index: 1; right: var(--sp-3); top: 26px;
  width: 142px; height: 142px; display: block;
  object-fit: cover; object-position: center 24%;
  border-radius: var(--r-pill); background: var(--surface); border: 1px solid rgba(var(--surface-rgb), .46);
  box-shadow: 0 12px 28px -14px rgba(var(--ink-rgb), .5);
}
.profile-hero__copy { position: relative; z-index: 2; min-width: 0; max-width: 176px; }
.profile-hero__copy .display-l { color: var(--text-on-ink); }
.profile-hero__copy .body-s { color: var(--text-on-ink-2); }
.profile-hero__copy .eyebrow { color: var(--text-on-ink-2); margin-bottom: var(--sp-1); }
.profile-actions { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.profile-action {
  min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-pill); background: rgba(var(--surface-rgb), .9); color: var(--ink);
  font: 700 var(--fs-micro)/1 var(--font-ui); cursor: pointer;
  transition: transform var(--t-tap) var(--ease-out), background var(--t-hover) var(--ease-out);
}
.profile-action:active { transform: scale(.96); }
.profile-action:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.profile-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: var(--sp-3); border-radius: var(--r-lg); background: rgba(var(--surface-rgb), .72);
  border: 1px solid rgba(var(--surface-rgb), .76); box-shadow: var(--e1);
}
.profile-stats > div { display: grid; justify-items: center; gap: 2px; padding: var(--sp-2); text-align: center; }
.profile-stats > div + div { border-left: 1px solid var(--line); }
.profile-stats svg { color: var(--sky-ink); }
.profile-stats strong { font: 600 var(--fs-body-s)/1.2 var(--font-ui); }
.profile-stats span { font: 400 var(--fs-micro)/1.25 var(--font-ui); color: var(--text-3); }
.profile-details { display: grid; gap: var(--sp-3); }
.profile-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line); }
.profile-row:last-child { padding-bottom: 0; border-bottom: 0; }
.profile-details .profile-row:nth-last-child(2) { padding-bottom: 0; border-bottom: 0; }
.profile-row strong { text-align: right; overflow-wrap: anywhere; }
.row.profile-life {
  width: 100%; margin-inline: 0; padding: var(--sp-3);
  background: rgba(var(--surface-rgb), .62);
  border-radius: var(--r-lg); border: 1px solid rgba(var(--surface-rgb), .72);
}
.profile-life .strong, .profile-life .meta { display: block; }
@media (hover: hover) { .profile-action:hover { background: var(--surface); } }

/* ── 2 · Home ───────────────────────────────────────────────────────────── */
.home__ring { display: flex; align-items: center; gap: var(--sp-4); }

/* Right-hand stat rows — icon tile, figure, label. Deliberately flat: no
   border, no shadow, no second accent. The ring is the card's only emphasis. */
.stats { display: grid; gap: var(--sp-4); margin: 0; }
.stat  { display: flex; align-items: center; gap: var(--sp-2); }
.stat__tile {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--info-bg); color: var(--sky-ink);
}
.stat__tile svg { stroke: currentColor; }
.stat__val {
  margin: 0;
  font: 500 var(--fs-figure-m)/1.1 var(--font-fig);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--text);
}
.stat__key { font: 400 var(--fs-micro)/1.3 var(--font-ui); color: var(--text-3); }

/* ── 3–6 · Enrollment ───────────────────────────────────────────────────── */
.enroll__steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-4); counter-reset: step; }
.enroll__step  { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: var(--sp-3); align-items: start; }
.enroll__num {
  counter-increment: step;
  width: 26px; height: 26px; border-radius: var(--r-pill);
  display: grid; place-items: center; background: var(--info-bg); color: var(--sky-ink);
  font: 700 var(--fs-body-s)/1 var(--font-ui);
}
.enroll__num::before { content: counter(step); }

/* The arithmetic, shown not just resolved (deck p.7) */
.sum { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
.sum__line { display: flex; align-items: baseline; gap: var(--sp-3); }
.sum__line .label { color: var(--text-2); font-size: var(--fs-body-s); }
.card--hero .sum__line .label        { color: var(--text-on-ink-2); }
.card--hero .sum__line--total .label { color: var(--text-on-ink); }
.sum__line .val {
  margin-left: auto; font: 500 var(--fs-figure-m)/1 var(--font-fig);
  font-variant-numeric: tabular-nums;
}
.sum__rule { height: 1px; background: var(--line); margin: var(--sp-1) 0; }
.sum__line--total .label { color: var(--text); font-weight: 700; font-size: var(--fs-body); }
.sum__line--total .val   { font-size: var(--fs-figure-l); }

.donut-legend { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
.donut-legend__row { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-body-s); }
.donut-legend__dot { width: 9px; height: 9px; border-radius: var(--r-pill); flex: 0 0 9px; }
.donut-legend__amt { margin-left: auto; font: 500 var(--fs-body)/1 var(--font-fig); font-variant-numeric: tabular-nums; }

/* ── 7 · Flex hub ───────────────────────────────────────────────────────── */
.flexcat { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); }
.flexcat__head { display: flex; align-items: center; gap: var(--sp-3); }
.flexcat__head .meta { display: block; }
.flexcat__figs {
  display: flex; align-items: baseline; gap: 4px;
  margin-left: auto; flex: 0 0 auto; white-space: nowrap;
}

.market__item { display: flex; align-items: center; gap: var(--sp-3); }

/* ── Latest claim — two lines, no icon tile, no borders ──────────────────── */
.claimline {
  display: grid; gap: 6px; width: 100%; text-align: left;
  min-height: 48px; padding: 2px 0; cursor: pointer;
  border-radius: var(--r-sm);
}
.claimline:focus-visible { outline: var(--focus-ring); outline-offset: 4px; }
.claimline__row { display: flex; align-items: baseline; gap: var(--sp-3); }
.claimline__row > :last-child { margin-left: auto; flex: 0 0 auto; }
.claimline__amt {
  font: 500 var(--fs-figure-m)/1 var(--font-fig);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em; color: var(--text);
}
.claimline .title, .claimline__amt { transition: color var(--t-hover) var(--ease-out); }
@media (hover: hover) {
  .claimline:hover .title, .claimline:hover .claimline__amt { color: var(--sky-ink); }
}
.claimline:active .title, .claimline:active .claimline__amt { color: var(--sky-ink); }

/* ── 8 · Benefits ───────────────────────────────────────────────────────── */
.covered { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }

/* Base tile: a plain labelled chip with its icon inline. Used by the plan
   sheet's checklist, where all four icons are the same tick — as oversized
   watermarks those would be four identical pieces of decoration, not
   information. */
.covered__tile {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px;
  padding: var(--sp-3);
  border-radius: var(--r-md); background: var(--mist); color: var(--text);
  font: 600 var(--fs-body-s)/1.35 var(--font-ui);
  text-align: left; border: 0; cursor: pointer;
  transition: box-shadow var(--t-hover) var(--ease-out), transform var(--t-tap) var(--ease-out);
}
.covered__tile svg { stroke: var(--sky-ink); }
.covered__tile:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.covered__tile:active { transform: scale(.985); }

/* Art variant: gradient tile with the icon as a visible, proportional accent
   anchored inside the bottom-right corner and sitting behind the text.

   The geometry keeps the two apart rather than trusting them to miss:
     text  starts at 12px; at two lines it ends at ~46px
     icon  top edge = min-height − bottom inset − size = 100 − 8 − 30 = 62px
   leaving a clear vertical gap, with padding-right holding every line
   clear of the icon's column.

   CONSTRAINT: labels here must fit two lines. A third line ends at ~65px and
   runs into the icon (measured at −7px in the plan sheet, which is why that
   checklist stays on the base tile). Keep labels short, or raise min-height to
   119px before adding a longer one.

   The restrained 30px size keeps each mark recognizable without turning it
   into a competing illustration. */
.covered--art .covered__tile {
  position: relative; overflow: hidden;
  align-content: start;
  min-height: 100px;
  padding: var(--sp-3) 46px var(--sp-3) var(--sp-3);
  background:
    linear-gradient(148deg, rgba(var(--sky-rgb), .20) 0%, rgba(var(--lav-rgb), .26) 100%),
    var(--surface);
}
.covered--art .covered__tile svg {
  position: absolute; right: var(--sp-3); bottom: var(--sp-2);
  width: 30px; height: 30px;
  stroke: var(--sky-deep); stroke-width: 1.6;
  opacity: .42; pointer-events: none;
}
@media (hover: hover) {
  .covered__tile:hover { box-shadow: var(--e-hover); }
}

/* ── My plans, banded by who pays ────────────────────────────────────────── */
.planset { display: grid; grid-template-columns: minmax(0, 1fr); }
.planset__head {
  display: flex; align-items: baseline; gap: var(--sp-3);
  padding-bottom: var(--sp-2);
}
.planset__sum {
  margin-left: auto; flex: 0 0 auto; white-space: nowrap;
  font: 600 var(--fs-micro)/1.3 var(--font-ui); color: var(--text-3);
}

.ecard {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); padding: var(--sp-5);
  border-radius: var(--r-md); background: var(--ink); color: var(--text-on-ink);
}
.ecard__qr {
  width: 148px; height: 148px; margin: 0 auto;
  display: grid; place-items: center; border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
}
.ecard__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-3); }
.ecard__field .k { font: 700 var(--fs-label)/1.2 var(--font-ui); letter-spacing: .1em; text-transform: uppercase; color: var(--text-on-ink-2); }
.ecard__field .v { font: 600 var(--fs-body-s)/1.4 var(--font-ui); }

/* ── 9 · Find care ──────────────────────────────────────────────────────── */
.map {
  position: relative; height: 148px; border-radius: var(--r-md); overflow: hidden;
  background:
    radial-gradient(60% 60% at 30% 40%, rgba(var(--sky-rgb), .18), rgba(var(--sky-rgb), 0) 70%),
    repeating-linear-gradient(0deg,  var(--line) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 26px),
    var(--surface-sunk);
}
.map__pin {
  position: absolute; width: 28px; height: 28px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--surface); color: var(--sky-ink);
  box-shadow: var(--e2); transform: translate(-50%, -50%);
}
.map__pin--me { background: var(--ink); color: var(--text-on-ink); width: 20px; height: 20px; }

/* ── 11 · FAQ ───────────────────────────────────────────────────────────── */
.faq__q {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  width: 100%; text-align: left; cursor: pointer;
  min-height: 44px; padding: var(--sp-3) 0;
  font: 600 var(--fs-body)/1.4 var(--font-ui); color: var(--text);
}
.faq__q:focus-visible { outline: var(--focus-ring); outline-offset: -2px; border-radius: var(--r-sm); }
.faq__q:active { color: var(--sky-ink); }
@media (hover: hover) { .faq__q:hover { color: var(--sky-ink); } .faq__q:hover svg { stroke: var(--sky-ink); } }
.faq__q svg { margin-left: auto; flex: 0 0 20px; stroke: var(--text-3); transition: transform var(--t-hover) var(--ease-out); }
.faq__q[aria-expanded="true"] svg { transform: rotate(180deg); }
.faq__a { display: grid; gap: var(--sp-3); padding-bottom: var(--sp-4); }
.faq__cite, .cite {
  display: inline-flex; align-items: center; gap: 6px;
  font: 600 var(--fs-micro)/1.3 var(--font-ui); color: var(--sky-ink);
}
.cite { color: var(--text-3); align-items: flex-start; }
.cite svg { flex: 0 0 auto; margin-top: 2px; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item:last-child { border-bottom: 0; }

/* ── 12 · Assistant ─────────────────────────────────────────────────────── */
.chat { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-3); align-content: start; }
.bubble {
  padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg);
  font-size: var(--fs-body); line-height: var(--lh-body); max-width: 86%;
}
.bubble--me  { background: var(--ink); color: var(--text-on-ink); justify-self: end; border-bottom-right-radius: var(--r-xs); }
.bubble--bot { background: var(--surface); border: 1px solid var(--line); justify-self: start; border-bottom-left-radius: var(--r-xs); box-shadow: var(--e1); }
.sources { display: grid; gap: 6px; margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line); }
.source { display: flex; align-items: center; gap: 6px; font-size: var(--fs-micro); color: var(--text-3); }
.source strong { color: var(--sky-ink); font-weight: 600; }

/* The composer is chrome, not content: it lives in the frame beside the tab
   bar, not inside the scrolling screen. As a sticky child of a short screen it
   floated mid-page, and its --paper fade painted a pale band across a ground
   that is no longer paper. Now it is a floating pill, sibling to the tab bar
   and styled the same way, sitting directly above it. */
.composer {
  position: absolute; z-index: 41;
  /* Keep the assistant composer on the same horizontal grid as the tabbar
     and the screen cards above it. */
  left: var(--sp-5); right: var(--sp-5);
  bottom: calc(var(--tabbar-h, 58px) + var(--sp-3) + var(--sp-2) + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 5px;
  background: rgba(var(--surface-rgb), .94);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
          backdrop-filter: blur(14px) saturate(1.6);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: 0 12px 30px -10px rgba(var(--ink-rgb), .30),
              0 2px 6px -2px rgba(var(--ink-rgb), .10);
  transition: border-color var(--t-hover) var(--ease-out),
              box-shadow var(--t-hover) var(--ease-out);
}
.composer[hidden] { display: none; }
/* The field gives up its own chrome to the pill, so the focus ring moves to
   the container — otherwise focus would be invisible. */
.composer .field {
  border: 0; background: none; box-shadow: none;
  min-height: 44px; padding: 0 var(--sp-2) 0 var(--sp-3);
}
.composer .field:focus { box-shadow: none; }
.composer:focus-within {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(var(--sky-rgb), .28),
              0 12px 30px -10px rgba(var(--ink-rgb), .30);
}

/* ── 13 · Life event ────────────────────────────────────────────────────── */
.events { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.event {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-2); padding: var(--sp-4);
  border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface);
  font: 600 var(--fs-body-s)/1.35 var(--font-ui); color: var(--text); text-align: left;
  cursor: pointer; min-height: 88px; align-content: start;
  transition: border-color var(--t-hover) var(--ease-out), background var(--t-hover) var(--ease-out),
              box-shadow var(--t-hover) var(--ease-out),
              transform var(--t-tap) var(--ease-out);
}
.event svg { stroke: var(--sky-ink); }
.event:active { transform: scale(.97); }
.event:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.event[aria-pressed="true"] { border-color: var(--sky); background: var(--info-bg); }
@media (hover: hover) {
  .event:hover { border-color: var(--line-strong); box-shadow: var(--e-hover); }
}

/* ── Claims ─────────────────────────────────────────────────────────────── */
.dropzone {
  display: grid; place-items: center; gap: var(--sp-2); text-align: center;
  padding: var(--sp-6) var(--sp-4); cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-md);
  background: var(--surface-sunk); color: var(--text-2);
  transition: border-color var(--t-hover) var(--ease-out), background var(--t-hover) var(--ease-out),
              box-shadow var(--t-hover) var(--ease-out);
}
.dropzone:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }
.dropzone[data-filled="true"] { border-style: solid; border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
@media (hover: hover) {
  .dropzone:hover { border-color: var(--sky); background: var(--info-bg); box-shadow: var(--e-hover); }
}

.receipt-thumb {
  height: 120px; border-radius: var(--r-sm);
  background:
    linear-gradient(160deg, rgba(var(--surface-rgb), .9), rgba(var(--surface-rgb), .3)),
    repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 12px),
    var(--surface-sunk);
}

/* ── Empty / info strip ─────────────────────────────────────────────────── */
.notice {
  display: flex; gap: var(--sp-2); align-items: flex-start;
  padding: var(--sp-3); border-radius: var(--r-md);
  background: var(--info-bg); color: var(--sky-ink);
  font: 400 var(--fs-body-s)/1.45 var(--font-ui);
}
.notice svg { flex: 0 0 18px; margin-top: 1px; }
.notice--warn { background: var(--warn-bg); color: var(--warn); }
