/* =========================================================================
   Luv Health design system
   Tokens → primitives → components → layouts → utilities
   ========================================================================= */

/* ---------- Tokens ----------
   Calm clinical premium: warm neutrals rather than cold grey, colour reserved
   for meaning, depth carried by soft wide shadows instead of hard borders.
   ---------------------------------------------------------------------- */
:root {
  /* Brand */
  --red-500: #E1262F;
  --red-600: #C51C26;
  --red-700: #A50F18;
  --red-900: #6F0710;
  --red-050: #FFF5F5;
  --red-100: #FFE5E7;
  --red-200: #FBC7CB;

  /* Neutrals — warmed a few degrees toward the brand so nothing reads
     as cold office software next to the red. */
  --ink: #1B1719;
  --ink-2: #443C3F;
  --ink-3: #6D6467;
  --ink-4: #968D90;
  --line: #EAE4E5;
  --line-2: #F4F1F1;
  --line-3: #FAF8F8;
  --surface: #FFFFFF;
  --surface-2: #FDFCFC;
  --canvas: #FAF8F8;
  --canvas-warm: #FBF8F7;

  /* Semantic — deepened slightly so they hold contrast on a warm ground */
  --green-500: #16794F;
  --green-600: #0F6242;
  --green-050: #ECF7F1;
  --amber-500: #9E5D00;
  --amber-050: #FDF4E6;
  --blue-500: #245C9E;
  --blue-050: #EDF3FA;

  /* Type */
  --font-display: "Plus Jakarta Sans", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;

  --step--1: clamp(0.79rem, 0.77rem + 0.1vw, 0.84rem);
  --step-0:  clamp(0.94rem, 0.92rem + 0.12vw, 1rem);
  --step-1:  clamp(1.08rem, 1.02rem + 0.3vw, 1.22rem);
  --step-2:  clamp(1.3rem, 1.18rem + 0.6vw, 1.6rem);
  --step-3:  clamp(1.55rem, 1.34rem + 1vw, 2.05rem);
  --step-4:  clamp(1.9rem, 1.5rem + 1.9vw, 2.8rem);
  --step-5:  clamp(2.4rem, 1.6rem + 3.6vw, 4.2rem);

  /* An in-app page title is a label, not a billboard: the marketing scale
     (step-4/5) stays for the public site. */
  --step-app-title: clamp(1.5rem, 1.28rem + 0.95vw, 2.05rem);

  --track-display: -0.024em;
  --track-tight: -0.032em;
  --track-caps: 0.085em;

  /* Space */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 40px;
  --sp-9: 56px; --sp-10: 72px; --sp-11: 96px;

  /* Radius */
  --r-sm: 8px; --r-md: 11px; --r-lg: 15px; --r-xl: 20px; --r-2xl: 28px; --r-pill: 999px;

  /* Elevation — warm-tinted, soft and wide. Two layers each: a tight contact
     shadow so an edge reads, and a broad one so the surface lifts. */
  --sh-1: 0 1px 2px rgba(38,25,28,.04), 0 2px 6px -2px rgba(38,25,28,.05);
  --sh-2: 0 2px 5px -2px rgba(38,25,28,.05), 0 12px 28px -14px rgba(38,25,28,.12);
  --sh-3: 0 4px 10px -4px rgba(38,25,28,.06), 0 26px 56px -22px rgba(38,25,28,.18);
  --sh-red: 0 5px 16px -7px rgba(197,28,38,.46);
  --sh-crisp: 0 0 0 1px rgba(38,25,28,.045);

  --header-h: 68px;
  --mobile-nav-h: 68px;
  --sidebar-w: 268px;
  --content-max: 1180px;

  --ease: cubic-bezier(.2,.7,.3,1);
  --ease-out: cubic-bezier(.22,.9,.28,1);
  --dur-1: .14s;
  --dur-2: .22s;
  --dur-3: .34s;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  margin: 0 0 var(--sp-3);
  line-height: 1.14;
  letter-spacing: var(--track-display);
  font-weight: 700;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); letter-spacing: var(--track-tight); line-height: 1.08; }
h2 { font-size: var(--step-3); letter-spacing: -0.028em; }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-weight: 650; }
p  { margin: 0 0 var(--sp-4); color: var(--ink-2); text-wrap: pretty; }
a  { color: var(--red-600); text-decoration: none; }
a:hover { color: var(--red-700); }
small { font-size: var(--step--1); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--sp-7) 0; }
code { font-family: var(--font-mono); font-size: .88em; }

img, svg, video { max-width: 100%; height: auto; display: block; }
.luv-icon { flex: none; display: inline-block; vertical-align: middle; }

/* One focus treatment everywhere: a soft brand halo rather than a hard
   outline, so keyboard users get an obvious ring that still looks designed. */
:focus-visible {
  outline: 2px solid var(--red-500);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 0 0 12px 0;
}
.skip-link:focus { left: 0; color: #fff; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------- Layout primitives ---------- */
.wrap { width: 100%; max-width: var(--content-max); margin-inline: auto; padding-inline: var(--sp-5); }
.wrap--narrow { max-width: 760px; }
.wrap--wide { max-width: 1360px; }
.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-7); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.section { padding-block: var(--sp-10); }
.section--tight { padding-block: var(--sp-8); }
.section--alt { background: var(--surface); }
.section--warm { background: var(--red-050); }

/* ---------- Buttons ----------
   One shape, four weights of emphasis. Only the primary carries colour and
   lift; everything else stays quiet so a screen has a single obvious action.
   ---------------------------------------------------------------------- */
.btn {
  --btn-bg: var(--red-500);
  --btn-fg: #fff;
  --btn-bd: transparent;
  --btn-sh: var(--sh-red);
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-display);
  font-weight: 650; font-size: var(--step-0); line-height: 1;
  letter-spacing: -0.005em;
  padding: 13px 21px; border-radius: var(--r-pill);
  background: var(--btn-bg); color: var(--btn-fg);
  border: 1px solid var(--btn-bd);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out),
              background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out),
              color var(--dur-1) var(--ease-out);
  box-shadow: var(--btn-sh);
  min-height: 46px;
}
.btn:hover { background: var(--red-600); transform: translateY(-1px); box-shadow: 0 9px 22px -8px rgba(197,28,38,.5); color: var(--btn-fg); }
.btn:active { transform: translateY(0); box-shadow: var(--sh-1); transition-duration: .06s; }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; box-shadow: none; }
.btn .luv-icon { margin-block: -2px; }

/* Secondary — a white button, not a second red one. */
.btn--secondary {
  --btn-bg: var(--surface); --btn-fg: var(--ink); --btn-bd: var(--line);
  --btn-sh: var(--sh-1);
}
.btn--secondary:hover { background: var(--surface); --btn-bd: #DDD4D6; box-shadow: var(--sh-2); color: var(--ink); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink-2); --btn-bd: transparent; --btn-sh: none; }
.btn--ghost:hover { background: var(--line-2); color: var(--ink); box-shadow: none; transform: none; }

.btn--danger { --btn-bg: var(--red-700); --btn-sh: 0 5px 16px -7px rgba(165,15,24,.5); }
.btn--danger:hover { background: var(--red-900); }

.btn--quiet { --btn-bg: var(--red-050); --btn-fg: var(--red-700); --btn-bd: transparent; --btn-sh: none; }
.btn--quiet:hover { background: var(--red-100); color: var(--red-700); box-shadow: none; transform: none; }

.btn--ink { --btn-bg: var(--ink); --btn-fg: #fff; --btn-sh: 0 5px 16px -8px rgba(27,23,25,.6); }
.btn--ink:hover { background: #2C2528; }

.btn--sm { padding: 8px 15px; font-size: var(--step--1); min-height: 36px; gap: 6px; }
.btn--lg { padding: 17px 30px; font-size: var(--step-1); min-height: 56px; }
.btn--block { width: 100%; }
.btn--icon { padding: 0; width: 40px; min-height: 40px; }

.btn.is-loading { pointer-events: none; position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 17px; height: 17px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.btn--secondary.is-loading::after, .btn--ghost.is-loading::after {
  border-color: rgba(27,23,25,.18); border-top-color: var(--ink);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  box-shadow: var(--sh-1);
}
.card--flat { box-shadow: none; }
.card--pad-lg { padding: var(--sp-7); }
.card--tight { padding: var(--sp-5); }
.card--link { display: block; color: inherit; transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out); }
.card--link:hover { transform: translateY(-2px); box-shadow: var(--sh-3); border-color: #DFD7D9; color: inherit; }
.card--accent { border-left: 3px solid var(--red-500); }
.card--raised { box-shadow: var(--sh-2); border-color: #EFE9EA; }
.card__title {
  font-family: var(--font-display); font-weight: 680; font-size: var(--step-1);
  margin: 0; letter-spacing: -0.02em; display: flex; align-items: center; gap: 9px;
}
.card__title .luv-icon { color: var(--ink-4); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }

.eyebrow {
  font-family: var(--font-display); font-size: .7rem; font-weight: 700;
  letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--red-600); margin: 0 0 var(--sp-3);
}
.lede { font-size: var(--step-1); color: var(--ink-3); line-height: 1.6; }
.muted { color: var(--ink-3); }
.tiny { font-size: var(--step--1); color: var(--ink-3); line-height: 1.55; }

/* ---------- Badges & pills ----------
   A badge states a fact; it never competes with a button. Quiet fills,
   no borders, one weight.
   ---------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-display); font-size: .72rem; font-weight: 650; letter-spacing: 0;
  padding: 4px 10px; border-radius: var(--r-pill);
  background: var(--line-2); color: var(--ink-2); white-space: nowrap; line-height: 1.45;
}
.badge--brand   { background: var(--red-050); color: var(--red-700); }
.badge--success { background: var(--green-050); color: var(--green-600); }
.badge--progress { background: #FFF2B3; color: #755600; }
.badge--warning { background: var(--amber-050); color: var(--amber-500); }
.badge--danger  { background: var(--red-100); color: var(--red-900); }
.badge--info    { background: var(--blue-050); color: var(--blue-500); }
.badge--neutral { background: var(--line-2); color: var(--ink-3); }
.badge--outline { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-3); }
.badge__dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.pill-group { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font-family: var(--font-display); font-size: var(--step--1); font-weight: 620; cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out),
              color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out);
  min-height: 38px;
}
.pill:hover { border-color: #DDD4D6; color: var(--ink); }
.pill.is-active { background: var(--ink); border-color: var(--ink); color: #fff; box-shadow: var(--sh-1); }
.pill.is-active:hover { color: #fff; }

/* ---------- Avatars ---------- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, var(--red-500), var(--red-700));
  color: #fff; font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  letter-spacing: .01em; overflow: hidden;
}
.avatar--sm { width: 34px; height: 34px; font-size: .78rem; }
.avatar--lg { width: 64px; height: 64px; font-size: 1.3rem; }
.avatar--neutral { background: linear-gradient(140deg, #55565A, #2E2F33); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Forms ----------
   Hairline borders, a warm inset ground, and one soft brand halo on focus.
   ---------------------------------------------------------------------- */
.field { margin-bottom: var(--sp-5); }
.field > label, .label {
  display: block; font-family: var(--font-display); font-weight: 640;
  font-size: var(--step--1); color: var(--ink); margin-bottom: 6px; letter-spacing: -0.005em;
}
.field > label .muted, .field > label .fw-normal { font-weight: 500; }
.field__hint { font-size: var(--step--1); color: var(--ink-3); margin-top: 6px; line-height: 1.5; }
.field__error { font-size: var(--step--1); color: var(--red-700); margin-top: 6px; font-weight: 600; display: flex; gap: 6px; align-items: flex-start; }

input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=number], input[type=date], input[type=time], input[type=url],
input[type=search], select, textarea {
  width: 100%; font-family: var(--font-body); font-size: var(--step-0);
  color: var(--ink); background: var(--surface);
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out),
              background-color var(--dur-1) var(--ease-out);
  min-height: 46px; appearance: none;
}
textarea { min-height: 118px; resize: vertical; line-height: 1.6; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236D6467' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px;
  cursor: pointer;
}
input:hover, select:hover, textarea:hover { border-color: #DDD4D6; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--red-500); box-shadow: 0 0 0 3px var(--red-100);
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
input[aria-invalid="true"], .has-error input, .has-error select, .has-error textarea {
  border-color: var(--red-600); background: var(--red-050);
}
input[type=checkbox], input[type=radio] {
  width: 19px; height: 19px; accent-color: var(--red-500); margin: 0; flex: none; cursor: pointer;
}

/* ---------- Search ---------- */
.search-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  width: min(100%, 390px);
  min-height: 46px;
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background-color .16s var(--ease);
}

.search-bar:hover { border-color: #DDD4D6; }

.search-bar:focus-within {
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px var(--red-100);
}

.search-bar--wide { width: min(100%, 680px); }
.search-bar--field { width: min(100%, 360px); box-shadow: none; }

.search-bar__icon {
  display: inline-grid;
  place-items: center;
  color: var(--ink-4);
  pointer-events: none;
}

.search-bar input[type=search] {
  min-width: 0;
  min-height: 36px;
  padding: 6px 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: .86rem;
}

.search-bar input[type=search]:hover,
.search-bar input[type=search]:focus {
  border: 0;
  outline: none;
  box-shadow: none;
}

.search-bar input[type=search]::-webkit-search-cancel-button { display: none; }

.search-bar__clear {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: var(--ink-4);
  text-decoration: none;
  transition: color .16s var(--ease), background-color .16s var(--ease);
}

.search-bar__clear:hover {
  color: var(--red-700);
  background: var(--red-050);
}

.search-bar__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 16px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--red-500);
  color: #fff;
  font-family: var(--font-display);
  font-size: .78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 14px -6px rgba(225, 38, 47, .7);
  transition: background-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}

.search-bar__submit:hover {
  background: var(--red-600);
  box-shadow: var(--sh-red);
}

.search-bar__submit:focus-visible,
.search-bar__clear:focus-visible {
  outline: 3px solid var(--red-200);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .search-bar,
  .search-bar--wide,
  .search-bar--field { width: 100%; }

  .search-bar { padding-left: 13px; }
  .search-bar__submit { padding-inline: 12px; }
}

.check {
  display: flex; gap: var(--sp-3); align-items: flex-start; padding: 13px 15px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out),
              box-shadow var(--dur-1) var(--ease-out);
}
.check:hover { border-color: #DDD4D6; background: var(--line-3); }
.check input { margin-top: 2px; }
.check__body { flex: 1; }
.check__title { font-weight: 620; font-family: var(--font-display); font-size: var(--step-0); }
.check__hint { font-size: var(--step--1); color: var(--ink-3); }
.check.is-selected { border-color: var(--red-500); background: var(--red-050); box-shadow: 0 0 0 3px var(--red-100); }

fieldset { border: 0; padding: 0; margin: 0 0 var(--sp-6); }
legend { padding: 0; font-family: var(--font-display); font-weight: 680; font-size: var(--step-1); margin-bottom: var(--sp-2); }

.form-grid { display: grid; gap: 0 var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ---------- Alerts ---------- */
.alert {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: 14px 17px; border-radius: var(--r-lg);
  background: var(--blue-050); color: var(--blue-500);
  border: 1px solid rgba(36,92,158,.14); font-size: var(--step--1); line-height: 1.55;
}
.alert > .luv-icon { margin-top: 1px; opacity: .9; }
.alert strong { display: block; font-family: var(--font-display); font-size: var(--step-0); margin-bottom: 2px; }
.alert p { color: inherit; margin: 0; opacity: .92; }
.alert--success { background: var(--green-050); color: var(--green-600); border-color: rgba(22,121,79,.16); }
.alert--warning { background: var(--amber-050); color: var(--amber-500); border-color: rgba(158,93,0,.16); }
.alert--danger  { background: var(--red-050); color: var(--red-900); border-color: var(--red-200); }
.alert--quiet   { background: var(--line-3); color: var(--ink-2); border-color: var(--line); }
.alert__body { flex: 1; min-width: 0; }

/* AI vendor health banner (console) — a run-out of credits or a rejected key,
   with the vendor's own words and what to do. Never shown to patients. */
.ai-health { display: grid; gap: 10px; }
.ai-health__head { display: flex; gap: 12px; align-items: flex-start; }
.ai-health__icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: rgba(178,106,0,.12); }
.ai-health__meta { margin-top: 2px !important; font-size: var(--step--1); opacity: .9; }
.ai-health__action { font-size: var(--step--1); line-height: 1.55; }
.ai-health__quote { padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.55); font-size: var(--step--1); line-height: 1.5; }
.ai-health__quote span { display: block; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }

/* Payments status card (console) — mode, keys, webhook health, Stripe's last
   complaint. Never shown to patients. */
.pay-health { display: grid; gap: 12px; align-content: start; }
.pay-health__facts { display: grid; gap: 7px; margin: 0; }
.pay-health__facts div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; font-size: var(--step--1); }
.pay-health__facts dt { color: var(--ink-3); font-weight: 600; }
.pay-health__facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pay-health__missing { color: var(--red-700); font-weight: 700; }
.pay-health__quote { padding: 9px 12px; border-radius: 10px; background: var(--red-050); color: var(--red-900); font-size: var(--step--1); line-height: 1.5; }
.pay-health__quote span { display: block; font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.pay-health__note { padding: 10px 12px; font-size: var(--step--1); }
.pay-health__setup { border-top: 1px solid var(--line-2); padding-top: 10px; }
.pay-health__setup summary { cursor: pointer; font-weight: 700; font-size: var(--step--1); }
.pay-health__setup p { margin: 8px 0 0; }
.pay-health__url { display: block; padding: 8px 10px; border-radius: 8px; background: var(--line-2); font-size: var(--step--1); overflow-wrap: anywhere; }
.pay-health__events { display: flex; flex-wrap: wrap; gap: 6px; }
.pay-health__events code { font-size: .68rem; }

/* Emergency screen — deliberately unmissable */
.emergency {
  background: linear-gradient(160deg, var(--red-700), var(--red-900));
  color: #fff; border-radius: var(--r-2xl); padding: var(--sp-8);
  box-shadow: 0 24px 60px -20px rgba(111,7,16,.6);
}
.emergency h1, .emergency h2 { color: #fff; }
.emergency p { color: rgba(255,255,255,.9); }
.emergency .btn { --btn-bg: #fff; --btn-fg: var(--red-900); box-shadow: none; }
.emergency .btn--outline { --btn-bg: transparent; --btn-fg: #fff; --btn-bd: rgba(255,255,255,.5); }

/* ---------- Toasts ---------- */
.toast-stack {
  position: fixed; z-index: 200; bottom: calc(var(--mobile-nav-h) + 16px); left: 50%;
  transform: translateX(-50%); width: min(440px, calc(100vw - 32px));
  display: flex; flex-direction: column; gap: var(--sp-2); pointer-events: none;
}
.toast {
  pointer-events: auto; display: flex; gap: var(--sp-3); align-items: flex-start;
  background: var(--ink); color: #fff; padding: 14px 16px; border-radius: var(--r-lg);
  box-shadow: 0 18px 42px -16px rgba(27,23,25,.55); font-size: var(--step--1); line-height: 1.5;
  animation: toast-in .32s var(--ease);
}
.toast--success { background: var(--green-600); }
.toast--error { background: var(--red-700); }
.toast--warning { background: #8C5400; }
.toast button { background: none; border: 0; color: inherit; opacity: .7; cursor: pointer; padding: 0; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (min-width: 900px) { .toast-stack { bottom: 24px; left: auto; right: 24px; transform: none; } }

/* ---------- Empty & skeleton states ---------- */
.empty {
  text-align: center; padding: var(--sp-9) var(--sp-5);
  border: 1px dashed #E0D7D9; border-radius: var(--r-xl); background: var(--surface-2);
}
.empty__icon {
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  margin: 0 auto var(--sp-4); background: var(--red-050); color: var(--red-500);
}
.empty h3 { margin-bottom: var(--sp-2); font-size: var(--step-1); }
.empty p { max-width: 40ch; margin-inline: auto; color: var(--ink-3); font-size: var(--step-0); }

.skeleton {
  background: linear-gradient(90deg, #F1ECED 25%, #F9F6F6 37%, #F1ECED 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
.skeleton--line { height: 12px; margin-bottom: 10px; }
.skeleton--title { height: 20px; width: 55%; margin-bottom: 16px; }
.skeleton--card { height: 120px; border-radius: var(--r-xl); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- Tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--r-lg); }
table.data { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 560px; }
table.data th {
  text-align: left; font-family: var(--font-display); font-weight: 700; color: var(--ink-4);
  font-size: .68rem; letter-spacing: var(--track-caps); text-transform: uppercase;
  padding: 11px 15px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.data td { padding: 15px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.data tbody tr { transition: background-color var(--dur-1) var(--ease-out); }
table.data tbody tr:hover { background: var(--line-3); }
table.data tbody tr:last-child td { border-bottom: 0; }

/* ---------- Stat cards ---------- */
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: var(--sp-5); box-shadow: var(--sh-1);
}
.stat__label { font-size: var(--step--1); color: var(--ink-3); font-weight: 600; margin-bottom: 6px; }
.stat__value { font-family: var(--font-display); font-size: var(--step-3); font-weight: 730; letter-spacing: -0.03em; line-height: 1; }
.stat__meta { font-size: var(--step--1); color: var(--ink-3); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.stat--brand { background: linear-gradient(152deg, var(--red-600), var(--red-900)); border: 0; color: #fff; box-shadow: 0 14px 34px -18px rgba(111,7,16,.7); }
.stat--brand .stat__label, .stat--brand .stat__meta { color: rgba(255,255,255,.82); }
.trend-up { color: var(--green-500); font-weight: 650; }
.trend-down { color: var(--red-600); font-weight: 650; }

/* ---------- Progress ---------- */
.progress { height: 7px; background: var(--line-2); border-radius: var(--r-pill); overflow: hidden; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--red-500), var(--red-700)); border-radius: var(--r-pill); transition: width .5s var(--ease); }

.steps { display: flex; gap: 6px; margin-bottom: var(--sp-3); }
.steps__dot { flex: 1; height: 5px; border-radius: var(--r-pill); background: var(--line); }
.steps__dot.is-done { background: var(--red-500); }
.steps__dot.is-current { background: var(--red-200); }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: var(--sp-1); border-bottom: 1px solid var(--line); overflow-x: auto; margin-bottom: var(--sp-6); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 12px 15px; font-family: var(--font-display); font-weight: 640; font-size: var(--step--1);
  color: var(--ink-3); border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px;
  transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--red-600); border-bottom-color: var(--red-500); }
.tab__count { display: inline-block; margin-left: 6px; background: var(--line-2); border-radius: var(--r-pill); padding: 1px 7px; font-size: .7rem; }
.tab.is-active .tab__count { background: var(--red-050); color: var(--red-700); }

/* ---------- Modal / drawer ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(27,23,25,.42); z-index: 150;
  display: grid; place-items: center; padding: var(--sp-4);
  animation: fade-in .2s var(--ease); backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface); border-radius: var(--r-2xl); width: min(560px, 100%);
  max-height: 88vh; overflow-y: auto; box-shadow: 0 32px 80px -24px rgba(38,25,28,.4);
  padding: var(--sp-7); animation: modal-in .28s var(--ease-out);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: var(--r-2xl) var(--r-2xl) 0 0; max-height: 92vh; }
  @keyframes modal-in { from { transform: translateY(100%); } }
}

/* ---------- Message bubbles ---------- */
.thread { display: flex; flex-direction: column; gap: var(--sp-5); }
.bubble-row { display: flex; gap: var(--sp-3); align-items: flex-end; }
.bubble-row--own { flex-direction: row-reverse; }
.bubble {
  max-width: min(560px, 82%); padding: 13px 17px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1);
  font-size: var(--step-0); line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.bubble--own { background: var(--red-600); color: #fff; border-color: var(--red-600); border-bottom-right-radius: 6px; box-shadow: var(--sh-red); }
.bubble--own a { color: #fff; text-decoration: underline; }
.bubble--care { border-bottom-left-radius: 6px; }
.bubble--assistant { background: var(--canvas-warm); border-color: var(--red-100); }
.bubble--system { background: transparent; border: 1px dashed var(--line); color: var(--ink-3); font-size: var(--step--1); box-shadow: none; max-width: 100%; text-align: center; }
.bubble--note { background: #FFFCF2; border-color: #F0E2BD; }
.bubble__meta { font-size: .72rem; color: var(--ink-4); margin-top: 6px; display: flex; gap: 8px; align-items: center; }
.bubble--own .bubble__meta { color: rgba(255,255,255,.75); justify-content: flex-end; }

/* ---------- Appointment card ---------- */
.appt {
  display: flex; gap: var(--sp-4); align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl);
  padding: var(--sp-5); box-shadow: var(--sh-1);
}
.appt__date {
  flex: none; width: 66px; text-align: center; padding: 10px 0;
  background: var(--red-050); border-radius: var(--r-lg); color: var(--red-700);
}
.appt__month { font-size: .66rem; font-weight: 750; letter-spacing: var(--track-caps); text-transform: uppercase; }
.appt__day { font-family: var(--font-display); font-size: 1.6rem; font-weight: 730; line-height: 1.05; }
.appt__body { flex: 1; min-width: 0; }
.appt__title { font-family: var(--font-display); font-weight: 680; font-size: var(--step-1); letter-spacing: -0.02em; }

.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: var(--sp-3); }
.slot {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-md);
  padding: 14px 8px; text-align: center; font-family: var(--font-display);
  font-weight: 650; font-size: var(--step-0); color: var(--ink); cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out),
              transform var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
  min-height: 50px;
}
.slot:hover { border-color: var(--red-300, var(--red-200)); color: var(--red-700); transform: translateY(-1px); box-shadow: var(--sh-2); }
.slot.is-selected { background: var(--red-500); border-color: var(--red-500); color: #fff; box-shadow: var(--sh-red); }

/* ---------- Charts ---------- */
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: var(--sp-6); box-shadow: var(--sh-1); }
.chart-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-5); }
.chart-holder { position: relative; width: 100%; min-height: 220px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-4); font-size: var(--step--1); color: var(--ink-3); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex-1 { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mt-0 { margin-top: 0 !important; } .mb-0 { margin-bottom: 0 !important; }
/* Full 8pt scale — every step exists so a class in a template always applies. */
.mt-1 { margin-top: var(--sp-1); } .mt-2 { margin-top: var(--sp-2); } .mt-3 { margin-top: var(--sp-3); } .mt-4 { margin-top: var(--sp-4); } .mt-5 { margin-top: var(--sp-5); } .mt-6 { margin-top: var(--sp-6); } .mt-7 { margin-top: var(--sp-7); } .mt-8 { margin-top: var(--sp-8); } .mt-9 { margin-top: var(--sp-9); } .mt-10 { margin-top: var(--sp-10); } .mt-11 { margin-top: var(--sp-11); }
.mb-1 { margin-bottom: var(--sp-1); } .mb-2 { margin-bottom: var(--sp-2); } .mb-3 { margin-bottom: var(--sp-3); } .mb-4 { margin-bottom: var(--sp-4); } .mb-5 { margin-bottom: var(--sp-5); } .mb-6 { margin-bottom: var(--sp-6); } .mb-7 { margin-bottom: var(--sp-7); } .mb-8 { margin-bottom: var(--sp-8); } .mb-9 { margin-bottom: var(--sp-9); } .mb-10 { margin-bottom: var(--sp-10); } .mb-11 { margin-bottom: var(--sp-11); }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); } .gap-5 { gap: var(--sp-5); } .gap-6 { gap: var(--sp-6); } .gap-7 { gap: var(--sp-7); } .gap-8 { gap: var(--sp-8); }
.hide { display: none !important; }

/* Type-scale and measure helpers, so templates never inline a size. */
.h-xl { font-size: var(--step-2) !important; }
.h-md { font-size: var(--step-1) !important; }
.h-sm { font-size: var(--step-0) !important; }
.fw-normal { font-weight: 500; }
.m-0 { margin: 0 !important; }
.measure-56 { max-width: 46rem; }
.measure-58 { max-width: 48rem; }
.measure-820 { max-width: 820px; }
.measure-22 { max-width: 18rem; }
.min-w-0 { min-width: 0; }
.flex-start { align-items: flex-start; }
.flex-baseline { align-items: baseline; }
.row--center { justify-content: center; }
.grid-halves { display: grid; gap: var(--sp-8); grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 760px) { .grid-halves { grid-template-columns: 1fr; } }
.tone-ok { background: var(--green-050); color: var(--green-500); }
.page-pad { padding-block: var(--sp-8) var(--sp-10); }

/* Repeating app patterns, lifted out of the templates. */
.rowline { padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.rowline--roomy { padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.rowline--last { border-bottom: 0; }
.rowline--soft { padding: 9px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.pad-y { padding: 8px 0; }
.display-num {
  font-family: var(--font-display); font-weight: 700; font-size: var(--step-1);
  letter-spacing: -.02em;
}
.empty--inline { padding: 32px 16px; border: 0; }
.select--inline { min-height: 38px; font-size: var(--step--1); width: auto; }
.clickable { cursor: pointer; }
.break-all { word-break: break-all; }
.chip-file {
  padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.06);
  font-size: var(--step--1);
}
.tile-glass {
  width: 46px; height: 46px; border-radius: 14px; display: grid;
  place-items: center; background: rgba(255,255,255,.16);
}
.tone-warn { background: var(--amber-050); color: var(--amber-500); }
.stack-gap + .stack-gap { margin-top: 12px; }
.divider { border-top: 1px solid var(--line); margin-block: var(--sp-5); }
.list-plain { list-style: none; padding: 0; margin: 0; }
.link-quiet { color: var(--ink-2); font-weight: 600; }
.link-quiet:hover { color: var(--red-600); }

/* ---------- Auth screens (sign in / register) ---------- */
.auth { position: relative; max-width: 440px; margin: 0 auto; }
.auth::before {
  content: ""; position: absolute; inset: -90px -140px auto; height: 360px;
  background: radial-gradient(closest-side, rgba(225,38,47,.08), transparent 72%);
  pointer-events: none;
}
.auth > * { position: relative; }
.auth h1 { text-align: center; font-size: var(--step-3); margin-bottom: var(--sp-2); }
.auth__lede { text-align: center; color: var(--ink-3); margin: 0 auto var(--sp-6); max-width: 34ch; }
.auth__card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: var(--sp-7); box-shadow: var(--sh-2);
}
@media (max-width: 480px) { .auth__card { padding: var(--sp-6) var(--sp-5); } }
.auth__foot {
  text-align: center; margin-top: var(--sp-6); color: var(--ink-3);
  font-size: clamp(1.125rem, 1rem + .4vw, 1.25rem); line-height: 1.5;
}

/* Password field with a visibility toggle */
.field--password .field__wrap { position: relative; }
.field--password input { padding-right: 54px; }
.field__reveal {
  position: absolute; top: 50%; right: 7px; transform: translateY(-50%);
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; background: transparent; border-radius: 10px;
  color: var(--ink-4); cursor: pointer;
  transition: color .16s var(--ease), background-color .16s var(--ease);
}
.field__reveal:hover { color: var(--ink); background: var(--line-2); }
.field__reveal:focus-visible { outline: 3px solid var(--red-500); outline-offset: 0; }
.field__reveal .luv-icon:last-child { display: none; }

/* Live password rules — each line mirrors one server validator.
   Three states: neutral before anything is typed, met, and (only after the
   field has been left or the form submitted) unmet. A rule going red on the
   first keystroke is noise, not help. */
.pw-rules {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; gap: 5px;
}
.pw-rules li {
  display: flex; align-items: center; gap: 9px;
  font-size: var(--step--1); line-height: 1.4; color: var(--ink-3);
  transition: color .15s var(--ease);
}
.pw-rules li::before {
  content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%;
  border: 1.5px solid var(--line); background: transparent;
  background-repeat: no-repeat; background-position: center; background-size: 10px;
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.pw-rules li.is-met { color: #15704a; }
.pw-rules li.is-met::before {
  border-color: var(--green-500); background-color: var(--green-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E");
}
.pw-rules li.is-fail { color: var(--red-700); }
.pw-rules li.is-fail::before {
  border-color: var(--red-500);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23E1262F' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
}
.field__error[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .pw-rules li, .pw-rules li::before { transition: none; }
}

.password-change__icon {
  display: grid; place-items: center; width: 54px; height: 54px;
  margin: 0 auto var(--sp-4); color: var(--red-600);
  border: 1px solid var(--red-100); border-radius: 17px;
  background: linear-gradient(145deg, #fff, var(--red-050));
  box-shadow: 0 12px 28px -16px rgba(111,7,16,.38);
}
.password-change::before { inset: -70px 0 auto; width: 100%; }
.password-change__note {
  display: flex; gap: 7px; align-items: center; justify-content: center;
  margin: var(--sp-5) 0 0; color: var(--ink-3);
  font-size: .72rem; line-height: 1.45; text-align: center;
}
.password-change__note .luv-icon { flex: none; color: var(--green-500); }

@media (max-width: 480px) {
  .password-change__icon { width: 48px; height: 48px; border-radius: 15px; }
  .password-change__note { align-items: flex-start; text-align: left; }
}

/* ---------- Booking confirmation ---------- */
.booked { max-width: 620px; margin: 0 auto; display: grid; gap: var(--sp-6); }
.booked__hero {
  position: relative; overflow: hidden; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-2xl); padding: var(--sp-8) var(--sp-6) var(--sp-7);
  box-shadow: var(--sh-2);
}
.booked__hero::before {
  content: ""; position: absolute; inset: 0 0 auto; height: 4px;
  background: linear-gradient(90deg, var(--green-500), #7CCBA4);
}
.booked__check {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto var(--sp-5);
  display: grid; place-items: center;
  background: var(--green-050); color: var(--green-500);
  animation: booked-pop .45s var(--ease) both;
}
@keyframes booked-pop {
  from { transform: scale(.55); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.booked__hero h1 { font-size: var(--step-3); margin-bottom: var(--sp-2); }
.booked__when {
  font-family: var(--font-display); font-size: var(--step-2); font-weight: 700;
  letter-spacing: -.02em; color: var(--ink); margin: 0 0 var(--sp-5);
}
.booked__when small {
  display: block; font-family: var(--font-body); font-weight: 500;
  font-size: var(--step-0); color: var(--ink-3); letter-spacing: 0; margin-top: 4px;
}
.booked__visit {
  text-align: left; margin: 0 auto var(--sp-6); max-width: 420px;
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  padding: var(--sp-4); background: var(--canvas-warm);
}
.booked__actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; }
.booked__note { font-size: var(--step--1); color: var(--ink-4); margin: var(--sp-5) 0 0; }

/* ---------- Settings sections ---------- */
.settings { max-width: 760px; display: grid; gap: var(--sp-6); }
.settings > .card, .settings > section { margin: 0; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap; padding: 14px 0;
  border-bottom: 1px solid var(--line-2);
}
.settings-row:last-child { border-bottom: 0; padding-bottom: 0; }

/* Settings architecture: sticky section nav + anchored section cards. */
.settings-layout {
  display: grid; gap: var(--sp-7); align-items: start;
  grid-template-columns: 200px minmax(0, 1fr); max-width: 980px;
}
.settings-nav {
  position: sticky; top: calc(var(--header-h) + 16px);
  display: grid; gap: 2px;
}
.settings-nav a {
  display: flex; align-items: center; gap: 9px; padding: 9px 12px;
  border-radius: var(--r-md); font-size: var(--step--1); font-weight: 600;
  color: var(--ink-3);
}
.settings-nav a:hover { background: var(--line-2); color: var(--ink); }
.settings-nav .luv-icon { color: var(--ink-4); }
.settings-nav a:hover .luv-icon { color: var(--red-600); }
.settings-col { display: grid; gap: var(--sp-6); min-width: 0; }
.settings-col > section, .settings-col > .card {
  margin: 0; scroll-margin-top: calc(var(--header-h) + 20px);
}
@media (max-width: 999px) {
  .settings-layout { grid-template-columns: 1fr; gap: var(--sp-5); }
  .settings-nav {
    position: static; grid-auto-flow: column; justify-content: start;
    overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  }
  .settings-nav a { white-space: nowrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill); }
}

/* Consistent section headers: icon tile + title + one-line purpose. */
.section-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: var(--sp-5); }
.section-head__icon {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: var(--red-050); color: var(--red-600);
}
.section-head h2 { font-size: var(--step-1); margin: 0 0 2px; }
.section-head p { font-size: var(--step--1); color: var(--ink-3); margin: 0; }

@media (max-width: 700px) { .hide-sm { display: none !important; } }
@media (min-width: 701px) { .only-sm { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* Record a past visit's outcome (review Draft 2, note 1). Shared by the
   clinical dashboard, the front-desk dashboard and the calendar agenda. */
.outcome-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.outcome-actions__btn {
  min-height: 34px; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2, #3b2f33);
  font: inherit; font-size: .8rem; font-weight: 650;
}
.outcome-actions__btn:hover { border-color: var(--ink-3); color: var(--ink); }
.outcome-actions__btn:focus-visible { outline: 3px solid rgba(225,38,47,.35); outline-offset: 2px; }
.outcome-actions__btn--done { background: var(--green-050); border-color: rgba(22,121,79,.2); color: var(--green-600); }
.outcome-actions__btn--done:hover { background: #def0e6; border-color: var(--green-500); color: var(--green-600); }
.outcome-queue__list { list-style: none; margin: 8px 0 0; padding: 0; }
.outcome-queue__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 8px 14px; padding: 10px 0; border-top: 1px solid var(--line-2, #F3EEEF);
}
.outcome-queue__who { display: flex; flex-direction: column; min-width: 0; }
.outcome-queue__who a { font-weight: 650; }

/* "Message your doctor" directly beneath emergency guidance (review Draft 2,
   note 2). Deliberately quieter than the red "Call 911" action above it. */
.lc-emergency { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
/* A long practice name must wrap inside the card, never push the emergency
   guidance off the side of a phone screen. */
.lc-card--emergency .lc-actions .btn { white-space: normal; max-width: 100%; line-height: 1.25;
  text-align: left; }
.luv-er-doctor {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 10px; padding: 12px 14px; border-radius: 14px;
  background: #fff; border: 1px solid #d9e2ec;
}
.luv-er-doctor__btn {
  display: inline-flex; align-items: center; gap: 9px; min-height: 42px;
  padding: 8px 16px 8px 8px; border-radius: 999px; text-decoration: none;
  background: #2d4a6b; color: #fff; font-weight: 700; font-size: .92rem;
}
.luv-er-doctor__btn:hover { background: #22384f; color: #fff; }
.luv-er-doctor__btn:focus-visible { outline: 3px solid rgba(45,74,107,.4); outline-offset: 2px; }
.luv-er-doctor__icon {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(255,255,255,.16);
}
.luv-er-doctor__note { flex: 1 1 240px; margin: 0; font-size: .82rem; line-height: 1.5; color: #3f4c5c; }
.ask-flow--emergency .luv-er-doctor { margin: 14px 0 0; }

@media print {
  .site-header, .app-nav, .mobile-nav, .app-sidebar, .btn, .toast-stack { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* Settings → Guided tour (templates/partials/guided_tour_setting.html). */
.tour-setting { display: grid; gap: 12px; }
.tour-setting__state { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: .9rem; color: var(--ink-2); line-height: 1.5; }
.tour-setting__state strong { color: var(--ink); }
.tour-setting__dot { flex: none; width: 9px; height: 9px; border-radius: 99px; background: var(--ink-4); transform: translateY(-1px); }
.tour-setting__dot.is-on { background: var(--green-500, #2f7d4f); }
.tour-setting__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tour-setting__actions form { margin: 0; }
