:root {
  --portal-maxw: 1160px;
  --portal-gutter: clamp(1rem, 4vw, 2.5rem);
  --portal-radius: 14px;
  --portal-card-pad: clamp(1.25rem, 3vw, 2rem);
  /* Scaffold-card width tokens (per layout.md sub-component collapses); consumed by .portal-scaffold-card--* modifiers so ScaffoldCard.astro emits a class, not an inline style literal. */
  --portal-card-w-auth: 480px;
  --portal-card-w-auth-wide: 520px;
  --portal-card-w-settings: 560px;
  --portal-card-w-notice: 600px;
  --portal-card-w-compose: 640px;
  --portal-card-w-detail: 800px;
}

/* ─── Shared header/nav (mirrors the marketing shell) ─────────── */
.logo-wrap a,
.logo-wrap a:hover { text-decoration: none; }
.masthead-name,
.masthead-name:visited { color: inherit; text-decoration: none; }
.masthead-name:hover { text-decoration: none; }
/* Operator-set override of clowder.css .logo-wrap (canonical: translateY(-15%) +
   align-self: flex-start on desktop, center + none on mobile). The operator set these
   manually and prefers this setting and layout for the portal header. The -5px lift and
   center alignment balance the portal's logo image against the background spotlight so
   the cat reads cleanly without the larger desktop float the marketing surface uses. */
.logo-wrap { transform: translateY(-5px); align-self: center; }

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  margin-left: auto;
}
.site-nav a {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: .02em;
  color: rgba(255,255,255,.82);
  text-decoration: none;
  padding: .5rem 0;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--white); text-decoration: underline; text-underline-offset: .45em; text-decoration-thickness: 1px; }
.site-nav a[aria-current="page"] {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: .45em;
  text-decoration-thickness: 2px;
}

.palette-flyout { margin-left: 0; display: flex; align-items: center; }
.palette-flyout-panel { min-width: auto; }
.palette-flyout-panel button { justify-content: center; }

.site-menu { display: none; }
.site-menu-toggle {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-width: 44px;
  height: 44px;
  padding: 0 .75rem;
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: 5px;
}
.site-menu-toggle::-webkit-details-marker { display: none; }
.site-menu-toggle:hover,
.site-menu[open] .site-menu-toggle { background: rgba(255,255,255,.12); }
.site-menu .site-menu-toggle:active { background: rgba(255,255,255,.28); box-shadow: inset 0 2px 0 rgba(0,0,0,.25); }
.site-menu-panel {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: var(--header-bg);
  border-top: 1px solid rgba(255,255,255,.2);
  border-bottom: 3px solid var(--clowder-light);
  padding: 1rem 1.25rem 1.5rem;
  z-index: 50;
}
.site-menu-panel nav { display: flex; flex-direction: column; }
.site-menu-panel nav a {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  letter-spacing: .02em;
  color: rgba(255,255,255,.88);
  text-decoration: none;
  padding: .8rem 0;
  border-bottom: 1px solid rgba(255,255,255,.14);
}
.site-menu-panel nav a:hover { color: var(--white); text-decoration: underline; }
.site-menu-panel nav a[aria-current="page"] {
  color: var(--white);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: .4em;
}
.site-menu:not([open]) .site-menu-palette { display: none; }
.site-menu-palette {
  position: static;
  margin-top: 1.25rem;
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  flex-direction: row;
  gap: .5rem;
  min-width: 0;
  z-index: auto;
}
.site-menu-palette button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem .75rem;
  background: transparent;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 5px;
  color: rgba(255,255,255,.85);
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  cursor: pointer;
  min-width: 0;
}
.site-menu-palette button:hover { border-color: var(--white); color: var(--white); }
.site-menu-palette button.active { border-color: var(--white); color: var(--white); background: rgba(255,255,255,.14); }
.pf-label-text { font-size: 1rem; min-width: 0; overflow-wrap: anywhere; }
.site-menu-panel .palette-flyout-panel {
  position: static;
  top: auto;
  right: auto;
  margin-top: 0;
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: auto;
  flex-direction: row;
}
@media (max-width: 1120px) {
  .masthead-name { font-size: 1.5rem; }
  .site-nav { gap: 1.25rem; }
}

/* ─── Shell layout ────────────────────────────────────────────── */
.portal-main {
  max-width: var(--portal-maxw);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 3.5rem) var(--portal-gutter);
}

.portal-hero {
  padding: clamp(2.5rem, 7vw, 5rem) 0;
  border-bottom:none;
}

.portal-hero p {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 52ch;
  margin: 0;
  color: var(--fg-muted);
}

/* The public call to action shares the marketing header's slot and button size. */
header .header-ask,
header .header-ask:visited {
  margin-left: .5rem;
  background: var(--white);
  color: var(--clowder);
  padding: .6rem 1rem;
  white-space: nowrap;
  flex-shrink: 0;
}
header .header-ask:hover { background: var(--clowder-light); color: var(--clowder); text-decoration: none; }
header .header-ask[aria-current="page"] { text-decoration: underline; text-underline-offset: .35em; text-decoration-thickness: 2px; }

/* ─── Buttons (aligned with marketing .site-btn system) ───────── */
.portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.85rem 1.4rem;
  border-radius: 5px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.portal-btn:active { transform: translateY(1px); }

/* The primary action sits on the header band, so use the primary-on-purple variant. */
header .portal-btn--primary {
  background: var(--white);
  color: var(--clowder);
  border-color: transparent;
}
header .portal-btn--primary:hover { background: var(--clowder-light); }

.portal-btn--primary {
  background: var(--clowder, #3D3966);
  color: var(--white, #fff);
  border-color: transparent;
}
.portal-btn--primary:hover { background: var(--clowder-mid, #5954A0); }

/* Body ghost buttons on light background */
.portal-scaffold .portal-btn:not(.portal-btn--primary):not(header .portal-btn) {
  border-color: var(--clowder, #3D3966);
  color: var(--clowder, #3D3966);
  background: transparent;
}
.portal-scaffold .portal-btn:not(.portal-btn--primary):not(header .portal-btn):hover {
  background: var(--bg-2, rgba(61,57,102,0.06));
}
/* Dark-palette: body ghost buttons need light-purple text/border to pass contrast on dark card */
[data-palette="dark"] .portal-scaffold .portal-btn:not(.portal-btn--primary):not(header .portal-btn) {
  border-color: var(--clowder-light, #C4C2E0);
  color: var(--clowder-light, #C4C2E0);
}
[data-palette="dark"] .portal-scaffold .portal-btn:not(.portal-btn--primary):not(header .portal-btn):hover {
  background: rgba(255,255,255,0.08);
}

/* Secondary action = ghost variant (components.md button contract: transparent ground, --clowder text/border in light, --clowder-light in dark).
   Explicit alias so markup names the variant at the call site. The :not(.portal-btn--primary) selectors above remain as the backstop for any .portal-btn without the modifier; behaviour is unchanged at existing call sites. */
.portal-btn--secondary {
  background: transparent;
  border-color: var(--clowder, #3D3966);
  color: var(--clowder, #3D3966);
}
.portal-btn--secondary:hover { background: var(--bg-2, rgba(61,57,102,0.06)); }
[data-palette="dark"] .portal-btn--secondary {
  border-color: var(--clowder-light, #C4C2E0);
  color: var(--clowder-light, #C4C2E0);
}
[data-palette="dark"] .portal-btn--secondary:hover { background: rgba(255,255,255,0.08); }
/* Brand-fixed (clowder fill, white text) per components.md — primary is brand-fixed in both themes;
   the header-only inversion (white fill, clowder text) lives at header .portal-btn--primary */
[data-palette="dark"] .portal-btn--primary {
  background: var(--clowder);
  border-color: transparent;
  color: var(--white, #fff);
}
[data-palette="dark"] .portal-btn--primary:hover { background: var(--clowder-mid); }
[data-palette="dark"] header .portal-btn--primary {
  background: var(--white);
  border-color: transparent;
  color: var(--clowder);
}
[data-palette="dark"] header .portal-btn--primary:hover {
  background: var(--clowder-light);
  color: var(--clowder);
}
/* Dark-palette: form-foot links need light-purple to pass contrast on dark card */
[data-palette="dark"] .portal-form-foot a { color: var(--link-fg, #A9A2D2); }
[data-palette="dark"] .portal-form-foot a:hover { color: var(--white); }

/* Running-text links (SC 1.4.1); standalone navigation, table, and button links keep their look. */
:is(p, li, dd, .portal-notice, .portal-form-hint, .portal-form-error, .portal-form-success, .asks-results-summary) a:not(nav a):not(td a):not(.portal-btn):not(.portal-footer-brand) {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
[data-palette="dark"] .portal-scaffold-card p a { color: var(--link-fg, #A9A2D2); }

/* ─── Skip-to-main link (SC 2.4.1) ─────────────────────────── */
.portal-skip-link {
  position: absolute; top: -100px; left: 0; z-index: 10000;
  background: var(--clowder, #3D3966); color: var(--white, #fff);
  padding: 0.6rem 1rem; border-radius: 0 0 6px 0; font-size: 1rem;
  text-decoration: none; font-family: 'DM Mono', monospace; text-transform: uppercase;
  transition: top 0.15s;
}
.portal-skip-link:focus { top: 0; }
[data-palette="dark"] .portal-skip-link { background: var(--clowder-light, #C4C2E0); color: #111018; }

/* ─── Depth convention (C5/C8, per palette-and-color.md) ──────────
   Light mode: flat borders-only surfaces. The hairline is the standard's
   --rule (1px solid var(--accent)), the default hairline per palette-and-color.md.
   No elevation, no shadows on surfaces. Gold (--accent light) is the border
   and marker color per the standard; it stays on everyday hairlines.

   Dark mode: edge-contrast elevation per palette-and-color.md. Reading-surface
   blocks lift with a lighter translucent-white hairline border on the --bg-2
   raised ground, not a shadow. The warm-charcoal ground reads dimensionally
   with edge contrast. The teal (--accent dark) stays on markers (status trail
   bullet, header bottom bar) and deliberate accents, not on everyday borders.

   Surfaces bound by this convention:
     .portal-scaffold-card, .portal-section, .portal-divider,
     .portal-review-card, .portal-review-reasoning, .portal-clean-review,
     .portal-approve-section, .portal-format-chip, .portal-private-banner,
     .portal-plan-card, .portal-ask-row.
   Form controls use a --fg-muted boundary in both palettes. */

/* Dark-mode edge-contrast hairlines for surfaces that carry the light-mode
   --rule border but had no dark override. The 0.08 opacity matches the
   existing .portal-section / .portal-billing-card / .portal-review-reasoning
   pattern; surfaces with existing dark overrides (review-card 0.06 and
   format-chip 0.18) keep their tuned values. */
[data-palette="dark"] .portal-scaffold-card { border-color: rgba(255,255,255,0.08); }
[data-palette="dark"] .portal-divider { border-top-color: rgba(255,255,255,0.08); }
[data-palette="dark"] .portal-footer { border-top-color: rgba(255,255,255,0.08); }

/* ─── Shell scaffolding notice (removed once real routes land) ── */
.portal-scaffold {
  max-width: var(--portal-maxw);
  margin: 0 auto;
  padding: 0 0 4rem;
}

.portal-scaffold-card {
  border: 1px solid var(--accent);
  border-radius: var(--portal-radius);
  padding: var(--portal-card-pad);
  background: var(--bg-2);
  margin-left: auto;
  margin-right: auto;
}

/* Card width modifiers; consume the --portal-card-w-* tokens (layout.md sub-component collapses).
   Replaces the former inline style="max-width:Npx" literals emitted by ScaffoldCard.astro. */
.portal-scaffold-card--auth { max-width: var(--portal-card-w-auth); }
.portal-scaffold-card--auth-wide { max-width: var(--portal-card-w-auth-wide); }
.portal-scaffold-card--settings { max-width: var(--portal-card-w-settings); }
.portal-scaffold-card--notice { max-width: var(--portal-card-w-notice); }
.portal-scaffold-card--compose { max-width: var(--portal-card-w-compose); }
.portal-scaffold-card--detail { max-width: var(--portal-card-w-detail); }

/* ─── Full-container scaffold pages (/account, /submit) ──────────
   These pages drop the card width modifier so the card spans the full scaffold
   (matching /asks list + detail) instead of floating at ~50% width in a sea of
   gutters. Form controls stay at the --prose-measure (42rem, per layout.md
   body-prose measure) so inputs and textareas stay typeable; headings, dividers,
   the billing tier-row, and the review 2-col rows span full width as anchors. */

.portal-scaffold-card h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.75rem;
}

.portal-scaffold-card h2 {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  margin: 0 0 0.75rem;
}

.portal-section-heading {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.portal-page-title {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.1;
  margin: 0 0 0.75rem;
}

.portal-scaffold-card p {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  margin: 0 0 1rem;
  color: var(--fg-muted);
}

.portal-scaffold-card ul {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  padding-left: 1.25rem;
  margin: 0;
  color: var(--fg-muted);
}

[data-palette="dark"] .portal-form-input {
  background: rgba(255, 255, 255, 0.06);
}

/* ─── Forms ─────────────────────────────────────────────────── */
.portal-form { display: flex; flex-direction: column; gap: 1rem; margin: 1.25rem 0; }
/* Inline-row modifier for compact single-line forms (resend-verification, sign-out). Wraps on narrow viewports. */
.portal-form--inline { flex-direction: row; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.portal-form label { display: flex; flex-direction: column; gap: 0.35rem; }
.portal-form label[hidden] { display: none; }
.portal-form-label {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.portal-form-caption { display: block; font-size: 1rem; color: var(--fg-muted); margin-top: 0.15rem; }
.portal-form-hint { text-transform: none; letter-spacing: 0; color: var(--fg-muted); font-size: 1rem; }
.portal-form-field { display: flex; flex-direction: column; gap: 0.35rem; }
.portal-form-input {
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 1.0625rem;
  min-width: 16px;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--fg-muted);
  border-radius: 8px;
  background: transparent;
  color: inherit;
}
.portal-form-textarea { resize: vertical; min-height: 5rem; }
.portal-form-submit { align-self: flex-start; margin-top: 0.5rem; }
.portal-form-foot { font-size: 1rem; margin: 1rem 0 0; color: var(--fg-muted); }
.portal-form-foot a { color: var(--clowder, #3D3966); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.portal-form-error,
.portal-form-success,
.portal-scaffold-card p.portal-form-error,
.portal-scaffold-card p.portal-form-success {
  color: var(--fg);
  padding: 0.625rem 0.85rem;
  border-radius: 8px;
  font-size: 1rem;
}

/* Shared status mark shapes pair status tokens with a non-color cue and visible text. */
.portal-status-mark { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--fg); }
.portal-status-mark__shape { display: inline-block; width: 0.75rem; height: 0.75rem; flex: 0 0 0.75rem; }
.portal-status-mark__label { font-size: 1rem; }
.portal-status-mark--warn .portal-status-mark__shape { border: 2px solid var(--status-warn); border-radius: 50%; }
.portal-status-mark--brand .portal-status-mark__shape { background: var(--status-brand); border-radius: 50%; }
.portal-status-mark--good .portal-status-mark__shape { background: var(--status-good); border-radius: 50%; }
.portal-status-mark--bad .portal-status-mark__shape { background: var(--status-bad); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.portal-status-mark--info .portal-status-mark__shape { border: 2px solid var(--status-info); }

/* Data tables keep wide scrolling inside a named, keyboard-focusable region. */
.portal-data-table-scroll { width: 100%; overflow-x: auto; }
.portal-data-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.portal-data-table th,
.portal-data-table td { padding: 0.75rem; border-bottom: 1px solid var(--accent); text-align: left; vertical-align: top; }
.portal-data-table thead th { color: var(--fg-muted); font-family: "DM Mono", ui-monospace, monospace; font-weight: 500; }
@media (max-width: 599px) {
  .portal-data-table { display: block; }
  .portal-data-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .portal-data-table tbody,
  .portal-data-table tr { display: block; width: 100%; }
  .portal-data-table tr { padding: 0.5rem 0; border-bottom: 1px solid var(--accent); }
  .portal-data-table td { display: grid; grid-template-columns: minmax(8rem, 0.4fr) minmax(0, 1fr); gap: 0.5rem; border: 0; }
  .portal-data-table td::before { content: attr(data-label); font-family: "DM Mono", ui-monospace, monospace; color: var(--fg-muted); }
}
.portal-form-error,
.portal-scaffold-card p.portal-form-error {
  border-inline-start: 4px solid var(--status-bad);
  background: color-mix(in srgb, var(--status-bad) 8%, transparent);
}
.portal-form-success,
.portal-scaffold-card p.portal-form-success {
  border-inline-start: 4px solid var(--status-good);
  background: color-mix(in srgb, var(--status-good) 8%, transparent);
}
.portal-form-row { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.portal-form-row[hidden] { display: none; }
.portal-btn[hidden] { display: none; }
.portal-form-row > * { flex: 1 1 220px; }
/* Verification row: stacks label + hint + widget vertically (matches label/input pattern,
   not the horizontal field-group layout) so the Turnstile widget reads as a labeled field. */
.portal-form-row--verification { flex-direction: column; gap: 0.35rem; }
.portal-form-row--verification > * { flex: none; }
/* Form air: extra top margin to create visual separation between form groups
   (question/context tight, options group, review/action group). */
.portal-form-air { margin-top: 1.5rem; }
.portal-checkbox { flex-direction: row; align-items: center; gap: 0.5rem; }
.portal-checkbox input { width: 1.1rem; height: 1.1rem; }
.portal-divider { border: none; border-top: 1px solid var(--accent); margin: 2rem 0; }
.portal-section { padding-top: 1.5rem; border-top: 1px solid var(--accent); margin-top: 2rem; }
[data-palette="dark"] .portal-section { border-top-color: rgba(255,255,255,0.08); }
/* ─── Submit review (pre-submission ask-clean surface) ──────── */
.portal-review-heading { font-size: 1.25rem; margin: 0 0 0.75rem; font-family: "Playfair Display", Georgia, serif; }
.portal-review-field { display: flex; flex-direction: column; gap: 0.25rem; margin: 0.75rem 0; }
.portal-review-text { margin: 0; line-height: 1.5; font-size: 1rem; white-space: pre-line; }
.portal-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.portal-btn:disabled:hover { transform: none; }

/* ─── Ask list ──────────────────────────────────────────────── */
/* ─── Status badges ─────────────────────────────────────────── */
.portal-status {
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 1rem; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem; border-radius: 999px; white-space: nowrap;
  font-weight: 600;
  color: var(--fg);
}
.portal-status::before { content: "\2022"; margin-right: 0.3em; font-size: 0.85em; }
.portal-status--received,
.portal-status--ask-cleaner,
.portal-status--research-fact-check,
.portal-status--writing-fact-check,
.portal-status--needs-info { background: color-mix(in srgb, var(--status-warn) 15%, transparent); }
.portal-status--received::before,
.portal-status--ask-cleaner::before,
.portal-status--research-fact-check::before,
.portal-status--writing-fact-check::before,
.portal-status--needs-info::before { color: var(--status-warn); }
.portal-status--approved,
.portal-status--inky-paws { background: color-mix(in srgb, var(--status-good) 15%, transparent); }
.portal-status--approved::before,
.portal-status--inky-paws::before { color: var(--status-good); }
.portal-status--old-paw,
.portal-status--held { background: color-mix(in srgb, var(--status-brand) 15%, transparent); }
.portal-status--old-paw::before,
.portal-status--held::before { color: var(--status-brand); }
.portal-status--diggers,
.portal-status--deadline-maine,
.portal-status--cubs { background: color-mix(in srgb, var(--status-info) 15%, transparent); }
.portal-status--diggers::before,
.portal-status--deadline-maine::before,
.portal-status--cubs::before { color: var(--status-info); }
.portal-status--rejected { background: color-mix(in srgb, var(--status-bad) 15%, transparent); }
.portal-status--rejected::before { color: var(--status-bad); }

/* ─── Account ──────────────────────────────────────────────── */
.portal-muted { color: var(--fg-muted); }

/* ─── Focus indicator (SC 2.4.7 — browser default invisible on dark) ── */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--clowder, #3D3966);
  outline-offset: 2px;
  border-radius: 4px;
}
[data-palette="dark"] :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline-color: var(--clowder-light, #C4C2E0);
}
/* Header and mobile-menu panel sit on var(--header-bg) = var(--clowder) in light mode.
   The global focus-visible outline also uses var(--clowder), so the ring is invisible (1:1)
   on the purple ground. Override to var(--clowder-light) for all focusable elements inside
   the header: #C4C2E0 on #3D3966 is ~4.6:1 (passes WCAG 1.4.11 3:1 floor). Dark mode is
   unaffected: the [data-palette="dark"] rule above already sets --clowder-light and wins
   on specificity (0,2,0 > 0,1,1). */
header :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline-color: var(--clowder-light, #C4C2E0);
}

/* Footer variants: public pages carry the marketing brand; signed-in pages stay minimal. */
.portal-footer {
  background: transparent;
  padding: 2rem var(--portal-gutter);
  text-align: center;
  border-top: 1px solid var(--accent);
  color: var(--fg-muted);
  font-size: 1rem;
  margin-top: 0;
}
.portal-footer-nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.25rem; }
.portal-footer a { color: var(--clowder); text-decoration: underline; text-underline-offset: 2px; }
[data-palette="dark"] .portal-footer a { color: var(--clowder-light); }
.portal-footer--minimal { display: flex; justify-content: center; }

.portal-footer--branded {
  background: var(--clowder);
  border-top: 0;
  color: rgba(255,255,255,.7);
  padding: 2.75rem 1.25rem 2rem;
}
.portal-footer--branded a,
.portal-footer--branded a:visited { color: var(--white); }
.portal-footer--branded .footer-logo { display: flex; align-items: center; justify-content: center; gap: .75rem; margin-bottom: 1rem; }
.portal-footer--branded .logo-img { height: 40px; width: auto; }
.portal-footer--branded .footer-name { font-family: 'Playfair Display', Georgia, serif; font-size: 1.5rem; color: var(--white); }
.portal-footer--branded p { font-family: 'DM Mono', monospace; font-size: 1rem; letter-spacing: .04em; margin: .4rem 0; }
.portal-footer--branded p .nowrap { white-space: nowrap; }
.portal-footer--branded .footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem 1.75rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}
.portal-footer--branded .footer-nav a,
.portal-footer--branded .footer-nav a:visited {
  font-family: 'DM Mono', monospace;
  font-size: 1rem;
  color: var(--white);
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,.4);
  text-underline-offset: .35em;
}
.portal-footer--branded .footer-nav a:hover { text-decoration-color: var(--white); }
[data-palette="dark"] .portal-footer--branded a,
[data-palette="dark"] .portal-footer--branded a:visited,
[data-palette="dark"] .portal-footer--branded a:hover,
[data-palette="dark"] .portal-footer--branded a:focus { color: var(--white); }
.portal-footer--branded .footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 .75rem;
  margin: 0;
}
.portal-footer--branded .footer-legal span { display: inline-block; max-width: 100%; text-align: center; overflow-wrap: anywhere; }
.portal-footer--branded .footer-legal span + span::before { content: "|"; margin-right: .75rem; opacity: .5; }
.portal-footer--branded :where(a, button, summary):focus-visible { outline-color: var(--white); }
@media (max-width: 860px) {
  .portal-footer--branded .footer-legal span + span::before { content: none; }
}


/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .portal-btn { transition: none; }
  .portal-skip-link { transition: none; }
}

.portal-intake-summary { white-space: pre-line; overflow-wrap: anywhere; }

/* ── Mobile header, aligned with the marketing shell ── */
@media (max-width: 860px) {
  .site-menu { display: block; flex-shrink: 0; }
  header .site-nav + .header-ask { margin-left: auto; }
  .site-nav { display: none; }
  header .palette-flyout { display: none; }
  header img.logo-img { height: 36px; }
  .header-inner { flex-wrap: nowrap; gap: .75rem; padding: .9rem 1.25rem; }
  .masthead-name { font-size: 1.35rem; }
  header .header-ask { padding: .55rem .8rem; }
}
@media (max-width: 480px) {
  header .masthead { display: none; }
}
.portal-review-more { margin-top: 1rem; border-top: 1px solid var(--accent); padding-top: .5rem; }
.portal-review-more summary { cursor: pointer; min-height: 44px; padding-block: .5rem; font-weight: 600; }
.portal-review-more summary:focus-visible { outline: 2px solid var(--link-fg); outline-offset: 3px; }

.portal-notice { margin: 1rem 0 0; padding: .75rem 1rem; border-left: 4px solid var(--status-warn); border-radius: 6px; background: color-mix(in srgb, var(--status-warn) 8%, transparent); }
.portal-notice--info { border-left-color: var(--status-info); background: color-mix(in srgb, var(--status-info) 8%, transparent); }
.portal-notice--warn { border-left-color: var(--status-warn); background: color-mix(in srgb, var(--status-warn) 8%, transparent); }
.portal-notice p { margin: 0; }
/* Follow-up questions from The Clowder: a distinct callout so they read as questions to the asker, not review fields. */
.portal-followups { --followup-ink: var(--clowder, #3D3966); margin: 0 0 1.25rem; padding: 1rem 1.1rem 1.1rem; border: 1px solid color-mix(in srgb, var(--followup-ink) 30%, transparent); border-left: 5px solid var(--followup-ink); border-radius: 8px; background: color-mix(in srgb, var(--followup-ink) 10%, var(--reading-surface, #fff)); }
[data-palette="dark"] .portal-followups { --followup-ink: var(--clowder-light, #C4C2E0); }
.portal-followups .portal-followups-eyebrow { display: flex; align-items: center; gap: .5rem; margin: 0 0 .35rem; font: 500 .875rem/1.4 "DM Mono", ui-monospace, monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--followup-ink); }
.portal-followups h3 { margin: 0 0 .75rem; font: 700 1.2rem/1.3 "Playfair Display", Georgia, serif; }
.portal-followups-list { display: grid; gap: .5rem; margin: 0 0 .85rem; padding: 0; list-style: none; counter-reset: followup; }
.portal-followups-list li { counter-increment: followup; display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: .65rem; align-items: start; padding: .65rem .8rem; border-radius: 6px; background: var(--reading-surface, #fff); font-weight: 600; line-height: 1.45; overflow-wrap: anywhere; }
.portal-followups-list li::before { content: counter(followup); display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--followup-ink); color: var(--reading-surface, #fff); font: 700 .9rem/1 "DM Mono", ui-monospace, monospace; }
.portal-followups .portal-followups-note { margin: 0; font-size: 1rem; line-height: 1.5; color: var(--fg); }
@media (max-width: 480px) { .portal-followups { padding: .85rem .8rem .9rem; } .portal-followups-list li { padding: .55rem .6rem; } }
