/*
 * Vitara Health design system
 * ------------------------------------------------------------------
 * Mobile-first, native-app feel, accessibility-first, classless.
 *
 * The views are semantic HTML with almost no classes, so this file
 * styles ELEMENTS directly. Adding a new screen rarely needs a new
 * class — write plain h1/p/fieldset/label/input/button and it works.
 *
 * Sections:
 *   1. Tokens          — colour, type, space, radius, motion
 *   2. Reset & base    — sane defaults, native scroll behaviour
 *   3. App shell       — the centred phone-width canvas (main)
 *   4. Typography      — headings, body, eyebrow, links
 *   5. Forms           — fieldset, label, text inputs, textarea
 *   6. Choice rows     — radio/checkbox as big tappable cards
 *   7. Buttons         — primary action, sticky native action bar
 *   8. Feedback        — errors / alerts
 *   9. Review table    — the summary screen
 * ------------------------------------------------------------------ */

:root {
  /* ---- 1a. Colour: raw palette ---- */
  --ms-color-ink:            #0F0F10;
  --ms-color-paper:          #F7F7F5;
  --ms-color-signal:         #2D5BE3;
  --ms-color-mid:            #6B6B72;
  --ms-color-green:          #1A7F5A;
  --ms-color-green-stroke:   oklch(0.627 0.194 149.214005);
  --ms-color-white:          #FFFFFF;

  --ms-color-signal-pale:    #EBF0FD;
  --ms-color-signal-border:  #C5D6F8;
  --ms-color-green-pale:     #E8F5EF;
  --ms-color-rule:           #E2E2DF;

  --ms-color-caution-pale:   #FEF5E7;
  --ms-color-caution-border: #F0C060;
  --ms-color-caution-text:   #9B6A0E;
  --ms-color-caution-body:   #7A520A;
  --ms-color-danger:         #C0392B;
  --ms-color-danger-pale:    #FBEAE8;

  /* ---- 1b. Colour: semantic roles ---- */
  --ms-bg-page:              var(--ms-color-paper);
  --ms-bg-surface:           var(--ms-color-white);
  --ms-bg-inverse:           var(--ms-color-ink);
  --ms-bg-info:              var(--ms-color-signal-pale);
  --ms-bg-success:           var(--ms-color-green-pale);
  --ms-bg-caution:           var(--ms-color-caution-pale);

  --ms-text-primary:         var(--ms-color-ink);
  --ms-text-secondary:       var(--ms-color-mid);
  --ms-text-on-inverse:      var(--ms-color-white);
  --ms-text-link:            var(--ms-color-signal);
  --ms-text-accent:          var(--ms-color-signal);
  --ms-text-danger:          var(--ms-color-danger);

  --ms-border-default:       var(--ms-color-rule);
  --ms-border-focus:         var(--ms-color-signal);

  --ms-action-primary-bg:    var(--ms-color-signal);
  --ms-action-primary-text:  var(--ms-color-white);

  /* ---- 1c. Type ---- */
  --ms-font-display: 'DM Serif Display', Georgia, 'Times New Roman', serif;
  --ms-font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ms-font-mono:    'SF Mono', 'Roboto Mono', Menlo, Consolas, monospace;

  /* Fluid type scale — comfortable on phones, scales up gently. */
  --ms-text-xs:   0.8125rem;  /* 13px — eyebrow, captions      */
  --ms-text-sm:   0.9375rem;  /* 15px — hints, secondary       */
  --ms-text-base: 1rem;       /* 16px — body & inputs (no iOS zoom) */
  --ms-text-lg:   1.125rem;   /* 18px — questions / legends    */
  --ms-display:   clamp(1.9rem, 7vw, 2.6rem); /* h1 hero        */

  --ms-leading-tight: 1.15;
  --ms-leading-body:  1.55;

  /* ---- 1d. Space (8pt-ish rhythm) ---- */
  --ms-space-1: 0.25rem;
  --ms-space-2: 0.5rem;
  --ms-space-3: 0.75rem;
  --ms-space-4: 1rem;
  --ms-space-5: 1.5rem;
  --ms-space-6: 2rem;
  --ms-space-7: 3rem;

  /* ---- 1e. Radius / shape ---- */
  --ms-radius-control: 0.375rem;  /* 6px — buttons, choice rows, alerts */
  --ms-radius-sm:   0.5rem;
  --ms-radius-md:   0.875rem;
  --ms-radius-lg:   1.25rem;
  --ms-radius-pill: 999px;

  /* ---- 1f. Touch / elevation / motion ---- */
  --ms-touch: 3.25rem;       /* 52px min tappable — accessibility first */
  --ms-shadow-1: 0 1px 2px rgba(15, 15, 16, 0.05), 0 1px 1px rgba(15, 15, 16, 0.04);
  --ms-shadow-2: 0 6px 16px rgba(15, 15, 16, 0.10);
  --ms-shadow-pop: 0 8px 24px rgba(45, 91, 227, 0.28);
  --ms-ring: 0 0 0 3px var(--ms-color-signal-border);
  --ms-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ms-duration: 160ms;

  /* App canvas width — roughly a phone, centred on larger screens. */
  --ms-shell: 30rem;

  color-scheme: light;
  accent-color: var(--ms-color-signal);
}

/* ------------------------------------------------------------------
   2. Reset & base
   ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ms-bg-page);
  color: var(--ms-text-primary);
  font-family: var(--ms-font-body);
  font-size: var(--ms-text-base);
  line-height: var(--ms-leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;   /* kill rubber-band chrome bounce */
}

::selection { background: var(--ms-color-signal-pale); }

img, svg { max-width: 100%; height: auto; display: block; }

[hidden] { display: none !important; }

/* Visible, consistent focus — keyboard users only. */
:focus-visible {
  outline: 2px solid var(--ms-border-focus);
  outline-offset: 2px;
  border-radius: var(--ms-radius-sm);
}
:focus:not(:focus-visible) { outline: none; }

/* ------------------------------------------------------------------
   3. App shell — the centred phone-width canvas
   The layout renders everything inside <main>; treat it as the screen.
   Bottom padding clears the sticky action bar. Safe-area insets keep
   content off the notch / home indicator on iOS.
   ------------------------------------------------------------------ */
main {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--ms-shell);
  min-height: 100dvh;
  margin-inline: auto;
  padding:
    calc(env(safe-area-inset-top) + var(--ms-space-6))
    calc(env(safe-area-inset-right) + var(--ms-space-5))
    calc(env(safe-area-inset-bottom) + var(--ms-space-4))
    calc(env(safe-area-inset-left) + var(--ms-space-5));
}

/* ------------------------------------------------------------------
   4. Typography
   ------------------------------------------------------------------ */
h1 {
  font-family: var(--ms-font-body);
  font-size: var(--ms-display);
  line-height: var(--ms-leading-tight);
  letter-spacing: -0.02em;
  font-weight: 800;
  margin: 0 0 var(--ms-space-4);
  text-wrap: balance;
}

/* App masthead — brand header across the wizard. */
header {
  margin: 0 0 var(--ms-space-4);
}
header .logo { font-size: 1.25rem; margin: 0; }

/* Wizard progress — a thin bar under the masthead that doubles as the
   divider the header's border used to provide. The track is the hairline
   colour; the value is signal blue and eases between steps. */
progress {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  margin: 0 0 var(--ms-space-6);
  border: 0;
  border-radius: var(--ms-radius-pill);
  background: var(--ms-border-default);
  color: var(--ms-action-primary-bg);
  overflow: hidden;
}
progress::-webkit-progress-bar {
  background: var(--ms-border-default);
  border-radius: var(--ms-radius-pill);
}
progress::-webkit-progress-value {
  background: var(--ms-action-primary-bg);
  border-radius: var(--ms-radius-pill);
  transition: width var(--ms-duration) var(--ms-ease);
}
progress::-moz-progress-bar {
  background: var(--ms-action-primary-bg);
  border-radius: var(--ms-radius-pill);
}

/* Pages with a masthead (the wizard) demote the h1 to a quiet section
   label, so the question — the <legend> — is what the eye lands on. The
   landing hero has no <header>, so its h1 is untouched. */
main:has(header) h1 {
  font-size: var(--ms-text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ms-text-secondary);
  margin: 0 0 var(--ms-space-4);
}

/* Brand wordmark — the serif lives here now. "Vitara" ink, "Health" signal.
   DM Serif Display ships a single (regular) weight, which reads lighter and
   more editorial than the old bold Georgia mark. */
.logo {
  font-family: var(--ms-font-display);
  font-size: clamp(1.875rem, 6.5vw, 2.5rem);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ms-text-primary);
  margin: 0 0 var(--ms-space-6);
}
.logo span { color: var(--ms-text-accent); }

/* ------------------------------------------------------------------
   4a. Landing hero
   The landing page is the only screen with no <header> masthead, so we
   target it with :not(:has(header)). The top bar keeps the wordmark
   pinned left with a trust marker pinned right; everything below it is
   centred. The hero h1 is the editorial serif, with its closing phrase
   set in italic signal blue.
   ------------------------------------------------------------------ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ms-space-3);
  margin: 0 0 var(--ms-space-6);
}
.topbar .logo {
  font-size: clamp(1.5rem, 6vw, 1.875rem);
  margin: 0;
}

/* Trust marker — green outline shield + label, pinned to the right. */
.trust {
  display: inline-flex;
  align-items: center;
  gap: var(--ms-space-2);
  margin: 0;
  font-size: var(--ms-text-xs);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ms-text-primary);
}
.trust svg {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: var(--ms-color-green-stroke);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

main:not(:has(header)) > .eyebrow,
main:not(:has(header)) > h1,
main:not(:has(header)) > .lede {
  text-align: center;
  margin-inline: auto;
}

main:not(:has(header)) h1 {
  font-family: var(--ms-font-display);
  font-weight: 400;
  letter-spacing: -0.01em;
}
main:not(:has(header)) h1 span {
  color: var(--ms-text-accent);
  font-style: italic;
}

/* A hero that owns the whole viewport: with no bottom CTA to anchor the page,
   fill the space under the topbar and centre the heading and copy in it. */
main:not(:has(header)) > .hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

/* Reassurance badge above the CTA — kept quiet: small, light, secondary. */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--ms-space-1);
  margin: 0 auto var(--ms-space-5);
  padding: var(--ms-space-1) var(--ms-space-3);
  background: var(--ms-bg-info);
  border: 1px solid var(--ms-color-signal-border);
  border-radius: var(--ms-radius-pill);
  color: var(--ms-text-secondary);
  font-size: var(--ms-text-xs);
  font-weight: 500;
  line-height: 1.2;
}
.badge svg {
  flex: 0 0 auto;
  width: 0.875rem;
  height: 0.875rem;
  fill: none;
  stroke: var(--ms-color-green-stroke);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Centre the pill on its own row. */
main:not(:has(header)) > .badge { display: flex; width: fit-content; }

h2, legend {
  font-size: var(--ms-text-lg);
  line-height: 1.3;
  font-weight: 650;
  margin: 0 0 var(--ms-space-3);
  text-wrap: pretty;
}

p {
  margin: 0 0 var(--ms-space-4);
  color: var(--ms-text-secondary);
  max-width: 60ch;
}

/* Eyebrow: the kicker line above the hero heading. The generous bottom gap
   pushes the hero down so it reads as vertically centred on a phone; the
   desktop card tames it (see the wide-screen media query). */
.eyebrow {
  font-size: var(--ms-text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ms-text-link);
  margin-bottom: clamp(2rem, 14vh, 6rem);
}

a {
  color: var(--ms-text-link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
  font-weight: 550;
}

/* Hint text under a label (id="<field>_hint"). */
[id$="_hint"] {
  font-size: var(--ms-text-sm);
  color: var(--ms-text-secondary);
  margin: calc(-1 * var(--ms-space-1)) 0 var(--ms-space-3);
}

/* ------------------------------------------------------------------
   5. Forms
   ------------------------------------------------------------------ */
form { display: contents; }

fieldset {
  border: 0;
  margin: 0 0 var(--ms-space-5);
  padding: 0;
  min-width: 0;
}

legend { padding: 0; width: 100%; }

label {
  display: block;
  font-weight: 450;
  margin-bottom: var(--ms-space-2);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="date"],
textarea,
select {
  width: 100%;
  min-height: var(--ms-touch);
  padding: var(--ms-space-3) var(--ms-space-4);
  margin-bottom: var(--ms-space-4);
  font-family: inherit;
  font-size: var(--ms-text-base);  /* 16px keeps iOS from zooming */
  color: var(--ms-text-primary);
  background: var(--ms-bg-surface);
  border: 1.5px solid var(--ms-border-default);
  border-radius: var(--ms-radius-md);
  box-shadow: var(--ms-shadow-1);
  transition: border-color var(--ms-duration) var(--ms-ease),
              box-shadow var(--ms-duration) var(--ms-ease);
  appearance: none;
}

textarea {
  min-height: 7.5rem;
  line-height: var(--ms-leading-body);
  resize: vertical;
}

input::placeholder, textarea::placeholder { color: var(--ms-text-secondary); opacity: 0.7; }

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--ms-border-focus);
  box-shadow: var(--ms-ring);
}

/* ------------------------------------------------------------------
   6. Choice rows — radios & consent checkbox as big tappable cards
   Markup is just <label><input type=radio> text</label>; we hide the
   native control and turn the whole label into a 52px+ tap target with
   a clear selected state. The input stays in the DOM (focusable,
   announced) and drives styling via :has().
   ------------------------------------------------------------------ */
label:has(input[type="radio"]),
label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: var(--ms-space-3);
  min-height: var(--ms-touch);
  margin: 0 0 var(--ms-space-3);
  padding: var(--ms-space-3) var(--ms-space-4);
  font-weight: 500;
  background: var(--ms-bg-surface);
  border: 1.5px solid var(--ms-border-default);
  border-radius: var(--ms-radius-control);
  box-shadow: var(--ms-shadow-1);
  cursor: pointer;
  transition: border-color var(--ms-duration) var(--ms-ease),
              background-color var(--ms-duration) var(--ms-ease),
              transform var(--ms-duration) var(--ms-ease);
  -webkit-user-select: none;
  user-select: none;
}

label:has(input[type="radio"]:checked),
label:has(input[type="checkbox"]:checked) {
  border-color: var(--ms-border-focus);
  background: var(--ms-bg-info);
  color: var(--ms-text-primary);
}

label:has(input:focus-visible) { box-shadow: var(--ms-ring); }
label:has(input[type="radio"]):active { transform: scale(0.99); }

/* Custom control glyph. Keep the real input but size & style it. */
label input[type="radio"],
label input[type="checkbox"] {
  appearance: none;
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  margin: 0;
  background: var(--ms-bg-surface);
  border: 1.5px solid var(--ms-color-mid);
  display: grid;
  place-content: center;
  cursor: pointer;
  transition: border-color var(--ms-duration) var(--ms-ease),
              background-color var(--ms-duration) var(--ms-ease);
}
label input[type="radio"] { border-radius: var(--ms-radius-pill); }
label input[type="checkbox"] { border-radius: 0.4rem; }

label input[type="radio"]::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  border-radius: var(--ms-radius-pill);
  transform: scale(0);
  transition: transform var(--ms-duration) var(--ms-ease);
  background: var(--ms-action-primary-text);
}
label input[type="radio"]:checked {
  background: var(--ms-action-primary-bg);
  border-color: var(--ms-action-primary-bg);
}
label input[type="radio"]:checked::before { transform: scale(1); }

label input[type="checkbox"]::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  transform: scale(0);
  transition: transform var(--ms-duration) var(--ms-ease);
  background: var(--ms-action-primary-text);
  clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 16%, 84% 0, 39% 70%);
}
label input[type="checkbox"]:checked {
  background: var(--ms-action-primary-bg);
  border-color: var(--ms-action-primary-bg);
}
label input[type="checkbox"]:checked::before { transform: scale(1); }

/* The consent block is a long label — let it wrap and read normally. */
label:has(input[type="checkbox"]) {
  align-items: flex-start;
  font-weight: 400;
  font-size: var(--ms-text-sm);
  line-height: var(--ms-leading-body);
  color: var(--ms-text-secondary);
}

/* ------------------------------------------------------------------
   7. Buttons — primary action + sticky native action bar
   The wizard's "Continue" / landing CTA is the last child of a form.
   We pin it to the bottom of the viewport like a native app's action
   bar, always within thumb reach, lifted on a frosted strip.
   ------------------------------------------------------------------ */
button,
input[type="submit"],
input[type="button"],
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ms-space-2);
  width: 100%;
  min-height: var(--ms-touch);
  padding: var(--ms-space-3) var(--ms-space-5);
  font-family: inherit;
  font-size: var(--ms-text-base);
  font-weight: 650;
  line-height: 1;
  color: var(--ms-action-primary-text);
  background: var(--ms-action-primary-bg);
  border: 0;
  border-radius: var(--ms-radius-control);
  box-shadow: var(--ms-shadow-pop);
  cursor: pointer;
  text-decoration: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  transition: transform var(--ms-duration) var(--ms-ease),
              box-shadow var(--ms-duration) var(--ms-ease),
              filter var(--ms-duration) var(--ms-ease);
}

button:active,
input[type="submit"]:active,
.button:active { transform: scale(0.98); filter: brightness(0.96); }

button:disabled, input[type="submit"]:disabled {
  opacity: 0.5;
  box-shadow: none;
  cursor: not-allowed;
}

/* Sticky action bar: the primary submit parks just above the home indicator
   and stays there as longer forms scroll. `margin-top: auto` pushes it to the
   bottom on short screens; the sticky `bottom` matches main's bottom padding,
   so the button sits at exactly the same height whether parked or stuck —
   avoiding the iOS Safari relayout jump that a `bottom: 0` + negative
   safe-area margin produced on short (radio) pages. */
form > button[type="submit"],
form > input[type="submit"],
main > form button[type="submit"] {
  position: sticky;
  bottom: calc(env(safe-area-inset-bottom) + var(--ms-space-4));
  margin-top: auto;
  z-index: 10;
}

/* button_to wraps the button in a <form class="button_to">; treat it like
   any other form so its CTA joins the sticky bottom action bar on mobile. */
form.button_to { display: contents; }

/* ------------------------------------------------------------------
   8. Feedback — validation errors / alerts
   ------------------------------------------------------------------ */
[role="alert"] {
  position: relative;
  margin: 0 0 var(--ms-space-4);
  padding: var(--ms-space-3) var(--ms-space-6) var(--ms-space-3) var(--ms-space-4);
  background: var(--ms-color-danger-pale);
  border: 1px solid var(--ms-color-danger);
  border-radius: var(--ms-radius-control);
  color: var(--ms-text-danger);
  font-size: var(--ms-text-sm);
  font-weight: 550;
  cursor: pointer;   /* tapping anywhere dismisses — see dismiss controller */
}
[role="alert"] ul { list-style: none; margin: 0; padding: 0; }
[role="alert"] li { margin: var(--ms-space-1) 0; }
[role="alert"] li + li { margin-top: var(--ms-space-2); }

/* Small cross in the corner. It's a real <button> for keyboard users; the
   click bubbles to the alert, which the dismiss controller removes. The
   global button styles would make it a big blue bar, so reset them here. */
[role="alert"] .dismiss {
  position: absolute;
  top: 50%;
  right: var(--ms-space-2);
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  min-height: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  box-shadow: none;
  border-radius: var(--ms-radius-control);
}
[role="alert"] .dismiss svg {
  width: 0.8rem;
  height: 0.8rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

/* ------------------------------------------------------------------
   9. Review table — summary screen rendered as stacked cards on phones
   ------------------------------------------------------------------ */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 var(--ms-space-5);
}

tr {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--ms-space-1) var(--ms-space-3);
  padding: var(--ms-space-4);
  margin-bottom: var(--ms-space-3);
  background: var(--ms-bg-surface);
  border: 1px solid var(--ms-border-default);
  border-radius: var(--ms-radius-md);
  box-shadow: var(--ms-shadow-1);
}

th[scope="row"] {
  grid-column: 1;
  text-align: left;
  font-size: var(--ms-text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ms-text-secondary);
}

td {
  grid-column: 1;
  color: var(--ms-text-primary);
}

/* The answer cell: clamp long free-text so a card can't overflow its width
   or grow unbounded. The Change link (last cell) is exempt. */
td:first-of-type {
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

td:last-child {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}
td:last-child a { white-space: nowrap; }

/* ------------------------------------------------------------------
   9a. Banner — a prominent, non-dismissible callout the reader must see
   before the body of the page (unlike [role="alert"], which is a
   dismissible form-feedback message). What a banner announces lives in
   the views.
   ------------------------------------------------------------------ */
.banner {
  margin: 0 0 var(--ms-space-4);
  padding: var(--ms-space-3) var(--ms-space-4);
  background: var(--ms-color-danger-pale);
  border: 1px solid var(--ms-color-danger);
  border-left-width: 4px;
  border-radius: var(--ms-radius-control);
}
.banner h2 {
  font-size: var(--ms-text-base);
  color: var(--ms-text-danger);
  margin: 0 0 var(--ms-space-1);
}
.banner p {
  margin: 0;
  font-size: var(--ms-text-sm);
  color: var(--ms-text-primary);
}

/* ------------------------------------------------------------------
   9b. Collapsible — <details> as a quiet card whose summary line is the
   toggle. Used for long supporting material readers open on demand.
   ------------------------------------------------------------------ */
details {
  margin: 0 0 var(--ms-space-5);
  padding: var(--ms-space-3) var(--ms-space-4);
  background: var(--ms-bg-surface);
  border: 1px solid var(--ms-border-default);
  border-radius: var(--ms-radius-md);
}
details summary {
  cursor: pointer;
  font-weight: 600;
}
details[open] summary {
  margin-bottom: var(--ms-space-3);
}

/* ------------------------------------------------------------------
   10. Call screen — a Meet-like audio call: a dark stage that fills the
   shell, avatar + status centred, controls along the bottom. Generic
   call vocabulary only; what a call is about lives in the views.
   ------------------------------------------------------------------ */
.call {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--ms-space-4);
}

.call-stage {
  flex: 1;
  min-height: 24rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--ms-space-2);
  padding: var(--ms-space-6);
  background: var(--ms-bg-inverse);
  color: var(--ms-text-on-inverse);
  border-radius: var(--ms-radius-lg);
  text-align: center;
}

.call-avatar {
  width: 6rem;
  height: 6rem;
  margin-bottom: var(--ms-space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--ms-radius-pill);
}

.call-avatar svg {
  width: 2.75rem;
  height: 2.75rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}

/* Beats the main:not(:has(header)) h1 hero sizing — this h1 is a caption
   on the stage, not the page hero. */
.call-stage .call-title {
  margin: 0;
  font-family: var(--ms-font-display);
  font-size: 1.5rem;
  font-weight: 400;
}

.call-status {
  margin: 0;
  font-size: var(--ms-text-sm);
  color: rgba(255, 255, 255, 0.65);
}

/* The join button sits alone; once connected it swaps for the mute/leave
   pair, whose [hidden] wrapper melts away (display: contents) so both
   buttons share the row. */
.call-controls { display: flex; gap: var(--ms-space-3); }
.call-controls > div { display: contents; }

.call-leave { background: var(--ms-color-danger); box-shadow: none; }

/* ------------------------------------------------------------------
   Motion preference
   ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Larger screens: the canvas becomes a centred card on the paper bg. */
@media (min-width: 34rem) {
  main {
    min-height: auto;
    margin-block: var(--ms-space-7);
    padding: var(--ms-space-7);
    background: var(--ms-bg-surface);
    border: 1px solid var(--ms-border-default);
    border-radius: var(--ms-radius-lg);
    box-shadow: var(--ms-shadow-2);
  }
  /* No need to push the hero down inside the fixed-height desktop card. */
  .eyebrow { margin-bottom: var(--ms-space-5); }
  /* On desktop the action bar needn't stick — it reads as a normal CTA. */
  main > form button[type="submit"],
  form > button[type="submit"] {
    position: static;
    margin-top: var(--ms-space-2);
  }
}
