/*
 * Steward base components, shared by the public site (src/personal-site) and the family app (workflows/personal).
 * A standalone stylesheet (assets/steward/components.css), loaded after assets/steward/tokens.css by those surfaces only.
 *
 * Every selector starts at the root class `.steward`, and every class is `st-` prefixed, so no staff screen can pick a
 * rule up and no Steward element is ever registered as a staff component (packages/design-system registry: btn,
 * button, chip, badge, status, panel, field ... are never used here). Colours come only from steward/tokens.css.
 * These rules are unlayered, so they win over the staff stylesheet's two cascade layers wherever both apply.
 * Calm by rule: no tilt, glow, gradient text or confetti.
 */

/* Root and reset. A Steward page puts `.steward` on <html>, so the whole page is stone; the staff styles.css is not
   loaded beside it, so this sheet carries its own reset. */
.steward *, .steward *::before, .steward *::after { box-sizing: border-box; }
.steward body { margin: 0; }
.steward,
.steward body {
  background: var(--st-stone);
  color: var(--st-ink);
  font-family: var(--st-font);
  font-size: var(--st-text-body);
  line-height: var(--st-leading);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.steward.st-root { min-height: 100vh; display: flex; flex-direction: column; overflow-x: clip; }
.steward.st-root > main { flex: 1 0 auto; }
.steward.st-root :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset) { margin: 0; }
.steward.st-root :where(h1, h2, h3, h4) { color: var(--st-ink); font-family: var(--st-font); text-wrap: balance; }
.steward.st-root :where(ul, ol).st-plain { list-style: none; padding: 0; }
.steward.st-root :where(fieldset) { border: 0; padding: 0; min-width: 0; }
.steward.st-root :where(img, svg) { display: block; max-width: 100%; }
.steward.st-root :where(a) { color: inherit; text-decoration: none; }
.steward.st-root :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--st-focus);
  outline-offset: 3px;
  border-radius: 6px;
}
.steward.st-root main:focus, .steward.st-root [tabindex="-1"]:focus { outline: none; }
.steward .st-sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Layout. */
.steward .st-wrap { padding-inline: var(--st-gutter); }
.steward .st-section { padding: var(--st-section) var(--st-gutter); }
.steward .st-section-tight { padding: var(--st-space-7) var(--st-gutter); }
.steward .st-band { background: var(--st-stone-2); }
.steward .st-band-evergreen { background: var(--st-evergreen); color: var(--st-on-evergreen); }
.steward .st-band-evergreen :is(h1, h2, h3, h4) { color: var(--st-on-evergreen); }
.steward .st-band-evergreen :is(.st-lede, .st-kicker, p) { color: var(--st-on-evergreen-2); }
.steward .st-band-evergreen .st-kicker::before { background: var(--st-on-evergreen-2); }
.steward .st-stack { display: grid; gap: var(--st-space-4); }
.steward .st-stack-lg { display: grid; gap: var(--st-space-6); }
.steward .st-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--st-space-3); }
.steward .st-grid { display: grid; gap: var(--st-space-5); grid-template-columns: minmax(0, 1fr); }
.steward .st-head {
  display: grid; gap: var(--st-space-4); grid-template-columns: minmax(0, 1fr);
  align-items: end; margin-bottom: var(--st-space-7);
}

/* Type. */
.steward .st-display {
  font-size: var(--st-text-display); font-weight: var(--st-weight-display); line-height: 1.02;
  letter-spacing: var(--st-track-display);
}
.steward .st-h1 {
  font-size: var(--st-text-h1); font-weight: var(--st-weight-display); line-height: 1.04;
  letter-spacing: var(--st-track-display);
}
.steward .st-h2 {
  font-size: var(--st-text-h2); font-weight: var(--st-weight-display); line-height: 1.08;
  letter-spacing: var(--st-track-heading);
}
.steward .st-h3 { font-size: var(--st-text-h3); font-weight: 700; line-height: 1.25; letter-spacing: -0.015em; }
.steward .st-lede { font-size: var(--st-text-lede); line-height: 1.5; color: var(--st-ink-2); max-width: var(--st-measure); }
.steward .st-body { color: var(--st-ink-2); max-width: var(--st-measure); }
.steward .st-small { font-size: var(--st-text-small); color: var(--st-ink-2); }
.steward .st-muted { color: var(--st-muted); }
.steward .st-accent { color: var(--st-evergreen); }
.steward .st-kicker {
  display: inline-flex; align-items: center; gap: var(--st-space-3);
  font-size: var(--st-text-small); font-weight: 600; letter-spacing: 0.02em; color: var(--st-ink-2);
}
.steward .st-kicker::before { content: ""; width: 28px; height: 2px; background: var(--st-evergreen); flex: none; }
.steward .st-label {
  font-size: var(--st-text-label); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--st-muted);
}
.steward .st-number { font-variant-numeric: tabular-nums; }
.steward .st-link {
  display: inline-block; min-height: 24px; color: var(--st-evergreen); font-weight: 600; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 0.2em;
}
.steward .st-link:hover { text-decoration-thickness: 2px; }

/* Buttons. A link that looks like a button is still a link (it goes somewhere); a <button> acts. */
.steward .st-button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--st-space-3);
  min-height: var(--st-control); padding: 0 var(--st-space-5);
  border: 1.5px solid transparent; border-radius: var(--st-radius-control);
  font: 650 1.0625rem/1.2 var(--st-font); text-align: center; cursor: pointer;
  text-decoration: none;
}
.steward .st-button svg { width: 18px; height: 18px; flex: none; }
.steward .st-button-primary { background: var(--st-evergreen); color: var(--st-on-evergreen); }
.steward .st-button-primary:hover { background: var(--st-evergreen-2); }
.steward .st-button-secondary { background: var(--st-surface); color: var(--st-ink); border-color: var(--st-control-line); }
.steward .st-button-secondary:hover { border-color: var(--st-ink); }
.steward .st-button-quiet { background: transparent; color: var(--st-evergreen); padding-inline: var(--st-space-3); }
.steward .st-button-quiet:hover { text-decoration: underline; }
.steward .st-button-inverse { background: var(--st-surface); color: var(--st-evergreen); }
.steward .st-button-large { min-height: var(--st-control-large); padding: 0 var(--st-space-6); font-size: 1.125rem; }
.steward .st-button-small { min-height: var(--st-control-small); padding: 0 var(--st-space-4); font-size: var(--st-text-small); }
.steward .st-button-block { width: 100%; }
.steward .st-button[disabled], .steward .st-button[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.steward .st-actions { display: flex; flex-wrap: wrap; gap: var(--st-space-4); align-items: center; }

/* Cards and trays. */
.steward .st-card {
  background: var(--st-surface); border: 1px solid var(--st-line); border-radius: var(--st-radius);
  box-shadow: var(--st-shadow-2); padding: var(--st-space-5);
}
.steward .st-card-quiet { box-shadow: none; }
.steward .st-card-feature { border-color: var(--st-evergreen); box-shadow: 0 0 0 1px var(--st-evergreen), var(--st-shadow-2); }
.steward .st-tray { background: var(--st-stone-2); border-radius: var(--st-radius-lg); padding: var(--st-space-5); }
.steward .st-card-sponsored { border-color: var(--st-clay-line); box-shadow: inset 4px 0 0 var(--st-clay), var(--st-shadow-2); }
.steward .st-divider { border: 0; border-top: 1px solid var(--st-line); margin: 0; }

/* Chips: a short state word with a dot. Clay is ONLY "missing" and "Sponsored". */
.steward .st-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 2px 10px;
  border-radius: var(--st-radius-pill); font-size: var(--st-text-label); font-weight: 700; line-height: 1.2;
  background: var(--st-neutral-bg); color: var(--st-neutral-ink); white-space: nowrap;
}
.steward .st-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.steward .st-chip-done { background: var(--st-evergreen-tint); color: var(--st-evergreen); }
.steward .st-chip-missing { background: var(--st-clay-bg); color: var(--st-clay-ink); }
.steward .st-chip-plain::before { display: none; }
.steward .st-tag {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 10px; border-radius: 8px;
  background: var(--st-neutral-bg); color: var(--st-neutral-ink); font-size: var(--st-text-label); font-weight: 650;
}
.steward .st-sponsored {
  display: inline-flex; align-items: center; min-height: 24px; padding: 2px 9px; border-radius: 6px;
  background: var(--st-clay-bg); color: var(--st-clay-ink); border: 1px solid var(--st-clay-line);
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
}

/* Progress: a ring (inline SVG, so it prints) and a bar. Both carry their value as text beside the picture. */
.steward .st-ring { position: relative; display: inline-grid; place-items: center; width: var(--st-ring-size); aspect-ratio: 1; }
.steward .st-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.steward .st-ring-track { fill: none; stroke: var(--st-track); }
.steward .st-ring-fill { fill: none; stroke: var(--st-evergreen); stroke-linecap: round; }
.steward .st-ring-text { position: relative; display: grid; place-items: center; text-align: center; line-height: 1.05; }
.steward .st-ring-text strong { font-size: 2.25rem; font-weight: 750; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.steward .st-ring-text span { font-size: var(--st-text-label); color: var(--st-muted); font-weight: 600; }
.steward .st-bar { height: 8px; border-radius: var(--st-radius-pill); background: var(--st-track); overflow: hidden; }
.steward .st-bar > span { display: block; height: 100%; width: var(--st-bar-value); border-radius: inherit; background: var(--st-evergreen); }

/* Lists, pairs and prose. */
.steward .st-list { display: grid; gap: var(--st-space-2); padding-left: 1.25em; color: var(--st-ink-2); }
.steward .st-list-check { list-style: none; padding-left: 0; }
.steward .st-list-check li { position: relative; padding-left: 1.75em; }
.steward .st-list-check li::before {
  content: ""; position: absolute; left: 0.2em; top: 0.45em; width: 0.7em; height: 0.4em;
  border-left: 2px solid var(--st-evergreen); border-bottom: 2px solid var(--st-evergreen); transform: rotate(-45deg);
}
.steward .st-pairs { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--st-space-1) var(--st-space-4); }
.steward .st-pairs dt { font-size: var(--st-text-label); font-weight: 700; letter-spacing: 0.04em; color: var(--st-muted); }
.steward .st-pairs dd { margin: 0 0 var(--st-space-2); color: var(--st-ink); }
.steward .st-prose { display: grid; gap: var(--st-space-4); max-width: var(--st-measure); color: var(--st-ink-2); }
.steward .st-prose :where(h2) { margin-top: var(--st-space-5); font-size: var(--st-text-h3); font-weight: 700; letter-spacing: -0.015em; color: var(--st-ink); }
.steward .st-prose :where(h3) { font-size: var(--st-text-body); font-weight: 700; color: var(--st-ink); }
.steward .st-prose :where(ul, ol) { display: grid; gap: var(--st-space-2); padding-left: 1.25em; }
.steward .st-prose strong { color: var(--st-ink); }
.steward .st-code { font-size: 0.92em; padding: 0 4px; border-radius: 4px; background: var(--st-neutral-bg); }
.steward .st-note { padding: var(--st-space-4); border-radius: var(--st-radius-control); background: var(--st-neutral-bg); color: var(--st-ink); }

/* Form controls: radio and checkbox cards, selects. Native inputs, so the browser and assistive technology own them. */
.steward .st-field { display: grid; gap: var(--st-space-2); min-width: 0; }
.steward .st-field-label { font-size: var(--st-text-small); font-weight: 650; color: var(--st-ink); }
.steward .st-select {
  min-height: var(--st-control); width: 100%; padding: 0 var(--st-space-4); border-radius: var(--st-radius-control);
  border: 1px solid var(--st-control-line); background: var(--st-surface); color: var(--st-ink); font: inherit; font-size: 1rem;
}
.steward .st-choices { display: grid; gap: var(--st-space-3); }
.steward .st-choice {
  display: flex; align-items: center; gap: var(--st-space-4); min-height: 3.5rem; padding: var(--st-space-4);
  border: 1px solid var(--st-control-line); border-radius: var(--st-radius-control); background: var(--st-surface); cursor: pointer;
}
.steward .st-choice:has(input:checked) { border-color: var(--st-evergreen); box-shadow: 0 0 0 1px var(--st-evergreen); background: var(--st-evergreen-tint); }
.steward .st-choice input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--st-evergreen); }
.steward .st-choice-text { display: grid; gap: 2px; }
.steward .st-choice-label { font-weight: 650; color: var(--st-ink); }
.steward .st-choice-hint { font-size: var(--st-text-small); color: var(--st-muted); }
/* An error is said in words (role="alert", tied to its field by aria-describedby), in ink on a neutral tray with a heavy
   ink rule. Clay never means error: it is only "missing" and "Sponsored". */
.steward .st-error {
  color: var(--st-ink); background: var(--st-neutral-bg); border: 1px solid var(--st-control-line); border-left: 4px solid var(--st-ink);
  border-radius: var(--st-radius-control); padding: var(--st-space-3) var(--st-space-4); font-weight: 700;
}

/* The skip link: off screen until focused. */
.steward .st-skip-link {
  position: absolute; left: -10000px; top: 8px; z-index: 100; min-height: 44px; padding: var(--st-space-3) var(--st-space-4);
  border-radius: var(--st-radius-control); background: var(--st-surface); color: var(--st-ink); font-weight: 700;
  box-shadow: var(--st-shadow-2);
}
.steward .st-skip-link:focus { left: 8px; outline: 3px solid var(--st-focus); outline-offset: 2px; }

/* Header. */
.steward .st-nav-link { display: inline-flex; align-items: center; min-height: 44px; }
.steward .st-header {
  position: relative; z-index: 20; display: flex; align-items: center; gap: var(--st-space-5);
  min-height: 72px; padding: var(--st-space-3) var(--st-gutter);
}
.steward .st-logo {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px;
  font-size: 1.4rem; font-weight: 750; letter-spacing: -0.025em; color: var(--st-ink);
}
.steward .st-logo img { width: 30px; height: 30px; }
.steward .st-audience { display: none; gap: 2px; }
.steward .st-audience a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--st-space-4); border-radius: 8px;
  font-size: var(--st-text-small); font-weight: 600; color: var(--st-ink-2);
}
.steward .st-audience a[aria-current] { background: var(--st-neutral-bg); color: var(--st-ink); }
.steward .st-header-links { margin-left: auto; display: none; align-items: center; gap: var(--st-space-5); }
.steward .st-header-links a:not(.st-button) {
  display: inline-flex; align-items: center; min-height: 44px; font-size: var(--st-text-small); font-weight: 600; color: var(--st-ink-2);
}
.steward .st-header-links a[aria-current]:not(.st-button) { color: var(--st-ink); text-decoration: underline; text-underline-offset: 0.35em; }
.steward .st-menu { margin-left: auto; }
.steward .st-menu-toggle {
  display: inline-flex; align-items: center; gap: var(--st-space-2); list-style: none;
  min-height: 44px; padding: 0 var(--st-space-4); border-radius: var(--st-radius-control);
  border: 1px solid var(--st-control-line); background: var(--st-surface); color: var(--st-ink);
  font: 650 var(--st-text-small)/1 var(--st-font); cursor: pointer;
}
.steward .st-menu-toggle::-webkit-details-marker { display: none; }
.steward .st-menu-toggle::marker { content: ""; }
.steward .st-menu-toggle svg { width: 18px; height: 18px; }
.steward .st-menu[open] .st-menu-toggle { background: var(--st-neutral-bg); }
.steward .st-menu-panel {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  display: grid; gap: var(--st-space-1); padding: var(--st-space-3) var(--st-gutter) var(--st-space-5);
  border-bottom: 1px solid var(--st-line); background: var(--st-stone); box-shadow: var(--st-shadow-2);
}
.steward .st-menu-panel a:not(.st-button) {
  display: flex; align-items: center; min-height: 48px; padding: 0 var(--st-space-2);
  border-radius: 8px; font-weight: 600; color: var(--st-ink);
}
.steward .st-menu-panel a[aria-current]:not(.st-button) { background: var(--st-neutral-bg); }
.steward .st-menu-panel .st-button { margin-top: var(--st-space-3); }

/* Footer. */
.steward .st-footer {
  display: grid; gap: var(--st-space-6); grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: var(--st-space-8) var(--st-gutter) var(--st-space-6); margin-top: var(--st-space-8);
  border-top: 1px solid var(--st-line); color: var(--st-ink-2);
}
.steward .st-footer > :first-child { grid-column: 1 / -1; }
.steward .st-footer h2 { font-size: var(--st-text-label); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--st-muted); margin-bottom: var(--st-space-2); }
.steward .st-footer ul { list-style: none; padding: 0; }
.steward .st-footer-link { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--st-text-small); }
.steward .st-footer-link:hover { color: var(--st-ink); text-decoration: underline; }
.steward .st-footer-base {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--st-space-4);
  padding-top: var(--st-space-5); border-top: 1px solid var(--st-line); font-size: var(--st-text-small); color: var(--st-muted);
}

/* Desktop. */
@media (min-width: 761px) {
  .steward .st-header { min-height: 88px; gap: var(--st-space-6); }
  .steward .st-audience { display: flex; }
  .steward .st-header-links { display: flex; }
  .steward .st-menu { display: none; }
  .steward .st-head { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--st-space-8); }
  .steward .st-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steward .st-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steward .st-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steward .st-pairs { grid-template-columns: max-content minmax(0, 1fr); }
  .steward .st-pairs dd { margin: 0; }
  .steward .st-card { padding: var(--st-space-6); }
  .steward .st-tray { padding: var(--st-space-6); }
  .steward .st-footer { grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr)); padding-top: 5.5rem; margin-top: 7.5rem; }
  .steward .st-footer > :first-child { grid-column: auto; }
}

/* Print: black on white, no chrome. */
@media print {
  .steward .st-header, .steward .st-footer, .steward .st-noprint { display: none; }
  .steward .st-card { box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .steward * { scroll-behavior: auto; transition: none; animation: none; }
}
