/* =====================================================================
   The Office — the sign-in portal (front page, "finish your sign-in").
   Load after glass.css. Everything reads the design tokens; layout uses
   logical properties so it mirrors in right-to-left (Arabic).
   Wide: one card, the office's rooms beside the form, over a dimmed view
   of the studio. Phone: the rooms shrink to a banner above the form.
   ===================================================================== */

@font-face { font-family: 'Fraunces'; src: url('/fonts/fraunces-latin.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }

.screen:has(.portal) {
  align-items: center;
  overflow: hidden;
  background: #f3f0e7;
}
/* a light island: the portal (and the steps of opening an office, below) set the tokens back to light, so every
   rule inside reads right */
.portal, .onboard {
  --surface: #faf8f2;          /* soft ivory */
  --surface-2: #f3f0e7;        /* paper cream */
  --surface-3: #ddd7ca;
  --surface-input: #ffffff;
  --ink: #2f4352;              /* ink navy, 9.7:1 on the card */
  --ink-muted: #5c5f4f;        /* olive gray, deepened: 6.2:1 on the card */
  --ink-placeholder: #6b6e5d;  /* 5.2:1 on white */
  --chrome-muted: #5c5f4f;
  --chrome-line: #a39c8e;
  --chrome-line-soft: #ddd7ca;
  --chrome-fill-hover: rgba(47, 67, 82, 0.06);
  --focus: #b9532b;
  --portal-link: #9e4523;      /* the website's burnt orange for text, 5.9:1 */
  /* the public website's look (welcome.css: cream, ink navy, one burnt orange), so the step from the site to here feels like one product (the app keeps its peach) */
  --primary: #b9532b;          /* burnt orange: white text on it 4.8:1 */
  --primary-hover: #9e4523;
  --primary-press: #8a3b1e;
  color: var(--ink);
}
.portal {
  width: min(1120px, 100%);
  height: min(720px, calc(100dvh - 48px));
  min-height: 0;
  margin: auto 0;
  display: grid;
  grid-template-columns: minmax(0, 9fr) minmax(0, 11fr);
  gap: var(--s-3);
  padding: var(--s-3);
  border: 1px solid var(--chrome-line-soft);
  border-radius: 32px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(34, 49, 60, 0.04), 0 24px 64px -12px rgba(34, 49, 60, 0.14);
  text-align: start;
}
.portal a, .portal .portal-link, .recover-links .linklike { color: var(--portal-link); }
.portal .input { background: var(--surface-input); color: var(--ink); border-color: var(--chrome-line); }
.portal .input::placeholder { color: var(--ink-placeholder); }
.portal .input:focus { border-color: var(--focus); }

/* ------------------------------------------------------------ the brand tile */
.portal-show {
  position: relative; min-height: 0; border-radius: 22px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-5);
  padding: var(--s-8);
  background: #2f4352;
}
/* a faint pixel grid, a nod to the office inside */
/* the office itself, in the website's dark window frame (a demo office; the picture is scripts/shoot-site.js's) */
.portal-show-room { position: relative; margin: 0; width: 100%; padding: 8px; border-radius: 18px; background: #22313c; box-shadow: 0 48px 90px -36px rgba(34, 49, 60, 0.55); }
.portal-show-room img { display: block; width: 100%; height: auto; border-radius: 10px; image-rendering: pixelated; }
.portal-show-room figcaption { padding: 8px 6px 2px; font-size: var(--fs-caption); color: #d9dee1; text-align: start; }
.portal-show-brand { position: relative; margin: 0; font-size: 0; line-height: 0; }
.portal-show-logo { display: block; width: min(200px, 60%); height: auto; margin-inline: auto; image-rendering: pixelated; }
.portal-show-tag { position: relative; margin: 0; max-width: 28ch; text-align: center; color: #faf8f2; font: 560 clamp(1.5rem, 2.4vw, 2.1rem)/1.1 'Fraunces', Georgia, serif; letter-spacing: -0.02em; }
.portal-show-tag:dir(rtl) { font-family: inherit; font-weight: var(--fw-bold); line-height: 1.4; letter-spacing: 0; }

/* ------------------------------------------------------------ the way in */
.portal-panel { display: flex; flex-direction: column; gap: var(--s-3); min-height: 0; padding: var(--s-6) var(--s-8) var(--s-6) var(--s-10); min-width: 0; }
.portal-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.portal .btn.primary, .portal .btn.primary:hover, .portal .btn.primary:active { color: #fff; }
/* back to the public website: top start, and the wordmark on the brand side */
.portal-back {
  display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 12px 0 6px;
  border-radius: 999px; color: var(--ink-muted); text-decoration: none; font-weight: var(--fw-bold); font-size: var(--fs-small);
}
.portal-back:hover { color: var(--ink); background: var(--chrome-fill-hover); }
.portal-back svg { width: 18px; height: 18px; }
[dir="rtl"] .portal-back svg { transform: scaleX(-1); }
.portal-show-home { display: inline-block; border-radius: 12px; }
.portal-top-end { margin-inline-start: auto; }
.portal-top h1.brand { margin: 0; font-size: 0; line-height: 0; }
.portal-pill {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: var(--tap); padding: 0 18px;
  border: 1px solid var(--chrome-line); border-radius: 999px; background: transparent; color: var(--ink);
  font: inherit; font-size: var(--fs-small); font-weight: var(--fw-semibold); cursor: pointer;
}
.portal-pill .px { width: 16px; height: 16px; color: var(--ink-muted); }
.portal-pill[aria-pressed="true"] { background: var(--surface-2); border-color: transparent; }
@media (hover: hover) { .portal-pill:hover { background: var(--surface-2); } }
.portal-center { flex: 1; width: 100%; max-width: 400px; margin-inline: auto; display: flex; flex-direction: column; justify-content: center; gap: var(--s-5); }
.portal-head { text-align: center; }
.portal-head h2 { margin: 0; font-size: 2.75rem; line-height: 1.1; font-weight: var(--fw-heavy); letter-spacing: -0.03em; text-align: center; }
/* headings in the website's serif (Latin only: Arabic keeps the app's face) */
:is(.portal-head, .onboard-head) h2:not(:dir(rtl)) { font-family: 'Fraunces', Georgia, serif; font-weight: 560; letter-spacing: -0.022em; }
.portal-head h2:focus { outline: none; }
.portal-sub { margin: var(--s-2) 0 0; color: var(--ink-muted); font-size: var(--fs-body); line-height: var(--lh-body); }
.portal-panel .note-box { margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--warning-soft); color: var(--ink) !important; font-weight: var(--fw-semibold); font-size: var(--fs-small); }
.portal-body { display: flex; flex-direction: column; gap: var(--s-4); }
.portal-body[hidden], .portal-switch[hidden] { display: none; }
.portal-form { display: flex; flex-direction: column; gap: var(--s-3); }
.portal-form .btn.block, .portal-body .btn.primary { min-height: 52px; border-radius: 999px; font-size: var(--fs-body); font-weight: var(--fw-bold); }
.portal-form .portal-alt .btn { min-height: 48px; border-radius: 999px; background: transparent; border: 1px solid var(--chrome-line); }
.portal-switch { margin: 0; text-align: center; font-size: 0.9375rem; color: var(--ink-muted); }
.portal-link { display: inline-flex; align-items: center; min-height: var(--tap); font-weight: var(--fw-semibold); text-decoration: none; }
@media (hover: hover) { .portal-link:hover { text-decoration: underline; } }

/* the start step of the single-player preview: no dark box, centred like the heading and the sign-in.
   The app's .join-team is a dark-theme panel (--paper-2 is resolved at :root, so the portal's light reset never
   reached it, and the dark label and hint vanished on it); here it is the page itself, same width as the sign-in form. */
.portal .join-team { margin: 0; padding: 0; border-radius: 0; background: transparent; text-align: center; }
.portal .join-team .field { align-items: stretch; gap: var(--s-2); }
.portal .join-team .field > label { text-align: center; font-size: var(--fs-small); font-weight: var(--fw-bold); color: var(--ink); }
.portal .join-team .field-row { flex-direction: column; align-items: stretch; gap: var(--s-3); }
.portal .join-team .field-row .input { flex: none; width: 100%; min-height: 58px; border-radius: 12px; text-align: center; }
.portal .join-team .field-row .btn { width: 100%; justify-content: center; }
.portal .join-team .field .hint { text-align: center; line-height: var(--lh-snug); }
.portal .join-team .field .error { justify-content: center; text-align: center; }
.portal .join-team .portal-start > h3 { text-align: center; }
.portal .join-team .steps { text-align: start; }

/* the label sits inside the box, and stays there */
.portal-form .field:has(> .input-wrap) { position: relative; }
.portal-form .field:has(> .input-wrap) > label {
  position: absolute; z-index: 1; top: 9px; inset-inline-start: 15px;
  font-size: var(--fs-caption); font-weight: var(--fw-semibold); color: var(--chrome-muted); pointer-events: none;
}
.portal-form .input-wrap > .input { min-height: 58px; padding-block: 24px 6px; border-radius: 12px; }
.portal-form .input-wrap.has-start > .input { padding-inline-start: 14px; }
.portal-form .input-wrap.has-start > .px:first-child { display: none; }
.portal-form .input-wrap > .input[aria-invalid="true"] { border-width: 2px; border-color: var(--danger); }

/* inputs with an icon at the start and/or a button at the end */
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > .px { position: absolute; inset-inline-start: var(--s-3); width: 20px; height: 20px; color: var(--ink-muted); pointer-events: none; }
.input-wrap > .input { min-height: 48px; }
.input-wrap.has-start > .input { padding-inline-start: 42px; }
.input-wrap.has-end > .input { padding-inline-end: 48px; }
.input-wrap:focus-within > .px { color: var(--accent-ink); }
.input-end {
  position: absolute; inset-inline-end: 4px; top: 50%; translate: 0 -50%;
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-muted); cursor: pointer;
}
.input-end .px { width: 20px; height: 20px; }
@media (hover: hover) { .input-end:hover { background: var(--chrome-fill-hover); color: var(--ink); } }
.hint.caps, .field .hint.caps { display: flex; align-items: center; gap: 6px; color: var(--warning); font-weight: var(--fw-semibold); }
.hint.caps .px { width: 16px; height: 16px; }
.field .field-error { margin: 0; }

.forgot { font-size: var(--fs-small); }
.forgot summary { display: flex; align-items: center; justify-content: flex-end; min-height: var(--tap); cursor: pointer; color: var(--portal-link); font-weight: var(--fw-semibold); }
.forgot[open] summary { min-height: 36px; }
.forgot .fine { margin: var(--s-1) 0 0; }
.login-problem { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: var(--s-3); border-radius: var(--r-md); background: var(--danger-soft); color: var(--danger); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.login-problem[hidden], .field-error[hidden] { display: none; }
.login-problem .px { flex: none; width: 20px; height: 20px; }

/* Discord and other ways, under an "or" */
.portal-alt { display: flex; flex-direction: column; gap: var(--s-3); align-items: stretch; }
.portal-alt:has(> [hidden]) { display: none; }
.portal-alt .row { justify-content: center; }
.portal-or { display: flex; align-items: center; gap: var(--s-3); color: var(--ink-muted); font-size: var(--fs-small); }
.portal-or::before, .portal-or::after { content: ''; flex: 1; height: 1px; background: var(--surface-3); }
.portal-start { padding-top: var(--s-4); border-top: 1px solid var(--surface-3); }
.portal-start h3 { margin: 0 0 var(--s-2); font-size: var(--fs-title); }

/* ------------------------------------------------------------ narrower */
@media (max-width: 900px) {
  .screen:has(.portal) { overflow-y: auto; }
  .portal { grid-template-columns: 1fr; height: auto; min-height: 0; border-radius: 28px; }
  .portal-show { min-height: 0; height: auto; padding: var(--s-6) var(--s-4); gap: var(--s-3); }
  .portal-show-logo { width: min(220px, 60%); }
  .portal-show-tag { font-size: 1.125rem; }
  .portal-show-room { display: none; }
  .portal-panel { padding: var(--s-3) var(--s-2) var(--s-4); gap: var(--s-5); }
  .portal-pill { padding: 0 14px; }
  .portal-head h2 { font-size: 2rem; }
  .portal-sub { font-size: 0.9375rem; }
}
@media (max-width: 480px) {
  .screen:has(.portal) { padding-inline: 0; padding-block-start: 0; align-items: flex-start; }
  .portal { border: 0; border-radius: 0; box-shadow: none; min-height: 100%; width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .portal { animation: fade-in var(--dur-base) var(--ease-out); }
}

/* ------------------------------------------------------------ recovery: a code by email */
.recover-links { display: flex; justify-content: flex-end; }
.recover-links[hidden] { display: none; }
.recover-links .linklike { display: flex; align-items: center; min-height: var(--tap); font-size: var(--fs-small); font-weight: var(--fw-semibold); text-decoration: none; }
.recover-links .linklike:disabled { color: var(--ink-muted); cursor: default; text-decoration: none; }
@media (hover: hover) { .recover-links .linklike:not(:disabled):hover { text-decoration: underline; } }
.recovery [hidden] { display: none !important; }
.recover-sent { margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--success-soft); color: var(--ink); font-size: var(--fs-small); line-height: var(--lh-snug); }
.code-digits { text-align: center; font-size: 1.5rem; letter-spacing: 0.3em; min-height: 56px; }
.code-digits::placeholder { letter-spacing: 0.2em; }
.verified, .unverified { display: flex; gap: var(--s-2); align-items: flex-start; margin: 0 0 var(--s-3); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.verified { color: var(--success); }
.unverified { color: var(--warning); }
.verified .px, .unverified .px { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.verify { margin-bottom: var(--s-4); }

/* Terms of use · Privacy notice, under the front page */
.portal-legal { margin: 0; text-align: center; font-size: var(--fs-small); color: var(--ink-muted); }
.portal-legal a { text-decoration: underline; text-underline-offset: 2px; }

/* the language switch, beside "Back to the website" */
.portal-top-end { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; justify-content: flex-end; }

/* the language switch: beside "Back to the website" where there is room, and with the legal links on a phone */
.portal-lang-foot-wrap { display: none; }
.portal-site-foot-wrap { display: none; }
@media (max-width: 560px) {
  .portal-top-end .portal-lang { display: none; }
  .portal-lang-foot-wrap { display: inline; }
  /* the way back to the website joins the legal links too, so the form keeps its room */
  .portal-top > .portal-back { display: none; }
  .portal-site-foot-wrap { display: inline; }
}
.portal-lang-foot { display: inline-flex; align-items: center; min-height: 36px; padding: 0 6px; font: inherit; text-decoration: underline; text-underline-offset: 2px; color: var(--portal-link); }

/* =====================================================================
   Opening an office, step by step (onboarding.js): the front page's bright card, the steps across the top,
   the step itself, and Back / Continue at the foot. The light tokens come from the island at the top of this file.
   ===================================================================== */
.screen:has(.onboard) { background: #f3f0e7; align-items: flex-start; }
.onboard {
  --edge: 1px solid #c8c1b3;
  --field-edge: #a39c8e;
  --success: #2f6b3a;          /* 6.4:1 on white */
  --success-soft: #e3f3e6;
  --danger: #b3363c;           /* 5.9:1 on white */
  --danger-soft: #fdecea;
  --sh-1: 0 1px 2px rgba(34, 49, 60, 0.08);
  --selected: #f6e6dc;         /* the chosen plan: a burnt-orange tint, with the burnt-orange edge */
  --selected-edge: #b9532b;
  width: min(820px, 100%);
  margin: auto 0;
  display: flex; flex-direction: column; gap: var(--s-4);
  padding: var(--s-5) var(--s-6) var(--s-4);
  border: 1px solid var(--chrome-line-soft); border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(34, 49, 60, 0.04), 0 24px 64px -12px rgba(34, 49, 60, 0.14);
  text-align: start;
}
.onboard.wide { width: min(1000px, 100%); }
.onboard a, .onboard .linklike { color: var(--portal-link); }
.onboard .input { background: var(--surface-input); color: var(--ink); border-color: var(--chrome-line); }
.onboard .input::placeholder { color: var(--ink-placeholder); }
.onboard .input:focus { border-color: var(--focus); }
.onboard .input[aria-invalid="true"] { border-width: 2px; border-color: var(--danger); }
.onboard .btn.primary, .onboard .btn.primary:hover, .onboard .btn.primary:active { color: #fff; }
.onboard .btn.primary:disabled { opacity: 0.75; cursor: progress; }
.onboard .fine { color: var(--ink-muted); }
.onboard-loading { min-height: 240px; justify-content: center; align-items: center; }

/* ---- the top: the wordmark (back to the website), what this is, the language */
.onboard-top { display: flex; align-items: center; gap: var(--s-3); }
.onboard-home { display: inline-flex; border-radius: 10px; }
.onboard-home img { display: block; width: auto; height: 40px; image-rendering: pixelated; }
.onboard-title-small { color: var(--ink-muted); font-size: var(--fs-small); font-weight: var(--fw-semibold); padding-inline-start: var(--s-3); border-inline-start: 1px solid var(--surface-3); }
.onboard-top-end { margin-inline-start: auto; }

/* ---- the steps: a numbered dot each, joined by a line that fills in as they are done */
.onboard-progress { padding: var(--s-2) 0 var(--s-1); }
.onboard-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); }
.onboard-step { position: relative; display: flex; justify-content: center; min-width: 0; }
/* the line from the step before */
.onboard-step + .onboard-step::before {
  content: ''; position: absolute; top: 17px; inset-inline-end: calc(50% + 22px); width: calc(100% - 44px); height: 2px;
  border-radius: 2px; background: var(--surface-3);
}
.onboard-step.done + .onboard-step::before { background: var(--primary); }
.onboard-step-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; padding: 0 2px;
  border: 0; background: none; font: inherit; color: var(--ink-muted); text-align: center;
}
button.onboard-step-btn { cursor: pointer; border-radius: var(--r-sm); }
.onboard-dot {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid var(--surface-3); background: var(--surface); color: var(--ink-muted);
  font-size: var(--fs-small); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums;
}
.onboard-dot .px { width: 18px; height: 18px; }
.onboard-label { font-size: var(--fs-small); font-weight: var(--fw-semibold); line-height: 1.25; overflow-wrap: anywhere; }
.onboard-step.done .onboard-dot { border-color: var(--primary); background: var(--primary); color: #fff; }
.onboard-step.done .onboard-label { color: var(--ink); }
.onboard-step.current .onboard-dot { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 4px var(--selected); }
.onboard-step.current .onboard-label { color: var(--ink); font-weight: var(--fw-bold); }
@media (hover: hover) { button.onboard-step-btn:hover .onboard-label { text-decoration: underline; } }

/* ---- the step */
.onboard-main { display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.onboard-head { text-align: center; max-width: 560px; margin-inline: auto; }
.onboard-count { margin: 0 0 var(--s-1); font-size: var(--fs-caption); font-weight: var(--fw-bold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--portal-link); }
.onboard-count-name { display: none; }
.onboard-head h2 { margin: 0; font-size: 2rem; line-height: 1.15; font-weight: var(--fw-heavy); letter-spacing: -0.02em; }
.onboard-head h2:focus, .onboard .cr-top h2:focus { outline: none; }
.onboard-lede { margin: var(--s-2) 0 0; color: var(--ink-muted); font-size: var(--fs-body); line-height: var(--lh-body); }
.onboard-body { min-width: 0; }
@media (prefers-reduced-motion: no-preference) {
  .onboard-body { animation: rise-in var(--dur-base) var(--ease-out); }
}
.onboard-center { text-align: center; }
.onboard-wait { display: flex; align-items: center; justify-content: center; gap: var(--s-2); margin: var(--s-6) 0; color: var(--ink-muted); }

/* what went wrong (or a word of news), at the top of the step, read out */
.onboard-alert:empty { display: none; }
.onboard-msg { display: flex; gap: var(--s-2); align-items: flex-start; margin: 0 auto; max-width: 560px; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); font-size: var(--fs-small); font-weight: var(--fw-semibold); line-height: var(--lh-snug); }
.onboard-msg .px { flex: none; width: 20px; height: 20px; }
.onboard-msg.error { background: var(--danger-soft); color: var(--danger); }
.onboard-msg.info { background: var(--success-soft); color: var(--success); }

/* ---- Back and Continue */
.onboard-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--chrome-line-soft); }
.onboard-foot .btn { min-height: 48px; border-radius: 999px; padding: 0 var(--s-5); font-size: var(--fs-body); font-weight: var(--fw-bold); }
.onboard-foot .btn.ghost { padding-inline: var(--s-3); color: var(--ink-muted); }
.onboard-foot .btn.ghost:hover { color: var(--ink); }
.onboard-next { min-width: 200px; }
.onboard-next .spinner { width: 18px; height: 18px; }
[dir="rtl"] .onboard-foot .onboard-back > .px, [dir="rtl"] .onboard-next > span + .px { transform: scaleX(-1); }
.onboard-legal { margin: 0; text-align: center; font-size: var(--fs-caption); }

/* ---- 1. the account */
.onboard-form { display: flex; flex-direction: column; gap: var(--s-4); width: min(440px, 100%); margin-inline: auto; }
.onboard-form [hidden] { display: none !important; }
.onboard-details { display: flex; flex-direction: column; gap: var(--s-4); }
.onboard-code { display: flex; flex-direction: column; gap: var(--s-3); }
.onboard-code .fine { margin: 0; text-align: center; }
.onboard-note { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; margin: 0; padding: var(--s-3); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-small); text-align: center; }
.onboard-note .px, .onboard-verified .px { flex: none; width: 18px; height: 18px; }
.onboard-verified { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: calc(-1 * var(--s-2)) 0 0; color: var(--success); font-size: var(--fs-small); font-weight: var(--fw-semibold); }
.onboard-verified .linklike { font-weight: var(--fw-semibold); }
.onboard .check-row { display: flex; align-items: flex-start; gap: var(--s-2); margin: 0; font-size: var(--fs-small); color: var(--ink-muted); line-height: var(--lh-snug); }
.onboard .check-row input { flex: none; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--primary); }
.onboard .check-row input[aria-invalid="true"] { outline: 2px solid var(--danger); outline-offset: 2px; }

/* a short list of what was set up: label, then value */
.onboard-summary { display: grid; gap: 0; margin: 0; width: min(440px, 100%); margin-inline: auto; }
.onboard-row { display: flex; justify-content: space-between; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--chrome-line-soft); }
.onboard-row:last-child { border-bottom: 0; }
.onboard-row dt { color: var(--ink-muted); font-size: var(--fs-small); }
.onboard-row dd { margin: 0; text-align: end; font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.onboard-row.total { padding-top: var(--s-3); border-top: 2px solid var(--ink); }
.onboard-row.total dt, .onboard-row.total dd { color: var(--ink); font-weight: var(--fw-heavy); font-size: var(--fs-body); }

/* ---- 2. the plan */
.onboard-plans { display: flex; flex-direction: column; gap: var(--s-3); }
.onboard .plan-pick { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-3); margin: 0; }
.onboard .plan-card { position: relative; gap: 6px; padding: var(--s-4); border-radius: 16px; border: 2px solid var(--surface-3); background: var(--surface); min-height: 100%; }
.onboard .plan-card strong { font-size: var(--fs-title); }
.onboard .plan-card .plan-price { font-size: var(--fs-body); }
.onboard .plan-card .fine { font-size: var(--fs-small); line-height: var(--lh-snug); }
.onboard .plan-card[aria-checked="true"] { border-color: var(--selected-edge); background: var(--selected); box-shadow: 0 0 0 3px var(--selected); }
.onboard .plan-card[aria-checked="true"], .onboard .plan-card[aria-checked="true"] * { color: var(--ink) !important; }
.onboard .plan-card[aria-checked="true"]::after {
  content: ''; position: absolute; top: 12px; inset-inline-end: 12px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.onboard .plan-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.onboard-incls { display: grid; grid-template-columns: 3fr 2fr; gap: var(--s-3); }
.onboard-incl { padding: var(--s-4); border-radius: 16px; background: var(--surface-2); }
.onboard-incl h3 { margin: 0 0 var(--s-2); font-size: var(--fs-small); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.onboard-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); font-size: var(--fs-small); }
.onboard-list li { display: flex; gap: var(--s-2); align-items: flex-start; line-height: var(--lh-snug); }
.onboard-list .px { flex: none; width: 18px; height: 18px; color: var(--primary); }
.onboard-incl:first-child .onboard-list { grid-template-columns: 1fr 1fr; }
.onboard-premium { background: var(--selected); }
.onboard-premium.off { background: var(--surface-2); }
.onboard-premium.off .onboard-list { color: var(--ink-muted); }
.onboard-premium.off .onboard-list .px { color: var(--ink-muted); }

/* ---- 3. the payment: the card beside what it is for */
.onboard-pay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: var(--s-5); align-items: start; }
.onboard-card .card-form { width: 100%; gap: var(--s-3); }
.onboard-card .card-form .field { gap: 6px; }
.onboard-card .card-form > .fine { margin: 0; }
.onboard-card .card-form > p[role="status"]:empty { display: none; }
.onboard-card .card-form > p[role="status"] { margin: 0; font-weight: var(--fw-semibold); color: var(--ink); }
.onboard-order { padding: var(--s-4) var(--s-5); border-radius: 16px; background: var(--surface-2); }
.onboard-order h3 { margin: 0 0 var(--s-1); font-size: var(--fs-small); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.onboard-order .onboard-summary { width: 100%; }
.onboard-order .onboard-row { border-bottom-color: var(--surface-3); }
.onboard-order .fine { margin: var(--s-3) 0 0; font-size: var(--fs-small); }
.onboard-confirm { display: flex; flex-direction: column; align-items: center; gap: var(--s-4); }
.onboard-badge { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.onboard-badge .px { width: 32px; height: 32px; }
@media (prefers-reduced-motion: no-preference) {
  .onboard-badge { animation: pop-badge 360ms var(--ease-out); }
  @keyframes pop-badge { from { transform: scale(0.6); opacity: 0; } }
}

/* ---- 4. the character: the character maker, borderless, inside the card */
.onboard .card.creator { width: 100%; height: min(640px, calc(100dvh - 260px)); min-height: 520px; border: 0; border-radius: 0; box-shadow: none; background: transparent; animation: none; }
.onboard .card.creator .cr-top { padding: 0 0 var(--s-2); text-align: center; justify-content: center; }
.onboard .card.creator .cr-top h2 { font-size: 2rem; font-weight: var(--fw-heavy); letter-spacing: -0.02em; }
.onboard .card.creator .cr-top p { font-size: var(--fs-body); }
.onboard .card.creator .cr-stage { margin-inline: 0; border-color: var(--chrome-line-soft); }
.onboard .card.creator .cr-foot { padding-inline: 0; }
.onboard .card.creator .cr-foot .btn { min-height: 48px; border-radius: 999px; padding: 0 var(--s-5); font-weight: var(--fw-bold); }
.onboard .card.creator .cr-step[aria-current="step"] .cr-step-num, .onboard .card.creator .cr-body[aria-checked="true"] { background: var(--selected); border-color: var(--primary); color: var(--ink); }
.onboard .card.creator .cr-bar-fill { background: var(--primary); }
.onboard .card.creator .cr-progress { padding-inline: 0; }
.onboard .card.creator .btn.on, .onboard .card.creator [aria-checked="true"].btn { background: var(--selected); border-color: var(--primary); }

/* ---- 5. open the office */
.onboard-ready { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-6); align-items: center; width: min(620px, 100%); margin-inline: auto; }
.onboard-me { margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-5) var(--s-3); border-radius: 20px; background: linear-gradient(#e9e4d8, #f3f0e7); }
.onboard-me canvas { image-rendering: pixelated; }
.onboard-me figcaption { padding: 4px 14px; border-radius: 999px; background: #fff; font-weight: var(--fw-bold); box-shadow: var(--sh-1); }
.onboard-dones { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); }
.onboard-done { display: flex; gap: var(--s-3); align-items: center; }
.onboard-done > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.onboard-done b { font-size: var(--fs-caption); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.onboard-done b + span { font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.onboard-done-ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--success-soft); color: var(--success); }
.onboard-done-ic .px { width: 18px; height: 18px; }
.onboard-tip { grid-column: 1 / -1; display: flex; gap: var(--s-2); align-items: flex-start; margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-small); line-height: var(--lh-snug); }
.onboard-tip .px { flex: none; width: 18px; height: 18px; color: var(--primary); }

/* ---- narrower */
@media (max-width: 760px) {
  .onboard { padding: var(--s-4) var(--s-4) var(--s-3); border-radius: 24px; }
  .onboard .plan-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .onboard-incls, .onboard-pay { grid-template-columns: 1fr; }
  .onboard-pay .onboard-order { order: -1; }
  .onboard-ready { grid-template-columns: 1fr; justify-items: center; gap: var(--s-4); }
  .onboard-dones { width: 100%; }
  .onboard .card.creator { height: auto; min-height: 0; }
  .onboard .card.creator .cr-main { min-height: 0; }
  .onboard .card.creator .cr-panels { max-height: 46dvh; }
  /* Back and Continue stay in reach while the options scroll */
  .onboard .card.creator { overflow: visible; }
  .onboard .card.creator .cr-foot { position: sticky; bottom: 0; z-index: 2; background: var(--surface); }
}
@media (max-width: 560px) {
  .screen:has(.onboard) { padding: 0; background: var(--surface, #faf8f2); }
  .onboard { min-height: 100%; border: 0; border-radius: 0; box-shadow: none; padding: var(--s-3) var(--s-4) calc(var(--s-3) + var(--safe-b, 0px)); }
  .onboard-title-small { display: none; }
  /* only the dots: the name of the step is in the line over the heading */
  .onboard-label { display: none; }
  .onboard-step.current .onboard-label { display: none; }
  .onboard-count-name { display: inline; }
  .onboard-step + .onboard-step::before { inset-inline-end: calc(50% + 20px); width: calc(100% - 40px); }
  .onboard-head h2, .onboard .card.creator .cr-top h2 { font-size: 1.625rem; }
  .onboard .plan-pick { grid-template-columns: 1fr 1fr; gap: var(--s-2); }
  .onboard .plan-card { padding: var(--s-3); }
  .onboard-incl:first-child .onboard-list { grid-template-columns: 1fr; }
  /* Continue on top, full width, where the thumb is; Back under it */
  .onboard-foot { position: sticky; bottom: 0; z-index: 2; flex-direction: column-reverse; align-items: stretch; gap: var(--s-1); margin-inline: calc(-1 * var(--s-4)); padding: var(--s-3) var(--s-4); background: var(--surface); }
  .onboard-foot .btn { width: 100%; }
  .onboard-foot > span:empty { display: none; }
}
