/* Health Vidya — consumer-health htmx shell stylesheet (S13 shell, redesigned S18;
   brand palette re-themed S52).
   Served as /app.css from Workers Static Assets and shared by every surface:
   the dynamic worker-rendered shell (base.html + healthvidya-web fragments), the
   static SaaS shells (apps/saath-provider|patient|admin), and the hospital
   demo. Kept framework-free (no build step beyond build-app.sh copy).

   DESIGN TOKENS — single source of truth for the product's look. Reference
   these instead of hardcoding colors/radii/shadows in future work.
---------------------------------------------------------------------------- */
:root {
  color-scheme: light;

  /* Brand + semantic color — S52 owner palette.

     The owner supplied SIX brand colors and left the role assignment to design.
     ONLY those six are used, plus white and one near-black ink; **every other
     value here is an explicit `color-mix()` tint or shade of one of the six**,
     so no off-palette hex can appear by accident. The six, and why each is
     where it is (ratios are the measured WCAG contrast; 4.5:1 body / 3:1 large):

       #A8120B  deep red   --accent        white-on-it 7.62, as text 7.62 → the brand anchor:
                                            primary buttons, links, active state, urgent/error.
       #FA2E23  bright red  --accent-hot    white-on-it 3.83 (FAILS AA) → NEVER a background for
                                            white text; a thin attention/edge accent only.
       #7FC0FA  light blue  --info          dark ink on it 8.47; as TEXT on white 1.94 → a tint and
                                            a focus ring, NEVER link text.
       #F0FA73  yellow      --highlight     ink-on-it 14.58 → highlight chip / soft-attention wash.
       #607080  slate       --ink-2/--muted as text on white 5.09 → secondary text, hints (AA).
       #787A5B  olive       --line/accent-2 as text on white 4.44 → borders, dividers, large uses.

     Contrast is why the deep red is the anchor and the bright red is not: the
     brighter red is the more "brand" color but it cannot carry white text at AA,
     while the deep red is identical as text and passes everywhere it is used. */
  --brand-red: #a8120b; /* 1 of 6 */
  --brand-red-hot: #fa2e23; /* 2 of 6 */
  --brand-blue: #7fc0fa; /* 3 of 6 */
  --brand-yellow: #f0fa73; /* 4 of 6 */
  --brand-slate: #607080; /* 5 of 6 */
  --brand-olive: #787a5b; /* 6 of 6 */

  /* Roles — every value below is a base color, white/ink, or a color-mix() of a base. */
  --accent: var(--brand-red); /* primary action, links, active state */
  --accent-strong: color-mix(in srgb, var(--brand-red) 88%, #000); /* hover / active — a shade of the red */
  --accent-soft: color-mix(in srgb, var(--brand-red) 12%, #fff); /* tinted chip, banner, active-tab bg */
  --accent-hot: var(--brand-red-hot); /* thin attention/edge accent ONLY (no white text on it) */
  --info: var(--brand-blue); /* informational tint + focus ring (never text on white) */
  --info-soft: color-mix(in srgb, var(--brand-blue) 22%, #fff); /* very light blue wash */
  --highlight: var(--brand-yellow); /* highlight chip / soft-attention wash */
  --ink: #17202b; /* the ONE near-black (not a brand color; body text needs a neutral) */
  --ink-2: var(--brand-slate); /* secondary text (5.09 on white) */
  --muted: var(--brand-slate); /* hints / captions (same slate; 5.09 on white) */
  --surface: #ffffff; /* card + header bg */
  --bg: color-mix(in srgb, var(--brand-olive) 12%, #fff); /* page background — an olive wash deep enough that a WHITE card reads as a distinct surface (owner S52: cards were hard to tell apart). Was 6%. */
  --line: color-mix(in srgb, var(--brand-olive) 30%, #fff); /* input / inner borders */
  --line-strong: color-mix(in srgb, var(--brand-olive) 55%, #fff); /* S52: card edges that must read as a distinct boundary (result cards, empty states) — measured 2.06:1 vs the white card. Was referenced by 3 rules but UNDEFINED after the theme rewrite, so those borders computed to 0px and the cards had NO edge. */
  --ok: var(--brand-slate); /* no green in the palette — slate reads as neutral-positive */
  --ok-soft: color-mix(in srgb, var(--brand-slate) 8%, #fff);
  --warn: var(--brand-olive);
  --warn-soft: var(--brand-yellow);
  --err: var(--brand-red); /* the deep red IS the error color */
  --err-soft: color-mix(in srgb, var(--brand-red) 12%, #fff);

  /* Shape + elevation */
  --radius: 0.875rem;
  --radius-sm: 0.5rem;
  --shadow-xs: 0 1px 2px rgb(15 23 42 / 0.05);
  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.06), 0 1px 3px rgb(15 23 42 / 0.06);
  --shadow-md: 0 2px 4px rgb(15 23 42 / 0.06), 0 8px 24px rgb(15 23 42 / 0.05);
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand-blue) 55%, transparent); /* light-blue focus ring */

  /* Rhythm + layout */
  --space: 1.5rem;
  --nav-h: 3.75rem;
  --content-max: 62rem;

  /* Type scale */
  --fs-h1: clamp(1.4rem, 2.5vw + 0.5rem, 1.75rem);
  --fs-h2: 1.15rem;
  --fs-h3: 1rem;
  --fs-body: 1rem;
  --fs-sm: 0.875rem;
  --fs-xs: 0.8rem;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Base
---------------------------------------------------------------------------- */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: var(--fs-body);
  line-height: 1.5;
}
h1,
h2,
h3,
h4 {
  line-height: 1.25;
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-weight: 650;
  letter-spacing: -0.01em;
}
h1 {
  font-size: var(--fs-h1);
}
h2 {
  font-size: var(--fs-h2);
}
h3 {
  font-size: var(--fs-h3);
}
p {
  margin: 0 0 0.75rem;
}
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}
/* S51 a11y — `link-in-text-block`. The global rule above removes underlines, which means a link
   sitting inside a sentence is distinguishable from surrounding text ONLY by colour; the episode
   card's answer row (`.episode-card__answer` / `.episode-card__skip`) measured 2.94:1, under the
   WCAG 3:1 minimum for that case. Underlining is the non-colour differentiator, so it is the
   smallest robust fix and it costs no layout change beyond the underline itself. Scoped to the
   card's in-text links so the global pill/button styling elsewhere is untouched. */
.episode-card__answer,
.episode-card__skip {
  text-decoration: underline;
}
.episode-card__answer:hover,
.episode-card__skip:hover {
  text-decoration: underline;
}
code {
  font-size: 0.9em;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0.1rem 0.35rem;
  border-radius: 0.375rem;
}

/* Header / app bar
---------------------------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(255 255 255 / 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  padding: 0 var(--space);
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 1px 0 rgb(15 23 42 / 0.03);
}
header h1 {
  font-size: 1.05rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  line-height: 1.1;
}
/* S52 brand — the real logo mark replaces the CSS dot that stood in for it. Sized to the h1 line
   and slightly bled to stay optically aligned with the wordmark. */
header h1 .brand-mark {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
}
/* S52 header-chrome (owner ask): the brand name is TWO lines beside the mark.

   The wrap is produced HERE rather than in the markup by a literal `\n`-strewn text node, because
   `width: min-content` on a two-word block is deterministic: the block narrows to the widest
   unbreakable unit (the longer word, "Health") and the two words wrap apart into exactly two lines.
   That is stable at every viewport width — unlike a `max-width`, which would collapse back to one
   line inside a wide header. The accessible name and the rendered "Health Vidya" run are unchanged,
   so no screen-reader or brand-string assertion moves.

   `line-height: 1.1` keeps the pair inside the header's `--nav-h` (3.75rem): two lines at 1.05rem x
   1.1 is ~2.31rem, inside the mark's 2.25rem box, so the header height is still driven by the mark
   and does NOT grow. */
header h1 .brand-wordmark {
  display: block;
  width: min-content;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

/* S52 header-chrome (owner ask): "convert the tabs to real tabs instead of bullets."

   VISUAL ONLY — this restyles the EXISTING nav landmark. It does not touch role/aria: the owner's
   ask is about how the pills read (round "bullets"), and S51 deliberately made these a navigation
   landmark with `aria-current="page"` rather than a tab widget (the two items are LINKS to two
   different documents). Reintroducing `role="tablist"`/`role="tab"` would re-break
   `aria-required-children` and would require the full tab contract (roving tabindex, aria-controls,
   JS), which is out of scope and was rejected in S51. So the markup is untouched and only the
   SHAPE changes: a flat tab strip with a TOP bar on the current item, instead of a round pill.

   ⚠️ S52 owner follow-up (verbatim): "The red text is horrible. We just need a red top border
   highlight I guess." So the active tab is marked by a RED TOP BORDER ONLY — the label is NOT
   tinted red and there is NO red fill. The label stays `--ink` in both states and the
   active/inactive distinction is the top bar plus the existing `font-weight: 700` (a non-colour cue
   that survives greyscale, per the S51 note in the base rule).

   Specificity note: the rules below are scoped to the top-bar variant and deliberately come AFTER
   the base `.discover-scope-tab` block in source order, so they win at equal specificity. */
.discover-scope--top .discover-scope-tab {
  padding: 0.35rem 0.15rem 0.55rem;
  border: 0;
  border-top: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
}
.discover-scope--top .discover-scope-tab:hover {
  color: var(--ink);
  border-color: transparent;
  border-top-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: transparent;
}
/* Active tab: a RED TOP BAR only (owner: "a red top border highlight"). No red label, no fill, so
   the label keeps its full `--ink` contrast against the page. The base rule's `font-weight: 700`
   on `.is-active` remains the non-colour differentiator. `aria-current` is unchanged in the
   markup; this only reads the `.is-active` class the template already emits. */
.discover-scope--top .discover-scope-tab.is-active {
  color: var(--ink);
  background: transparent;
  border-top-color: var(--accent);
}
/* S52: the `gap: 0.25rem` from the base top-bar variant packed the pills together; in a strip, tabs
   read as separate when they have a little more room. */
.discover-scope--top {
  gap: 1rem;
}
header .hint {
  font-size: var(--fs-sm);
  margin: 0;
}

/* Layout
---------------------------------------------------------------------------- */
main {
  max-width: var(--content-max);
  margin: 2rem auto;
  padding: 0 1.25rem;
  display: grid;
  gap: var(--space);
}
main > section,
main > div {
  min-width: 0;
}

/* Card
---------------------------------------------------------------------------- */
main section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
/* Hub slots are htmx mount points: the wrapper is a transparent container
   and the mounted fragment card carries the chrome. Before a fragment mounts,
   the slot holds a span.hint — treat that as an inviting "choose a tab" cue
   (a soft, dashed placeholder) rather than a broken empty card. */
main section[id^='patient-'] {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}
main section[id^='patient-'] > span.hint {
  margin: 0;
  text-align: center;
  display: block;
  color: var(--muted);
  font-size: var(--fs-sm);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}
main section[id^='patient-'] > section {
  animation: mountIn 0.18s ease;
}
@keyframes mountIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Buttons
---------------------------------------------------------------------------- */
.btn,
button {
  --btn-bg: var(--accent);
  --btn-fg: #ffffff;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition:
    background 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.04s ease;
  text-decoration: none;
}
.btn:hover,
button:hover {
  background: var(--accent-strong);
  color: #ffffff;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}
.btn:active,
button:active {
  transform: translateY(1px);
}
.btn:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
button[type='submit'] {
  background: var(--accent);
  color: #fff;
}

/* Ghost/soft variant used for secondary + logout */
.btn.logout {
  --btn-bg: transparent;
  --btn-fg: var(--ink-2);
  border-color: var(--line);
  box-shadow: none;
}
.btn.logout:hover {
  --btn-bg: var(--accent-soft); /* S52: error-light tint is derived from the brand red */
  --btn-fg: var(--err);
  border-color: var(--accent-soft);
  box-shadow: none;
}

/* TD-38: the logout control is a real form POST (the route is POST-only, so a GET anchor 405s). The
   generic `form { display: grid }` + `form button { margin-top: 0.75rem }` rules above would push it
   off the header's centre line, so reset the wrapper to inline and the button's stray margin. Scoped
   to `.logout-form` — no other form or button is affected. */
.logout-form {
  display: inline;
  margin: 0;
}
.logout-form button {
  justify-self: auto;
  margin-top: 0;
}

/* Hint / muted text
---------------------------------------------------------------------------- */
.hint {
  color: var(--muted);
  font-size: var(--fs-sm);
}

/* Tab cue (U2): the pre-mount placeholder inside a hub tab slot. Mirrors the
   patient-hub slot cue (a soft dashed placeholder) so an un-mounted tab reads
   as an invitation rather than a broken empty card. */
.tab-cue {
  display: block;
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* Skeleton loaders (U2): pulsing content blocks shown while an htmx region is
   in flight, in place of raw "Loading…" text. Static (non-animated) under
   prefers-reduced-motion. */
.skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.skeleton-block {
  display: block;
  height: 0.85rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--line) 25%, color-mix(in srgb, var(--brand-olive) 10%, #fff) 37%, var(--line) 63%);
  background-size: 400% 100%;
  animation: skeletonPulse 1.3s ease-in-out infinite;
}
.skeleton-block:last-child {
  width: 62%;
}
.skeleton-block.skeleton-title {
  height: 1.15rem;
  width: 42%;
}
@keyframes skeletonPulse {
  from {
    background-position: 100% 50%;
  }
  to {
    background-position: 0 50%;
  }
}

/* Developer debug bar (U2): collapsed disclosure holding stack metadata that
   used to leak into the product header. Deliberately de-emphasised — muted,
   small, and out of the primary visual flow. */
.dev-bar {
  max-width: var(--content-max);
  margin: 1.5rem auto 2rem;
  padding: 0 1.25rem;
  font-size: var(--fs-xs);
  color: var(--muted);
}
.dev-bar > summary {
  cursor: pointer;
  display: inline-block;
  padding: 0.25rem 0.6rem;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: var(--fs-xs);
  list-style: none;
}
.dev-bar > summary::-webkit-details-marker {
  display: none;
}
details.dev-bar[open] > summary {
  margin-bottom: 0.5rem;
}
.dev-bar .hint {
  margin: 0;
  font-size: var(--fs-xs);
}

/* Overview cards (U3): the provider hub's at-a-glance metrics, rendered ABOVE the
   tab body. Each card is an <a> that links OUT to the tab that owns the detail
   (the review's "overview, then drill in" shape) rather than duplicating the
   fragment inline. The value is precomputed in the view model and is a neutral
   em-dash when the metric is absent, so the emphasis here is on legibility of
   that value, not on any state colouring — an absent metric must NOT look like a
   warning or an error. */
.provider-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0.25rem;
}
.overview-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  text-decoration: none;
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.12s ease;
}
.overview-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.overview-card:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}
.overview-label {
  font-size: var(--fs-xs);
  font-weight: 550;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.overview-value {
  font-size: var(--fs-h2);
  font-weight: 650;
  line-height: 1.2;
  color: var(--ink);
}

/* Dev banner (U4): staging-only sign-in affordance. Visually distinct but not
   alarming; never rendered in production. */
.dev-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  max-width: var(--content-max);
  margin: 1rem auto 0;
  padding: 0.6rem 1.25rem;
  font-size: var(--fs-sm);
  /* S52: this is an INFORMATIONAL notice ("you are on staging"), not a brand action, so it carries
     the informational blue, not the brand red. Text is ink (AA on the blue wash). */
  color: var(--ink);
  background: var(--info-soft);
  border: 1px solid var(--info);
  border-radius: var(--radius);
}
.dev-banner > .hint {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-block {
    animation: none;
    background: var(--line);
  }
  main section[id^='patient-'] > section {
    animation: none;
  }
}

/* Forms
---------------------------------------------------------------------------- */
label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  margin: 0.25rem 0 0.35rem;
}
input[type='text'],
input[type='email'],
input[type='number'],
input[type='password'],
input[type='tel'],
textarea,
select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: var(--fs-body);
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-xs);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}
input::placeholder,
textarea::placeholder {
  color: var(--line);
}
input:hover,
textarea:hover,
select:hover {
  border-color: var(--line);
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}
textarea {
  resize: vertical;
  min-height: 4.5rem;
}
form {
  display: grid;
  gap: 0.25rem;
}
form button {
  justify-self: start;
  margin-top: 0.75rem;
}

/* =========================================================================
   PATIENT HUB
   ========================================================================= */

/* Welcome card + pillar nav */
.patient-home-fragment {
  border-top: 3px solid var(--accent);
}
.patient-home-fragment > p {
  color: var(--ink-2);
}

.patient-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.patient-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}
.patient-nav a:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: transparent;
}
.patient-nav a:focus-visible {
  box-shadow: var(--focus);
}

/* Shared role-hub nav (provider admin shell + admin portal): the same pill
   treatment as the patient hub's pillar nav, but on the full-width hub
   surfaces. Links mount each fragment region on demand (S18.5 prefetch). */
.hub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.25rem;
}
.hub-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  font-size: var(--fs-sm);
  font-weight: 550;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}
.hub-nav a:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: transparent;
}
.hub-nav a:focus-visible {
  box-shadow: var(--focus);
}

/* =========================================================================
   PATIENT HOME AS SIDEBAR / DRAWER
   =========================================================================
   The patient-home card is a persistent left sidebar on wide screens and a
   slide-in overlay drawer (behind a scrim) on narrow screens. Pure UI chrome:
   htmx owns every content mount; the tiny toggle script on the patient
   dashboard page only flips `body.patient-hub-open`, which the rules here
   react to. The inner patient-home fragment keeps its content; the drawer
   chrome lives on the #patient-home wrapper. */

/* Brand cluster in the sticky header (toggle + title). */
.hub-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
/* Hamburger — visible only while the overlay drawer is active (narrow). */
.hub-toggle {
  display: none;
  cursor: pointer;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink-2);
  transition:
    background 0.12s ease,
    border-color 0.12s ease;
}
.hub-toggle:hover {
  background: var(--accent-soft);
  border-color: transparent;
}
.hub-toggle:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}
.hub-toggle-bar {
  display: block;
  width: 1.05rem;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

/* Scrim behind the overlay drawer — inert until the drawer is open. */
.hub-scrim {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 90;
  border: 0;
  cursor: pointer;
  background: rgb(15 23 42 / 0.38);
  opacity: 0;
  transition: opacity 0.2s ease;
}
body.patient-hub-open .hub-scrim {
  display: block;
  opacity: 1;
}

/* Wide: the hub becomes a persistent sidebar column + content column. */
main.patient-hub {
  grid-template-columns: 15.5rem minmax(0, 1fr);
  align-items: start;
}
main.patient-hub > :not(#patient-home) {
  grid-column: 2;
}
main.patient-hub > #patient-home {
  grid-row: 1 / -1;
  grid-column: 1;
  position: sticky;
  top: calc(var(--nav-h) + 1.25rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.15rem;
  box-shadow: var(--shadow-sm);
}
/* The mounted fragment is pure content — drop the nested card chrome. */
main.patient-hub > #patient-home .patient-home-fragment {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}
main.patient-hub > #patient-home .patient-home-fragment > p {
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
/* Nav reads as a vertical sidebar menu inside the drawer. */
main.patient-hub > #patient-home .patient-nav {
  flex-direction: column;
  align-items: stretch;
  gap: 0.375rem;
  margin-top: 0.25rem;
}
main.patient-hub > #patient-home .patient-nav a {
  width: 100%;
  justify-content: flex-start;
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.85rem;
}

/* Advisory ("Things to know") — soft info surface */
.hub-advisory {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand-red) 10%, #fff), color-mix(in srgb, var(--brand-red) 5%, #fff)), var(--surface);
  border-color: var(--line);
}
.pack-advisory-region .hint {
  margin: 0;
  font-size: var(--fs-sm);
}
.advisory-cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.advisory-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.advisory-card h3 {
  margin: 0 0 0.25rem;
  color: var(--accent-strong);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.advisory-card p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}

/* =========================================================================
   CAPTURE ("Add a health record")
   ========================================================================= */
.phr-capture-form h2 {
  margin-bottom: 0.25rem;
}
.phr-capture-form form {
  margin-top: 0.75rem;
}

/* S19-01 photo-OCR affordance, generalized by S20 to any health document:
   camera (image) + filesystem (image/PDF/text) buttons wired to the lazy OCR
   bridge. Progressive enhancement — hidden preview + status line are driven
   by the fragment's inline script; if JS/OCR is unavailable these stay inert
   and manual entry still works. */
.phr-capture-photo {
  margin-top: 0.75rem;
}
.phr-capture-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.phr-photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px dashed var(--line-strong, var(--line));
  background: var(--surface-2, #fff);
  color: var(--ink);
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}
.phr-photo-btn:hover {
  background: var(--bg-pressed, color-mix(in srgb, var(--brand-olive) 12%, #fff));
}
.phr-photo-btn[hidden] {
  display: none;
}
/* Document badge shown for PDF/text selections (a printable pill with the
   file name + size) instead of a broken <img> preview. */
.phr-doc-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  font-weight: 550;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.phr-doc-badge[hidden] {
  display: none;
}
.phr-photo-preview {
  display: block;
  max-width: 100%;
  max-height: 9rem;
  margin-top: 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: contain;
}
.phr-photo-status {
  min-height: 1.2em;
  margin-top: 0.4rem;
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* =========================================================================
   TIMELINE
   ========================================================================= */
.phr-timeline-fragment {
  border-top: 3px solid var(--ok);
}
.phr-timeline-fragment > p:first-of-type {
  color: var(--muted);
}
.phr-timeline {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
}
.phr-timeline .phr-entry {
  position: relative;
  display: grid;
  gap: 0.15rem;
  padding: 0.6rem 0 0.6rem 1.25rem;
  border-bottom: 1px dashed var(--line);
}
.phr-timeline .phr-entry:last-child {
  border-bottom: 0;
}
.phr-timeline .phr-entry::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}
.phr-at,
.phr-type {
  display: inline-block;
  font-size: var(--fs-xs);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.phr-summary {
  color: var(--ink);
  font-weight: 500;
}
.phr-notice {
  display: block;
  font-size: var(--fs-sm);
  color: var(--ink); /* S52: was var(--warn) (olive text on yellow) — ink on yellow is 14.58, olive was only 4.4 on white and 3.x on yellow */
  background: var(--warn-soft); /* S52: the caution wash is the brand YELLOW */
  border-left: 3px solid var(--warn); /* olive edge — the structural color, not a second semantic */
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.55rem;
  margin-top: 0.25rem;
}

/* S52 semantic colour — CAUTION = yellow (--warn-soft) with an olive structural edge.
   Used by the episode card's safety-net "Watch for" list. The safety-net is the one block that
   must read as "keep an eye on this" (not urgent — that is the red emergency branch — and not
   informational), so it is the natural home for the caution colour. Ink on the yellow wash is
   14.58:1, so it stays AA even at the smallest text size. */
.episode-card__safety-watch {
  margin: 0.5rem 0;
  padding: 0.55rem 0.7rem;
  background: var(--warn-soft);
  border-left: 3px solid var(--warn);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
}
.episode-card__safety-watch .episode-card__safety-label {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.episode-card__safety-watch ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}
/* S52 semantic colour — the PHR lab "flag" (high/low/abnormal) is a caution marker. */
.phr-lab-flag {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--ink);
  background: var(--warn-soft);
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}
.phr-timeline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.phr-timeline-actions .btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--accent-strong);
  border-color: var(--accent);
  box-shadow: none;
}
.phr-timeline-actions .btn:hover {
  --btn-bg: var(--accent-soft);
  border-color: var(--accent-strong);
  box-shadow: none;
}

/* =========================================================================
   HEALTH ("Your Health" dashboard)
   ========================================================================= */
.phr-dashboard-fragment {
  border-top: 3px solid var(--accent);
}
.phr-banner {
  background: var(--ok-soft);
  color: var(--ok);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}
.phr-record-count {
  color: var(--ink-2);
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: var(--fs-sm);
}
.phr-recent h3,
.phr-advisories h3 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 1.25rem 0 0.5rem;
}
.phr-recent ul,
.phr-advisories ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.phr-recent li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--line);
}
.phr-recent li:last-child {
  border-bottom: 0;
}
.phr-advisories details {
  margin: 0.25rem 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  padding: 0.5rem 0.75rem;
}
.phr-advisories summary {
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
}
.phr-advisories details li {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  padding: 0.2rem 0;
  list-style: disc;
  margin-left: 1.1rem;
}

/* =========================================================================
   REMINDERS
   ========================================================================= */
.patient-reminders-ledger {
  border-top: 3px solid var(--warn);
}
.patient-reminders-ledger .hint {
  margin-bottom: 0.75rem;
}
.phr-reminder-ledger {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}
.phr-reminder-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--line);
}
.phr-reminder-row:first-child {
  padding-top: 0;
}
.phr-reminder-row:last-child {
  border-bottom: 0;
}
.phr-reminder-medication {
  font-weight: 600;
  color: var(--ink);
}
.phr-reminder-dosage {
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.phr-reminder-cadence {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--warn);
  background: var(--warn-soft);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
}
.phr-reminder-fire-btn {
  --btn-bg: var(--warn);
}
.phr-reminder-fire-btn:hover {
  --btn-bg: var(--warn); /* S52: brand warn (olive) */
}
/* Fire result */
.phr-reminder-fire {
  margin-top: 1rem;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.phr-reminder-headline {
  font-weight: 600;
  color: var(--accent-strong);
  margin: 0;
}
.phr-reminder-list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
}
.phr-reminder-list li {
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.phr-reminder-state {
  color: var(--ok);
  font-weight: 600;
}

/* Reminder set form */
.patient-reminder-form form {
  margin-top: 0.5rem;
}

/* =========================================================================
   FEEDBACK
   ========================================================================= */
.phr-feedback-invite {
  border-top: 3px solid var(--info); /* S52: brand section stripe */
}
.phr-feedback-banner {
  color: var(--ink-2);
}
.phr-feedback-metrics {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.phr-feedback-metrics h3 {
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.phr-feedback-metrics ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.phr-feedback-metrics li {
  margin-bottom: 0.35rem;
}

/* =========================================================================
   EXPLORE (health feed, platform-packs)
   ========================================================================= */
.pack-feed-fragment {
  border-top: 3px solid var(--highlight); /* S52: brand section stripe */
}
.feed-cards {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.feed-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.feed-kind {
  display: inline-block;
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  margin-bottom: 0.4rem;
}
.feed-card h3 {
  margin: 0 0 0.25rem;
  font-size: var(--fs-h3);
}
.feed-card p {
  margin: 0 0 0.5rem;
  color: var(--ink-2);
  font-size: var(--fs-sm);
}
.feed-card .btn {
  --btn-bg: var(--accent);
  padding: 0.3rem 0.75rem;
  font-size: var(--fs-xs);
}

/* =========================================================================
   SEARCH (catalog)
   ========================================================================= */
.patient-search-fragment {
  border-top: 3px solid var(--accent); /* S52: brand section stripe */
}
.catalog-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}
.catalog-item {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--line);
}
.catalog-item:last-child {
  border-bottom: 0;
}
.catalog-name {
  font-weight: 600;
}
.catalog-specialty {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* =========================================================================
   APPOINTMENTS
   ========================================================================= */
.patient-appointments-fragment {
  border-top: 3px solid var(--accent-hot); /* S52: brand section stripe */
}

/* =========================================================================
   PROVIDER / ONBOARDING
   ========================================================================= */
.onboarding {
  border-top: 3px solid var(--accent-hot); /* S52: brand section stripe */
}
.onboarding .onboarding-step strong {
  color: var(--accent-strong);
}

/* =========================================================================
   LOGIN
   ========================================================================= */
#login-form {
  margin-top: 0.25rem;
}
#login-result {
  margin-bottom: 0;
}
.otp-result p {
  background: var(--ok-soft);
  color: var(--ok);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  font-size: var(--fs-sm);
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 640px) {
  main {
    margin: 1.25rem auto 3rem;
    padding: 0 0.9rem;
    gap: 1rem;
  }
  main section {
    padding: 1rem 1.1rem;
  }
  header {
    padding: 0 0.9rem;
    min-height: var(--nav-h);
  }
  header h1 {
    font-size: 1.05rem;
  }
  .patient-nav a {
    font-size: var(--fs-xs);
    padding: 0.4rem 0.7rem;
  }
  .phr-reminder-cadence {
    margin-left: 0;
  }
}

/* Overlay drawer on narrow viewports: not enough horizontal space for the
   persistent sidebar, so the patient-home card slides in from the left edge
   over the content, behind a dimming scrim, toggled via the hamburger. */
@media (max-width: 48rem) {
  main.patient-hub {
    grid-template-columns: 1fr;
  }
  main.patient-hub > :not(#patient-home) {
    grid-column: auto;
  }
  .hub-toggle {
    display: flex;
  }

  main.patient-hub > #patient-home {
    grid-row: auto;
    grid-column: auto;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    bottom: 0;
    width: min(84vw, 17.5rem);
    z-index: 100;
    margin: 0;
    border-radius: 0;
    border-top: 0;
    border-bottom: 0;
    padding: 1.25rem 1.15rem;
    transform: translateX(-102%);
    opacity: 0;
    visibility: hidden;
    transition:
      transform 0.22s ease,
      opacity 0.22s ease,
      visibility 0.22s ease;
    overflow-y: auto;
  }
  body.patient-hub-open main.patient-hub > #patient-home {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    box-shadow: var(--shadow-md);
  }
  main.patient-hub > #patient-home .patient-nav a {
    padding: 0.5rem 0.7rem;
  }
}
/* =========================================================================
   PATIENT CARD SEARCH (S26-02, ADR-028)
   Deterministic card-search surface on /app/patient/search. Presented with
   the existing token system; purely additive so first-paint layout is
   unchanged. No JS here — one .card-search CSS (below) drives a tiny scanline
   that flashes only while htmx swaps the results region.
   ========================================================================= */

.card-search-row {
  display: flex;
  align-items: center;
  gap: var(--space);
}
.card-search-input {
  flex: 1 1 auto;
  min-width: 0;
  /* S38 (owner direction): "make the text box bigger and more like a llm chat start box."

     The hero copy that used to sit above this input is GONE, so the input is now the page's visual
     entry point and carries the weight a prompt field does: tall, generously padded, strongly
     rounded, with a soft resting border and an accent focus ring.

     Sized in rem/em rather than a fixed pixel height, so it grows with the user's font preference
     instead of fighting it. `.card-search-row` is `align-items: center`, so the Search button stays
     centred against the taller field with no further change. */
  width: 100%;
  padding: 1.05rem 1.3rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04);
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}
.card-search-input::placeholder {
  color: var(--muted);
}
.card-search-input:focus,
.card-search-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand-red-hot) 30%, transparent);
}

/* S38 (owner direction): "Move the search box to the bottom of the screen so that we can later
   continue the conversation."

   Both Discover surfaces (Everyone and Mine) render their composer as the LAST element, so
   `position: sticky; bottom: 0` holds it against the viewport bottom while the results above scroll
   past it. An element with further content after it would instead be pushed UP by that content, which
   is why the ordering in the templates is load-bearing rather than cosmetic.

   STICKY, not `fixed`: a fixed bar leaves the flow, so the last card would sit underneath it and
   would need a bottom padding that has to be kept in sync with the bar's height. Sticky stays in
   flow, so the content ends above it with nothing to measure.

   The tinted background and backdrop blur are REQUIRED, not decorative — without them the results
   show through the bar as they scroll under it. The tint matches the page background so the bar
   reads as part of the page rather than a floating panel. `env(safe-area-inset-bottom)` keeps the
   input clear of the home indicator on phones, where a bottom-pinned control is most likely to
   collide with it. */
.discover-dock {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin: 1rem 0 0;
  padding: 0.85rem 1rem calc(0.85rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); /* var(--bg), near-opaque so results do not bleed through */
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
/* S38: the sticky container now wraps the BAR **and** the corpus SELECTORS, rather than the bar
   alone. That is what keeps the two visible together — only the dock is sticky, so selectors left in
   the feed would scroll away while the bar stayed pinned. It also makes "below the search bar" a
   structural fact (document order inside the dock) rather than a coincidence of two sticky offsets. */
.discover-dock .card-search-row {
  gap: 0.6rem;
}
.search-indicator {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: var(--fs-sm);
  visibility: hidden;
}
.search-indicator.htmx-request {
  visibility: visible;
}

/* Filter chips — labelled toggles produced server-side from the catalog's
   seen categories/tags (no hard-coded taxonomy drift). */
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
}
/* S38 (owner direction): "They should be below the search bar easier to the thumb."

   The selectors render BELOW the bar inside `.discover-dock`, so the thumb reaches the filter row
   without first crossing the input. The base rule's TOP margin belongs to the old position (between
   the header and the results); down here the gap sits ABOVE, separating the row from the bar. */
.filter-chips--dock {
  margin: 0.5rem 0 0;
}
.filter-chips[role='group'] {
  align-items: center;
}
.filter-chips .filter-chips-label {
  font-size: var(--fs-sm);
  color: var(--ink-2);
  margin-right: 0.15rem;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  font-size: var(--fs-sm);
  font-weight: 550;
  line-height: 1;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}
.filter-chip:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: transparent;
}
.filter-chip:focus-visible {
  box-shadow: var(--focus);
  outline: none;
}
.filter-chip.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.filter-chip[aria-pressed='true'] {
  color: #fff;
  background: var(--accent);
  border-color: transparent;
}
.filter-chip .remove {
  font-weight: 700;
}

/* S26-03 (ADR-028): discover scope row — Everyone (public) vs Mine (private). */
.discover-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.discover-scope-tab,
.discover-scope-tab:any-link {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
}
.discover-scope-tab:hover {
  color: var(--accent-strong);
  border-color: var(--accent);
}
.discover-scope-tab.is-active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  /* S51 a11y: the active/inactive distinction is otherwise hue-only (teal fill vs outlined
     pill), so add a weight cue — a non-colour differentiator that survives greyscale and
     colour-blindness. Both states already share `font-weight: 600` from the base rule above;
     700 does not change the pill's box, so the header layout is unchanged. */
  font-weight: 700;
}
/* S38: the scope tabs in the HEADER (owner direction: "move the Everyone and Mine tabs to the top
   bar instead of patient marketplace").

   The base rule carries `margin: 0 0 1rem`, which exists for its old IN-CONTENT position (above the
   results, below the input). Inside the sticky header that bottom margin would push the tab row off
   the header's centre line, so the top-bar variant resets it. The pills keep their shape, so the row
   reads as a segmented control next to the wordmark rather than as a second toolbar. */
.discover-scope--top {
  margin: 0;
  gap: 0.25rem;
  flex-wrap: nowrap;
}
.discover-scope--top .discover-scope-tab {
  padding: 0.3rem 0.7rem;
  white-space: nowrap;
}

/* S26-03 Mine (private records) discover body. */
.patient-mine-fragment {
  display: block;
}
.patient-mine-fragment .mine-privacy-note {
  margin: 0 0 0.75rem;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.patient-mine-fragment .mine-body {
  display: block;
}

/* S27-01 Mine-scoped search (owner-only). Reuses the .card-search shell; only
   the summary/spacing chrome is new. Separated from the Everyone/public bar so
   searching on the Mine tab never reaches public catalog/advisory content. */
.patient-mine-fragment .mine-search {
  margin: 0 0 0.75rem; /* card-search form wrapper inside Mine */
}
.mine-search-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.75rem;
  margin: 0.75rem 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.mine-search-clear {
  margin-left: auto;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mine-no-match {
  margin: 1rem 0 0;
  padding: 0.8rem 1rem;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

/* S27-03 (DP-27-1 safe direction): Mine may ALSO reach public guidance. While a
   Mine search is active (?q= non-empty) the worker resolves the same public
   Everyone result set (providers + advisory) and renders it as an additive,
   clearly-labelled block BELOW the owner-record .mine-body. Owner records never
   appear here and public cards never enter the record body above. */
.mine-public {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}
.mine-public-title {
  margin: 0 0 0.35rem;
  font-size: var(--fs-h3);
  color: var(--ink);
}
.mine-public-note {
  margin: 0 0 0.4rem;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.mine-public .result-card-list {
  margin-top: 0.9rem;
}
.mine-public .result-card {
  background: var(--surface);
}

/* Ranked result cards. */
.result-card-list {
  display: grid;
  gap: 1rem; /* S52: was 0.75rem — with cards now carrying a real edge, a little more air between them makes each one read as its own object (owner: cards were hard to tell apart). */
  margin: 0.9rem 0 0;
  padding: 0;
  list-style: none;
}
.result-card {
  display: block;
  padding: 0.9rem calc(var(--space) * 1.1);
  background: var(--surface);
  /* S52: a card must read as a distinct object from the card above AND from the page. The
     --line-strong edge (55% olive, 2.06:1 vs white) plus a slightly lifted shadow does that;
     the previous single hairline at 1.78:1 against a near-white page did not. */
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.result-card .card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}
.result-card .card-title {
  margin: 0;
  font-size: var(--fs-h3);
  font-weight: 680;
  color: var(--ink);
}
.result-card .card-specialty {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: var(--fs-xs);
  font-weight: 550;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  white-space: nowrap;
}
.result-card .card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin: 0.5rem 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
}
.result-card .card-price {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
}
.result-card .card-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.result-card .card-summary {
  margin: 0.5rem 0 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink-2);
}
/* S52: informational — the source/attribution line ("NIH: …") answers "where did this come from",
   which is information, not an action. Slate text (AA 5.09) with a blue informational rule above it. */
.result-card .card-provenance {
  margin: 0.5rem 0 0;
  padding-top: 0.4rem;
  border-top: 1px solid var(--info);
  font-size: var(--fs-xs);
  color: var(--ink-2);
}
.result-card .card-why {
  margin: 0.55rem 0 0;
  padding: 0.45rem 0.6rem;
  font-size: var(--fs-sm);
  color: var(--ink); /* ink, not slate: slate on the blue wash is 4.43, just under AA */
  /* S52: informational — "Why this matched" is an EXPLANATION, never an action, so it carries the
     informational blue (--info), not the brand red. The blue is used as a TINT + edge here, never
     as text on white (contrast 1.94 there). */
  background: var(--info-soft);
  border-left: 3px solid var(--info);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.result-card .card-why .why-label {
  font-weight: 620;
  color: var(--ink);
}
.result-card .card-cta {
  display: inline-flex;
  align-items: center;
  margin: 0.65rem 0 0;
  padding: 0.5rem 0.95rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 0.375rem;
  text-decoration: none;
  transition: background 0.12s ease;
}
.result-card .card-cta:hover {
  background: var(--accent-strong);
}
.result-card .card-cta:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
.result-card[data-score] {
  position: relative;
}
.result-card[data-score]::after {
  content: attr(data-score);
  position: absolute;
  top: 0.6rem;
  right: 0.65rem;
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

/* S52 UX (owner direction): the SMALL / compact feed card.

   "create small cards template and use that instead of the large cards. That way we can have the
   user land on the large card when user wants details."

   The compact card is the SAME object as `.result-card` — same --surface, same --line-strong edge,
   same --radius and shadow — just a denser body: title + kind + one-line snippet + score. Reusing
   the base class (rather than inventing a parallel `.card--small` family) is deliberate: it keeps
   the "a card reads as a distinct object" property the owner asked for in T-local, and it means
   the S52 card-edge work cannot regress on the feed because there is only one edge rule.

   When the card is detail-addressable it IS an `<a>`, so the whole object is the tap target; the
   text colours are set explicitly because an anchor would otherwise inherit link styling. */
.result-card--compact {
  padding: 0.7rem calc(var(--space) * 0.95);
  text-decoration: none;
  /* S52 (owner: "The red text is horrible. We just need a red top border highlight I guess."):
     the compact card is an `<a>`, so the global `a { color: var(--accent) }` made the WHOLE card —
     title, snippet and the "view details" cue — render in the brand red. Red is an ACCENT here, not
     a text colour: the card's accent is a RED TOP BORDER, and every child below is reset to normal
     ink/slate. `color: inherit` alone was not enough because the anchor's own colour wins. */
  color: var(--ink);
  border-top: 3px solid var(--accent);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}
/* The title, snippet and meta are explicitly re-coloured so the anchor's red does not cascade onto
   them. (An `<article>` card gets the same values, so both variants read identically.) */
.result-card--compact .card-title {
  color: var(--ink);
}
.result-card--compact .card-specialty,
.result-card--compact .card-meta {
  color: var(--ink-2);
}
a.result-card--compact:hover {
  border-top-color: var(--accent-strong);
  box-shadow: var(--shadow-md, var(--shadow-sm));
}
a.result-card--compact:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
/* The compact body is tighter: the base head/meta margins are sized for the large card. */
.result-card--compact .card-head {
  gap: 0.25rem 0.6rem;
  /* Leave room for the absolutely-positioned score (data-score::after) top-right. */
  padding-right: 2.6rem;
}
.result-card--compact .card-title {
  font-size: var(--fs-h3);
  font-weight: 640;
}
.result-card--compact .card-snippet {
  margin: 0.35rem 0 0;
  font-size: var(--fs-sm);
  line-height: 1.45;
  color: var(--ink-2);
  /* One line max — the compact card's whole point is that a user scans many of them. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-card--compact .card-meta {
  margin: 0.35rem 0 0;
}
.result-card--compact .card-cta {
  margin: 0.5rem 0 0;
  padding: 0.35rem 0.8rem;
}
/* S52 UX follow-up (owner): "Only the view details should be a CTA button. The rest of the text
   does not need to be a link." The `.card-open` cue was a `<span>` riding a whole-card `<a>`; the
   card is now a plain `<article>` and the detail link is a `card-cta` button, so this rule is dead. */
.result-card--compact[data-score]::after {
  top: 0.55rem;
  right: 0.6rem;
}

/* ============================================================================================
   S52 UX item 11 — the RICH corpus short card: concept icon, country flag, source-logo redirect.
   ============================================================================================

   ONE delimited block, deliberately: every rule below styles a slot that only a CORPUS card with a
   `corpus_presentation()` mapping renders. A provider card and an unmapped corpus card emit none of
   these elements, so they are byte-identically styled by the rules above — the absent-state
   guarantee (ADR-029 D4) is enforced by the selectors matching nothing, not by a conditional here. */

/* The concept icon at the HEAD of the card (before the title).

   `currentColor` is what makes one vendored `healthicons` SVG work for every card: the files ship
   `fill="currentColor"`, so setting `color` here themes the icon with no per-icon recolouring and
   no SVG patching. The colour is the same `--ink-2` the kind label uses, so the icon reads as
   metadata rather than as an action — it must not compete with the title.

   It is `inline-block` and sized in CSS as well as by the `width`/`height` attributes, so a broken
   or slow load reserves no awkward space and a CSS-only change can rescale it. */
.card-concept {
  display: inline-block;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0 0 0.3rem;
  color: var(--ink-2);
  vertical-align: middle;
}

/* The SOURCE strip: country flag + country name on the left, the source logo on the right.

   A flex row with `margin-top: auto` on the logo pushes it to the far end; `gap` keeps the flag from
   colliding with the country name when both render. It sits AFTER the snippet and BEFORE the CTA,
   so the reading order is: what this is (head) → what it says (snippet) → where it came from
   (source) → what you can do (CTA). That order matters for a screen reader as much as for sight. */
.card-provenance {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.45rem 0 0;
  font-size: var(--fs-xs, 0.75rem);
  color: var(--ink-2);
}

/* The flag is DECORATIVE — the country name beside it is the accessible carrier, so this element
   carries `aria-hidden` in the template. `flex: none` keeps it from being squeezed by a long
   country name on a narrow card, and the explicit width/height stop the inline SVG from expanding
   to its viewBox when the text wraps. */
.card-provenance__flag {
  display: inline-flex;
  flex: none;
  align-items: center;
  line-height: 0;
}
.card-provenance__flag .card-flag {
  display: block;
  width: 1.1rem;
  height: auto;
  border-radius: 1px;
  box-shadow: 0 0 0 1px var(--line, rgba(0, 0, 0, 0.12));
}

/* `margin-right: auto` sends the source logo to the card's trailing edge, so the strip reads as
   `[flag] Country ................ [logo]` and the logo lines up with the CTA below it. */
.card-provenance__country {
  margin-right: auto;
}

/* The source LINK: a small text affordance that reaches the original source through `/out/{corpus}`
   — the redirect page, never the final external URL.

   `margin-left: auto` positions it at the card's trailing edge, so the strip reads
   `[flag] Country ............ Source ↗` even when the country name did not render (an empty
   `country_name`). The focus ring is the shared token so a keyboard user sees the same affordance
   they see everywhere else in the app. */
.card-provenance__source {
  display: inline-flex;
  flex: none;
  align-items: center;
  margin-left: auto;
  color: var(--ink-2);
  text-decoration: none;
  line-height: 0;
}
.card-provenance__source:hover {
  color: var(--accent-strong);
}
.card-provenance__source:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 3px;
}

/* S52 UX item 11(d) (owner, REVISED): the card's action row — **View details** (primary, existing)
   beside **Start an episode** (secondary, new).

   A flex WRAP row, not two block links: on a narrow card the two buttons stay on one line when they
   fit and wrap cleanly when they do not, instead of each claiming its own full-width row (which made
   the compact card noticeably taller). `align-items: center` keeps the two different-height
   affordances on one baseline.

   The two are deliberately NOT the same class: `card-cta` is the primary action and keeps its filled
   treatment, while `card-episode` is secondary. Two identically-weighted buttons on every card would
   compete for the tap, and "which one do I press?" is the wrong question on a card whose job is to
   be scanned. */
.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin: 0.5rem 0 0;
}
/* The row supplies the spacing, so the primaries inside it must not add their own top margin (the
   base `.card-cta` rule above sets one for the standalone case). */
.card-actions .card-cta {
  margin: 0;
}

/* **Start an episode** — the secondary affordance. It opens the S44 P1 episode card for this feed's
   ORIGINAL QUERY (not for the specific row; see `EveryoneData::episode_start_href`).

   A quiet text link rather than a second filled button: the same `--accent-strong` on hover as every
   other secondary link in the app, and the shared focus ring so it is keyboard-reachable. `flex: none`
   keeps it from being squeezed to an unreadable width by a long primary label. */
.card-episode {
  flex: none;
  color: var(--ink-2);
  font-size: var(--fs-sm, 0.875rem);
  font-weight: 600;
  text-decoration: none;
  padding: 0.35rem 0.2rem;
  border-radius: 3px;
}
.card-episode:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}
.card-episode:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* S26-05 Discover polish (ADR-028): header subline + guided empty/landing states. */
/* S38: `.discover-sub` is REMOVED as dead CSS, together with the hero copy it styled.

   Owner direction: "Remove the copy - Everything in one search / Search verified doctors, clinics,
   and trusted health guidance — all in one place." The paragraph it styled no longer renders, so
   the rule has no element to match. Kept as a note rather than left in place because a selector for
   a deleted element is the kind of thing that later reads as "this is still used". */
.discover-empty {
  margin: 1.1rem 0 0;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.discover-empty-title {
  margin: 0 0 0.3rem;
  font-size: var(--fs-h3);
  font-weight: 680;
  color: var(--ink);
}
.discover-empty-copy {
  margin: 0 0 0.8rem;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 44rem;
}
.suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* =========================================================================
   S28-01 — Immersive Discover home (patient shell). Mirrored additive block:
   patient == admin carry this byte-identical; the worker-origin provider shell
   carries the same new classes. Discover is the immersive patient home and no
   card region renders outside the two tabs.
   ========================================================================= */

/* Primary content: the immersive Discover two-tab surface fills the content
   column and lays out spaciously. */
main.patient-hub > #patient-search.hub-discover {
  display: block;
  min-height: calc(100vh - var(--nav-h) - 3rem);
  padding: 0.25rem 0 1.5rem;
}
main.patient-hub > #patient-search.hub-discover .patient-everyone-fragment,
main.patient-hub > #patient-search.hub-discover .patient-mine-fragment {
  width: 100%;
  max-width: 60rem;
}

/* Real-action regions (capture/reminders/feedback/appointments) are hidden until
   a user opens a form — they are not competing card stacks on the immersive home. */
main.patient-hub > .patient-action-region:empty {
  display: none;
}
main.patient-hub > .patient-action-region:not(:empty) {
  padding-bottom: 1.5rem;
}

/* Rail section labels + reserved non-card slot. */
.patient-nav-label {
  display: block;
  margin: 0.9rem 0 0.3rem;
  padding: 0 0.2rem;
  font-size: var(--fs-xs);
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.patient-nav-label:first-child {
  margin-top: 0.4rem;
}
.patient-nav-placeholder {
  display: block;
  padding: 0.55rem 0.85rem;
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* Mine browse overview (S28-01): owner cards folded together under Mine. */
.mine-overview {
  display: block;
}
.mine-overview > * + * {
  margin-top: 1.4rem;
}

/* ---- S36 D52: per-lane result tabs + panes ------------------------------------------------
 *
 * The tab row sits above the single swappable results region; each tab is an ordinary link
 * (hx-get with a full href), so this works with JS disabled.
 *
 * Panes are all rendered server-side and all but the active one carry `hidden`, so switching
 * tabs is a plain navigation and needs no client state. `[hidden]` is set explicitly rather
 * than relying on the default, because a flex/grid parent can override `display: none`. */
.list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0 0 0.75rem;
  border-bottom: 1px solid var(--border, var(--line));
}
.list-tab {
  padding: 0.4rem 0.75rem;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 0.5rem 0.5rem 0 0;
  font-size: 0.875rem;
  text-decoration: none;
  color: inherit;
  opacity: 0.7;
}
.list-tab:hover {
  opacity: 1;
}
.list-tab.is-active {
  border-color: var(--border, var(--line));
  background: var(--surface, #fff);
  font-weight: 600;
  opacity: 1;
}
.lane-pane[hidden] {
  display: none;
}

/* ---- S36 D52: per-source card facts -------------------------------------------------------
 *
 * The corpora share only `id`, so each card renders whatever its own source knows
 * (`generic_name`, `brand_name`, `therapeutic_class`, `also_called`, …) as a labelled list. The
 * labels come from the data, so this styling must work for any label/value pair rather than for a
 * fixed set of columns.
 *
 * Two columns with `auto` on the label so the values line up down the card without a hardcoded
 * width — the labels differ per corpus (`generic_name` vs `therapeutic_class`), so any fixed
 * width would either clip the long ones or leave a gap after the short ones. */
.card-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 0.6rem;
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
}
.card-fact-label {
  color: var(--muted, #607080);
  /* The labels are machine-ish keys; make that legible rather than pretending they are prose. */
  font-variant: small-caps;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.card-fact-value {
  margin: 0;
  overflow-wrap: anywhere;
}

/* =========================================================================
   S52 UX — the CONTENT DETAIL surface (owner direction):

     "apply the current large cards template to the detail page. Modify to
      include any fields that may have been missed."

   The feed now renders the COMPACT card, so the detail page (`/app/patient/content/{id}`)
   is the LARGE card — the place a user lands "when they want details". This block gives the
   detail surface the SAME card object the large feed card was (same --surface, a
   --line-strong edge, --radius, --shadow-sm) and styles the four fields the detail page had
   been missing: summary, "Why this", the source line, and the per-corpus facts.

   DELIBERATELY SELF-CONTAINED AND APPEND-ONLY. The large card's rules live under the
   `.result-card` scope, which is a SIBLING's committed work (S52 small-cards + the card-edge
   fix); re-scoping or refactoring them would restyle the feed, which this task must NOT do.
   So the tokens are re-declared / re-read HERE under `content-detail-*` instead. The four
   added fields mirror their feed counterparts' look (informational BLUE for "Why this", a
   blue top rule for the source line) without sharing a selector with them.

   `.card-facts` / `.card-fact-label` / `.card-fact-value` are already GLOBAL and are reused
   for the facts list, so only the detail-scoped extras are declared here. */

/* The detail surface AS the large card: one object, with the S52 card edge + lift. */
.content-detail {
  display: block;
  padding: 0.9rem calc(var(--space) * 1.1);
  background: var(--surface, #fff);
  border: 1px solid var(--line-strong, var(--line));
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.content-detail-back {
  margin: 0 0 0.6rem;
  font-size: var(--fs-sm);
}
.content-detail-back a {
  color: var(--accent-strong);
  text-decoration: none;
}
.content-detail-back a:hover {
  text-decoration: underline;
}

/* Head: title + kind pill, matching the large card's `card-head` / `card-specialty`. */
.content-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
}
.content-detail-title {
  margin: 0;
  font-size: var(--fs-h2, 1.5rem);
  font-weight: 680;
  color: var(--ink);
}
.content-detail-kind {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  font-size: var(--fs-xs);
  font-weight: 550;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  white-space: nowrap;
}

/* S52: the SUMMARY — the large card's `card-summary`, restored. Corpus HTML, sanitised at
   build time, so it renders as markup (the same boundary as `.content-detail-html`). */
.content-detail-summary {
  margin: 0.5rem 0 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
  color: var(--ink-2);
}

/* S52: "Why this" — the large card's `card-why`, restored. Informational BLUE (`--info`) as a
   TINT + left edge, never as text on white (the S52 note: `--info` on white is 1.94:1). The
   label sits at `--ink` so it stays AA on the blue wash. */
.content-detail-why {
  margin: 0.55rem 0 0;
  padding: 0.45rem 0.6rem;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: var(--info-soft);
  border-left: 3px solid var(--info);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.content-detail-why .why-label {
  font-weight: 620;
  color: var(--ink);
}

/* The body: real sanitised corpus markup. */
.content-detail-body {
  margin: 0.6rem 0 0;
}
.content-detail-html {
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: var(--ink-2);
}
.content-detail-html :first-child {
  margin-top: 0;
}
.content-detail-html :last-child {
  margin-bottom: 0;
}

/* S52: the per-corpus facts list. The base `.card-facts` grid is global; the detail surface
   only needs a little more top air so it separates from the body above it. */
.content-detail-facts {
  margin-top: 0.7rem;
}

/* Footer: the S52 source line (informational, mirrors the large card's `card-source` with a
   blue top rule), the per-corpus attribution, and the "open original" link. */
.content-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.9rem;
  margin: 0.7rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--info);
}
.content-detail-source-line {
  flex-basis: 100%;
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--ink-2);
}
.content-detail-source {
  font-size: var(--fs-xs);
  color: var(--ink-2);
}
.content-detail-original {
  margin-left: auto;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-strong);
  text-decoration: none;
}
.content-detail-original:hover {
  text-decoration: underline;
}
.content-detail-original:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
