/* Aulama ID surfaces: sign in, register, account and terms.
   Builds on aulama.css tokens. Markup and ids come from the existing
   login.js / register.js / account.js / aulama-auth-v2-8.js behaviour. */

/* the auth helper forces a dark colour-scheme inline; follow the site theme instead */
:root { color-scheme: light !important; }
:root[data-theme="dark"] { color-scheme: dark !important; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark !important; } }

/* ------------------------------------------------------------------ auth backdrop */
/* The same sky as the home page opening, at the visitor's hour, drifting
   slowly behind a glass form. */
.auth-page { min-height: 100vh; min-height: 100svh; overflow-x: hidden; }
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #1b2430; }
.auth-bg img {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; object-position: center;
  transform-origin: 60% 55%;
  animation: auth-drift 60s ease-in-out infinite alternate;
}
.auth-bg img:not([src]) { opacity: 0; }
@keyframes auth-drift { from { transform: scale(1.04); } to { transform: scale(1.1) translate(-1.4%, -.8%); } }
.auth-bg::after {
  /* a soft wash on the reading side so the intro stays legible on any sky */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(250, 248, 240, .72) 0%, rgba(250, 248, 240, .42) 40%, rgba(250, 248, 240, 0) 66%);
}
:root[data-hero-sky="night"] .auth-bg::after { background: linear-gradient(100deg, rgba(4, 8, 14, .62) 0%, rgba(4, 8, 14, .25) 40%, rgba(4, 8, 14, .05) 66%); }

.auth-header {
  position: fixed; z-index: 20; inset: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--nav-top) clamp(16px, 3vw, 40px) 0;
  animation: nav-in 1s var(--ease) .05s backwards;
}
.auth-header .brand img { width: 184px; height: auto; margin-block: -8px; }
@media (max-width: 760px) { .auth-header .brand img { width: 139px; margin-block: -6px; } }
@media (max-width: 440px) { .auth-header .brand img { width: 110px; margin-block: -4px; } }

/* Stage: the story of the account on the left, the form on the right. */
.auth-stage {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100svh;
  width: min(1200px, 100%); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  align-items: center; gap: clamp(40px, 6vw, 112px);
  padding: calc(var(--nav-h) + var(--nav-top) + 32px) clamp(20px, 5vw, 64px) 48px;
}
.auth-column { display: grid; justify-items: center; min-width: 0; }
.auth-intro { display: grid; align-content: center; gap: 22px; min-width: 0; }
.auth-intro > * { animation: rise-in 1s var(--ease) backwards; }
.auth-intro > :nth-child(2) { animation-delay: .1s; }
.auth-intro > :nth-child(3) { animation-delay: .2s; }
.auth-intro > :nth-child(4) { animation-delay: .3s; }
.auth-intro > :nth-child(5) { animation-delay: .4s; }
.auth-intro-mark { height: 38px; width: auto; justify-self: start; filter: drop-shadow(0 6px 20px rgba(0, 0, 0, .12)); }
.auth-intro-title { margin: 0; font-size: clamp(40px, 5.2vw, 72px); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; text-wrap: balance; }
.auth-intro-title > span { display: block; }
.auth-intro-lead { margin: 0; max-width: 30em; color: var(--ink); opacity: .82; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.7; }
.auth-apps { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0; padding: 0; list-style: none; }
.auth-apps li {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 13px 6px 6px; border-radius: 999px;
  font-size: 13.5px; font-weight: 650; color: var(--ink);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.7); backdrop-filter: blur(16px) saturate(1.7);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 0 0 .5px var(--glass-edge), 0 6px 18px -8px rgba(0, 0, 0, .25);
}
.auth-apps img { width: 26px; height: 26px; object-fit: contain; border-radius: 8px; }
.auth-points { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.auth-points li { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 15px; font-weight: 500; }
.auth-points svg {
  flex: none; width: 22px; height: 22px; padding: 4px; border-radius: 50%;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* Copy that sits straight on the sky follows the sky, not the site theme. */
:root[data-hero-sky="day"] :is(.auth-intro, .auth-foot) {
  --ink: #0a0c12; --ink-2: #3a4150; --accent: #178a4d;
  --b1: #6cbf2a; --b2: #1f9d5c; --b3: #0f8f8a;
  --grad: linear-gradient(115deg, var(--b1), var(--b2) 50%, var(--b3));
  --glass-bg: rgba(255, 255, 255, .42); --glass-hi: rgba(255, 255, 255, .9); --glass-edge: rgba(15, 22, 45, .1);
  color: var(--ink);
}
:root[data-hero-sky="night"] :is(.auth-intro, .auth-foot) {
  --ink: #f2f4f9; --ink-2: #c6cdda; --accent: #5ee08f;
  --b1: #c4f06a; --b2: #4ade80; --b3: #2dd4bf;
  --grad: linear-gradient(115deg, var(--b1), var(--b2) 50%, var(--b3));
  --glass-bg: rgba(20, 28, 36, .4); --glass-hi: rgba(255, 255, 255, .28); --glass-edge: rgba(255, 255, 255, .12);
  color: var(--ink);
}

.auth-card {
  width: min(460px, 100%);
  display: grid; gap: 22px;
  padding: clamp(24px, 3.4vw, 36px);
  border-radius: 34px;
  --lg-blur: 26px; --lg-refraction: 30;
  background: var(--glass-bg-strong);
  transition: opacity .5s var(--ease), transform .6s var(--ease);
  animation: rise-in 1.1s var(--ease) .15s backwards;
}
.auth-ui-booting .auth-card { opacity: 0; transform: translateY(12px) scale(.98); }
.auth-page-entering .auth-card { opacity: 0; transform: translateY(12px); }
.is-auth-page-leaving .auth-card { opacity: 0; transform: translateY(-8px) scale(.98); transition-duration: .28s; }
.auth-session-checking .auth-card { opacity: .55; pointer-events: none; }
.auth-foot { position: relative; z-index: 1; justify-self: center; margin: 18px 0 0; padding: 6px 14px; border-radius: 999px; text-align: center; color: var(--ink); font-size: 13px; background: var(--glass-bg); -webkit-backdrop-filter: blur(14px) saturate(1.6); backdrop-filter: blur(14px) saturate(1.6); }
.auth-foot a { text-decoration: underline; text-underline-offset: 3px; }

/* tablets held upright: the story sits above the form, centred */
@media (orientation: portrait) and (min-width: 700px) and (max-width: 1100px) {
  .auth-stage { grid-template-columns: 1fr; justify-items: center; align-content: center; gap: 40px; }
  .auth-intro { justify-items: center; text-align: center; max-width: 620px; }
  .auth-intro-mark { justify-self: center; }
  .auth-apps { justify-content: center; }
  .auth-points { display: none; }
  .auth-bg::after { background: linear-gradient(180deg, rgba(250, 248, 240, .7), rgba(250, 248, 240, .3) 45%, rgba(250, 248, 240, .1) 75%); }
  :root[data-hero-sky="night"] .auth-bg::after { background: linear-gradient(180deg, rgba(4, 8, 14, .55), rgba(4, 8, 14, .12) 45%, rgba(4, 8, 14, 0) 70%); }
}
/* narrow landscape tablets and small laptops: tighter two columns */
@media (min-width: 861px) and (max-width: 1100px) and (orientation: landscape) {
  .auth-stage { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); gap: 40px; }
  .auth-intro-title { font-size: clamp(36px, 4.6vw, 52px); }
  .auth-points { display: none; }
}
/* phones: the form comes first, the account story follows it */
@media (max-width: 699px) {
  .auth-stage { grid-template-columns: 1fr; justify-items: center; align-content: start; gap: 30px; padding: calc(var(--nav-h) + var(--nav-top) + 14px) 14px 40px; }
  .auth-column { order: 1; width: 100%; }
  .auth-intro { order: 2; justify-items: center; text-align: center; gap: 14px; max-width: 460px; }
  .auth-intro-mark, .auth-intro-lead, .auth-points { display: none; }
  .auth-intro-title { font-size: 26px; }
  .auth-intro-title > span { display: inline; }
  .auth-intro-title > span + span { margin-left: .25em; }
  .auth-apps { justify-content: center; }
  .auth-apps li { font-size: 12.5px; padding-right: 11px; }
  .auth-apps img { width: 22px; height: 22px; }
  .auth-card { border-radius: 30px; }
  .auth-bg::after { background: rgba(255, 255, 255, .08); }
  :root[data-hero-sky="night"] .auth-bg::after { background: rgba(4, 8, 14, .28); }
}
/* phones on their side: keep two columns, trim the story to its title */
@media (max-height: 560px) and (orientation: landscape) {
  .auth-stage { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); align-items: start; gap: 28px; padding: calc(var(--nav-h) + var(--nav-top) + 8px) clamp(16px, 4vw, 40px) 28px; }
  .auth-intro { position: sticky; top: calc(var(--nav-h) + var(--nav-top) + 16px); gap: 12px; }
  .auth-intro-lead, .auth-points, .auth-intro-mark { display: none; }
  .auth-intro-title { font-size: clamp(26px, 4vw, 36px); }
  .auth-card { gap: 16px; padding: 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-bg img, .auth-intro > *, .auth-card, .auth-header { animation: none; }
}

/* heading */
.login-message, .register-copy { display: grid; gap: 8px; }
.register-kicker { margin: 0; color: var(--accent); font-size: 13px; font-weight: 650; letter-spacing: .06em; }
.login-heading, .register-title {
  margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  font-size: clamp(30px, 4.4vw, 38px); line-height: 1.1; letter-spacing: -.03em; font-weight: 700;
}
.login-heading-logo, .register-title img { height: 30px; width: auto; }
.login-tagline, .register-tagline { margin: 0; color: var(--ink-2); font-size: 16px; min-height: 1.5em; }
.login-tagline-caret, .typing-caret, .turnstile-caret {
  display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px;
  background: var(--accent); animation: caret 1s steps(1) infinite;
}
.is-copy-complete .login-tagline-caret, .is-copy-complete .typing-caret { opacity: 0; animation: none; }
@keyframes caret { 50% { opacity: 0; } }

/* form */
.login-panel, .register-panel { display: grid; gap: 16px; position: relative; }
.panel-title { display: flex; align-items: center; justify-content: space-between; color: var(--ink-3); font-size: 13px; }
.panel-title strong { color: var(--ink-2); font-weight: 600; }
.login-options, .register-options { display: grid; gap: 14px; }
.requires-human-check:not(.is-human-verified) .login-options,
.requires-human-check:not(.is-human-verified) .register-options { display: none; }
.auth-passage-known .turnstile-zone { display: none; }
.auth-passage-known .requires-human-check .login-options,
.auth-passage-known .requires-human-check .register-options { display: grid; }
.is-verification-transitioning, .is-verification-resizing, .is-verification-revealing { overflow: hidden; }
.is-verification-shattering .turnstile-zone { opacity: 0; transform: scale(.96); transition: opacity .24s var(--ease), transform .3s var(--ease); }

.turnstile-zone { display: grid; justify-items: center; gap: 14px; padding: 8px 0; text-align: center; }
.turnstile-shell { min-height: 65px; display: grid; place-items: center; }
.turnstile-copy { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }
.verification-burst { display: none; }
.turnstile-load-state { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 14px; }
.turnstile-load-spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.turnstile-retry-button { border: 0; border-radius: 999px; padding: 8px 16px; background: color-mix(in srgb, var(--ink) 8%, transparent); font-weight: 600; font-size: 14px; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-options label:not(.remember-login-choice), .register-options label:not(.agreement-line) { display: grid; gap: 7px; position: relative; }
.login-options label > span:first-child, .register-options label > span:first-child { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.auth-page input[type="email"], .auth-page input[type="password"], .auth-page input[type="text"] {
  width: 100%; height: 52px; padding: 0 16px;
  border: 1px solid var(--field-border); border-radius: 16px;
  background: var(--field); color: var(--ink);
  font-size: 16px;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease);
}
.auth-page input::placeholder { color: var(--ink-3); }
.auth-page input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.auth-password-field input { padding-right: 52px; }
.auth-password-toggle {
  position: absolute; right: 6px; bottom: 6px;
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink-3);
}
.auth-password-toggle:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.auth-password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-password-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: -4px; }
.auth-password-meter span { height: 4px; border-radius: 4px; background: var(--line-2); transition: background-color .3s var(--ease); }
.auth-password-meter[data-score="1"] span:nth-child(-n+1) { background: #ef4444; }
.auth-password-meter[data-score="2"] span:nth-child(-n+2) { background: #f59e0b; }
.auth-password-meter[data-score="3"] span:nth-child(-n+3) { background: #22c55e; }
.auth-password-meter[data-score="4"] span { background: var(--accent); }
.auth-password-hint, .auth-password-match { margin: -6px 0 0; color: var(--ink-3); font-size: 12.5px; }
.auth-password-match.is-valid { color: var(--ok); }
.auth-password-match.is-invalid { color: var(--danger); }

.login-commit-row, .register-commit-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.remember-login-choice, .agreement-line { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); }
.remember-login-choice input { position: absolute; opacity: 0; pointer-events: none; }
.remember-login-control {
  flex: none; position: relative; width: 38px; height: 22px; margin-top: 1px; border-radius: 999px;
  background: var(--line-2); transition: background-color .25s var(--ease);
}
.remember-login-control span {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .35s var(--spring);
}
.remember-login-choice input:checked + .remember-login-control { background: var(--accent); }
.remember-login-choice input:checked + .remember-login-control span { transform: translateX(16px); }
.remember-login-choice input:focus-visible + .remember-login-control { outline: 2px solid var(--accent); outline-offset: 2px; }
.remember-login-copy { display: grid; gap: 2px; }
.remember-login-copy strong { color: var(--ink); font-size: 13.5px; font-weight: 600; }
.remember-login-copy small { color: var(--ink-3); font-size: 12px; line-height: 1.45; }
.agreement-line input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.agreement-line a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.email-login-button, .register-submit {
  position: relative; overflow: hidden; flex: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; min-width: 52px; padding: 0 22px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 650; font-size: 15px;
  transition: transform .45s var(--spring), opacity .2s var(--ease);
}
.email-login-button:hover, .register-submit:hover { transform: translateY(-1px); }
.email-login-arrow, .register-submit-arrow { display: grid; }
.email-login-arrow svg, .register-submit-arrow svg { width: 18px; height: 18px; }
.email-login-progress, .register-submit-progress, .google-login-progress, .google-register-progress { display: none; gap: 4px; }
.email-login-progress span, .register-submit-progress span, .google-login-progress span, .google-register-progress span,
.google-auth-loading-progress span {
  width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: dots 1s ease-in-out infinite;
}
.email-login-progress span:nth-child(2), .register-submit-progress span:nth-child(2), .google-login-progress span:nth-child(2), .google-register-progress span:nth-child(2), .google-auth-loading-progress span:nth-child(2) { animation-delay: .15s; }
.email-login-progress span:nth-child(3), .register-submit-progress span:nth-child(3), .google-login-progress span:nth-child(3), .google-register-progress span:nth-child(3), .google-auth-loading-progress span:nth-child(3) { animation-delay: .3s; }
@keyframes dots { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
.is-loading .email-login-progress, .is-loading .register-submit-progress, .is-loading .google-login-progress, .is-loading .google-register-progress { display: inline-flex; }
.is-loading .email-login-label, .is-loading .email-login-arrow, .is-loading .register-submit-label, .is-loading .register-submit-arrow { display: none; }
.console-button:disabled, .register-submit:disabled, .google-register-button:disabled { opacity: .55; cursor: progress; }

.login-divider, .register-divider {
  display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12.5px;
}
.login-divider::before, .login-divider::after, .register-divider::before, .register-divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }

.passkey-login-button, .google-login-button, .google-register-button {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 50px;
  border: 1px solid var(--field-border); border-radius: 999px;
  background: var(--field); color: var(--ink); font-weight: 600; font-size: 15px;
  transition: background-color .2s var(--ease), transform .45s var(--spring);
}
.passkey-login-button:hover, .google-login-button:hover, .google-register-button:hover { background: color-mix(in srgb, var(--ink) 6%, var(--field)); }
.google-login-icon img, .google-register-icon { width: 20px; height: 20px; }
.passkey-login-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.login-secondary-actions { display: flex; justify-content: space-between; gap: 12px; }
.login-inline-link, .register-footer a { border: 0; background: none; padding: 4px 0; color: var(--accent); font-weight: 600; font-size: 14px; }
.register-footer { text-align: center; }
.register-verify-button { width: 100%; height: 48px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 650; }
.login-error, .register-error { margin: 0; min-height: 0; color: var(--danger); font-size: 14px; text-align: center; opacity: 0; transition: opacity .25s var(--ease); }
.login-error.is-visible, .register-error.is-visible, .register-error:not(:empty) { opacity: 1; }
.login-error.is-success, .register-error.is-success { color: var(--ok); }

/* device accounts (login.js) */
.device-account-chooser { display: grid; gap: 10px; }
.device-account-heading { display: flex; justify-content: space-between; align-items: flex-end; }
.device-account-heading strong { display: block; font-size: 15px; }
.device-account-heading span { color: var(--ink-3); font-size: 12.5px; }
.device-account-list { display: grid; gap: 6px; }
.device-account-row { display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 18px; background: var(--field); border: 1px solid var(--field-border); }
.device-account-select { flex: 1; display: flex; align-items: center; gap: 12px; padding: 8px; border: 0; border-radius: 14px; background: transparent; text-align: left; min-width: 0; }
.device-account-select:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.device-account-avatar { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--grad); color: #fff; font-weight: 700; }
.device-account-avatar img { width: 100%; height: 100%; object-fit: cover; }
.device-account-copy { display: grid; min-width: 0; }
.device-account-copy strong, .device-account-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-account-copy span { color: var(--ink-3); font-size: 12.5px; }
.device-account-state { color: var(--ink-3); font-size: 12px; }
.device-account-remove { width: 34px; height: 34px; border: 0; border-radius: 12px; background: transparent; color: var(--ink-3); }
.device-account-remove:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); }

/* Google sign-in overlay */
.google-auth-loading {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 18px;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.google-auth-loading img { height: 34px; }
.google-auth-loading-progress { display: flex; gap: 6px; color: var(--accent); }

@media (max-width: 520px) {
  .auth-stage { place-items: end center; padding-bottom: 24px; }
  .auth-card { border-radius: 30px; }
  .login-commit-row, .register-commit-row { flex-direction: column; align-items: stretch; }
  .email-login-button, .register-submit { width: 100%; }
}

/* ------------------------------------------------------------------ account */
.account-main { width: min(1080px, 100% - var(--gutter) * 2); margin: 0 auto; padding: calc(var(--nav-h) + var(--nav-top) + 48px) 0 96px; }
.account-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.account-page-head h1 { margin: 0 0 8px; font-size: clamp(34px, 5vw, 54px); letter-spacing: -.03em; line-height: 1.08; }
.account-page-head p:not(.eyebrow) { margin: 0; color: var(--ink-2); font-size: 17px; }
.account-home-link { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--glass-bg); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi); }
.account-home-link svg { width: 20px; height: 20px; }
.account-workspace { display: grid; grid-template-columns: 240px 1fr; gap: 24px; align-items: start; }
.account-section-nav {
  position: sticky; top: calc(var(--nav-h) + var(--nav-top) + 20px);
  display: grid; gap: 4px; padding: 8px; border-radius: 26px;
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
}
.account-section-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; color: var(--ink-2); font-weight: 600; font-size: 15px; }
.account-section-nav a svg { width: 20px; height: 20px; }
.account-section-nav a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.account-section-nav a.is-active { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.account-profile-panel { display: grid; gap: 20px; }
.account-status { padding: 12px 16px; border-radius: 16px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--ink-2); font-size: 14px; }
.account-status:empty { display: none; }
.account-section {
  display: grid; gap: 20px; padding: clamp(22px, 3vw, 32px); border-radius: 30px;
  background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--card-shadow);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  scroll-margin-top: calc(var(--nav-h) + var(--nav-top) + 20px);
}
.account-section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.account-section-heading h2 { margin: 2px 0 4px; font-size: 24px; letter-spacing: -.02em; }
.account-section-heading p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.account-section-kicker { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .14em; }
.account-section-state { padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 6%, transparent); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.account-profile-head { display: flex; align-items: center; gap: 18px; }
.account-avatar-editor { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; }
.account-avatar-preview { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; overflow: hidden; background: var(--grad); color: #fff; font-size: 30px; font-weight: 700; }
.account-avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.account-avatar-edit-badge { position: absolute; right: -2px; bottom: -2px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--bg); box-shadow: 0 0 0 3px var(--card-solid); }
.account-avatar-edit-badge svg { width: 14px; height: 14px; }
.account-profile-copy { display: grid; gap: 2px; min-width: 0; }
.account-profile-copy strong { font-size: 20px; }
.account-profile-copy span { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.account-field { display: grid; gap: 7px; }
.account-field span { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.account-field input {
  height: 50px; padding: 0 16px; border-radius: 16px;
  border: 1px solid var(--field-border); background: var(--field); color: var(--ink); font-size: 16px;
}
.account-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.account-tier-overview { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; padding: 20px; border-radius: 22px; background: color-mix(in srgb, var(--accent) 8%, var(--card-solid)); }
.account-tier-mark { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--grad); color: #fff; font-weight: 800; font-size: 22px; }
.account-tier-copy { display: grid; gap: 2px; }
.account-tier-copy strong { font-size: 19px; }
.account-tier-copy p { margin: 0; color: var(--ink-2); font-size: 14px; }
.account-tier-badge { padding: 5px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 650; }
.account-tier-overview.is-premium .account-tier-mark { background: linear-gradient(135deg, #f7c948, #e0932c); }
.account-tier-overview.is-admin .account-tier-mark { background: linear-gradient(135deg, #3a6df6, #1fb5b0); }
.account-tier-overview.is-super-admin .account-tier-mark { background: linear-gradient(135deg, #8b4dff, #3a6df6); }
.account-management-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.account-info-card { display: grid; gap: 6px; padding: 18px; border-radius: 20px; border: 1px solid var(--line); }
.account-info-label { color: var(--ink-3); font-size: 12.5px; font-weight: 600; }
.account-info-card strong { font-size: 17px; }
.account-info-card p { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.trusted-device-summary, .account-password-summary {
  display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: 18px; border-radius: 20px; border: 1px solid var(--line);
}
.trusted-device-summary > div { display: grid; gap: 2px; }
.trusted-device-summary span, .trusted-device-summary small, .account-password-copy small { color: var(--ink-3); font-size: 13px; }
.trusted-device-summary strong, .account-password-copy strong { font-size: 16px; }
.account-password-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.account-password-icon svg { width: 22px; height: 22px; }
.account-password-copy { flex: 1; display: grid; gap: 2px; }
.managed-device-account-list, .passkey-list { display: grid; gap: 8px; }
.managed-device-account, .passkey-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--line); }
.managed-device-avatar, .passkey-item-icon { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--grad); color: #fff; font-weight: 700; }
.managed-device-avatar img { width: 100%; height: 100%; object-fit: cover; }
.passkey-item-icon { border-radius: 12px; }
.passkey-item-icon svg { width: 20px; height: 20px; }
.managed-device-account-copy, .passkey-item-copy { flex: 1; display: grid; min-width: 0; }
.managed-device-account-copy strong, .passkey-item-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.managed-device-account-copy span, .passkey-item-copy span, .passkey-item-copy small { color: var(--ink-3); font-size: 12.5px; }
.managed-device-account-action, .passkey-remove { border: 0; border-radius: 999px; padding: 8px 14px; background: color-mix(in srgb, var(--ink) 6%, transparent); font-weight: 600; font-size: 13px; }
.passkey-remove { color: var(--danger); }
.passkey-empty { padding: 18px; border-radius: 18px; border: 1px dashed var(--line-2); color: var(--ink-3); text-align: center; font-size: 14px; }
.account-security-subhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.account-security-subhead h3 { margin: 0 0 4px; font-size: 18px; }
.account-security-subhead p { margin: 0; color: var(--ink-2); font-size: 14px; }
.passkey-support-hint { color: var(--ink-3); font-size: 12.5px; }
.passkey-add-button svg { width: 18px; height: 18px; }
.account-form-actions {
  position: sticky; bottom: 16px; z-index: 5;
  display: flex; justify-content: flex-end; gap: 10px; padding: 10px; border-radius: 999px;
  width: fit-content; margin-left: auto;
}
.account-form-actions { background: var(--glass-bg-strong); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi), inset 0 0 0 .5px var(--glass-edge); }

.avatar-crop-dialog, .password-dialog {
  width: min(440px, calc(100vw - 32px)); padding: 24px; border: 0; border-radius: 30px;
  background: var(--glass-bg-strong); color: var(--ink);
  -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 var(--glass-hi), inset 0 0 0 .5px var(--glass-edge);
}
.avatar-crop-dialog::backdrop, .password-dialog::backdrop { background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.avatar-crop-head, .password-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.avatar-crop-head div, .password-dialog-head div { display: grid; gap: 4px; }
.avatar-crop-head strong, .password-dialog-head strong { font-size: 19px; }
.avatar-crop-head span, .password-dialog-head span { color: var(--ink-3); font-size: 13.5px; }
.avatar-crop-close, .password-dialog-close { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--ink) 7%, transparent); }
.avatar-crop-close svg, .password-dialog-close svg { width: 16px; height: 16px; }
.avatar-crop-frame { position: relative; aspect-ratio: 1; border-radius: 22px; overflow: hidden; background: #111; touch-action: none; }
.avatar-crop-frame canvas { width: 100%; height: 100%; }
.avatar-crop-mask { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 999px rgba(0, 0, 0, .45); border-radius: 50%; clip-path: none; }
.avatar-crop-zoom { display: grid; gap: 6px; margin: 16px 0; color: var(--ink-2); font-size: 13.5px; }
.avatar-crop-zoom input { accent-color: var(--accent); }
.avatar-crop-actions, .password-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.password-card, .password-dialog-card { display: grid; gap: 14px; }
.password-policy { margin: 0; color: var(--ink-3); font-size: 13px; }
.password-dialog-status { margin: 0; font-size: 14px; color: var(--danger); }

@media (max-width: 860px) {
  .account-workspace { grid-template-columns: 1fr; }
  .account-section-nav { position: static; grid-auto-flow: column; overflow-x: auto; border-radius: 22px; }
  .account-section-nav a { white-space: nowrap; }
  .account-management-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .account-tier-overview { grid-template-columns: auto 1fr; }
  .account-tier-badge { grid-column: 1 / -1; justify-self: start; }
  .trusted-device-summary, .account-password-summary, .account-security-subhead { flex-direction: column; align-items: stretch; }
  .account-form-actions { width: 100%; justify-content: stretch; }
  .account-form-actions > * { flex: 1; }
}

/* ------------------------------------------------------------------ terms */
/* A long read: a calm paper sheet over a softly blurred meadow, a chapter
   rail with a reading gauge, and generous measure for the text. */
.terms-body { background: var(--bg); }
.terms-body .page-glow { display: none; }
.terms-sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.terms-sky img { position: absolute; inset: -6%; width: 112%; height: 112%; max-width: none; object-fit: cover; filter: blur(22px) saturate(1.15); opacity: .55; }
.terms-sky img:not([src]) { opacity: 0; }
.terms-sky::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 30%, transparent), color-mix(in srgb, var(--bg) 82%, transparent) 55%, var(--bg)); }
.terms-body main, .terms-body .site-footer { position: relative; z-index: 1; }
.terms-progress { position: fixed; inset: 0 0 auto; z-index: 60; height: 3px; pointer-events: none; }
.terms-progress span { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 0 3px 3px 0; box-shadow: 0 0 12px color-mix(in srgb, var(--b2) 60%, transparent); }
.terms-stage { width: min(1180px, 100% - var(--gutter) * 2); margin: 0 auto; padding: calc(var(--nav-h) + var(--nav-top) + clamp(40px, 7vw, 88px)) 0 110px; }
.terms-hero { display: grid; gap: 18px; max-width: 860px; margin-bottom: clamp(32px, 5vw, 56px); }
.terms-hero > * { animation: rise-in 1s var(--ease) backwards; }
.terms-hero > :nth-child(2) { animation-delay: .08s; }
.terms-hero > :nth-child(3) { animation-delay: .16s; }
.terms-hero > :nth-child(n+4) { animation-delay: .24s; }
.terms-hero h1 { margin: 0; font-size: clamp(44px, 7vw, 88px); line-height: 1; letter-spacing: -.04em; }
.terms-hero > p:not(.eyebrow) { margin: 0; max-width: 46em; color: var(--ink-2); font-size: clamp(16px, 1.4vw, 18px); line-height: 1.75; }
.terms-hero .eyebrow { margin: 0; }
.terms-actions { display: flex; }
.terms-read-return {
  display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 24px;
  border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 650;
  transition: transform .5s var(--spring);
}
.terms-read-return:hover { transform: translateY(-2px); }
.terms-language-switch { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 999px; width: fit-content; max-width: 100%; background: var(--glass-bg); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi), inset 0 0 0 .5px var(--glass-edge); -webkit-backdrop-filter: blur(16px) saturate(1.8); backdrop-filter: blur(16px) saturate(1.8); }
.terms-language-switch button { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 15px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 14px; white-space: nowrap; transition: color .2s var(--ease), background-color .3s var(--ease); }
.terms-language-switch button:hover { color: var(--ink); }
.terms-language-switch button[aria-pressed="true"] { background: var(--lens-bg); color: var(--ink); box-shadow: 0 2px 8px -2px rgba(0, 0, 0, .15), inset 0 1px 0 var(--glass-hi), inset 0 0 0 .5px var(--glass-edge); }
.terms-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: clamp(24px, 3vw, 40px); align-items: start; }
.terms-toc {
  position: sticky; top: calc(var(--nav-h) + var(--nav-top) + 24px);
  max-height: calc(100vh - var(--nav-h) - var(--nav-top) - 48px); overflow: auto;
  display: grid; gap: 10px; padding: 18px 12px 18px 18px; border-radius: 26px;
  background: var(--glass-bg); box-shadow: var(--glass-shadow), inset 0 1px 0 var(--glass-hi), inset 0 0 0 .5px var(--glass-edge);
  -webkit-backdrop-filter: blur(24px) saturate(1.7); backdrop-filter: blur(24px) saturate(1.7);
  scrollbar-width: thin;
}
.terms-toc strong { font-size: 13px; letter-spacing: .06em; color: var(--ink-3); padding-left: 10px; }
.terms-toc-list { position: relative; display: grid; gap: 2px; }
.terms-toc-list a {
  position: relative; padding: 8px 10px 8px 14px; border-radius: 12px;
  color: var(--ink-2); font-size: 13.5px; line-height: 1.4;
  transition: color .2s var(--ease), background-color .25s var(--ease);
}
.terms-toc-list a::before {
  content: ""; position: absolute; left: 3px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px;
  background: var(--grad); transform: scaleY(0); transition: transform .35s var(--spring);
}
.terms-toc-list a:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); color: var(--ink); }
.terms-toc-list a[aria-current="true"] { background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--ink); font-weight: 650; }
.terms-toc-list a[aria-current="true"]::before { transform: scaleY(1); }
.terms-card {
  padding: clamp(26px, 5vw, 64px) clamp(22px, 5.5vw, 72px);
  border-radius: 36px;
  background: var(--card-solid);
  border: 1px solid var(--card-border); box-shadow: var(--card-shadow);
  animation: rise-in 1.1s var(--ease) .2s backwards;
}
.terms-card > .eyebrow { margin-bottom: 10px; }
.terms-card h2 { margin: 0 0 18px; font-size: clamp(28px, 3vw, 36px); letter-spacing: -.025em; }
.terms-card h3 {
  margin: 44px 0 12px; padding-top: 28px; border-top: 1px solid var(--line);
  font-size: clamp(19px, 1.6vw, 22px); letter-spacing: -.012em;
  scroll-margin-top: calc(var(--nav-h) + var(--nav-top) + 28px);
}
.terms-card h2 + h3, .terms-card h2 + p + h3 { border-top: 0; padding-top: 0; margin-top: 28px; }
.terms-card p { margin: 0 0 14px; max-width: 70ch; color: var(--ink-2); font-size: 16.5px; line-height: 1.9; }
.terms-bottom-actions { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 30; transform: translateX(-50%); animation: rise-in .8s var(--ease) backwards; }
.terms-bottom-actions .terms-read-return { box-shadow: var(--shadow-lg); }
/* tablets and phones: the chapter rail becomes a sticky, scrollable strip */
@media (max-width: 820px) {
  .terms-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .terms-toc {
    position: sticky; top: calc(var(--nav-h) + var(--nav-top) + 8px); z-index: 4;
    display: flex; overflow-x: auto; overflow-y: hidden; max-height: none;
    padding: 6px; border-radius: 999px;
    scrollbar-width: none; -webkit-mask: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
            mask: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  }
  .terms-toc::-webkit-scrollbar { display: none; }
  .terms-toc strong { display: none; }
  .terms-toc-list { display: flex; gap: 4px; padding-inline: 10px; }
  .terms-toc-list a { white-space: nowrap; padding: 8px 14px; border-radius: 999px; }
  .terms-toc-list a::before { display: none; }
  .terms-card { border-radius: 30px; }
  .terms-language-switch { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .terms-language-switch::-webkit-scrollbar { display: none; }
}
@media (max-width: 480px) {
  .terms-stage { width: calc(100% - 24px); }
  .terms-card { padding: 24px 20px; border-radius: 26px; }
  .terms-card p { font-size: 16px; line-height: 1.85; }
  .terms-language-switch button { padding: 0 12px; font-size: 13.5px; }
}
/* phones on their side: shorter hero so the text starts sooner */
@media (max-height: 560px) and (orientation: landscape) {
  .terms-stage { padding-top: calc(var(--nav-h) + var(--nav-top) + 24px); }
  .terms-hero h1 { font-size: 40px; }
  .terms-toc { top: calc(var(--nav-h) + var(--nav-top) + 6px); }
}
@media (prefers-reduced-motion: reduce) { .terms-hero > *, .terms-card, .terms-bottom-actions { animation: none; } }
