/*
 * Converged Innovations account portal, staff console and sign-in stylesheet. The public website is the account-web
 * repository (decision TO-27) and keeps its own copy; rules only the website used were removed here.
 *
 * Identity: light and editorial — a bright canvas, generous whitespace, a soft gradient mesh behind
 * the sign-in card, Geist for text. The page follows the
 * visitor's light or dark preference. One brand accent (teal); red and amber appear only as status
 * colours (errors, draft notices). Fonts are self-hosted (/static, SIL OFL): no external requests.
 * Every text pair meets WCAG 2.2 AA (4.5:1) in both themes; borders of form controls and focus
 * rings meet 3:1.
 *
 * The page CSP forbids inline styles, so pages use these classes and element styles only.
 * Shared vocabulary for the account pages: form elements, `.button` / `button` (primary) and
 * `.secondary`, `.notice` and `.notice.error`, `.card`, `table`, `.muted`, `.visually-hidden`.
 * Layouts: `.portal` (signed-in pages with a sidebar), `.auth` (sign-in and similar, one centred
 * card), `.prose` (documents).
 *
 * Spacing uses longhand margins on components so a component class never cancels the spacing
 * of a layout class it is combined with (e.g. `class="section notice"`).
 */

/* ---- Fonts --------------------------------------------------------------------------------- */

@font-face {
  font-family: "Geist";
  src: url("/static/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist Mono";
  src: url("/static/geist-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Instrument Serif";
  src: url("/static/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---- Tokens -------------------------------------------------------------------------------- */

:root {
  color-scheme: light dark;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;

  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #0b1020;
  --muted: #4b5565;
  --line: #e7e9ee;
  --line-strong: #d0d5dd;
  --field: #858e9f;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-tint: #e7f6f3;
  --on-accent: #ffffff;
  --ink: #0b1020;
  --on-ink: #ffffff;
  --ink-hover: #1d2435;
  --error: #b42318;
  --error-tint: #fef3f2;
  --draft: #93370d;
  --draft-tint: #fffaeb;
  --focus: #0f766e;
  --selection: #8edccd;

  /* Soft colour wash behind the sign-in card. */
  --mesh-1: rgba(110, 231, 183, 0.38);
  --mesh-2: rgba(125, 211, 252, 0.40);
  --mesh-3: rgba(196, 181, 253, 0.36);
  --mesh-4: rgba(253, 186, 116, 0.20);

  /* The desktop terminal palette, the same in both themes, as in the app. */
  --term-bg: #10141b;
  --term-bar: #171c25;
  --term-line: #262d3a;
  --term-text: #d7dde6;
  --term-muted: #8b96a8;
  --term-accent: #64daba;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 16px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, 0.04), 0 24px 48px -12px rgba(16, 24, 40, 0.18);

  --shell: 1120px;
  --header-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0d14;
    --bg-subtle: #0e131c;
    --surface: #111722;
    --surface-raised: #151c29;
    --text: #edf0f5;
    --muted: #a5afbf;
    --line: #222a37;
    --line-strong: #313b4c;
    --field: #6f7b8f;
    --accent: #5eead4;
    --accent-hover: #99f6e4;
    --accent-tint: rgba(94, 234, 212, 0.10);
    --on-accent: #04201c;
    --ink: #edf0f5;
    --on-ink: #0a0d14;
    --ink-hover: #ffffff;
    --error: #fda29b;
    --error-tint: rgba(240, 68, 56, 0.12);
    --draft: #fec84b;
    --draft-tint: rgba(247, 144, 9, 0.12);
    --focus: #5eead4;
    --selection: #1f6f66;

    --mesh-1: rgba(16, 185, 129, 0.16);
    --mesh-2: rgba(14, 165, 233, 0.16);
    --mesh-3: rgba(139, 92, 246, 0.16);
    --mesh-4: rgba(249, 115, 22, 0.08);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.4), 0 32px 64px -16px rgba(0, 0, 0, 0.7);
  }
}

/* ---- Base ---------------------------------------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  /* Long addresses and names wrap rather than widening the page past a phone's screen. */
  overflow-wrap: break-word;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1 0 auto;
  width: 100%;
  padding-bottom: 5rem;
}

[hidden] {
  display: none !important;
}

[id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

img,
svg {
  max-width: 100%;
}

::selection {
  background: var(--selection);
  color: var(--text);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---- Type ---------------------------------------------------------------------------------- */

h1,
h2,
h3 {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  margin-top: 3.5rem;
  font-size: clamp(2.1rem, 1.6rem + 2vw, 3rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.7rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.08rem;
  letter-spacing: -0.012em;
}

p,
ul,
ol,
dl {
  margin: 0 0 1rem;
}

ol,
ul {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.35rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
  text-decoration-thickness: 2px;
}

strong {
  font-weight: 600;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-subtle);
  overflow-wrap: anywhere;
}

pre {
  margin: 0 0 1rem;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  line-height: 1.5;
}

pre code {
  padding: 0;
  border: 0;
  background: none;
}

hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.lede {
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.22rem);
  line-height: 1.55;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.prose {
  max-width: 46rem;
}

.prose h1 {
  margin-bottom: 1rem;
}

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

/* ---- Layout -------------------------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--on-ink);
  font-weight: 600;
}

.skip-link:focus {
  top: 0.75rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  width: 28px;
  height: 28px;
  flex: none;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-block;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.site-nav a[aria-current] {
  color: var(--text);
  background: var(--bg-subtle);
}

.site-nav .site-nav__account {
  margin-left: 0.5rem;
  padding: 0.45rem 1rem;
  background: var(--ink);
  color: var(--on-ink);
}

.site-nav .site-nav__account:hover,
.site-nav .site-nav__account[aria-current] {
  background: var(--ink-hover);
  color: var(--on-ink);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer__inner {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2rem;
  padding-top: 3.5rem;
  padding-bottom: 3rem;
}

.site-footer__about p {
  max-width: 22rem;
  margin-top: 0.75rem;
}

.site-footer__title {
  margin: 0 0 0.85rem;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li + li {
  margin-top: 0.5rem;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-footer__legal {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.site-footer__legal p {
  margin: 0;
}

/* ---- Buttons ------------------------------------------------------------------------------- */

.button,
button,
input[type="submit"],
input[type="button"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--on-ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.005em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: var(--ink-hover);
  border-color: var(--ink-hover);
  color: var(--on-ink);
  text-decoration: none;
}

.button:active,
button:active {
  transform: translateY(1px);
}

.button.secondary,
button.secondary,
input.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button.secondary:hover,
button.secondary:hover,
input.secondary:hover {
  border-color: var(--field);
  background: var(--bg-subtle);
  color: var(--text);
}

.button.danger,
button.danger {
  border-color: var(--error);
  background: var(--error);
  color: #ffffff;
}

@media (prefers-color-scheme: dark) {
  .button.danger,
  button.danger {
    color: #2a0a07;
  }
}

.button.danger:hover,
button.danger:hover {
  filter: brightness(0.92);
  background: var(--error);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
}

/* ---- Colour wash ---------------------------------------------------------------------------- */

/* The wash of colour behind the sign-in card: layered radial gradients, no images. */
.mesh {
  position: relative;
  isolation: isolate;
  /* The wash reaches past the sides: clip it here (never on <main>, which would cut off wide
     content elsewhere). `clip` makes no scroll container; older browsers fall back to hidden. */
  overflow-x: hidden;
  overflow-x: clip;
}

.mesh::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -12rem -20vw auto;
  height: 46rem;
  background:
    radial-gradient(38% 42% at 18% 28%, var(--mesh-1), transparent 70%),
    radial-gradient(34% 40% at 82% 18%, var(--mesh-2), transparent 70%),
    radial-gradient(36% 38% at 64% 62%, var(--mesh-3), transparent 72%),
    radial-gradient(28% 34% at 30% 76%, var(--mesh-4), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .button,
  button {
    transition: none;
  }
}

/* ---- Facts, errors and documents ------------------------------------------------------------ */

.facts {
  display: grid;
  gap: 0;
  margin: 0 0 1.5rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.facts div {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) 2fr;
  gap: 1rem;
  padding: 0.75rem 1rem;
}

.facts div + div {
  border-top: 1px solid var(--line);
}

.facts dt {
  color: var(--muted);
  font-weight: 500;
}

.facts dd {
  margin: 0;
}

.facts code {
  word-break: break-all;
}

.error-page {
  max-width: 34rem;
  margin: 4rem auto 0;
  text-align: center;
}

/* ---- Components shared with the account pages ---------------------------------------------- */

.notice {
  margin: 0 0 1.5rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--radius);
  background: var(--accent-tint);
  color: var(--text);
}

.notice.error {
  border-color: color-mix(in srgb, var(--error) 35%, transparent);
  background: var(--error-tint);
  color: var(--error);
}

.card > .notice:last-child {
  margin-bottom: 0;
}

.notice h2 {
  margin-bottom: 0.4rem;
  font-size: 1.05rem;
}

.card {
  margin: 0 0 1.25rem;
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card > :last-child {
  margin-bottom: 0;
}

.card > h1:first-child {
  margin-top: 0;
}

.card h2 {
  margin-bottom: 0.6rem;
  font-size: 1.12rem;
  letter-spacing: -0.015em;
}

.card h3 {
  margin-top: 1.25rem;
  font-size: 1rem;
}

/* Every table sits in one of these, so a table wider than a phone scrolls inside its box
   instead of pushing its last column (often a button) off the screen. */
.table-scroll {
  margin: 0 0 1rem;
  overflow-x: auto;
}

.table-scroll > table {
  margin-bottom: 0;
}

table {
  width: 100%;
  margin: 0 0 1rem;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.93rem;
}

caption {
  padding: 0 0 0.6rem;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: left;
}

th,
td {
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

tbody tr:last-child td,
tbody tr:last-child th {
  border-bottom: 0;
}

thead th {
  background: var(--bg-subtle);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

td form {
  margin: 0;
}

td form > button {
  margin-top: 0;
}

/* Forms */

form {
  margin: 0 0 1rem;
}

form > * {
  margin-top: 0;
  margin-bottom: 0;
}

form > * + * {
  margin-top: 0.75rem;
}

label {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 550;
}

label + input,
label + textarea,
label + select {
  margin-top: 0.4rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="search"],
input[type="url"],
input[type="number"],
input[type="date"],
input:not([type]),
select,
textarea {
  display: block;
  width: 100%;
  max-width: 30rem;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--field);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  /* A real outline: forced-colours mode draws it, and it needs no colour mixing. */
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: var(--focus);
}

textarea {
  max-width: 40rem;
  min-height: 9rem;
  resize: vertical;
}

input[autocomplete="one-time-code"] {
  max-width: 12rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  letter-spacing: 0.25em;
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--error);
}

input[type="radio"],
input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0 0.5rem 0 0;
  vertical-align: -0.15rem;
  accent-color: var(--accent);
}

input[type="radio"] + label,
input[type="checkbox"] + label {
  display: inline;
  font-weight: 500;
}

fieldset {
  margin: 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

legend {
  padding: 0 0.4rem;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}

form > button,
form > .button,
form > input[type="submit"] {
  margin-top: 1.25rem;
}

/* The QR code keeps a white backing in dark mode so it scans. */
.qr {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.codes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 12rem));
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.codes li + li {
  margin-top: 0;
}

.recovery-code {
  display: block;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Support request bodies keep the sender's line breaks. */
.support-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* A support thread: the customer's messages, and replies from Converged Innovations support marked by an accent
   rule; staff-only notes in the console get a dashed outline. */
.support-thread {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.support-message {
  margin: 0 0 0.9rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.support-message--staff {
  border-left: 4px solid var(--accent);
}

.support-message--internal {
  border-style: dashed;
}

.support-message__meta {
  margin: 0 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* ---- The signed-in portal: a sidebar and a content column ---------------------------------- */

.portal {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  gap: 3rem;
  padding-top: 2.75rem;
}

.portal__nav {
  position: sticky;
  top: calc(var(--header-h) + 1.5rem);
  align-self: start;
}

.portal__title {
  margin: 0 0 0.6rem 0.75rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.portal__nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.portal__nav li + li {
  margin-top: 0.1rem;
}

.portal__nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
}

.portal__nav a:hover {
  background: var(--bg-subtle);
  color: var(--text);
}

.portal__nav a[aria-current] {
  background: var(--accent-tint);
  color: var(--accent);
  font-weight: 600;
}

.portal__nav ul + .portal__title {
  margin-top: 1.25rem;
}

.portal__nav svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.portal__content {
  min-width: 0;
  max-width: 50rem;
}

.portal__content > h1:first-child {
  margin-top: 0;
}

/* The overview's status tiles. */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 1.75rem 0 2rem;
  padding: 0;
  list-style: none;
}

.tiles > li + li {
  margin-top: 0;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tile__label {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.tile__value {
  margin: 0;
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.tile__value--good {
  color: var(--accent);
}

.tile__note {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.tile__action {
  margin: auto 0 0;
  padding-top: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---- Sign-in and similar: one card in the middle of a soft wash ---------------------------- */

.auth {
  display: grid;
  place-items: start center;
  /* Block padding only: the shell's side gutter keeps the card off a phone's edges. */
  padding-block: 4.5rem 2rem;
}

.auth__card {
  width: 100%;
  max-width: 28rem;
  padding: 2.25rem 2.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
  box-shadow: var(--shadow-lg);
}

.auth__card > :last-child {
  margin-bottom: 0;
}

.auth__card h1 {
  margin: 0 0 0.75rem;
  font-size: 1.65rem;
  letter-spacing: -0.03em;
}

.auth__card .card {
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: none;
}

.auth__card input[type="email"],
.auth__card input[type="password"],
.auth__card input[type="text"],
.auth__card input:not([type]) {
  max-width: none;
}

.auth__card form > button,
.auth__card form > input[type="submit"] {
  width: 100%;
}

.auth__card details {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.auth__card summary {
  color: var(--muted);
  font-size: 0.92rem;
  cursor: pointer;
}

/* Passkey controls are driven by /static/passkeys.js rather than a form: the same rhythm as forms. */
.passkey > * {
  margin-top: 0;
  margin-bottom: 0;
}

.passkey > * + * {
  margin-top: 0.75rem;
}

.passkey > label + input {
  margin-top: 0.4rem;
}

.passkey > button {
  margin-top: 1.25rem;
}

/* In a sign-in card, the passkey option sits under the password form, set apart by a rule. */
.auth__card .passkey {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.auth__card .passkey > p:first-child {
  color: var(--muted);
  font-size: 0.92rem;
}

.auth__card .passkey > button {
  margin-top: 0.75rem;
}

.auth__card .passkey + p,
.auth__card form + p {
  margin-top: 1.25rem;
  font-size: 0.92rem;
}

/* ---- Small screens ------------------------------------------------------------------------- */

@media (max-width: 960px) {

  

  .site-footer__inner {
    grid-template-columns: 1fr 1fr;
  }

  .site-footer__about {
    grid-column: 1 / -1;
  }

  .portal {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding-top: 1.5rem;
  }

  .portal__nav {
    position: static;
    margin: 0 -1.5rem;
    padding: 0 1.5rem 0.25rem;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
  }

  .portal__title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .portal__nav ul {
    display: flex;
    gap: 0.25rem;
  }

  .portal__nav li + li {
    margin-top: 0;
  }

  /* The staff console's groups share the one scrolling row. */
  .portal__nav--groups {
    display: flex;
    gap: 0.25rem;
  }

  .portal__nav a {
    white-space: nowrap;
  }
}

@media (max-width: 720px) {
  /* Two or three rows tall here: a sticky header would cover a third of a small screen and the
     targets of in-page links. */
  .site-header {
    position: static;
  }

  [id] {
    scroll-margin-top: 1rem;
  }

  .site-header__inner {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.6rem;
    padding-bottom: 0.6rem;
  }

  /* Every link stays visible: the list wraps under the brand rather than scrolling sideways. */
  .site-nav {
    width: 100%;
  }

  .site-nav ul {
    gap: 0.1rem 0;
  }

  .site-nav a {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }

  .site-nav .site-nav__account {
    margin-left: 0.25rem;
    padding: 0.4rem 0.9rem;
  }

  .facts div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .auth {
    padding-top: 2rem;
  }

  .auth__card {
    padding: 1.6rem 1.3rem;
  }

  .codes {
    grid-template-columns: 1fr;
  }
}

/* ---- Forced colours (Windows high contrast): keep the drawn markers visible --------------- */

@media (forced-colors: active) {

  .mesh::before {
    display: none;
  }

  /* Backgrounds vanish in forced colours: underline the current page and section instead. */
  .site-nav a[aria-current],
  .portal__nav a[aria-current] {
    text-decoration: underline 2px;
    text-underline-offset: 0.3em;
  }
}
