/*
 * Lumina Health · components. Each class here has a builder in js/ui.js;
 * screens compose builders and never restyle a component locally. Every
 * pressable thing is at least --tap (44pt) in both directions.
 */

/* ── Sections and inset-grouped lists (iOS Settings anatomy) ──────────── */
.section {
  margin-top: var(--s6);
}
.section:first-child {
  margin-top: var(--s2);
}
.section-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  padding: 0 var(--gutter) var(--s2);
}
.section-h h2 {
  font-size: var(--fs-t3);
  font-weight: 700;
  letter-spacing: -0.3px;
}
.section-h .eyebrow + * {
  margin-left: auto;
}
/* A list's own header, the Figma's TODAY / QUICK ACTIONS: set in the ink colour,
   tracked capitals, a step below a section title. */
.section-h .group-h {
  font-size: var(--fs-sub);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.section-h .link {
  font-size: var(--fs-sub);
  color: var(--text-link);
  font-weight: 500;
  min-height: var(--tap);
  min-width: var(--tap);
  justify-content: center;
  display: inline-flex;
  align-items: center;
  margin: -12px -8px -12px 0;
  padding: 0 8px;
  border-radius: 8px;
}
.section-f {
  padding: var(--s2) calc(var(--gutter) + 0px) 0;
  font-size: var(--fs-foot);
  color: var(--text-2);
  line-height: 1.4;
}

.group {
  /* sides only: a shorthand here would zero the mt-* spacing utilities */
  margin-inline: var(--s4);
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--e1);
  overflow: hidden;
}
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--s3);
  min-height: 52px;
  width: 100%;
  padding: 10px var(--s4);
  text-align: left;
  color: var(--text);
  background: var(--card);
  transition: background var(--d-press) var(--ease-out);
}
button.row:active,
a.row:active {
  background: var(--surface-sunken);
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: var(--sep, var(--s4));
  height: 0.5px;
  background: var(--line);
}
.hc .row + .row::before {
  height: 1px;
}
/* Rows that lead with an icon tile or an avatar are spaced, not ruled: the
   tiles already give the list its rhythm (the Figma's lists have no rules).
   Text-only rows keep the hairline, where white space alone would blur them. */
.row.has-ic + .row.has-ic::before,
.row.has-av + .row.has-av::before,
.row.has-bare + .row.has-bare::before {
  display: none;
}
.row.has-ic {
  --sep: 68px;
}
.row.has-av {
  --sep: 72px;
}
/* Icon tiles: tinted, the Figma's (a pale square, the icon in the deeper ink),
   not iOS Settings' filled squares. Every ink meets 4.5:1 on its tint. */
.row-ic {
  width: 40px;
  height: 40px;
  border-radius: var(--r-field);
  display: grid;
  place-items: center;
  flex: none;
  color: var(--brand-ink);
  background: var(--brand-tint);
}
.row-ic .ic {
  width: 22px;
  height: 22px;
}
.row-ic.tone-teal {
  background: var(--cat-result-tint);
  color: var(--teal-700);
}
.row-ic.tone-green {
  background: var(--cat-goal-tint);
  color: var(--green-700);
}
.row-ic.tone-amber {
  background: var(--amber-50);
  color: var(--amber-700);
}
.row-ic.tone-red {
  background: var(--red-50);
  color: var(--red-700);
}
.row-ic.tone-rose {
  background: #fce7ef;
  color: #a8335a;
}
.row-ic.tone-violet {
  background: var(--cat-visit-tint);
  color: var(--cat-visit);
}
.row-ic.tone-slate {
  background: var(--surface-sunken);
  color: var(--slate-600);
}
.row-ic.tone-soft {
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.row-ic.cat-visit { background: var(--cat-visit-tint); color: var(--cat-visit); }
.row-ic.cat-result { background: var(--cat-result-tint); color: var(--cat-result); }
.row-ic.cat-med { background: var(--cat-med-tint); color: var(--cat-med); }
.row-ic.cat-message { background: var(--cat-message-tint); color: var(--cat-message); }
.row-ic.cat-refill { background: var(--cat-refill-tint); color: var(--cat-refill); }
.row-ic.cat-file { background: var(--cat-file-tint); color: var(--cat-file); }
.row-ic.cat-goal { background: var(--cat-goal-tint); color: var(--cat-goal); }
/* a bare icon in a row (the Figma's recent searches): no tile */
.row-ic.bare {
  width: 24px;
  background: none;
  color: var(--text-2);
}
.hc .row-ic {
  box-shadow: inset 0 0 0 1px currentColor;
}
.hc .row-ic.bare {
  box-shadow: none;
}
.row-main {
  flex: 1;
  min-width: 0;
}
.row-title,
.row-sub {
  display: block;
}
.row-title {
  font-size: var(--fs-body);
  line-height: 1.3;
}
.row-title.w600 {
  font-weight: 600;
}
.row-sub {
  margin-top: 2px;
  font-size: var(--fs-sub);
  color: var(--text-2);
  line-height: 1.35;
}
.row-val {
  flex: none;
  max-width: 45%;
  text-align: right;
  font-size: var(--fs-body);
  color: var(--text-2);
}
.row-chev {
  flex: none;
  color: var(--slate-400);
  margin-right: -6px;
}
.hc .row-chev {
  color: var(--slate-600);
}
.ts-ax .row,
.ts-xl .row {
  flex-wrap: wrap;
}
.ts-ax .row-val {
  max-width: none;
  text-align: left;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card {
  margin-inline: var(--s4);
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--e1);
  padding: var(--s4);
  position: relative;
}
.card.flat {
  box-shadow: none;
  border: 1px solid var(--line);
}
.card.tint-brand {
  background: var(--brand-tint);
  box-shadow: none;
}
.card.hero {
  background: linear-gradient(160deg, var(--navy-700) 0%, var(--navy-800) 55%, #10405a 100%);
  color: #fff;
  box-shadow: 0 18px 40px -22px rgba(19, 34, 79, 0.65);
  overflow: hidden;
}
.card.hero::after {
  content: "";
  position: absolute;
  inset: auto -40px -60px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.32), transparent 65%);
  pointer-events: none;
}
.card.hero .muted {
  color: rgba(255, 255, 255, 0.78);
}
.card-press {
  display: block;
  width: auto;
  text-align: left;
  transition: transform var(--d-press) var(--ease-out);
}
.card-press:active {
  transform: scale(0.985);
}
.tiles {
  margin-inline: var(--s4);
}
.tile {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--e1);
  padding: 14px;
  text-align: left;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform var(--d-press) var(--ease-out);
}
button.tile:active {
  transform: scale(0.98);
}
.tile-h {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-foot);
  font-weight: 600;
  color: var(--text-2);
}
.tile-h .ic {
  width: 16px;
  height: 16px;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: 52px;
  padding: 0 var(--s5);
  border-radius: var(--r);
  font-size: var(--fs-head);
  font-weight: 600;
  letter-spacing: -0.2px;
  text-align: center;
  transition: transform var(--d-press) var(--ease-out), background var(--d-fast) var(--ease-out),
    opacity var(--d-fast) var(--ease-out);
}
.btn:active:not([disabled]) {
  transform: scale(0.98);
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn .ic {
  width: 20px;
  height: 20px;
}
.btn-primary {
  background: var(--brand);
  color: var(--text-on-brand);
}
.btn-primary:active:not([disabled]) {
  background: var(--brand-hover);
}
.btn-secondary {
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.btn-light {
  background: #fff;
  color: var(--navy-800);
}
.btn-glass {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.btn-ghost {
  background: transparent;
  color: var(--text-link);
  min-height: var(--tap);
  padding: 0 var(--s3);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger-ghost {
  background: var(--danger-tint);
  color: var(--danger);
}
.btn-sm {
  min-height: 36px;
  padding: 0 var(--s4);
  border-radius: var(--r-pill);
  font-size: var(--fs-sub);
}
/* A small button still gets a 44pt target. */
.btn-sm::before {
  content: "";
  position: absolute;
  inset: -4px -2px;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.42;
  cursor: not-allowed;
}
.btn.loading {
  pointer-events: none;
}
.btn.loading .btn-label {
  opacity: 0;
}
.btn.loading::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  animation: spin 700ms linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.btn-row {
  display: flex;
  gap: var(--s3);
}
.btn-row > * {
  flex: 1;
}
.ts-ax .btn-row {
  flex-direction: column;
}

/* ── Pills and status ──────────────────────────────────────────────────── */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: var(--fs-foot);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--surface-sunken);
  color: var(--text-2);
}
.pill .ic {
  width: 14px;
  height: 14px;
  stroke-width: 2.25;
}
.pill.ok {
  background: var(--ok-tint);
  color: var(--ok);
}
.pill.attn {
  background: var(--attn-tint);
  color: var(--attn);
}
.pill.danger {
  background: var(--danger-tint);
  color: var(--danger);
}
.pill.brand {
  background: var(--brand-tint);
  color: var(--brand-ink);
}
.pill.accent {
  background: var(--accent-tint);
  color: var(--accent-ink);
}
.pill.on-dark {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}
.hc .pill.ok,
.hc .pill.attn,
.hc .pill.danger,
.hc .pill.brand,
.hc .pill.accent {
  box-shadow: inset 0 0 0 1px currentColor;
}

/* ── Chips (multi-select) ──────────────────────────────────────────────── */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 var(--s4);
  border-radius: var(--r-pill);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-size: var(--fs-sub);
  font-weight: 500;
  transition: background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.chip[aria-pressed="true"],
.chip[aria-checked="true"] {
  background: var(--brand);
  color: #fff;
  box-shadow: none;
}
.chip .ic {
  width: 16px;
  height: 16px;
  stroke-width: 2.25;
}

/* ── Fields ────────────────────────────────────────────────────────────── */
.field {
  display: block;
}
.field + .field {
  margin-top: var(--s4);
}
/* The Figma's field: a tracked capital label over a pale filled field. */
.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: var(--fs-foot);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}
.field-lrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
}
.field-lrow .field-label {
  margin-bottom: 0;
}
.field-lrow {
  margin-bottom: 8px;
}
.field-aside {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  margin: -14px -10px -14px 0;
  padding: 0 10px;
  font-size: var(--fs-sub);
  font-weight: 600;
  color: var(--text-link);
}
.field-label .req {
  color: var(--text-2);
  font-weight: 500;
}
.input {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 0 var(--s4);
  border-radius: var(--r-field);
  border: 1px solid var(--line-strong);
  background: var(--field);
  font-size: var(--fs-body);
  color: var(--text);
  transition: border-color var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
textarea.input {
  padding: 14px var(--s4);
  min-height: 112px;
  resize: none;
  line-height: 1.4;
}
.input::placeholder {
  color: var(--slate-500);
}
.input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent);
}
.field.invalid .input {
  border-color: var(--danger);
}
.field-help {
  margin-top: 6px;
  font-size: var(--fs-foot);
  color: var(--text-2);
  line-height: 1.38;
}
.field-err {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: var(--fs-foot);
  color: var(--danger);
  font-weight: 500;
}
.field-err .ic {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}
.input-wrap {
  position: relative;
}
.input-wrap .input {
  padding-right: 52px;
}
.input-wrap .icon-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-2);
}
.otp {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--s2);
}
.otp .input {
  text-align: center;
  padding: 0;
  font-size: var(--fs-t2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  min-height: 60px;
}

/* ── Switch ────────────────────────────────────────────────────────────── */
.switch {
  position: relative;
  flex: none;
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: var(--slate-300);
  transition: background var(--d-fast) var(--ease-out);
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  transition: transform var(--d-base) var(--ease-ios);
}
[aria-checked="true"] > .switch,
.switch[aria-checked="true"] {
  background: var(--accent);
}
[aria-checked="true"] > .switch::after,
.switch[aria-checked="true"]::after {
  transform: translateX(20px);
}
.hc .switch {
  background: var(--slate-500);
}
/* …but an ON switch keeps its fill, a shade deeper (the rule above would
   otherwise win on source order at equal specificity). */
.hc [aria-checked="true"] > .switch,
.hc .switch[aria-checked="true"] {
  background: var(--teal-800);
}
/* iOS "On/Off labels" for Increase Contrast: state never by colour alone. */
.hc [aria-checked="true"] > .switch::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 9px;
  width: 1.5px;
  height: 13px;
  background: #fff;
}

/* ── Segmented control ─────────────────────────────────────────────────── */
.seg {
  display: flex;
  padding: 2px;
  border-radius: 10px;
  background: var(--surface-sunken);
  gap: 2px;
}
.seg-btn {
  flex: 1;
  min-height: 36px;
  border-radius: 8px;
  font-size: var(--fs-sub);
  font-weight: 500;
  color: var(--text);
  position: relative;
  transition: background var(--d-fast) var(--ease-out), box-shadow var(--d-fast) var(--ease-out);
}
.seg-btn::before {
  content: "";
  position: absolute;
  inset: -4px 0;
}
.seg-btn[aria-selected="true"],
.seg-btn[aria-pressed="true"] {
  background: var(--surface);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12), 0 0 0 0.5px rgba(15, 23, 42, 0.04);
}
.hc .seg-btn[aria-selected="true"],
.hc .seg-btn[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1.5px var(--slate-700);
}
/* At the largest sizes a segment's label wraps rather than clipping. */
.ts-ax .seg-btn,
.ts-xl .seg-btn {
  min-height: 44px;
  padding: 4px 6px;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}
.seg.pad-x {
  margin: 0 var(--s4);
}

/* ── Avatars (initials only: no stock faces of real people) ─────────────── */
.av {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.2px;
  color: var(--navy-800);
  background: var(--navy-100);
}
.av.sm {
  width: 32px;
  height: 32px;
  font-size: 13px;
}
.av.lg {
  width: 64px;
  height: 64px;
  font-size: 22px;
}
.av.xl {
  width: 88px;
  height: 88px;
  font-size: 30px;
}
.av.t1 {
  background: #dbeafe;
  color: #1e3a8a;
}
.av.t2 {
  background: #ccfbf1;
  color: #115e59;
}
.av.t3 {
  background: #ede9fe;
  color: #4c1d95;
}
.av.t4 {
  background: #fce7f3;
  color: #9d174d;
}
.av.t5 {
  background: #fef3c7;
  color: #92400e;
}
.av-wrap {
  position: relative;
  flex: none;
}
.av-wrap .presence {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--green-600);
  box-shadow: 0 0 0 2.5px var(--surface);
}

/* ── Banners ───────────────────────────────────────────────────────────── */
.banner {
  margin: 0 var(--s4);
  display: flex;
  gap: var(--s3);
  align-items: flex-start;
  padding: 14px var(--s4);
  border-radius: var(--r);
  background: var(--info-tint);
  color: var(--text);
}
.banner .ic {
  width: 22px;
  height: 22px;
  color: var(--info);
  margin-top: 1px;
}
.banner-t {
  font-size: var(--fs-sub);
  font-weight: 600;
  line-height: 1.35;
}
.banner-b {
  font-size: var(--fs-sub);
  color: var(--text-2);
  line-height: 1.4;
  margin-top: 2px;
}
.banner .btn-ghost {
  margin: 4px 0 -8px -12px;
  font-size: var(--fs-sub);
  font-weight: 600;
}
.banner.ok {
  background: var(--ok-tint);
}
.banner.ok .ic {
  color: var(--ok-icon);
}
.banner.attn {
  background: var(--attn-tint);
}
.banner.attn .ic {
  color: var(--attn-icon);
}
.banner.danger {
  background: var(--danger-tint);
}
.banner.danger .ic {
  color: var(--danger);
}
.banner.quiet {
  background: var(--card);
  box-shadow: var(--e1);
}
.banner.quiet .ic {
  color: var(--text-2);
}
.hc .banner {
  box-shadow: inset 0 0 0 1px var(--slate-400);
}

/* The app-wide offline strip, under the status bar. */
.netbar {
  position: absolute;
  z-index: 55;
  left: 50%;
  top: calc(var(--safe-top) + 4px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--slate-800);
  color: #fff;
  font-size: var(--fs-foot);
  font-weight: 600;
  box-shadow: var(--e2);
  pointer-events: none;
  white-space: nowrap;
}
.netbar[hidden] {
  display: none;
}
.netbar .ic {
  width: 15px;
  height: 15px;
}

/* ── Sheets ────────────────────────────────────────────────────────────── */
.sheets {
  position: absolute;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}
.scrim {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  opacity: 0;
  transition: opacity var(--d-base) var(--ease-out);
  pointer-events: auto;
}
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: calc(100% - var(--safe-top) - 8px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--e3);
  transform: translateY(105%);
  transition: transform var(--d-push) var(--ease-ios);
  pointer-events: auto;
}
.sheet.bg {
  background: var(--bg);
}
.sheets.open .scrim {
  opacity: 1;
}
.sheets.open .sheet {
  transform: translateY(0);
}
.sheets.closing .sheet {
  transition-duration: 240ms;
  transition-timing-function: var(--ease-in);
}
.grabber {
  flex: none;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: var(--slate-300);
  margin: 6px auto 0;
}
.sheet-h {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  padding: 8px 8px 4px var(--gutter);
}
.sheet-h h2 {
  font-size: var(--fs-t3);
  font-weight: 700;
  letter-spacing: -0.3px;
}
.sheet-x {
  width: var(--tap);
  height: var(--tap);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-2);
}
.sheet-x span {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-sunken);
}
.sheet-x .ic {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}
.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--s2) var(--gutter) calc(var(--s5) + var(--safe-bottom));
  scrollbar-width: none;
}
.sheet-body::-webkit-scrollbar {
  display: none;
}

/* ── Toast ─────────────────────────────────────────────────────────────── */
.toasts {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(var(--safe-top) + 6px);
  z-index: 90;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.toast {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  max-width: calc(100% - 32px);
  padding: 12px 16px;
  border-radius: var(--r-pill);
  background: var(--slate-900);
  color: #fff;
  font-size: var(--fs-sub);
  font-weight: 600;
  box-shadow: var(--e2);
  transform: translateY(-16px) scale(0.96);
  opacity: 0;
  transition: transform var(--d-base) var(--ease-ios), opacity var(--d-fast) var(--ease-out);
}
.toast.in {
  transform: none;
  opacity: 1;
}
.toast .ic {
  width: 18px;
  height: 18px;
  color: var(--teal-300);
}

/* ── Empty, skeleton, error ────────────────────────────────────────────── */
.empty {
  margin: var(--s8) var(--s6);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--s2);
}
.empty-ic {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: var(--brand-tint);
  color: var(--brand-ink);
  margin-bottom: var(--s2);
}
.empty-ic .ic {
  width: 30px;
  height: 30px;
}
.empty h2 {
  font-size: var(--fs-t3);
  font-weight: 700;
}
.empty p {
  font-size: var(--fs-sub);
  color: var(--text-2);
  max-width: 30ch;
  line-height: 1.45;
}
.empty .btn {
  margin-top: var(--s3);
}
.skel {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--slate-100) 0%, var(--slate-200) 50%, var(--slate-100) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
}
@keyframes shimmer {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -50% 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .skel {
    animation: none;
  }
}

/* ── Progress (multi-step flows) ───────────────────────────────────────── */
.steps {
  display: flex;
  gap: 6px;
  padding: 0 var(--gutter);
}
.steps span {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--slate-200);
}
.steps span.on {
  background: var(--brand);
}
.steps-label {
  padding: var(--s2) var(--gutter) 0;
  font-size: var(--fs-foot);
  color: var(--text-2);
  font-weight: 500;
}

/* ── Data: range bar, charts, legends ──────────────────────────────────── */
.range {
  position: relative;
  padding-top: 26px;
}
.range-track {
  position: relative;
  display: flex;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  gap: 2px;
}
.range-track span {
  height: 100%;
}
.range-track .band-ok {
  background: color-mix(in srgb, var(--green-600) 55%, white);
}
.range-track .band-attn {
  background: color-mix(in srgb, var(--amber-600) 50%, white);
}
.range-track .band-low {
  background: color-mix(in srgb, var(--amber-600) 30%, white);
}
.range-pin {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: var(--fs-cap);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.range-pin::after {
  content: "";
  width: 3px;
  height: 22px;
  border-radius: 2px;
  background: var(--slate-900);
  box-shadow: 0 0 0 2px var(--surface);
}
.range-legend {
  display: flex;
  justify-content: space-between;
  gap: var(--s2);
  margin-top: 8px;
  font-size: var(--fs-cap);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart text {
  font-family: var(--font);
  font-size: 12px;
  fill: var(--text-2);
  font-variant-numeric: tabular-nums;
}
/* A halo keeps a label readable where it crosses data. */
.chart text.halo,
.chart text[style*="font-weight:700"] {
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 4px;
  stroke-linejoin: round;
}
.chart .grid line {
  stroke: var(--line);
  stroke-width: 1;
}
.hc .chart .grid line {
  stroke: var(--slate-300);
}
.chart-toggle {
  margin-top: var(--s2);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sub);
  font-variant-numeric: tabular-nums;
}
.data-table th,
.data-table td {
  padding: 8px 4px;
  text-align: left;
  border-bottom: 0.5px solid var(--line);
}
.data-table th {
  font-weight: 600;
  color: var(--text-2);
  font-size: var(--fs-foot);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  font-size: var(--fs-foot);
  color: var(--text-2);
}
.legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -1px;
}

/* ── Face ID lock and app-switcher privacy ─────────────────────────────── */
.lock {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s4);
  padding: var(--s8);
  text-align: center;
  color: #fff;
  background: radial-gradient(120% 70% at 50% 0%, #1b3a8f 0%, var(--navy-950) 70%);
}
.lock.on {
  display: flex;
}
.lock .faceid {
  width: 88px;
  height: 88px;
  color: #fff;
}
.lock h2 {
  font-size: var(--fs-t2);
  font-weight: 700;
}
.lock p {
  color: rgba(255, 255, 255, 0.82);
  font-size: var(--fs-sub);
  max-width: 28ch;
  line-height: 1.45;
}
.lock.scanning .faceid {
  animation: scan 900ms var(--ease-out) both;
}
@keyframes scan {
  0% {
    opacity: 0.5;
    transform: scale(0.92);
  }
  60% {
    opacity: 1;
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}
.privacy-blur {
  position: absolute;
  inset: 0;
  z-index: 99;
  display: none;
  place-items: center;
  background: color-mix(in srgb, var(--navy-950) 55%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  backdrop-filter: blur(28px) saturate(120%);
}
.privacy-blur.on {
  display: grid;
}
.privacy-blur .mark {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--navy-600), var(--teal-700));
  color: #fff;
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, 0.5);
}

/* ── Lumina mark ───────────────────────────────────────────────────────── */
/* The app icon (js/brand.js appIcon): the colour mark on a white squircle. */
.app-icon {
  flex: none;
  width: var(--ai);
  height: var(--ai);
  border-radius: calc(var(--ai) * 0.225);
  display: grid;
  place-items: center;
  background: #fff;
  box-shadow: inset 0 0 0 0.5px rgba(15, 23, 42, 0.14);
}


/* A field inside a grey container is white, so it still reads as a field. */
.card .input,
.group .input,
.sheet .card .input {
  background: var(--surface);
}
.hc .group,
.hc .card,
.hc .tile {
  box-shadow: inset 0 0 0 1px var(--slate-400);
}
