/* ════════════════════════════════════════════════════════════════════════════
   LedgerAI, Sage Companion app shell.
   Top bar + top nav for every authenticated page (login + signup +
   empty-state dashboard + close + accountant share view all use the
   same chrome). Loaded after close.css so it can reuse the Sage
   Companion tokens (--clay, --cream, --ink, etc.) defined there.
   ════════════════════════════════════════════════════════════════════════════ */

.app-topbar {
  padding: 18px 0;
  border-bottom: 1px solid transparent;
}
.app-topbar-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

/* App nav, primary pill + quiet text links */
.app-nav {
  display: flex; align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.app-nav-item {
  display: inline-flex; align-items: center;
  font-family: 'Onest', system-ui, sans-serif;
  font-size: 13.5px; font-weight: 500;
  color: var(--muted);
  padding: 7px 13px;
  border-radius: 100px;
  text-decoration: none;
  transition: color 140ms, background 140ms, border-color 140ms;
  border: 1px solid transparent;
  letter-spacing: -0.005em;
}
.app-nav-item:hover { color: var(--ink); }
.app-nav-item.is-active { color: var(--clay-deep); }
.app-nav-item.is-active:not(.app-nav-primary) {
  background: var(--cream-2);
}
/* Primary item, Monthly Close gets the cream pill always; clay-deep
   text always; on active, slightly stronger background + clay border. */
.app-nav-primary {
  background: var(--cream-2);
  color: var(--clay-deep);
  font-weight: 600;
}
.app-nav-primary:hover {
  background: var(--clay-soft);
  color: var(--clay-deep);
}
.app-nav-primary.is-active {
  background: var(--clay-soft);
  border-color: var(--clay-line);
  color: var(--clay-deep);
}

@media (max-width: 880px) {
  .app-topbar-inner {
    grid-template-columns: auto auto;
    grid-template-rows: auto auto;
    gap: 12px 12px;
  }
  .app-nav {
    grid-column: 1 / -1;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    white-space: nowrap;
  }
  .app-nav::-webkit-scrollbar { display: none; }
}

/* ── DASHBOARD, empty-state "Get started" treatment ─────────────────────── */

.empty-hero {
  padding: 56px 0 28px;
  text-align: center;
}
.empty-hero h1 {
  font-family: 'Onest', sans-serif;
  font-size: 44px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 14px;
}
.empty-hero h1 .serif {
  color: var(--clay);
  font-size: 46px;
}
.empty-hero p {
  font-size: 17px;
  color: var(--ink-soft);
  max-width: 540px;
  margin: 0 auto;
  line-height: 1.55;
}

.get-started {
  background: linear-gradient(135deg, #ECF0E2 0%, #DDE8D7 100%);
  border: 1px solid var(--clay-line);
  border-radius: 24px;
  padding: 32px 36px;
  margin-top: 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.5),
    0 12px 32px -16px rgba(79,107,69,0.20);
}
.get-started h2 {
  margin: 0 0 6px;
  font-size: 24px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.018em;
}
.get-started h2 .serif {
  color: var(--clay-deep);
  font-size: 26px;
}
.get-started p {
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 460px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 32px;
}
.tile {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 22px 24px;
  text-decoration: none;
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 140ms, transform 140ms;
}
.tile:hover { border-color: var(--clay-line); transform: translateY(-1px); }
.tile-eyebrow {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.tile-name {
  font-size: 16.5px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.008em;
}
.tile-desc {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 2px;
}

/* ── AUTH PAGES, login / signup card ────────────────────────────────────── */

.auth-frame {
  /* Batch 1 (May 2026): tightened vertical padding to remove the
     large empty band above the signup card on 1440x900. The legacy
     min-height: 100vh - 80px centred the card and left ~280px of
     empty cream above it at desktop heights. Switch to a top-aligned
     flex with comfortable but not excessive padding; the card still
     centres horizontally. */
  min-height: calc(100vh - 80px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 48px 20px 64px;
  /* Defensive overflow guard. Combined with the html/body rule in
     tokens.css this means no child can scroll the viewport sideways
     on a 375px or 390px phone. */
  max-width: 100%;
  overflow-x: hidden;
}
.auth-card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 22px;
  padding: 40px 36px;
  width: 100%;
  /* Cap width but allow shrinking inside narrow viewports. The
     min() form prevents an 480px card from forcing a horizontal
     scroll on a 390px phone (legacy bug). */
  max-width: min(440px, 100%);
  box-shadow: 0 12px 32px -16px rgba(79,107,69,0.15);
  /* Long content (a 60-char email) must wrap inside the card, not
     punch out of it. min-width:0 lets flex children honor the cap. */
  min-width: 0;
  overflow-wrap: anywhere;
}
.auth-eyebrow {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  margin-bottom: 10px;
}
.auth-card h1 {
  font-family: 'Onest', sans-serif;
  font-size: 28px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.018em;
  margin: 0 0 8px;
  line-height: 1.2;
}
.auth-card h1 .serif {
  color: var(--clay-deep);
  font-size: 30px;
}
.auth-card .sub {
  font-size: 14.5px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.55;
}
.auth-card label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 6px;
}
.auth-card input[type="email"],
.auth-card input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  font-family: 'Onest', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
  margin-bottom: 4px;
  /* Long email overflow guard. Without min-width:0 a long string
     stretches the input past its parent's max-width on phones. */
  min-width: 0;
  max-width: 100%;
}
.auth-card input[type="email"]:focus,
.auth-card input[type="text"]:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(79,107,69,0.10);
}
/* Inline-validation states (Batch 1, May 2026). The blur listener
   on /signup adds .is-invalid + flips aria-invalid; we surface it
   with a calm warning border + the warning palette. The hint slot
   below each input renders the field-level guidance. */
.auth-card input.is-invalid,
.auth-card input[aria-invalid="true"] {
  border-color: var(--warning, #B45309);
  background: #FDF6EB;
}
.auth-card .field-hint {
  font-size: 12.5px;
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.4;
  min-height: 16px;
}
.auth-card .field-hint.is-error {
  color: var(--warning, #B45309);
}
/* Trust block under the signup CTA. Four short claims that answer
   the most common "what happens next?" anxieties. Layout: vertical
   stack on phones, two-column on >=520px. */
.auth-card .signup-trust {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.auth-card .signup-trust li {
  list-style: none;
  padding-left: 18px;
  position: relative;
}
.auth-card .signup-trust li::before {
  content: "·";
  position: absolute;
  left: 4px;
  top: -1px;
  color: var(--clay-deep);
  font-weight: 700;
}
@media (min-width: 520px) {
  .auth-card .signup-trust {
    grid-template-columns: 1fr 1fr;
    column-gap: 18px;
  }
}
/* Phone breakpoint: keep the card readable at 375px (iPhone SE) +
   390px (iPhone 12-15). Smaller padding + slightly compressed h1. */
@media (max-width: 480px) {
  .auth-frame {
    padding: 24px 14px 48px;
  }
  .auth-card {
    padding: 28px 22px;
    border-radius: 18px;
  }
  .auth-card h1 {
    font-size: 25px;
  }
  .auth-card h1 .serif {
    font-size: 26px;
  }
}
.auth-card .auth-submit {
  width: 100%;
  padding: 13px 22px;
  background: var(--clay);
  color: var(--cream);
  border: none;
  border-radius: 100px;
  font-family: 'Onest', sans-serif;
  font-size: 14.5px; font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 8px 24px -10px rgba(79,107,69,0.55),
    0 2px 8px -2px rgba(79,107,69,0.20);
  transition: transform 140ms, filter 140ms;
}
.auth-card .auth-submit:hover { transform: translateY(-1px); filter: brightness(1.05); }
.auth-card .auth-submit[disabled] { opacity: 0.55; cursor: wait; }
.auth-card .auth-back {
  display: block;
  text-align: center;
  margin-top: 22px;
  font-size: 13.5px;
  color: var(--muted);
  text-decoration: none;
  transition: color 140ms;
}
.auth-card .auth-back:hover { color: var(--ink); }
.auth-card .auth-alt {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rule-soft);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.auth-card .auth-alt a {
  color: var(--clay-deep);
  font-weight: 500;
  border-bottom: 1px solid var(--clay-line);
  padding-bottom: 1px;
}
.auth-msg {
  display: none;
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.5;
}
.auth-msg.success {
  background: var(--clay-soft);
  border: 1px solid var(--clay-line);
  color: var(--clay-deep);
}
.auth-msg.error {
  background: rgba(180,83,9,0.08);
  border: 1px solid rgba(180,83,9,0.25);
  color: var(--warning);
}
.auth-msg.show { display: block; }


/* ════════════════════════════════════════════════════════════════════════════
   LEVEL-2 INTERIOR PAGE COMPONENTS
   Shared form / card / segmented-control / file-upload styles for the
   /import, /quickbooks, /settings, /run-review, /refer, /upgrade,
   and /onboarding templates. All built on the same Sage Companion
   tokens (--cream, --clay, --ink, --rule) defined in close.css.
   ════════════════════════════════════════════════════════════════════════════ */

.page-wrap {
  max-width: 760px; margin: 0 auto;
  padding: 32px 24px 96px;
}
.page-hero {
  margin-bottom: 32px;
}
.page-hero h1 {
  font-family: 'Onest', sans-serif;
  font-size: 36px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.022em;
  line-height: 1.1;
  margin: 0 0 10px;
}
.page-hero h1 .serif {
  color: var(--clay-deep);
  font-size: 38px;
}
.page-hero p {
  margin: 0;
  font-size: 16px; color: var(--ink-soft);
  line-height: 1.55;
  max-width: 540px;
}
.page-eyebrow {
  display: inline-block;
  font-size: 11px; color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 500;
  margin-bottom: 12px;
}

/* Paper card, the workhorse interior container */
.surface {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 18px;
  padding: 26px 28px;
  margin-bottom: 16px;
}
.surface-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.surface-title {
  font-size: 16px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.010em;
  margin: 0;
}
.surface-meta { font-size: 13px; color: var(--muted); }

/* Form fields, matches the auth-card styling but reusable */
.field { display: flex; flex-direction: column; margin-bottom: 18px; }
.field label,
.surface label {
  display: block;
  font-size: 12px; font-weight: 500;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 6px;
}
.field-help {
  font-size: 12.5px; color: var(--muted);
  margin: -10px 0 14px;
  line-height: 1.45;
}
.surface input[type="text"],
.surface input[type="email"],
.surface input[type="password"],
.surface input[type="number"],
.surface input[type="url"],
.surface textarea,
.surface select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  font-family: 'Onest', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
  transition: border-color 140ms, box-shadow 140ms;
}
.surface select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23807E70' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}
.surface input:focus,
.surface textarea:focus,
.surface select:focus {
  border-color: var(--clay);
  box-shadow: 0 0 0 3px rgba(79,107,69,0.10);
}

/* Radio + segmented control */
.choice-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.choice {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 100px;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 140ms, color 140ms, background 140ms;
}
.choice:hover { border-color: var(--clay-line); color: var(--ink); }
.choice input[type="radio"],
.choice input[type="checkbox"] {
  appearance: none;
  width: 14px; height: 14px;
  border: 1.5px solid var(--rule);
  border-radius: 50%;
  margin: 0;
  position: relative;
  cursor: pointer;
}
.choice input[type="checkbox"] { border-radius: 4px; }
.choice input[type="radio"]:checked,
.choice input[type="checkbox"]:checked {
  border-color: var(--clay);
  background: var(--clay);
}
.choice input[type="radio"]:checked::after {
  content: ''; position: absolute;
  inset: 3px; border-radius: 50%;
  background: var(--cream);
}
.choice input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--cream);
  font-size: 10px; font-weight: 700;
}
.choice:has(input:checked) {
  border-color: var(--clay);
  background: var(--clay-soft);
  color: var(--clay-deep);
}

/* CTA row */
.cta-row {
  display: flex; gap: 10px; align-items: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* Status pills */
.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 500;
  padding: 5px 12px 5px 10px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.status-pill::before {
  content: ''; width: 7px; height: 7px;
  border-radius: 50%;
}
.status-pill.connected { color: var(--positive); background: rgba(79,122,74,0.10); }
.status-pill.connected::before { background: var(--positive); box-shadow: 0 0 0 3px rgba(79,122,74,0.18); }
.status-pill.warn { color: var(--warning); background: rgba(180,83,9,0.10); }
.status-pill.warn::before { background: var(--warning); }
.status-pill.muted { color: var(--muted); background: var(--cream-2); }
.status-pill.muted::before { background: var(--muted-2); }

/* File upload dropzone */
.dropzone {
  border: 2px dashed var(--rule);
  border-radius: 18px;
  padding: 36px 24px;
  text-align: center;
  background: var(--cream-2);
  cursor: pointer;
  transition: border-color 140ms, background 140ms;
}
.dropzone:hover, .dropzone.is-drag {
  border-color: var(--clay);
  background: var(--clay-soft);
}
.dropzone-icon {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 32px;
  color: var(--clay);
  display: block;
  margin-bottom: 8px;
}
.dropzone-text {
  font-size: 15px; color: var(--ink-soft);
  margin-bottom: 4px;
}
.dropzone-text .pick {
  color: var(--clay-deep);
  font-weight: 500;
  border-bottom: 1px solid var(--clay-line);
  padding-bottom: 1px;
}
.dropzone-help {
  font-size: 12.5px; color: var(--muted);
  margin: 0;
}

/* Progress treatment for async actions */
.progress {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--cream-2);
  border-radius: 12px;
  font-size: 13.5px;
  color: var(--ink-soft);
  display: none;
  align-items: center;
  gap: 10px;
}
.progress.show { display: flex; }
.progress.success { background: var(--clay-soft); color: var(--clay-deep); }
.progress.error   { background: rgba(180,83,9,0.10); color: var(--warning); }

/* Step nav for onboarding */
.steps {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 32px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}
.step {
  display: inline-flex; align-items: center; gap: 8px;
}
.step .step-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--paper);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted-2);
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-variant-numeric: tabular-nums;
}
.step.is-done .step-dot { background: var(--clay); border-color: var(--clay); color: var(--cream); }
.step.is-done .step-name { color: var(--ink-soft); }
.step.is-active .step-dot { background: var(--clay-soft); border-color: var(--clay-line); color: var(--clay-deep); }
.step.is-active .step-name { color: var(--clay-deep); font-weight: 600; }
.step-sep { color: var(--rule); font-size: 14px; }


/* ════════════════════════════════════════════════════════════════════════════
   + NEW REVIEW PILL, quick-action affordance in the top bar
   ════════════════════════════════════════════════════════════════════════════ */

.new-review-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--clay);
  color: var(--cream);
  border: none;
  padding: 7px 14px 7px 12px;
  border-radius: 100px;
  font-family: 'Onest', sans-serif;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 140ms, filter 140ms, box-shadow 140ms;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 6px 18px -8px rgba(79,107,69,0.45),
    0 1px 4px -1px rgba(79,107,69,0.16);
}
.new-review-pill:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.22) inset,
    0 10px 24px -10px rgba(79,107,69,0.55),
    0 1px 4px -1px rgba(79,107,69,0.20);
}
.new-review-pill-plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  background: rgba(255,255,255,0.18);
  border-radius: 50%;
  font-size: 13px; line-height: 1;
  margin-right: 1px;
}


/* ════════════════════════════════════════════════════════════════════════════
   CINEMATIC READING LOADER, /run-review/{job_id}/status

   Sage Companion intake experience. Brand pulse on the clay mark,
   morphing thinking-verb (Reading → Categorizing → Surfacing →
   Preparing), cycling transaction-row tile that slides in real
   categorized rows from the in-flight worker, calm "Done." reveal
   when the job lands.

   All animations respect prefers-reduced-motion (no infinite loops
   or sliding entrances when the user has motion turned off).
   ════════════════════════════════════════════════════════════════════════════ */

.reading-stage {
  max-width: 640px; margin: 0 auto;
  padding: 56px 24px 80px;
  text-align: center;
}
.reading-mark {
  width: 72px; height: 72px;
  margin: 0 auto 28px;
  border-radius: 50%;
  background: var(--clay);
  color: var(--cream);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 38px; line-height: 1;
  position: relative;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 18px 48px -22px rgba(79,107,69,0.45);
  animation: readingPulse 2.6s ease-in-out infinite;
}
.reading-mark::after {
  content: ''; position: absolute; inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--clay-line);
  opacity: 0;
  animation: readingHalo 2.6s ease-out infinite;
}
@keyframes readingPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 18px 48px -22px rgba(79,107,69,0.45); }
  50%      { transform: scale(1.04); box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 22px 56px -22px rgba(79,107,69,0.55); }
}
@keyframes readingHalo {
  0%   { opacity: 0; transform: scale(1);    }
  40%  { opacity: 0.6;                        }
  100% { opacity: 0; transform: scale(1.18); }
}

.reading-eyebrow {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 14px; color: var(--clay-deep);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  text-transform: lowercase;
}

.reading-headline {
  font-family: 'Onest', sans-serif;
  font-size: 44px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.06;
  margin: 0 0 14px;
}
.reading-headline .verb {
  display: inline-block;
  color: var(--clay);
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 46px;
  min-width: 220px;
  text-align: left;
  transition: opacity 360ms ease;
}
.reading-headline .verb.is-fading { opacity: 0; }

.reading-deck {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0 auto 36px;
  max-width: 480px;
  line-height: 1.55;
}

/* Cycling transaction row, looks like one ledger line being read */
.reading-tx {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 18px 22px;
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  text-align: left;
  min-height: 64px;
  overflow: hidden;
  position: relative;
}
.reading-tx-content {
  display: contents;
  opacity: 0;
  animation: readingRowEnter 360ms ease-out forwards;
}
.reading-tx-content.is-leaving {
  animation: readingRowLeave 240ms ease-in forwards;
}
@keyframes readingRowEnter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0);   }
}
@keyframes readingRowLeave {
  from { opacity: 1; transform: translateY(0);    }
  to   { opacity: 0; transform: translateY(-8px); }
}
.reading-tx-source {
  font-size: 10.5px; font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
  background: var(--cream-2);
  border-radius: 100px;
  padding: 4px 10px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.reading-tx-name {
  font-size: 14.5px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.005em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reading-tx-amount {
  font-size: 14.5px; font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Stage rail underneath the tx row */
.reading-rail {
  height: 3px;
  background: var(--rule-soft);
  border-radius: 2px;
  position: relative;
  margin: 4px auto 28px;
  max-width: 520px;
  overflow: hidden;
}
.reading-rail-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 6%;
  background: var(--clay);
  border-radius: 2px;
  transition: width 480ms cubic-bezier(.2,.6,.2,1);
}

.reading-meta {
  font-size: 12.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.005em;
  margin-bottom: 6px;
}
.reading-meta .v { color: var(--ink-soft); font-weight: 500; }

/* "Done." reveal */
.reading-done {
  margin-top: 8px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 480ms ease, transform 480ms ease;
}
.reading-done.is-visible {
  opacity: 1; transform: translateY(0);
}
.reading-done-headline {
  font-family: 'Onest', sans-serif;
  font-size: 52px; font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.026em;
  line-height: 1.05;
  margin: 0 0 12px;
}
.reading-done-headline em {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-weight: 400;
  color: var(--clay-deep);
  font-size: 56px;
}
.reading-done-meta {
  font-size: 14.5px; color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 26px;
}
.reading-done-meta .v { color: var(--ink); font-weight: 500; }
.reading-done-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--clay);
  color: var(--cream);
  border: none;
  padding: 14px 24px;
  border-radius: 100px;
  font-family: 'Onest', sans-serif;
  font-size: 15px; font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.18) inset,
    0 12px 28px -12px rgba(79,107,69,0.55),
    0 2px 8px -2px rgba(79,107,69,0.20);
  transition: transform 140ms, filter 140ms;
}
.reading-done-cta:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* Failed state */
.reading-failed {
  background: rgba(180,83,9,0.08);
  border: 1px solid rgba(180,83,9,0.30);
  border-radius: 18px;
  padding: 26px 28px;
  text-align: left;
  margin-top: 20px;
}
.reading-failed h2 { color: var(--warning); margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.reading-failed p  { color: var(--ink-soft); margin: 0 0 14px; font-size: 14.5px; line-height: 1.55; }

@media (prefers-reduced-motion: reduce) {
  .reading-mark, .reading-mark::after { animation: none; }
  .reading-tx-content { animation: none; opacity: 1; transform: none; }
  .reading-tx-content.is-leaving { animation: none; opacity: 0; }
  .reading-headline .verb { transition: none; }
  .reading-done { transition: none; }
}

@media (max-width: 700px) {
  .reading-stage     { padding: 36px 18px 56px; }
  .reading-headline  { font-size: 32px; }
  .reading-headline .verb { font-size: 34px; min-width: 0; }
  .reading-done-headline { font-size: 36px; }
  .reading-done-headline em { font-size: 38px; }
  .reading-deck { font-size: 15px; }
}


/* ════════════════════════════════════════════════════════════════════════════
   TRANSACTIONS PAGE, filter pills
   ════════════════════════════════════════════════════════════════════════════ */

.tx-filter-row {
  padding: 14px 22px;
  border-bottom: 1px solid var(--rule-soft);
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center;
}
.tx-filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: 'Onest', sans-serif;
  font-size: 12.5px; font-weight: 500;
  color: var(--muted);
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 5px 11px;
  border-radius: 100px;
  cursor: pointer;
  transition: border-color 140ms, color 140ms, background 140ms;
}
.tx-filter-pill:hover { border-color: var(--clay-line); color: var(--ink); }
.tx-filter-pill.is-active {
  background: var(--clay-soft);
  border-color: var(--clay-line);
  color: var(--clay-deep);
  font-weight: 600;
}
.tx-filter-pill .count {
  font-size: 11px; color: var(--muted);
  background: var(--cream-2);
  border-radius: 100px;
  padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
.tx-filter-pill.is-active .count {
  background: rgba(79,107,69,0.16);
  color: var(--clay-deep);
}
.tx-filter-sep {
  color: var(--rule);
  margin: 0 4px;
  font-size: 14px;
}
.tx-filter-select {
  margin-left: auto;
  padding: 6px 30px 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 100px;
  font-family: 'Onest', sans-serif;
  font-size: 12.5px; font-weight: 500;
  color: var(--ink-soft);
  background: var(--paper);
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23807E70' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  outline: none;
  cursor: pointer;
}
.tx-filter-select:focus { border-color: var(--clay); }

