/*
 * Account Portal stylesheet: the one Auth shell.
 *
 * One origin, one file, no third party: the portal serves these bytes itself
 * and mirrors the sylphx.com design tokens (web/src/brand/brand.css,
 * DESIGN.md "Altitude") on purpose, because cross-origin asset isolation
 * means it cannot link the site's stylesheet.
 *
 * Light is canonical and dark is designed, not inverted; the theme follows
 * the operating system, because a page that runs no script cannot remember
 * a toggle. An instance's `/brand.css` re-points the same tokens (accent,
 * palette, fonts, radius) and loads after this file, so every rule here reads
 * tokens and never a literal colour. Every text pair holds WCAG AA (4.5:1,
 * 3:1 for control borders) in both themes. Nothing moves that carries
 * meaning; under `prefers-reduced-motion` nothing moves at all.
 */

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

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

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

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

/* ── Tokens ─────────────────────────────────────────────────────────────
   Only `:root` declares tokens, so `/brand.css` (also `:root`, later in the
   cascade) always wins. Names are the `/brand.css` contract. */

:root {
  color-scheme: light;

  --canvas: #fafbfd;
  --canvas-2: #f1f4f8;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --line: #e2e7ee;
  --line-strong: #cdd4de;
  /* A control is identified by its edge: 3:1 against the surface. */
  --control-line: #828da0;
  --text: #0a0d14;
  --text-2: #4b5565;
  --text-3: #5f6a7c;
  --ink: var(--text);
  --muted: var(--text-3);

  --accent: #1463ff;
  --accent-strong: #0f56e6;
  --accent-soft: #e6f0ff;
  --accent-ink: #ffffff;
  --violet: var(--accent);
  --good: #0b7a4b;
  --warn: #955600;
  --bad: #c4271f;

  /* The sky of sylphx.com: the current's three stops as soft light. Only
     the platform's own pages use it. */
  --sky-a: rgb(47 75 255 / 0.2);
  --sky-b: rgb(47 168 255 / 0.22);
  --sky-c: rgb(255 181 138 / 0.26);
  /* An instance's one ambient glow; `/brand.css` tints it with the accent
     or turns it off with a palette. */
  --glow-a: rgb(110 120 140 / 0.1);
  --grid-line: transparent;

  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    monospace;

  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;
  --btn-radius: var(--r-md);

  --shadow-card: 0 1px 2px rgb(10 13 20 / 0.04),
    0 16px 40px -18px rgb(10 13 20 / 0.14);
  --dur: 180ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);

  --card-measure-signin: 27rem;
  --card-measure-decision: 30rem;
  --control-h: 2.875rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;

    --canvas: #06080c;
    --canvas-2: #040508;
    --surface: #0c0f15;
    --surface-2: #12161e;
    --line: #1c222d;
    --line-strong: #2a3240;
    --control-line: #5f6b7e;
    --text: #eef1f6;
    --text-2: #a3acbb;
    --text-3: #8b95a5;

    --accent: #4d94ff;
    --accent-strong: #6aa8ff;
    --accent-soft: #0f2347;
    --accent-ink: #04070d;
    --good: #4cc98a;
    --warn: #e9a23b;
    --bad: #ff8a80;

    --sky-a: rgb(47 75 255 / 0.2);
    --sky-b: rgb(47 168 255 / 0.13);
    --sky-c: rgb(255 181 138 / 0.08);
    --glow-a: rgb(150 160 180 / 0.06);

    --shadow-card: 0 0 0 1px rgb(255 255 255 / 0.02),
      0 24px 48px -24px rgb(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: 100dvh;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 0;
}

h1,
h2,
p,
dl,
dd,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

code {
  font-family: var(--font-mono);
}

img,
svg {
  display: block;
}

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

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

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 1rem;
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow-card);
}

.skip:focus-visible {
  top: 1rem;
}

/* ── The shell ──────────────────────────────────────────────────────────
   Masthead, the stage with its one card, footer: every page. The ground
   carries one ambient light at its top edge. */

.portal {
  position: relative;
  isolation: isolate;
}

.portal::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: min(46rem, 90vh);
  pointer-events: none;
  mask-image: linear-gradient(to bottom, #000 0%, #000 30%, transparent 100%);
}

.portal--platform::before {
  background:
    radial-gradient(56% 64% at 14% -6%, var(--sky-a) 0%, transparent 70%),
    radial-gradient(48% 58% at 58% -14%, var(--sky-b) 0%, transparent 72%),
    radial-gradient(40% 52% at 98% 0%, var(--sky-c) 0%, transparent 70%);
}

.portal--tenant::before {
  background: radial-gradient(
    120% 80% at 50% -24%,
    color-mix(in srgb, var(--glow-a) 70%, transparent) 0%,
    transparent 64%
  );
}

.shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100dvh;
  padding: 1.25rem 1rem 1rem;
}

.shell__column {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  width: 100%;
  max-width: 40rem;
}

.masthead {
  display: flex;
  justify-content: center;
  padding-block: 0.25rem 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding-inline: 0.375rem;
  border-radius: var(--r-md);
  color: var(--text);
  text-decoration: none;
}

.brand--lockup .lockup {
  width: auto;
  height: 1.625rem;
}

.lockup__word {
  fill: #0a0d14;
}

@media (prefers-color-scheme: dark) {
  .lockup__word {
    fill: #f4f6fa;
  }
}

.brand__logo {
  /* An SVG with a viewBox and no intrinsic size needs an explicit height. */
  height: 2.25rem;
  width: auto;
  max-width: 12rem;
  object-fit: contain;
}

.brand__monogram {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--r-sm);
  background: var(--btn-bg, var(--text));
  color: var(--btn-fg, var(--canvas));
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.stage {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  /* On a phone the card follows the masthead, so its actions stay near the
     thumb; from tablet up it sits in the middle of the page. */
  justify-content: flex-start;
  padding-block-end: 2rem;
}

.stage__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.foot {
  display: flex;
  justify-content: center;
  padding-block: 0.5rem;
}

.foot__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.25rem;
  font-size: 0.8125rem;
}

.foot__links .link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  color: var(--text-3);
  text-decoration: none;
}

.foot__links .link:hover {
  color: var(--text);
}

@media (min-width: 480px) {
  .shell {
    padding: 1.75rem 1.5rem 1rem;
  }

  .masthead {
    padding-block-end: 1.5rem;
  }

  .stage {
    justify-content: center;
    padding-block-end: 2rem;
  }

  .portal--tenant .stage {
    padding-block-end: 1rem;
  }
}

/* ── The card ───────────────────────────────────────────────────────────
   One card per page: `form` (sign-in, sign-up), `decision` (approve or
   deny) and `result` (what happened). Same head, same rhythm. */

.card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: var(--card-measure-signin);
  padding: 1.75rem 1.375rem;
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.card--decision {
  max-width: var(--card-measure-decision);
}

@media (min-width: 480px) {
  .card {
    padding: 2.25rem 2.25rem 2rem;
    gap: 1.5rem;
  }

  .card--decision {
    padding: 1.75rem 2rem;
    gap: 1.125rem;
  }

  .portal--tenant .card--form {
    padding-block: 1.5rem;
    gap: 0.875rem;
  }

  .portal--tenant .card--form > .form {
    gap: 0.875rem;
  }

  .portal--tenant .card--form > .code {
    padding-block: 0.875rem;
  }

  .portal--tenant .card--form > .notice {
    padding-block: 0.5rem;
  }
}

.card__head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card--result .card__head {
  align-items: center;
  text-align: center;
}

.title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

@media (min-width: 480px) {
  .title {
    font-size: 1.625rem;
  }
}

.lede {
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.55;
  text-wrap: pretty;
}

.lede + .lede {
  margin-top: -0.75rem;
}

.lede__strong {
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}

.card__foot {
  color: var(--text-2);
  font-size: 0.875rem;
  text-align: center;
}

.card__note {
  color: var(--text-3);
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: center;
  text-wrap: pretty;
}

.link {
  color: var(--accent-strong);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}

.link:hover {
  text-decoration-color: currentColor;
}

/* The status glyph above a heading. */
.sigil {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-block-end: 0.5rem;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
}

.sigil svg {
  width: 1.375rem;
  height: 1.375rem;
}

.sigil--good {
  color: var(--good);
  background: color-mix(in srgb, var(--good) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--good) 24%, var(--surface));
}

.sigil--bad {
  color: var(--bad);
  background: color-mix(in srgb, var(--bad) 9%, var(--surface));
  border-color: color-mix(in srgb, var(--bad) 22%, var(--surface));
}

.sigil--warn {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--warn) 24%, var(--surface));
}

.app-mark {
  display: inline-grid;
  place-items: center;
  width: 2.625rem;
  height: 2.625rem;
  margin-block-end: 0.25rem;
  border-radius: var(--r-lg);
  background: var(--text);
  color: var(--canvas);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 600;
}

.card--decision .sigil {
  margin-block-end: 0.25rem;
}

/* ── Forms ──────────────────────────────────────────────────────────── */

.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4375rem;
}

.label {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
}

.label__hint {
  margin-inline-start: 0.25rem;
  color: var(--text-3);
  font-weight: 400;
}

.help {
  color: var(--text-3);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.input {
  width: 100%;
  min-height: var(--control-h);
  padding: 0 0.875rem;
  border: 1px solid var(--control-line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  /* 16 px keeps phones from zooming into the field. */
  font-size: 1rem;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.input:hover:not(:focus) {
  border-color: var(--text-2);
}

.input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
}

.input:user-invalid {
  border-color: var(--bad);
}

.input--code {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.input--code::placeholder {
  letter-spacing: 0.12em;
}

/*
 * The 6-digit code, segmented with no script: one native input (so paste,
 * autofill, backspace and moving on after each digit are the browser's own),
 * drawn as six cells. In a monospace face every digit is `1ch` wide; each
 * digit gets `1ch + --otp-gap` of advance, and the cells are painted under
 * those advances. Split the extra width evenly around the painted row
 * to center it and leave room for the caret after the sixth digit.
 */
.input--otp,
.well[data-sylphx-sign-in] .sx-signin .sx-signin__code {
  --otp-gap: 1.9ch;
  --otp-tile: calc(1ch + var(--otp-gap));
  --otp-cell: calc(var(--otp-tile) - 0.55ch);
  --otp-x: calc((var(--otp-tile) - var(--otp-cell) + var(--otp-gap)) / 2);
  --otp-fill: linear-gradient(var(--surface-2), var(--surface-2));
  --otp-edge: linear-gradient(var(--control-line), var(--control-line));
  display: block;
  width: calc(6 * var(--otp-tile) + var(--otp-gap));
  max-width: 100%;
  min-height: 3.375rem;
  margin-inline: auto;
  padding: 0 0 0 var(--otp-gap);
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: clamp(1.375rem, 6vw, 1.625rem) !important;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: var(--otp-gap);
  text-align: start;
  caret-color: var(--accent);
  background-color: transparent;
  background-image:
    var(--otp-fill), var(--otp-fill), var(--otp-fill), var(--otp-fill),
    var(--otp-fill), var(--otp-fill), var(--otp-edge), var(--otp-edge),
    var(--otp-edge), var(--otp-edge), var(--otp-edge), var(--otp-edge);
  background-repeat: no-repeat;
  background-size:
    calc(var(--otp-cell) - 2px) calc(100% - 2px),
    calc(var(--otp-cell) - 2px) calc(100% - 2px),
    calc(var(--otp-cell) - 2px) calc(100% - 2px),
    calc(var(--otp-cell) - 2px) calc(100% - 2px),
    calc(var(--otp-cell) - 2px) calc(100% - 2px),
    calc(var(--otp-cell) - 2px) calc(100% - 2px),
    var(--otp-cell) 100%,
    var(--otp-cell) 100%,
    var(--otp-cell) 100%,
    var(--otp-cell) 100%,
    var(--otp-cell) 100%,
    var(--otp-cell) 100%;
  background-position:
    calc(var(--otp-x) + 1px) 1px,
    calc(var(--otp-tile) + var(--otp-x) + 1px) 1px,
    calc(2 * var(--otp-tile) + var(--otp-x) + 1px) 1px,
    calc(3 * var(--otp-tile) + var(--otp-x) + 1px) 1px,
    calc(4 * var(--otp-tile) + var(--otp-x) + 1px) 1px,
    calc(5 * var(--otp-tile) + var(--otp-x) + 1px) 1px,
    var(--otp-x) 0,
    calc(var(--otp-tile) + var(--otp-x)) 0,
    calc(2 * var(--otp-tile) + var(--otp-x)) 0,
    calc(3 * var(--otp-tile) + var(--otp-x)) 0,
    calc(4 * var(--otp-tile) + var(--otp-x)) 0,
    calc(5 * var(--otp-tile) + var(--otp-x)) 0;
  box-shadow: none;
}

@media (max-width: 360px) {
  .input--otp,
  .well[data-sylphx-sign-in] .sx-signin .sx-signin__code {
    --otp-gap: 1.65ch;
  }
}

.input--otp:hover:not(:focus) {
  border-color: transparent;
}

.input--otp:focus-visible,
.well[data-sylphx-sign-in] .sx-signin .sx-signin__code:focus-visible {
  --otp-edge: linear-gradient(var(--accent), var(--accent));
  outline: none;
  box-shadow: none;
}

.field--otp .label,
.field--otp .help {
  text-align: center;
}

/* ── Buttons ────────────────────────────────────────────────────────────
   Primary is ink, one per view (an instance's accent through brand.css);
   secondary is the surface with a hairline; ghost is text. */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  --btn-border: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  min-height: var(--control-h);
  padding: 0 1.125rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--btn-radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    filter var(--dur) var(--ease);
}

.btn--block {
  width: 100%;
}

.btn--primary {
  --btn-bg: var(--text);
  --btn-fg: var(--canvas);
  --btn-border: var(--text);
}

.btn--primary:hover {
  filter: brightness(1.18) contrast(0.92);
}

@media (prefers-color-scheme: dark) {
  .btn--primary:hover {
    filter: brightness(0.9);
  }
}

.btn--secondary:hover,
.btn--social:hover {
  --btn-bg: var(--surface-2);
  --btn-border: var(--control-line);
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-border: transparent;
  --btn-fg: var(--text-2);
}

.btn--ghost:hover {
  --btn-fg: var(--text);
  --btn-bg: var(--surface-2);
}

.btn:active {
  filter: brightness(0.94);
}

/* Apple's guidelines: its own black or white button. */
.btn--apple {
  --btn-bg: #000000;
  --btn-fg: #ffffff;
  --btn-border: #000000;
}

@media (prefers-color-scheme: dark) {
  .btn--apple {
    --btn-bg: #ffffff;
    --btn-fg: #000000;
    --btn-border: #ffffff;
  }
}

.btn__logo {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
}

.portal--platform {
  --btn-radius: 999px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.or {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ── Notices, badges, facts ─────────────────────────────────────────── */

.notice {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-left-width: 3px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.notice__label {
  color: var(--text);
  font-weight: 600;
}

.notice__body {
  color: var(--text-2);
}

.notice--info {
  border-left-color: var(--accent);
}

.notice--good {
  border-left-color: var(--good);
}

.notice--warn {
  border-left-color: var(--warn);
}

.notice--bad {
  border-left-color: var(--bad);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  flex: none;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: currentColor;
}

.badge--good {
  color: var(--good);
  background: color-mix(in srgb, var(--good) 11%, var(--surface));
}

.badge--warn {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, var(--surface));
}

.mono-id {
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.facts {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.fact {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
}

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

.fact dt {
  color: var(--text-3);
}

.fact dd {
  min-width: 0;
  color: var(--text);
  font-weight: 500;
  text-align: end;
  overflow-wrap: anywhere;
}

/* ── The code ───────────────────────────────────────────────────────────
   A device code, one cell per character, mono and tabular; the dash is a
   gap, not a character to copy. */

.code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  padding: 1.125rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}

.code__label {
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.code__value {
  width: 100%;
  text-align: center;
}

.code__cells {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3125rem;
  width: 100%;
}

.code__cell {
  display: inline-grid;
  place-items: center;
  flex: 0 1 2.125rem;
  min-width: 0;
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 1.375rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums slashed-zero;
}

.code__sep {
  flex: none;
  width: 0.5rem;
  height: 2px;
  margin-inline: 0.125rem;
  border-radius: 1px;
  background: var(--control-line);
}

.code__value--plain code {
  font-size: 1.125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  overflow-wrap: anywhere;
}

.code--compact {
  padding: 0.75rem;
}

.code--compact .code__cell {
  flex-basis: 1.625rem;
  font-size: 1.0625rem;
}

@media (min-width: 480px) {
  .code__cell {
    flex-basis: 2.375rem;
    font-size: 1.5rem;
  }

  .code--compact .code__cell {
    flex-basis: 1.75rem;
    font-size: 1.125rem;
  }

  .code__cells {
    gap: 0.375rem;
  }
}

/* The device code beside a hosted sign-in form. */
.context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 0.8125rem;
}

.context__label {
  color: var(--text-2);
  font-weight: 500;
}

.context__code {
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

/* ── Who is deciding ────────────────────────────────────────────────── */

.identity {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}

.identity__mark {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
}

.identity__body {
  flex: 1;
  min-width: 0;
}

.identity__label {
  color: var(--text-3);
  font-size: 0.75rem;
}

.identity__email {
  overflow: hidden;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity__org {
  color: var(--text-3);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

/* ── What an app asks for ───────────────────────────────────────────── */

.scopes {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.scopes__label {
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}

.scopes__list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.scopes__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  font-size: 0.875rem;
}

.scopes__tick {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--good);
}

.scopes__words {
  color: var(--text);
}

.scopes__list .mono-id {
  color: var(--text-3);
  font-size: 0.8125rem;
}

/* ── Doors: where to go next ────────────────────────────────────────── */

.doors {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-align: start;
}

.door {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.75rem 0.875rem;
  color: var(--text);
  text-decoration: none;
  transition: background-color var(--dur) var(--ease);
}

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

.door:hover {
  background: var(--surface-2);
}

.door:focus-visible {
  outline-offset: -2px;
}

.door__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0.125rem;
  min-width: 0;
}

.door__title {
  font-size: 0.9375rem;
  font-weight: 500;
}

.door__note {
  color: var(--text-3);
  font-size: 0.8125rem;
}

.door__chevron {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  color: var(--text-3);
}

/* ── The platform's sign-in: the form beside the brand panel ────────────
   Below 1024 px the panel is gone and the card is the page. */

.aside {
  display: none;
}

@media (min-width: 1024px) {
  .portal--split::before {
    display: none;
  }

  .portal--split .shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .portal--split .shell__column {
    justify-self: center;
    max-width: calc(var(--card-measure-signin) + 3rem);
    padding: 1.5rem 1.5rem 0.75rem;
  }

  .portal--split .masthead {
    justify-content: flex-start;
    margin-inline-start: -0.375rem;
  }

  .portal--split .stage {
    padding-block-end: 4rem;
  }

  .portal--split .card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .portal--split .foot {
    justify-content: flex-start;
  }

  .aside {
    position: sticky;
    top: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    height: calc(100dvh - 1.5rem);
    min-height: 35rem;
    padding: clamp(2rem, 4vw, 4rem);
    overflow: hidden;
    isolation: isolate;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--surface);
  }
}

.aside__sky {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 70% at 18% 0%, rgb(47 75 255 / 0.3) 0%, transparent 70%),
    radial-gradient(50% 60% at 62% -8%, rgb(47 168 255 / 0.34) 0%, transparent 72%),
    radial-gradient(40% 50% at 96% 4%, rgb(255 181 138 / 0.32) 0%, transparent 70%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 38%, transparent 82%);
  pointer-events: none;
}

.aside__air {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  mask-image: linear-gradient(to bottom, #000 0%, #000 44%, transparent 76%);
  pointer-events: none;
}

.air__rule,
.air__current {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.air__rule {
  stroke: color-mix(in srgb, var(--text) 9%, transparent);
  stroke-width: 1;
}

.air__current {
  stroke: url(#aside-air);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 90 910;
  animation: air-travel 17s linear infinite;
}

.aside__air g:nth-child(4n + 2) .air__current {
  animation-duration: 20s;
  animation-delay: -4.6s;
}

.aside__air g:nth-child(4n + 3) .air__current {
  animation-duration: 23s;
  animation-delay: -9.2s;
}

.aside__air g:nth-child(4n) .air__current {
  animation-duration: 14s;
  animation-delay: -13.8s;
}

@keyframes air-travel {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.aside__copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 34rem;
}

.aside__label {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.aside__tagline {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.aside__body {
  max-width: 30rem;
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.6;
}

/* ── Hosted sign-in ─────────────────────────────────────────────────────
   The compiled first-party form (`/sign-in.js`, `/sign-in.css`) re-dressed
   with the shell's tokens. Its flow is untouched; only its look is ours. */

.stage__inner > .well {
  width: 100%;
  max-width: var(--card-measure-signin);
  margin-inline: auto;
}

.well {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.well[data-sylphx-sign-in] .sx-signin {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  margin: 0;
  --sx-signin-ink: var(--text);
  --sx-signin-muted: var(--text-3);
  --sx-signin-accent: var(--accent);
  --sx-signin-surface: var(--surface);
  color: var(--text);
}

.well[data-sylphx-sign-in] .sx-signin > form {
  display: contents;
}

.well[data-sylphx-sign-in] .sx-signin h1 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

@media (min-width: 480px) {
  .well[data-sylphx-sign-in] .sx-signin h1 {
    font-size: 1.625rem;
  }
}

.well[data-sylphx-sign-in] .sx-signin h1 + form > label:first-child,
.well[data-sylphx-sign-in] .sx-signin h1 + .sx-signin__providers {
  margin-top: 1.5rem;
}

.well[data-sylphx-sign-in] .sx-signin__intro {
  margin: 0 0 1.5rem;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.well[data-sylphx-sign-in] .sx-signin__symbol {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.25rem;
}

.well[data-sylphx-sign-in] .sx-signin__providers {
  gap: 0.625rem;
}

.well[data-sylphx-sign-in] .sx-signin__provider {
  min-height: var(--control-h);
  padding: 0 1.125rem;
  gap: 0.625rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--btn-radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 500;
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.well[data-sylphx-sign-in] .sx-signin__provider:hover {
  border-color: var(--control-line);
  background: var(--surface-2);
}

.well[data-sylphx-sign-in] .sx-signin__provider svg {
  width: 1.125rem;
  height: 1.125rem;
}

.well[data-sylphx-sign-in] .sx-signin__provider small {
  margin-inline-start: 0.25rem;
  padding: 0.0625rem 0.4375rem;
  border: 0;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.6875rem;
  font-weight: 500;
}

.well[data-sylphx-sign-in] .sx-signin__divider {
  margin: 0.875rem 0 1rem;
  color: var(--text-3);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.well[data-sylphx-sign-in] .sx-signin__divider::before,
.well[data-sylphx-sign-in] .sx-signin__divider::after {
  background: var(--line);
}

.well[data-sylphx-sign-in] .sx-signin label {
  margin-bottom: 0.4375rem;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
}

.well[data-sylphx-sign-in] .sx-signin input {
  min-height: var(--control-h);
  padding: 0 0.875rem;
  border: 1px solid var(--control-line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  box-shadow: none;
  transition:
    border-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.well[data-sylphx-sign-in] .sx-signin input::placeholder {
  color: var(--text-3);
  opacity: 1;
}

.well[data-sylphx-sign-in] .sx-signin input:hover:not(:disabled):not(:focus) {
  border-color: var(--text-2);
}

.well[data-sylphx-sign-in] .sx-signin input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 24%, transparent);
}

.well[data-sylphx-sign-in] .sx-signin input + label {
  margin-top: 1rem;
}

.well[data-sylphx-sign-in] .sx-signin .sx-signin__code {
  margin-top: 0.25rem;
}

.well[data-sylphx-sign-in] .sx-signin__error {
  color: var(--bad);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.well[data-sylphx-sign-in] .sx-signin__error:empty {
  margin: 1rem 0 0;
}

.well[data-sylphx-sign-in] .sx-signin__error:not(:empty) {
  margin: 0.75rem 0;
  padding: 0.625rem 0.875rem;
  border: 1px solid color-mix(in srgb, var(--bad) 30%, var(--line));
  border-left-width: 3px;
  border-left-color: var(--bad);
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--bad) 6%, var(--surface));
  color: var(--text);
}

.well[data-sylphx-sign-in] .sx-signin__primary {
  min-height: var(--control-h);
  padding: 0 1.125rem;
  border: 1px solid var(--btn-bg, var(--text));
  border-radius: var(--btn-radius);
  background: var(--btn-bg, var(--text));
  color: var(--btn-fg, var(--canvas));
  font-size: 0.9375rem;
  font-weight: 500;
}

.well[data-sylphx-sign-in] .sx-signin__primary:hover:not(:disabled) {
  filter: brightness(1.18) contrast(0.92);
}

@media (prefers-color-scheme: dark) {
  .well[data-sylphx-sign-in] .sx-signin__primary:hover:not(:disabled) {
    filter: brightness(0.9);
  }
}

.well[data-sylphx-sign-in] .sx-signin__terms {
  order: 2;
  margin: 0.875rem 0 0;
  color: var(--text-3);
  font-size: 0.75rem;
  line-height: 1.55;
  text-wrap: balance;
}

.well[data-sylphx-sign-in] .sx-signin__terms a {
  color: var(--text-2);
  text-underline-offset: 3px;
}

.well[data-sylphx-sign-in] .sx-signin__terms a:hover {
  color: var(--text);
}

.well[data-sylphx-sign-in] .sx-signin button.sx-signin__link {
  align-self: flex-start;
  min-height: 2.75rem;
  padding: 0.5rem 0.25rem;
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 3px;
}

.well[data-sylphx-sign-in] .sx-signin button.sx-signin__link:hover:not(:disabled) {
  color: var(--text);
  text-decoration-color: currentColor;
}

.well[data-sylphx-sign-in] .sx-signin button.sx-signin__link:disabled {
  color: var(--text-3);
  text-decoration: none;
}

/* Passkey: a one-tap secondary action grouped with Continue, above Terms. */
.well[data-sylphx-sign-in] .sx-signin button.sx-signin__passkey {
  order: 1;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--control-h);
  margin: 0.625rem 0 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--btn-radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  text-decoration: none;
}

.well[data-sylphx-sign-in] .sx-signin button.sx-signin__passkey:hover:not(:disabled) {
  border-color: var(--control-line);
  background: var(--surface-2);
}

.well[data-sylphx-sign-in] .sx-signin__primary + button.sx-signin__link {
  display: block;
  align-self: center;
  margin: 0.5rem auto 0;
}

.well[data-sylphx-sign-in] .sx-signin__alternatives {
  order: 1;
  justify-content: center;
  gap: 0 1.25rem;
  margin-top: 0.75rem;
}

.well[data-sylphx-sign-in] > noscript .lede {
  margin-top: 0.5rem;
}

/* ── Motion and contrast preferences ────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  .air__current {
    stroke-dasharray: none;
    opacity: 0.35;
  }
}

@media (forced-colors: active) {
  .card,
  .code__cell,
  .facts,
  .doors,
  .identity,
  .notice {
    border: 1px solid CanvasText;
  }

  .btn {
    border: 1px solid ButtonText;
  }

  .input--otp,
  .well[data-sylphx-sign-in] .sx-signin .sx-signin__code {
    border: 1px solid CanvasText;
    background-image: none;
    letter-spacing: 0.5ch;
  }

  .portal::before,
  .aside__sky,
  .aside__air {
    display: none;
  }
}
