/* Finature web app (app.finature.com, ADR-005). One design language with the mobile app
   (src/theme.ts) and the site's desktop agent demo: ink #080C15, navy sky gradient, paper
   #F4F6F8, white sheets with 21px radii, ink primary buttons, mono eyebrows. */

:root {
  --ink: #080c15;
  --ink-2: #242a36;
  --navy: #06102d;
  --navy-2: #102b6f;
  --blue: #266bd5;
  --cyan: #9cecf1;
  --paper: #f4f6f8;
  --white: #ffffff;
  --muted: #687182;
  --faint: #9aa2ae;
  --line: #e2e6eb;
  --line-2: #d4d9e0;
  --good: #27843a;
  --good-soft: #e8f5ea;
  --bad: #b3261e;
  --bad-soft: #fcebe9;
  --shadow: 0 14px 36px rgba(7, 16, 34, .13);
  /* Soft surfaces instead of hairline dividers */
  --lift-sm: 0 1px 2px rgba(8, 12, 21, .05), 0 4px 14px -8px rgba(8, 12, 21, .14);
  --lift: 0 1px 2px rgba(8, 12, 21, .04), 0 12px 32px -18px rgba(8, 12, 21, .22);
  --tint: #eef1f4;
  --gutter: clamp(20px, 3vw, 40px);
  --sky: linear-gradient(180deg, #06102d 0%, #0c1745 34%, #214ea4 70%, #8fe5ed 100%);
  --fin-card: linear-gradient(162deg, #bdf7f4 0%, #64add8 34%, #1b4497 62%, #030513 96%);
  --ease: cubic-bezier(.2, .7, .1, 1);
  --font: 'Inter Tight', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.42; letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
:where(button) { font: inherit; color: inherit; cursor: pointer; }
:where(button:disabled) { cursor: default; }
a { color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }
.eyebrow { font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--muted); letter-spacing: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mark { display: block; flex: none; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Scrollbars like the site */
* { scrollbar-width: thin; scrollbar-color: rgba(8, 12, 21, .22) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(8, 12, 21, .2); border: 3px solid transparent; border-radius: 10px; background-clip: padding-box; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: 14px; border: 0;
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background-color .18s, border-color .18s, transform .18s var(--ease), opacity .18s;
}
.btn:active:not(:disabled) { transform: scale(.985); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover:not(:disabled) { background: #1a2130; }
.btn-line { background: var(--white); color: var(--ink); border: 1px solid var(--line-2); }
.btn-line:hover:not(:disabled) { border-color: var(--faint); }
.btn-ghost { background: var(--white); color: var(--ink); border: 1px solid var(--line-2); min-height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13px; font-weight: 500; }
.btn-ghost:hover { border-color: var(--faint); }
.btn:disabled { opacity: .4; }
.btn svg { width: 16px; height: 16px; }
.btn-lg { min-height: 54px; border-radius: 16px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- Boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; background: var(--paper); }
.boot .mark { width: 30px; height: 30px; color: var(--ink); animation: spin-soft 1.6s var(--ease) infinite; }
@keyframes spin-soft { to { transform: rotate(180deg); } }

/* ---------- Sign in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); }
.signin-sky {
  position: relative; overflow: hidden; color: #fff; background: var(--sky);
  display: flex; flex-direction: column; justify-content: space-between; padding: 36px 44px 34px;
}
.signin-sky::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 80% 100%, rgba(156, 236, 241, .35), transparent 70%);
}
.brand { display: inline-flex; align-items: center; gap: 11px; font-family: var(--mono); font-size: 13px; letter-spacing: .18em; color: rgba(255, 255, 255, .9); }
.brand .mark { width: 22px; height: 22px; color: #fff; }
.signin-hero { position: relative; z-index: 1; }
.signin-hero h2 { margin: 26px 0 0; max-width: 15ch; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.06; font-weight: 600; letter-spacing: -0.035em; }
.signin-hero p { margin: 14px 0 0; max-width: 38ch; color: rgba(255, 255, 255, .72); font-size: 15.5px; }
.signin-foot { position: relative; z-index: 1; font-family: var(--mono); font-size: 11.5px; color: rgba(8, 12, 21, .62); }
.signin-panel { display: flex; align-items: center; justify-content: center; padding: 48px 32px; }
.signin-box { width: 100%; max-width: 400px; }
.signin-box h1 { margin: 8px 0 0; font-size: 34px; line-height: 38px; font-weight: 600; letter-spacing: -1.5px; }
.signin-box .lead { margin: 12px 0 0; color: var(--ink-2); font-size: 15px; line-height: 21px; }
.signin-actions { display: grid; gap: 10px; margin-top: 30px; }
.signin-note { display: flex; gap: 10px; margin-top: 26px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.signin-note svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--muted); }
.notice { display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; padding: 12px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.4; background: var(--white); box-shadow: var(--lift-sm); }
.notice.bad { background: var(--bad-soft); box-shadow: none; color: var(--bad); }

/* Sign-in and sign-up forms */
.auth-form { display: grid; gap: 16px; margin-top: 26px; }
.field { display: grid; gap: 7px; min-width: 0; }
.field label { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.field input {
  width: 100%; height: 52px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 14px;
  background: var(--white); color: var(--ink); font: inherit; font-size: 15px;
  transition: border-color .18s, box-shadow .18s;
}
.field input::placeholder { color: var(--faint); }
.field input:hover { border-color: var(--faint); }
.field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(38, 107, 213, .12); }
.field-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.pw { position: relative; }
.pw input { padding-right: 52px; }
.pw-eye { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.pw-eye:hover { background: var(--paper); color: var(--ink); }
.pw-eye[aria-pressed="true"] { color: var(--blue); }
.pw-eye svg { width: 19px; height: 19px; }
.pw-rules { list-style: none; margin: -4px 0 2px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 14px; }
.pw-rules li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); transition: color .18s; }
.pw-rules .tick { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: background-color .18s, border-color .18s, color .18s; }
.pw-rules .tick svg { width: 10px; height: 10px; }
.pw-rules li.is-met { color: var(--good); }
.pw-rules li.is-met .tick { background: var(--good); border-color: var(--good); color: #fff; }
.auth-form .btn { margin-top: 6px; }
.auth-switch { margin: 18px 0 0; font-size: 14px; color: var(--ink-2); text-align: center; }
.auth-switch a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.auth-switch a:hover { text-decoration-color: var(--ink); }
.auth-start { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 220px; color: var(--muted); font-size: 14px; }
.signin-trust { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.signin-trust li { display: flex; gap: 9px; font-size: 12.5px; line-height: 1.4; color: rgba(8, 12, 21, .7); }
.signin-trust li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--navy-2); }

/* ---------- Finature card (the app's FinatureCard) ---------- */
.fin-card {
  position: relative; aspect-ratio: 1.586; width: 100%; border-radius: 18px; overflow: hidden; color: #fff;
  background: var(--fin-card);
  box-shadow: 0 30px 60px -24px rgba(3, 5, 19, .6), inset 0 0 0 1px rgba(255, 255, 255, .42);
}
.fin-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, .3) 0%, transparent 38%); pointer-events: none; }
.fin-card-top { position: absolute; left: 6%; right: 6%; top: 8%; display: flex; justify-content: space-between; font-family: var(--mono); font-size: clamp(8px, 1.6cqw, 11px); letter-spacing: .14em; color: rgba(255, 255, 255, .88); }
.fin-card .mark { position: absolute; left: 50%; top: 50%; width: 15%; height: auto; transform: translate(-50%, -50%); color: #fff; }
.fin-card-num { position: absolute; left: 6%; top: 19%; font-family: var(--mono); font-size: clamp(9px, 1.8cqw, 12px); color: rgba(255, 255, 255, .78); }
.fin-card-debit { position: absolute; right: 6%; bottom: 9%; font-weight: 600; font-size: clamp(10px, 2cqw, 14px); letter-spacing: .02em; }
.fin-card-pan { position: absolute; left: 6%; bottom: 9%; font-family: var(--mono); font-size: clamp(10px, 3.6cqw, 17px); letter-spacing: .14em; color: rgba(255, 255, 255, .92); }
.fin-card-exp { position: absolute; left: 6%; bottom: calc(9% + clamp(14px, 5cqw, 24px)); font-family: var(--mono); font-size: clamp(8px, 2.4cqw, 11px); letter-spacing: .1em; color: rgba(255, 255, 255, .7); }
.fin-card { transition: filter .4s var(--ease); }
.fin-card.is-frozen { filter: grayscale(.85) brightness(.92); }
.fin-card.is-frozen .fin-card-top span:last-child { color: #fff; background: rgba(8, 12, 21, .45); padding: 2px 7px; border-radius: 6px; }
.signin-card { container-type: inline-size; width: min(380px, 84%); margin-top: 44px; transform: rotate(-4deg); }

/* ---------- Underlying card tiles (fictional demo catalog) ---------- */
.ctile {
  container-type: inline-size; position: relative; aspect-ratio: 1.586; border-radius: 13px; overflow: hidden; color: #fff;
  box-shadow: 0 12px 26px -14px rgba(3, 5, 19, .55), inset 0 0 0 1px rgba(255, 255, 255, .3);
}
.ctile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, .26) 0%, transparent 40%); pointer-events: none; }
.ctile[data-card="card_flat"] { background: linear-gradient(150deg, #eef1f5 0%, #a3adbb 34%, #3b4453 72%, #0f131b 100%); }
.ctile[data-card="card_grocery"] { background: linear-gradient(150deg, #dcf7e8 0%, #5cc39c 34%, #1a6d58 70%, #062720 100%); }
.ctile[data-card="card_dining"] { background: linear-gradient(150deg, #ffe4d2 0%, #e48e62 34%, #8b3a4b 70%, #2a0d1b 100%); }
.ctile[data-card="card_store"] { background: linear-gradient(150deg, #d6e7ff 0%, #6f9ef0 34%, #2347a6 70%, #081338 100%); }
.ctile[data-card="card_travel"] { background: linear-gradient(150deg, #efe3ff 0%, #a98ef0 34%, #4a35a6 70%, #140b38 100%); }
.ctile-issuer { position: absolute; left: 8%; top: 10%; font-family: var(--mono); font-size: max(7px, 5.4cqw); letter-spacing: .1em; color: rgba(255, 255, 255, .85); }
.ctile-name { position: absolute; left: 8%; bottom: 9%; right: 8%; font-weight: 600; font-size: max(9px, 8.4cqw); letter-spacing: -0.01em; line-height: 1.1; }
.ctile-chip { position: absolute; left: 8%; top: 32%; width: 15%; aspect-ratio: 1.3; border-radius: 3px; background: linear-gradient(135deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .25)); }
.ctile.is-paused { filter: grayscale(.85) brightness(.95); }
/* Issuer art (real cards): the image is the card face */
.ctile.is-art { background: #e9edf2; box-shadow: 0 14px 28px -16px rgba(3, 5, 19, .55), 0 0 0 1px rgba(8, 12, 21, .06); }
.ctile.is-art::after { background: linear-gradient(115deg, rgba(255, 255, 255, .18) 0%, transparent 34%); }
.ctile.is-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); height: 100vh; min-height: 0; }
.side {
  position: relative; display: flex; flex-direction: column; min-height: 0;
  padding: 22px 14px 16px; color: #fff; background: var(--sky); overflow: hidden;
}
.side .brand { margin: 2px 6px 26px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 10px; border-radius: 12px;
  color: rgba(255, 255, 255, .7); font-size: 14.5px; text-decoration: none; transition: background-color .18s, color .18s;
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .13); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.nav-ico { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.nav-ico svg { width: 19px; height: 19px; }
.nav a[data-route="/ask"] .nav-ico { width: 24px; height: 24px; margin: 0 -2px; border-radius: 50%; background: var(--ink); color: #fff; }
.nav a[data-route="/ask"] .nav-ico .mark { width: 14px; height: 14px; }
.badge { margin-left: auto; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 600; box-shadow: 0 0 0 2px rgba(6, 16, 45, .55); }

.side-agents { margin-top: 30px; padding: 0 6px; }
.side-agents .eyebrow { color: rgba(255, 255, 255, .55); font-size: 11px; }
.side-agents p { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; color: rgba(255, 255, 255, .7); }
.side-agents a { color: #fff; text-underline-offset: 3px; }

.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: rgba(255, 255, 255, .5); backdrop-filter: blur(10px); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6); }
.me-ico { flex: none; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; box-shadow: 0 4px 10px -4px rgba(3, 5, 19, .4); }
.me-text { min-width: 0; flex: 1; }
.me-text strong { display: block; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text span { display: block; font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-out { flex: none; width: 32px; height: 32px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; }
.me-out:hover { background: rgba(8, 12, 21, .07); color: var(--ink); }
.me-out svg { width: 17px; height: 17px; }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--paper); }
.head { flex: none; padding: 16px var(--gutter) 0; position: relative; z-index: 15; }
.head-in { display: flex; align-items: center; gap: 12px; min-height: 48px; max-width: 1120px; margin: 0 auto; }
.head-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.head-glyph { width: 24px; height: 24px; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.head-glyph svg, .head-glyph .mark { width: 22px; height: 22px; }
.head-copy { display: flex; flex-direction: column; min-width: 0; }
.head-copy strong { font-weight: 600; font-size: 19px; letter-spacing: -0.021em; line-height: 1.2; }
.head-copy span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head-actions { margin-left: auto; display: flex; gap: 8px; }
.view { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.view.is-entering > * { animation: rise .38s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.page { padding: 10px var(--gutter) 56px; max-width: calc(1120px + 2 * var(--gutter)); margin: 0 auto; }

.chip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px 0 8px; border-radius: 15px; background: var(--tint); font-size: 12px; color: var(--muted); white-space: nowrap; }
.chip svg { width: 15px; height: 15px; }

/* ---------- Approvals: a button in the top bar that drops a sheet down ---------- */
.approvals { position: relative; margin-left: auto; }
.approvals-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 11px; border: 0; border-radius: 14px;
  background: var(--white); color: var(--ink); box-shadow: var(--lift-sm); font-size: 14px; font-weight: 500;
  transition: box-shadow .2s var(--ease), background-color .2s, color .2s;
}
.approvals-btn:hover { box-shadow: var(--lift); }
.approvals-btn > svg { width: 17px; height: 17px; }
.approvals-btn[aria-expanded="true"] { background: var(--ink); color: #fff; }
.approvals-count { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue); color: #fff; font-size: 10.5px; font-weight: 600; }
.approvals-chev { display: inline-flex; color: var(--faint); transition: transform .24s var(--ease); }
.approvals-chev svg { width: 14px; height: 14px; transform: rotate(90deg); }
.approvals-btn[aria-expanded="true"] .approvals-chev { transform: rotate(180deg); color: rgba(255, 255, 255, .7); }
.approvals-pop {
  position: absolute; right: 0; top: calc(100% + 10px); width: 380px; max-height: min(72vh, 580px); overflow-y: auto;
  padding: 18px 18px 10px; border-radius: 22px; background: var(--white);
  box-shadow: 0 28px 70px -24px rgba(7, 16, 34, .38), 0 2px 8px rgba(7, 16, 34, .06);
  transform-origin: top right; opacity: 0; transform: translateY(-8px) scale(.97); visibility: hidden; pointer-events: none;
  transition: opacity .18s var(--ease), transform .26s var(--ease), visibility 0s linear .26s;
}
.approvals-pop:focus { outline: none; }
.approvals.is-open .approvals-pop { opacity: 1; transform: none; visibility: visible; pointer-events: auto; transition: opacity .2s var(--ease), transform .28s var(--ease), visibility 0s; }
.approvals-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 0 2px 4px; }
.approvals-title { margin: 1px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1; }

/* ---------- Common pieces ---------- */
.title { margin: 6px 0 0; font-size: 34px; line-height: 38px; font-weight: 600; letter-spacing: -1.5px; }
.lead { margin: 8px 0 0; color: var(--ink-2); font-size: 15px; line-height: 21px; max-width: 60ch; }
.section { margin-top: 34px; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin-bottom: 14px; }
.section-title { margin: 0; font-size: 24px; line-height: 28px; font-weight: 600; letter-spacing: -0.8px; }
.sheet { background: var(--white); border-radius: 22px; box-shadow: var(--lift); }
.sheet-pad { padding: 18px 20px; }
.sheet.list { padding: 6px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 18px 26px; }
.empty-ico { width: 46px; height: 46px; border-radius: 23px; background: var(--tint); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.empty-ico svg { width: 21px; height: 21px; }
.empty-title { margin: 12px 0 0; font-weight: 600; font-size: 16px; letter-spacing: -0.02em; }
.empty-sub { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); max-width: 30ch; }
.rows { margin: 0; padding: 0; list-style: none; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 54px; }
.row strong { display: block; font-weight: 500; font-size: 14.5px; }
.row em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pill { flex: none; font-family: var(--mono); font-size: 11px; padding: 3px 8px; border-radius: 7px; }
.pill.good { color: var(--good); background: var(--good-soft); }
.pill.bad { color: var(--bad); background: var(--bad-soft); }
.pill.muted { color: var(--muted); background: #eef1f4; }
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 7px 0; font-size: 13.5px; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { font-weight: 500; text-align: right; }

/* ---------- Home ---------- */
.cards-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.card-item { display: flex; flex-direction: column; gap: 10px; }
.card-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.card-meta strong { font-weight: 500; font-size: 14px; }
.card-meta em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 1px; }
.card-meta-end { display: flex; align-items: center; gap: 12px; }
.check { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.check-form { padding: 22px 24px 24px; }
.check-out { margin: 10px; padding: 18px 20px; background: var(--paper); border-radius: 16px; min-height: 260px; display: flex; flex-direction: column; }
.field-label { display: block; font-family: var(--mono); font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.amount { display: flex; align-items: baseline; gap: 4px; padding: 8px 14px 10px; border-radius: 16px; background: var(--paper); transition: box-shadow .18s; }
.amount span { font-family: var(--mono); font-size: 30px; color: var(--muted); }
.amount input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-family: var(--mono); font-weight: 500; font-size: 34px; letter-spacing: -0.04em; color: var(--ink); padding: 0; }
.amount:focus-within { box-shadow: 0 0 0 4px rgba(38, 107, 213, .12); }
.segs { display: flex; flex-wrap: wrap; gap: 7px; }
.seg { height: 36px; padding: 0 14px; border-radius: 18px; border: 0; background: var(--tint); font-size: 13px; font-weight: 500; transition: background-color .18s, color .18s; }
.seg:hover { background: #e4e8ee; }
.seg[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.form-gap { margin-top: 20px; }
.check-out .empty { margin: auto; }
.notice svg { flex: none; width: 16px; height: 16px; margin-top: 1px; }
.result-top { display: flex; align-items: center; gap: 14px; }
.result-top .ctile { width: 92px; flex: none; }
.result-card { font-weight: 600; font-size: 22px; letter-spacing: -0.03em; line-height: 1.15; }
.result-earn { margin-top: 2px; font-family: var(--mono); font-size: 13px; color: var(--good); }
.why { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.why li { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.4; color: var(--ink-2); }
.why li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--blue); }
.result-foot { margin-top: auto; padding-top: 14px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- Home: money (Plaid Sandbox) ---------- */
.money-connect { display: flex; align-items: center; gap: 18px; padding: 22px 24px; flex-wrap: wrap; }
.money-ico { flex: none; width: 48px; height: 48px; border-radius: 15px; background: var(--tint); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.money-ico svg { width: 22px; height: 22px; }
.money-connect-copy { flex: 1; min-width: 220px; }
.money-connect-copy strong { display: block; font-weight: 600; font-size: 17px; letter-spacing: -0.02em; }
.money-connect-copy p { margin: 3px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; max-width: 58ch; }
.money-connect-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.money-wait { display: flex; align-items: center; gap: 12px; padding: 26px 24px; color: var(--muted); font-size: 14px; }
.money-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 20px; }
.money-worth, .money-spend { padding: 22px 24px; }
.money-worth { display: flex; flex-direction: column; background: linear-gradient(160deg, #ffffff 0%, #ffffff 55%, #eef5ff 100%); }
.money-worth-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.link-quiet { border: 0; background: none; padding: 4px 6px; margin: -4px -6px; border-radius: 8px; font-size: 12.5px; color: var(--muted); }
.link-quiet:hover { color: var(--ink); background: var(--tint); }
.money-big { margin: 10px 0 0; font-family: var(--mono); font-weight: 500; font-size: clamp(34px, 3.6vw, 44px); letter-spacing: -0.05em; line-height: 1; }
.money-mid { margin: 10px 0 0; font-family: var(--mono); font-weight: 500; font-size: 28px; letter-spacing: -0.04em; line-height: 1; }
.money-parts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.money-parts span { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 14px; background: var(--paper); min-width: 120px; }
.money-parts em { font-style: normal; font-size: 12px; color: var(--muted); }
.money-parts strong { font-family: var(--mono); font-weight: 500; font-size: 15px; }
.money-source { margin: auto 0 0; padding-top: 18px; font-size: 12px; color: var(--muted); }
.bars { list-style: none; margin: 20px 0 0; padding: 0; display: grid; gap: 12px; }
.bars li { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 12px; font-size: 13.5px; }
.bar-label { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 8px; border-radius: 4px; background: var(--tint); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--navy-2), var(--blue)); transition: width .7s var(--ease); }
.bar-val { font-family: var(--mono); font-size: 13px; color: var(--ink); min-width: 74px; text-align: right; }
.money-txns { margin-top: 20px; padding: 18px 10px 8px; }
.money-txns-head { padding: 0 14px 6px; }
.txns { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 8px; }
.txns li { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px; border-radius: 14px; }
.txns li:hover { background: var(--paper); }
.txn-ico { flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--tint); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.txn-main { flex: 1; min-width: 0; }
.txn-main strong { display: block; font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-main em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-end { flex: none; text-align: right; }
.txn-end strong { display: block; font-family: var(--mono); font-weight: 500; font-size: 14px; }
.txn-end strong.is-in { color: var(--good); }
.txn-end em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 1px; }

/* ---------- Ask (the demo thread, live) ---------- */
.ask { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.thread { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding: 14px max(var(--gutter), calc((100% - 880px) / 2)); }
.msg { max-width: 88%; animation: rise .32s var(--ease) both; }
.msg p { margin: 0; font-size: 15px; line-height: 21px; }
.msg-user { align-self: flex-end; max-width: 82%; padding: 10px 15px; border-radius: 18px 18px 6px 18px; background: var(--ink); color: #fff; }
.msg-agent { align-self: flex-start; padding: 12px 15px; border-radius: 18px 18px 18px 6px; background: var(--white); box-shadow: var(--lift-sm); }
.msg-source { display: block; margin-top: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.msg-source.is-ask { color: var(--blue); }
.msg-task { min-width: min(100%, 360px); }
.msg-task .who { color: var(--ink-2); }
.msg-task.is-failed p { color: var(--bad); }
.msg-task .apr-pay { margin-top: 12px; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.msg a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.msg a.btn { color: inherit; text-decoration: none; }
.msg a.btn-ink { color: #fff; }
.booked { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--paper); }
.booked-ico { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--white); color: var(--blue); }
.booked-ico svg { width: 18px; height: 18px; }
.booked-main strong { display: block; font-size: 14.5px; font-weight: 600; }
.booked-main em { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.booked-main em.mono { font-size: 11px; color: var(--faint); }
.booked-links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.task-steps { list-style: none; margin: 2px 0 10px; padding: 0; display: grid; gap: 4px; }
.task-steps li { display: flex; gap: 8px; font-size: 13px; color: var(--ink-2); }
.task-steps li span { width: 14px; flex: none; color: var(--good); text-align: center; }
.task-steps li.is-running span { color: var(--blue); }
.task-steps li.is-failed, .task-steps li.is-failed span { color: var(--bad); }
.task-live { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; font-weight: 500; }
.replying { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; font-size: 12.5px; color: var(--blue); font-weight: 500; }
.replying-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); animation: pulse 1.4s infinite; }
.replying .link-quiet { margin-left: auto; }
.who { display: block; font-family: var(--mono); font-weight: 500; font-size: 10px; letter-spacing: .1em; color: var(--blue); margin-bottom: 5px; }
.dots { display: inline-flex; gap: 4px; padding: 6px 0 2px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: blink 1.1s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.tool { align-self: stretch; border-radius: 16px; background: var(--white); box-shadow: var(--lift-sm); animation: rise .32s var(--ease) both; }
.tool.is-error { box-shadow: var(--lift-sm), inset 0 0 0 1px #efcbc8; }
.tool-btn { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 56px; padding: 8px 12px 8px 10px; border: 0; background: none; text-align: left; border-radius: 16px; }
.tool-logo { flex: none; width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: #e7eeff; color: var(--navy-2); }
.tool-logo .mark { width: 15px; height: 15px; }
.tool-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tool-name { font-family: var(--mono); font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.tool-end { flex: none; display: inline-flex; align-items: center; gap: 8px; }
.tool-chev { width: 16px; height: 16px; color: var(--faint); transition: transform .2s var(--ease); }
.tool-chev svg { width: 16px; height: 16px; display: block; }
.tool-btn[aria-expanded="true"] .tool-chev { transform: rotate(90deg); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--blue); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.json { margin: 0 10px 10px; padding: 12px 14px; border-radius: 12px; background: var(--paper); }
.json pre { margin: 4px 0 12px; font-family: var(--mono); font-size: 12px; line-height: 1.6; color: var(--ink-2); white-space: pre; overflow-x: auto; }
.json pre:last-child { margin-bottom: 0; }
.json .k { color: var(--blue); }
.json .n { color: #8a4b0f; }
.json .l { color: var(--navy-2); }
.compose { flex: none; padding: 8px max(var(--gutter), calc((100% - 880px) / 2)) 18px; }
.suggest { display: flex; gap: 7px; margin: 0 -16px 10px; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 28px), transparent); }
.suggest::-webkit-scrollbar { display: none; }
.sug { flex: none; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 8px 14px 9px; border-radius: 16px; border: 0; background: var(--white); box-shadow: var(--lift-sm); text-align: left; transition: box-shadow .18s var(--ease); }
.sug:hover { box-shadow: var(--lift); }
.sug-tag { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sug-text { font-size: 13px; font-weight: 500; white-space: nowrap; }
.composer { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 6px 6px 18px; border-radius: 18px; background: var(--white); box-shadow: var(--lift); transition: box-shadow .18s; }
.composer:focus-within { box-shadow: var(--lift), 0 0 0 4px rgba(38, 107, 213, .12); }
.composer input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); }
.composer input::placeholder { color: var(--faint); }
.send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 14px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; transition: opacity .18s, transform .18s var(--ease); }
.send svg { width: 19px; height: 19px; }
.send:disabled { opacity: .3; }

/* ---------- Approvals panel ---------- */
.rules { margin: 4px 0 8px; padding: 12px 14px 4px; border-radius: 16px; background: var(--paper); }
.rules .row { min-height: 54px; }
.pill-out { flex: none; font-family: var(--mono); font-size: 11px; color: var(--good); }

/* ---------- Activity ---------- */
.act { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 70px; padding: 10px 14px; border: 0; border-radius: 16px; background: none; text-align: left; transition: background-color .18s; }
button.act:hover { background: var(--paper); }
.act .ctile { width: 54px; flex: none; border-radius: 7px; }
.act-main { flex: 1; min-width: 0; }
.act-main strong { display: block; font-weight: 500; font-size: 14.5px; }
.act-main em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.act-end { text-align: right; flex: none; }
.act-end strong { display: block; font-family: var(--mono); font-weight: 500; font-size: 14px; }
.act-end em { display: block; font-style: normal; font-size: 12px; color: var(--good); margin-top: 2px; }
.act-detail { margin: 0 8px 8px; padding: 8px 14px 8px 76px; border-radius: 14px; background: var(--paper); }

/* ---------- Card ---------- */
.card-hero { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 32px; align-items: center; }
.card-hero .fin-card { container-type: inline-size; }

/* ---------- Card: the Stripe test card ---------- */
.card-meta-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; font-size: 13.5px; color: var(--ink-2); }
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.swipe { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.swipe-form { padding: 22px 24px 24px; }
.swipe-out { margin: 10px; padding: 18px 20px; border-radius: 16px; background: var(--paper); display: flex; flex-direction: column; justify-content: center; min-height: 220px; }
.swipe-out .empty { margin: auto; }
.swipe-verdict { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
.swipe-verdict .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); flex: none; }
.swipe-verdict.is-declined .dot { background: var(--bad); }
.swipe-route { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
.swipe-route .ctile { width: 86px; flex: none; }
.swipe-route strong { display: block; font-weight: 500; font-size: 15px; }
.swipe-route em { display: block; font-style: normal; font-family: var(--mono); font-size: 13px; color: var(--good); margin-top: 2px; }
.swipe-foot { margin-top: 14px; font-size: 12px; color: var(--muted); }
.swipe-foot .mono { font-size: 11.5px; }
.act .fin-mini { width: 54px; flex: none; aspect-ratio: 1.586; border-radius: 7px; background: var(--fin-card); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4); }

/* ---------- Approvals: one card per pending purchase (10 §4) ---------- */
.apr-list { display: grid; gap: 10px; margin-top: 12px; }
.apr-list:empty { display: none; }
.apr { padding: 16px; border-radius: 18px; background: var(--paper); transition: opacity .3s var(--ease), background-color .3s; }
.apr-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.apr-merchant { font-weight: 600; font-size: 14px; }
.apr-time { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--white); font-size: 12px; color: var(--ink-2); }
.apr-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); animation: pulse 1.6s var(--ease) infinite; }
.apr.is-late .apr-time { color: var(--bad); }
.apr.is-late .apr-dot { background: var(--bad); }
.apr-total { margin: 8px 0 0; font-size: 28px; line-height: 32px; font-weight: 600; letter-spacing: -0.03em; }
.apr-total span { font-family: var(--mono); font-size: 12px; font-weight: 400; letter-spacing: 0; color: var(--muted); }
.apr-lines { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.apr-lines li { display: flex; justify-content: space-between; gap: 14px; font-size: 13.5px; line-height: 1.35; }
.apr-lines li > span:last-child { flex: none; font-family: var(--mono); font-size: 12.5px; }
.apr-lines .is-sub { color: var(--muted); font-size: 12.5px; }
.apr-lines .is-total { margin-top: 4px; font-weight: 600; }
.apr-lines .is-total > span:last-child { font-size: 14px; }
.apr-pay { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 10px; border-radius: 14px; background: var(--white); }
.apr-pay .ctile { width: 58px; flex: none; border-radius: 7px; }
.apr-pay strong { display: block; font-weight: 500; font-size: 13.5px; }
.apr-pay em { display: block; font-style: normal; font-size: 12px; color: var(--good); margin-top: 2px; }
.apr-pay em.is-quiet { color: var(--muted); }
.apr-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; font-size: 13px; }
.apr-meta em { display: block; font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.apr-rail { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.apr-rail .mono { padding: 2px 6px; border-radius: 6px; background: var(--white); font-size: 10.5px; letter-spacing: .06em; color: var(--ink-2); }
.apr-note { margin: 10px 0 0; font-size: 12.5px; color: var(--bad); }
.apr-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; }
.apr-actions .btn { min-height: 44px; }
.apr-confirm { margin-top: 14px; }
.apr-confirm-label { display: block; font-size: 13.5px; font-weight: 500; }
.apr-pw { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 8px; }
.apr-pw input { min-width: 0; height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--white); color: var(--ink); font: inherit; font-size: 14px; }
.apr-pw input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(38, 107, 213, .12); }
.apr-pw .btn { min-height: 44px; }
.apr-err { margin: 8px 0 0; font-size: 12.5px; color: var(--bad); }
.apr-confirm .link-quiet { margin-top: 8px; }
.apr-done { display: flex; align-items: center; gap: 10px; margin: 14px 0 0; font-size: 14px; font-weight: 500; }
.apr-done-ico { flex: none; width: 26px; height: 26px; border-radius: 13px; display: inline-flex; align-items: center; justify-content: center; background: var(--good); color: #fff; }
.apr-done-ico svg { width: 15px; height: 15px; }
.apr.is-muted .apr-done-ico { background: var(--faint); }
.apr.is-done { background: var(--good-soft); }
.apr.is-done.is-muted { background: var(--tint); }
.apr-ids { margin: 12px 0 0; font-size: 10.5px; color: var(--faint); overflow-wrap: anywhere; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- Agents: live agent ---------- */
.connect-main { padding: 22px 24px 24px; min-width: 0; }
.connect-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.connect-form .btn { min-height: 52px; }
.connect-main .apr-err { margin-top: 10px; }
.token-box { margin-top: 18px; padding: 16px; border-radius: 16px; background: var(--paper); display: grid; gap: 12px; min-width: 0; }
.token-warn { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.token-warn svg { width: 18px; height: 18px; flex: none; color: var(--blue); }
.token-line { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px; border-radius: 12px; background: var(--white); }
.token-line code { flex: 1; min-width: 0; font-size: 12px; overflow-wrap: anywhere; }
.token-box .agent-sub { margin: 0; }
.snippet { min-width: 0; }
.snippet-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.snippet-head strong { font-size: 13.5px; font-weight: 600; }
.snippet-head span { flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.snippet pre { margin: 0; background: var(--white); font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.tokens { margin-top: 18px; }

.empty-row { flex-direction: row; text-align: left; gap: 16px; padding: 20px 22px; }
.empty-row > div { flex: 1; min-width: 0; }
.empty-row .empty-title { margin: 0; }
.empty-row .empty-sub { max-width: 52ch; }
.store-lead { margin: -4px 0 16px; }
.store, .agent { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.store-main, .agent-main { padding: 22px 24px 24px; min-width: 0; }
.agent-sub { margin: 0 0 14px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.agent-examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.agent-examples .seg { height: auto; min-height: 32px; padding: 6px 12px; text-align: left; line-height: 1.3; }
.agent-run { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.agent-run .apr-pay { margin-top: 14px; }
.agent-text { margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.store-log { margin: 10px; padding: 16px 16px 12px; border-radius: 16px; background: var(--paper); min-width: 0; }
.steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.steps li { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 6px; border-radius: 15px; background: var(--tint); font-size: 12.5px; color: var(--muted); }
.step-dot { width: 20px; height: 20px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--white); font-family: var(--mono); font-size: 11px; }
.steps li.is-now { background: var(--ink); color: #fff; }
.steps li.is-now .step-dot { background: rgba(255, 255, 255, .16); }
.steps li.is-done { color: var(--good); background: var(--good-soft); }
.store-search { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.store-search input { min-width: 0; height: 48px; padding: 0 14px 0 42px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--white); color: var(--ink); font: inherit; font-size: 15px; }
.store-search input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(38, 107, 213, .12); }
.store-search-ico { position: absolute; left: 14px; top: 14px; width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.store-search .btn { min-height: 48px; }
.store-items { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 4px; }
.store-item { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 10px; border-radius: 14px; transition: background-color .18s; }
.store-item:hover { background: var(--paper); }
.store-item.is-out { opacity: .55; }
.store-thumb { flex: none; width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--tint); color: var(--ink-2); }
.store-thumb svg { width: 20px; height: 20px; }
.store-item-main { flex: 1; min-width: 0; }
.store-item-main strong { display: block; font-weight: 500; font-size: 14.5px; }
.store-item-main em { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }
.store-price { flex: none; font-family: var(--mono); font-size: 14px; }
.store-none { padding: 18px 10px; font-size: 13.5px; color: var(--muted); }
.btn-sm { min-height: 36px; padding: 0 14px; border-radius: 11px; font-size: 13px; }
.store-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.quote-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.quote-head strong { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.quote .apr-lines { margin-top: 14px; padding: 14px 16px; border-radius: 16px; background: var(--paper); }
.quote-arrives { margin: 12px 2px 0; font-size: 13px; color: var(--ink-2); }
.quote .apr-pay { background: var(--paper); }
.wait-top { display: flex; align-items: center; gap: 12px; }
.wait-top strong { font-size: 18px; font-weight: 600; letter-spacing: -0.02em; }
.wait-clock { margin-left: auto; padding: 4px 10px; border-radius: 12px; background: var(--tint); font-size: 13px; }
.wait .lead { font-size: 14px; }
.paid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start; }
.paid .store-actions { grid-column: 1 / -1; }
.paid-ico { width: 38px; height: 38px; border-radius: 19px; display: inline-flex; align-items: center; justify-content: center; background: var(--good); color: #fff; }
.paid-ico svg { width: 20px; height: 20px; }
.paid.is-muted .paid-ico { background: var(--faint); }
.paid.is-bad .paid-ico { background: var(--bad); }
.paid-title { margin: 6px 0 0; font-size: 18px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.paid-sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.log { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.log li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 9px 10px; border-radius: 12px; background: var(--white); }
.log-name { font-size: 12px; color: var(--ink); }
.log-sum { grid-column: 1; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-end { grid-column: 2; grid-row: 1 / span 2; display: inline-flex; }
.log li.is-note { background: transparent; padding: 4px 10px; }
.log li.is-note .log-sum { white-space: normal; color: var(--blue); }
.log li.is-error { background: var(--bad-soft); }

/* Activity: purchase status pills and the loading row */
.pill.live { color: var(--blue); background: #e8f0fc; }
.act-end .pill { display: inline-block; margin-top: 4px; }
.act-chev { display: inline-flex; width: 16px; height: 16px; margin-left: 8px; vertical-align: middle; color: var(--faint); }
.list-wait { display: flex; justify-content: center; padding: 22px; }

/* ---------- Toast (the app's dark toast) ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 50; max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(8, 12, 21, .96); color: #fff; font-size: 14px; line-height: 1.35; text-align: center;
  opacity: 0; transform: translate(-50%, 10px); pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Phone tab bar (the app's FinatureTabBar), hidden on desktop */
.tabbar { display: none; }

/* ---------- Narrower windows ---------- */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .side { padding: 22px 10px 14px; align-items: center; }
  .side .brand span, .nav-label, .side-agents, .me-text { display: none; }
  .side .brand { margin: 2px 0 26px; }
  .nav { width: 100%; }
  .nav a { justify-content: center; padding: 0; }
  .badge { position: absolute; top: 3px; right: 9px; margin: 0; }
  .me { flex-direction: column; padding: 8px 6px; gap: 6px; }
  .check { grid-template-columns: minmax(0, 1fr); }
  .money-grid, .txns { grid-template-columns: minmax(0, 1fr); }
  .check-out { min-height: 0; }
  .card-hero { grid-template-columns: minmax(0, 1fr); }
  .card-hero .fin-card { max-width: 380px; }
  .swipe { grid-template-columns: minmax(0, 1fr); }
  .store, .agent { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .signin { grid-template-columns: minmax(0, 1fr); }
  .signin-sky { padding: 24px 22px 26px; min-height: 0; }
  .signin-hero h2 { font-size: 28px; }
  .signin-hero p, .signin-card { display: none; }
  .signin-sky { gap: 18px; }
  .signin-foot, .signin-trust { display: none; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .signin-panel { padding: 28px 20px 40px; align-items: flex-start; }

  .shell { display: flex; flex-direction: column; height: auto; min-height: 100vh; }
  .side { flex-direction: row; align-items: center; justify-content: space-between; padding: 12px 16px; background: linear-gradient(100deg, #06102d 0%, #0c1745 45%, #214ea4 100%); position: sticky; top: 0; z-index: 20; }
  .side .brand { margin: 0; }
  .side .brand span { display: inline; font-size: 12px; }
  .nav, .side-agents { display: none; }
  .me { margin: 0; flex-direction: row; padding: 0; background: none; box-shadow: none; backdrop-filter: none; }
  .me-ico { width: 30px; height: 30px; border-radius: 9px; font-size: 13px; }
  .me-out { color: rgba(255, 255, 255, .85); }
  .me-out:hover { background: rgba(255, 255, 255, .12); color: #fff; }
  .main { border-right: 0; flex: 1; }
  /* Phones: Approvals sits in the top bar as an icon; the dropdown opens below it. */
  .head { position: fixed; top: 9px; right: 104px; z-index: 25; padding: 0; background: none; }
  .head-in { min-height: 0; max-width: none; }
  .head-title { display: none; }
  .approvals-btn { height: 36px; padding: 0 9px; gap: 6px; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16); }
  .approvals-btn > span:not(.approvals-count), .approvals-chev { display: none; }
  .approvals-btn[aria-expanded="true"] { background: #fff; color: var(--ink); }
  .approvals-pop { position: fixed; left: 12px; right: 12px; top: 66px; width: auto; max-height: calc(100vh - 170px); }
  .view { overflow: visible; padding-bottom: 96px; }
  .page { padding: 22px 16px 28px; }
  .ask { height: calc(100vh - 54px - 82px); }
  .thread { padding: 10px 14px; }
  .compose { padding: 8px 12px 12px; }
  .suggest { margin: 0 -12px 10px; padding: 2px 12px; }
  .title { font-size: 30px; line-height: 34px; }
  .act-detail { padding-left: 16px; }
  .store-main, .agent-main, .connect-main { padding: 18px 16px 20px; }
  .connect-form { grid-template-columns: minmax(0, 1fr); }
  .store-item { flex-wrap: wrap; gap: 10px 12px; }
  .store-item-main { flex-basis: calc(100% - 56px); }
  .store-price { margin-left: 54px; }
  .store-item .btn { margin-left: auto; }
  .empty-row { flex-direction: column; align-items: flex-start; }
  .apr-total { font-size: 26px; }

  .tabbar {
    display: flex; justify-content: space-around; align-items: center; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 30;
    height: 66px; padding: 0 6px; border-radius: 27px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(16px);
    box-shadow: 0 14px 36px rgba(7, 16, 34, .16), inset 0 0 0 1px rgba(8, 12, 21, .06);
  }
  .tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 56px; height: 52px; border-radius: 20px; color: var(--muted); font-size: 10.5px; text-decoration: none; }
  .tabbar a svg { width: 20px; height: 20px; }
  .tabbar a[aria-current="page"] { color: var(--ink); background: #edf1f6; }
  .tabbar a[data-route="/ask"] { background: none; }
  .tabbar .orb { width: 44px; height: 44px; border-radius: 22px; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
  .tabbar .orb .mark { width: 18px; height: 18px; }
  .tabbar a[data-route="/ask"] span:last-child { display: none; }
  .toast { bottom: 92px; }
}

@media (max-width: 520px) {
  .bars li { grid-template-columns: 92px minmax(0, 1fr) auto; }
  .money-parts span { min-width: 0; flex: 1 1 40%; }
  .cards-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .msg { max-width: 92%; }
  .tool-meta { display: none; }
  .amount input { font-size: 30px; }
}

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