/* e-Commet Analytics app. Tokens match the product site's design system
   (product-site/src/styles/tokens.css): e-Commet navy #0a2540, light teal
   #c6eeeb panels, brand teal #9ee3de as a fill only, Plus Jakarta Sans. */

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --c-ink: #0a2540;
  --c-ink-2: #46546a;
  --c-ink-3: #5b6779;
  --c-accent: #0b5a50;
  --c-danger: #9b2c22;
  --c-paper: #ffffff;
  --c-mist: #f1f9f9;
  --c-wash: #c6eeeb;
  --c-teal-light: #9ee3de;   /* fill or decoration only, never text on white */
  --c-danger-wash: #fdeceb;
  --c-line: #e2e9ee;
  --c-line-2: #d3dde5;
  --c-field: #858d9c;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-md: 10px;
  --r: 14px;
  --r-lg: 24px;
  --r-pill: 999px;
  --shadow: 0 1px 2px rgba(10, 37, 64, 0.06), 0 24px 64px -24px rgba(10, 37, 64, 0.22);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--c-ink); background: var(--c-mist); -webkit-font-smoothing: antialiased; }
h1, h2, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; border-radius: 6px; }
h1:focus-visible { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--c-ink-3); font-weight: 400; }
.noscript { max-width: 420px; margin: 20vh auto; padding: 24px; text-align: center; }

/* Loading */
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--c-paper); }
.boot__mark { width: 34px; aspect-ratio: 77.7 / 115.3; background: var(--c-ink); -webkit-mask: url("/brand/rocket.svg") no-repeat center / contain; mask: url("/brand/rocket.svg") no-repeat center / contain; animation: pulse 1.4s ease-in-out infinite; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--c-line-2); border-top-color: var(--c-accent); animation: spin .8s linear infinite; display: inline-block; }
.loading { display: grid; place-items: center; padding: 72px 0; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--c-ink); }
.brand__mark { height: 30px; aspect-ratio: 77.7 / 115.3; background: currentColor; -webkit-mask: url("/brand/rocket.svg") no-repeat center / contain; mask: url("/brand/rocket.svg") no-repeat center / contain; }
.brand__name { font-size: 18px; line-height: 1; letter-spacing: -0.03em; white-space: nowrap; }
.brand__name strong { font-weight: 800; }
.brand__name span { font-weight: 500; color: var(--c-accent); }
.brand--light { color: #fff; }
.brand--light .brand__name span { color: var(--c-teal-light); }

/* Buttons and links */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; border-radius: var(--r-pill); border: 1px solid transparent; font-size: 15px; font-weight: 650; white-space: nowrap; transition: background-color .2s ease, border-color .2s ease, opacity .2s ease; }
.btn--primary { background: var(--c-ink); color: #fff; }
.btn--primary:hover:not(:disabled) { background: #123a5f; }
.btn--secondary { background: var(--c-paper); color: var(--c-ink); border-color: var(--c-line-2); }
.btn--secondary:hover:not(:disabled) { border-color: var(--c-ink); }
.btn--danger { background: var(--c-danger); color: #fff; }
.btn--block { width: 100%; }
.btn--small { height: 38px; padding: 0 16px; font-size: 14px; }
.btn:disabled { opacity: .55; }
.btn.is-busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent; animation: spin .7s linear infinite; }
.link { background: none; border: 0; padding: 0; color: var(--c-accent); font-weight: 650; font-size: inherit; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .2s ease; }
.link:hover { text-decoration-color: currentColor; }
.link--danger { color: var(--c-danger); }
.link:disabled { opacity: .5; }
.pill { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); background: var(--c-wash); color: var(--c-accent); font-size: 12.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.pill--wait { background: #fff4dc; color: #7a4a00; }
.pill--btn { height: 34px; padding: 0 14px; font-size: 13.5px; border: 1px solid transparent; transition: background-color .2s ease, color .2s ease; }
.pill--btn:hover { background: var(--c-accent); color: #fff; }

/* Signed-out frame */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 5fr) 7fr; background: var(--c-paper); }
.auth__side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; padding: 44px 48px; background: var(--c-ink); color: #fff; }
.auth__side::before { content: ""; position: absolute; width: 560px; height: 560px; right: -260px; bottom: -220px; border-radius: 50%; background: radial-gradient(closest-side, rgba(158, 227, 222, .34), rgba(158, 227, 222, 0)); pointer-events: none; }
.auth__side::after { content: ""; position: absolute; width: 320px; height: 320px; left: -160px; top: 22%; border-radius: 50%; background: radial-gradient(closest-side, rgba(11, 90, 80, .55), rgba(11, 90, 80, 0)); pointer-events: none; }
.auth__side > * { position: relative; z-index: 1; }
.auth__headline { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.12; letter-spacing: -0.025em; font-weight: 600; max-width: 13em; }
.auth__points { margin-top: 28px; display: grid; gap: 12px; color: #c9d1de; font-size: 15px; }
.auth__points li { display: flex; align-items: center; gap: 12px; }
.auth__points li::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c-teal-light); }
.auth__legal { font-size: 13px; color: #9aa4b5; }
.auth__main { display: grid; place-items: center; padding: 48px 24px; }
.auth__col { width: 100%; max-width: 400px; animation: rise .35s var(--ease) both; }
.auth__brand-m { display: none; margin-bottom: 28px; }
.auth__foot { margin-top: 22px; text-align: center; font-size: 15px; color: var(--c-ink-2); }

.card { display: grid; gap: 18px; }
.card__title { font-size: 32px; line-height: 1.1; letter-spacing: -0.025em; font-weight: 600; }
.card__lede { color: var(--c-ink-2); margin-top: -6px; }
.field { display: grid; gap: 6px; }
.label { font-size: 14px; font-weight: 650; }
.hint { font-size: 13.5px; color: var(--c-ink-3); }
.input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--c-field); border-radius: var(--r-md); background: #fff; font-size: 16px; transition: border-color .2s ease, box-shadow .2s ease; }
.input::placeholder { color: #9aa1ae; }
.input:hover { border-color: var(--c-ink-2); }
.input:focus-visible { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(11, 90, 80, .22); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 68px; }
.input-peek { position: absolute; right: 6px; top: 6px; height: 36px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--c-accent); font-size: 13.5px; font-weight: 650; }
.input-peek:hover { background: var(--c-wash); }
.input--code { font-size: 26px; font-weight: 600; letter-spacing: .32em; text-align: center; height: 60px; font-variant-numeric: tabular-nums; }
.input--code::placeholder { color: #cfd4dc; }
.row-end { text-align: right; font-size: 14px; margin-top: -8px; }
.error { padding: 11px 14px; border-radius: var(--r-md); background: var(--c-danger-wash); color: var(--c-danger); font-size: 14.5px; font-weight: 500; }
.botcheck:empty { display: none; }

.checks { display: grid; gap: 6px; margin-top: -6px; font-size: 14px; color: var(--c-ink-3); }
.check { display: flex; align-items: center; gap: 10px; }
.check::before { content: ""; flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--c-field); transition: background-color .2s ease, border-color .2s ease; }
.check.is-met { color: var(--c-ink); }
.check.is-met::before { border-color: var(--c-accent); background: var(--c-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.3 8.3l2.4 2.4 5-5.2' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }

.steps { counter-reset: step; display: grid; gap: 18px; }
.steps > li { counter-increment: step; position: relative; padding-left: 40px; display: grid; gap: 8px; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 50%; background: var(--c-wash); color: var(--c-accent); font-size: 13px; font-weight: 700; display: grid; place-items: center; }
.steps strong { font-weight: 650; }
.steps span { color: var(--c-ink-2); font-size: 14.5px; }
.qr { width: 176px; height: 176px; display: grid; place-items: center; border: 1px solid var(--c-line); border-radius: var(--r); background: #fff; }
.qr svg { display: block; width: 164px; height: 164px; }
.qr .hint, .qr .error { margin: 12px; text-align: center; }
.manual { display: grid; gap: 8px; justify-items: start; font-size: 14.5px; }
.manual__key { display: grid; gap: 6px; justify-items: start; }
.secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; letter-spacing: .04em; padding: 8px 12px; border-radius: 8px; background: var(--c-mist); border: 1px solid var(--c-line); word-break: break-all; }

/* Signed-in shell */
.shell { min-height: 100vh; }
.top { background: var(--c-paper); border-bottom: 1px solid var(--c-line); }
.top__in { max-width: 1240px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.top__left, .top__right { display: flex; align-items: center; gap: 18px; min-width: 0; }
.top__who { font-size: 14px; color: var(--c-ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top__link { background: none; border: 0; padding: 8px 4px; font-size: 14.5px; font-weight: 650; color: var(--c-ink-2); }
.top__link:hover, .top__link.is-on { color: var(--c-accent); }
.switch { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 14px; border: 1px solid var(--c-line-2); border-radius: var(--r-pill); background: var(--c-paper); font-size: 14.5px; font-weight: 650; min-width: 0; transition: border-color .2s ease; }
.switch:hover:not(:disabled) { border-color: var(--c-ink); }
.switch:disabled { opacity: 1; }
.switch__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.switch__caret { color: var(--c-ink-3); font-size: 12px; }

.page { max-width: 1240px; margin: 0 auto; padding: 40px 24px 96px; animation: rise .3s var(--ease) both; }
.page--narrow { max-width: 640px; padding-top: 64px; }
.page--mid { max-width: 880px; }
.page--dash { max-width: 1680px; padding: 16px 16px 64px; }
.view--app .top__in { max-width: 1680px; }
.page--dash > #dash-root > .loading { padding: 120px 0; }
.page__title { font-size: clamp(28px, 3.2vw, 38px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 600; }
.page__lede { margin-top: 10px; color: var(--c-ink-2); max-width: 60ch; }
.page__foot { margin-top: 28px; font-size: 15px; }
.kicker { font-size: 14px; font-weight: 700; letter-spacing: .02em; color: var(--c-accent); margin-bottom: 8px; }
.panel { background: var(--c-paper); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 44px; }

/* Account picker */
.page--narrow .input[type=search] { margin-top: 24px; }
.accounts { margin-top: 24px; display: grid; gap: 10px; }
.account { width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px 18px; min-height: 64px; background: var(--c-paper); border: 1px solid var(--c-line); border-radius: var(--r); text-align: left; transition: border-color .2s ease, box-shadow .2s ease, transform .2s var(--ease); }
button.account:hover { border-color: var(--c-ink); box-shadow: 0 8px 24px -16px rgba(10, 37, 64, .35); }
.account__name { font-weight: 650; font-size: 16.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__go { color: var(--c-ink-3); transition: transform .2s var(--ease), color .2s ease; }
button.account:hover .account__go { transform: translateX(3px); color: var(--c-ink); }
.account__markets { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.account.is-empty { background: transparent; border-style: dashed; }

/* Settings */
.block { margin-top: 36px; background: var(--c-paper); border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 28px; }
.block__title { font-size: 19px; font-weight: 650; letter-spacing: -0.015em; display: flex; align-items: center; gap: 10px; }
.block__lede { margin-top: 4px; color: var(--c-ink-3); font-size: 14.5px; }
.count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 7px; border-radius: var(--r-pill); background: var(--c-ink); color: #fff; font-size: 12.5px; font-weight: 700; }
.reqs { margin-top: 16px; display: grid; gap: 12px; }
.req { display: grid; gap: 14px; padding: 16px 18px; border-radius: var(--r); background: var(--c-wash); }
.req__who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.req__who strong { font-weight: 650; }
.req__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.req__pick { display: grid; gap: 12px; padding-top: 14px; border-top: 1px solid rgba(11, 90, 80, .18); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px 0 12px; display: inline-flex; align-items: center; gap: 8px; border-radius: var(--r-pill); border: 1px solid var(--c-field); background: var(--c-paper); font-size: 14px; font-weight: 600; color: var(--c-ink-2); transition: background-color .15s ease, border-color .15s ease, color .15s ease; }
.chip::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--c-field); }
.chip:hover:not(:disabled) { border-color: var(--c-ink); }
.chip.is-on { background: var(--c-ink); border-color: var(--c-ink); color: #fff; }
.chip.is-on::before { border-color: var(--c-teal-light); background: var(--c-teal-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.3 8.3l2.4 2.4 5-5.2' fill='none' stroke='%230a2540' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.chip:disabled { opacity: .45; }
.invite { margin-top: 14px; display: grid; gap: 12px; }
.invite__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.invite__row .input { flex: 1 1 240px; height: 42px; font-size: 15px; }
.invite__row .btn { height: 42px; }
.invite__pick { display: grid; gap: 10px; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--c-mist); border: 1px solid var(--c-line); }
.seg__btn { height: 34px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: none; font-size: 14px; font-weight: 650; color: var(--c-ink-3); }
.seg__btn.is-on { background: var(--c-paper); color: var(--c-ink); box-shadow: 0 1px 2px rgba(10, 37, 64, .14); }
.people { margin-top: 16px; border-top: 1px solid var(--c-line); }
.person { border-bottom: 1px solid var(--c-line); }
.person__head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 16px 4px; background: none; border: 0; text-align: left; font-size: 15px; }
.person__head:disabled { color: inherit; opacity: 1; }
.person__head:hover:not(:disabled) .person__email { color: var(--c-accent); }
.person__email { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.person__sum { margin-left: auto; color: var(--c-ink-3); font-size: 14px; white-space: nowrap; }
.person__caret { color: var(--c-ink-3); font-size: 12px; transition: transform .2s var(--ease); }
.person__head[aria-expanded=true] .person__caret { transform: rotate(180deg); }
.person__body { display: grid; gap: 20px; padding: 6px 4px 24px; }
.person__group { display: grid; gap: 10px; }
.person__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.person__confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; border-radius: var(--r-md); background: var(--c-mist); font-size: 14.5px; }
.toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; width: fit-content; }
.toggle input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 999px; background: var(--c-field); position: relative; margin: 0; cursor: pointer; transition: background-color .2s ease; flex: none; }
.toggle input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.toggle input:checked { background: var(--c-accent); }
.toggle input:checked::after { transform: translateX(16px); }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); padding: 12px 20px; border-radius: var(--r-pill); background: var(--c-ink); color: #fff; font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s var(--ease); max-width: calc(100vw - 32px); z-index: 10; }
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth__side { display: none; }
  .auth__brand-m { display: block; }
  .auth__main { place-items: start center; padding: 40px 20px 56px; }
  .card__title { font-size: 28px; }
  .top__in { padding: 0 16px; height: 58px; }
  .top__who { display: none; }
  .top__left, .top__right { gap: 10px; }
  .brand__name { font-size: 16px; }
  .top__left { flex: 1; }
  .top__right { flex: none; }
  .top .brand__name { display: none; }
  .top .brand__mark { height: 28px; }
  .switch { padding: 0 10px 0 12px; }
  .switch__name { max-width: 34vw; }
  .top .btn--small { padding: 0 12px; }
  .page { padding: 28px 16px 72px; }
  .page--narrow { padding-top: 36px; }
  .panel { padding: 28px 22px; border-radius: var(--r); }
  .block { padding: 20px 16px; border-radius: var(--r); }
  .person__head { flex-wrap: wrap; }
  .person__sum { margin-left: 0; flex: 1 1 calc(100% - 32px); order: 3; }
  .person__caret { order: 4; }
  .account--multi { flex-wrap: wrap; }
  .account__markets { justify-content: flex-start; flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
