:root {
  --bg: #ffffff;
  --canvas: #fbfcff;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --text: #1d1d1f;
  --muted: #6b7280;
  --line: #e7e9ef;
  --line-strong: #d5d9e4;
  --blue: #0a84ff;
  --blue-dark: #0066cc;
  --mint: #2fbf71;
  --coral: #ff6b57;
  --amber: #ff9f0a;
  --violet: #7c5cff;
  --red: #d83b2d;
  --shadow: 0 12px 36px rgba(29, 29, 31, 0.08);
  --shadow-soft: 0 6px 20px rgba(29, 29, 31, 0.05);
  --radius: 8px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 60px;
  padding: 10px clamp(18px, 4vw, 44px);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(29, 29, 31, 0.07);
}

.brand,
.nav,
.action-row,
.review-actions,
.section-head,
.bulk-bar,
.check-label,
.transaction-main,
.action-column {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: white;
  background: var(--text);
  border-radius: 50%;
  font-size: 13px;
}

.nav {
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.nav a:hover {
  color: var(--text);
}

.shell,
.footer {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
}

.shell {
  padding: 30px 0 60px;
}

.footer {
  padding: 0 0 24px;
  color: var(--muted);
  font-size: 13px;
}

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
  align-items: center;
  gap: clamp(26px, 5vw, 60px);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.hero-copy h1,
.page-heading h1,
.center-panel h1,
.auth-panel h1 {
  margin-bottom: 14px;
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-copy h1 {
  font-size: clamp(44px, 6vw, 72px);
}

.page-heading h1 {
  font-size: clamp(32px, 4vw, 48px);
}

.center-panel h1,
.auth-panel h1 {
  font-size: clamp(30px, 4vw, 44px);
}

.hero-copy p,
.page-heading p,
.center-panel p,
.panel p,
.setup-card p {
  color: var(--muted);
  line-height: 1.6;
}

.hero-copy p,
.page-heading p {
  max-width: 620px;
}

.compact-heading {
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 11px;
  font-weight: 800;
}

.muted {
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: white;
  background: var(--blue);
  cursor: pointer;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.button:hover {
  background: var(--blue-dark);
}

.button.ghost,
.button.soft {
  color: var(--blue-dark);
  background: #f2f8ff;
  border-color: #cfe5ff;
}

.button.ghost:hover,
.button.soft:hover {
  background: #e8f3ff;
}

.button.danger,
.button.soft-danger {
  color: var(--red);
  background: #fff2f0;
  border-color: #ffd2cc;
}

.button.danger:hover,
.button.soft-danger:hover {
  color: #9f2118;
  background: #ffe8e3;
}

.button.small {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
}

.button:disabled {
  color: #9aa3af;
  background: #f2f4f7;
  border-color: #e1e5ec;
  cursor: not-allowed;
}

.action-row,
.review-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.toolbar-actions {
  margin-top: 0;
}

.roomy-actions {
  gap: 14px;
  padding-top: 6px;
}

.product-surface {
  min-height: 390px;
  display: grid;
  place-items: center;
}

.mini-window,
.panel,
.auth-panel,
.center-panel,
.onboarding,
.raw-card,
.review-card,
.setup-card,
.metric-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  border-radius: var(--radius);
}

.mini-window {
  width: min(100%, 500px);
  padding: 14px;
}

.window-dot-row {
  display: flex;
  gap: 7px;
  margin-bottom: 14px;
}

.window-dot-row span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cfd6e3;
}

.draft-card,
.sms-body,
.empty-list {
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.draft-card {
  padding: 22px;
}

.draft-card h2,
.panel h2,
.slide h2,
.raw-card h2,
.review-card h2,
.setup-card h2 {
  margin: 0 0 10px;
  line-height: 1.18;
}

dl {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 700;
}

.band {
  padding: 24px 0 8px;
}

.feature-grid,
.stats-grid,
.field-grid,
.metric-strip,
.setup-map,
.account-example-list {
  display: grid;
  gap: 14px;
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-grid article,
.stat {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.feature-grid h2 {
  margin: 0 0 8px;
}

.feature-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.auth-panel,
.center-panel {
  width: min(680px, 100%);
  margin: 38px auto;
  padding: clamp(24px, 4vw, 42px);
}

.center-panel {
  text-align: center;
}

.small-panel {
  padding: 26px;
}

.center-panel .action-row {
  justify-content: center;
}

.form {
  display: grid;
  gap: 16px;
}

.form.compact {
  align-content: start;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--text);
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.inline-check input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: white;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.13);
}

.flash {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: var(--radius);
  border: 1px solid;
  font-weight: 700;
}

.flash.error {
  color: var(--red);
  background: #fff5f3;
  border-color: #ffc9c1;
}

.flash.notice {
  color: #167247;
  background: #effbf5;
  border-color: #bfead0;
}

.page-heading {
  margin-bottom: 24px;
}

.panel,
.onboarding {
  padding: clamp(20px, 3vw, 30px);
  margin-bottom: 22px;
}

.split-panel {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(280px, 1.05fr);
  gap: 28px;
  align-items: start;
}

.setup-map {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 22px;
}

.setup-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
}

.setup-card.complete {
  border-color: #bceccc;
  background: #fbfffd;
}

.setup-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--blue-dark);
  background: #eaf4ff;
  font-weight: 800;
}

.setup-card.complete .setup-index {
  color: #157244;
  background: #e9f9ef;
}

.slide-rail {
  display: flex;
  gap: 9px;
  margin-bottom: 20px;
}

.slide-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--muted);
  background: white;
  cursor: pointer;
  font-weight: 800;
}

.slide-dot.active {
  color: white;
  background: var(--blue);
  border-color: var(--blue);
}

.slide {
  display: none;
  min-height: 240px;
}

.slide.active {
  display: block;
}

.instruction-list {
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--text);
  line-height: 1.78;
}

.code-block {
  overflow: auto;
  padding: 16px;
  background: #15171c;
  color: #f8fafc;
  border-radius: var(--radius);
  line-height: 1.5;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.callout {
  margin-top: 16px;
  padding: 13px;
  color: #8a5200;
  background: #fff8eb;
  border: 1px solid #f4d59b;
  border-radius: var(--radius);
}

.slide-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.action-column {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.stats-grid,
.metric-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 22px;
}

.stat,
.metric-card {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.stat span,
.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat strong,
.metric-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 24px;
}

.accent-blue {
  border-top: 3px solid var(--blue);
}

.accent-green {
  border-top: 3px solid var(--mint);
}

.accent-amber {
  border-top: 3px solid var(--amber);
}

.accent-coral {
  border-top: 3px solid var(--coral);
}

.transaction-panel {
  box-shadow: var(--shadow);
}

.section-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.section-head h2,
.section-head p {
  margin-bottom: 0;
}

.bulk-bar {
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 12px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.bulk-bar select {
  width: min(240px, 100%);
}

.check-label {
  display: inline-flex;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.check-label input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--blue);
}

.transaction-list {
  display: grid;
  gap: 9px;
}

.focused-deck-shell {
  width: min(860px, 100%);
  margin: 0 auto;
}

.focused-deck-top {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}

.focused-deck-top h2 {
  margin-bottom: 0;
}

.focused-count {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 800;
}

.focused-card-stage {
  display: grid;
}

.focused-transaction-card {
  display: none;
  grid-column: 1;
  grid-row: 1;
  min-height: 540px;
  padding: clamp(20px, 4vw, 36px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.focused-transaction-card.active {
  display: grid;
  gap: 18px;
}

.focused-card-progress,
.focused-card-hero,
.focused-actions,
.focused-nav {
  display: flex;
  align-items: center;
}

.focused-card-progress {
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.focused-card-hero {
  justify-content: space-between;
  gap: 22px;
  align-items: flex-start;
}

.focused-card-hero h2 {
  margin-bottom: 8px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.04;
}

.focused-amount {
  display: grid;
  justify-items: end;
  gap: 4px;
  white-space: nowrap;
}

.focused-amount strong {
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1;
}

.focused-amount span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.focused-amount.positive {
  color: #167247;
}

.focused-amount.negative {
  color: var(--text);
}

.focused-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.focused-facts div {
  min-width: 0;
  padding: 12px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.focused-facts dt,
.focused-raw span,
.focused-notes span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.focused-facts dd {
  margin: 4px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.focused-raw,
.focused-notes {
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.focused-raw p,
.focused-notes p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.focused-actions {
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.focused-actions form {
  margin: 0;
}

.focused-nav {
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.warning-callout {
  color: #8a5200;
  background: #fff8ea;
  border-color: #ffdf9c;
}

.transaction-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto 86px auto;
  gap: 14px;
  align-items: center;
  min-height: 64px;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.transaction-row:hover,
.transaction-row.selected {
  border-color: #b8d9ff;
  box-shadow: 0 8px 24px rgba(10, 132, 255, 0.09);
}

.transaction-main {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.transaction-payee,
.transaction-meta {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transaction-payee {
  font-weight: 750;
}

.transaction-meta,
.transaction-date {
  color: var(--muted);
  font-size: 13px;
}

.transaction-amount {
  font-weight: 800;
  white-space: nowrap;
}

.transaction-amount.positive {
  color: #167247;
}

.transaction-amount.negative {
  color: var(--text);
}

.icon-text,
.danger-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 8px;
}

.danger-link:hover {
  color: var(--red);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  background: #f3f5f8;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-pill.pending {
  color: #167247;
  background: #eaf9f0;
}

.status-pill.queued,
.status-pill.processing,
.status-pill.received {
  color: var(--blue-dark);
  background: #edf6ff;
}

.status-pill.approved {
  color: var(--blue-dark);
  background: #eaf4ff;
}

.status-pill.unresolved,
.status-pill.needs_fx,
.status-pill.failed {
  color: #8a5200;
  background: #fff5df;
}

.status-pill.skipped {
  color: #7c4dff;
  background: #f2efff;
}

.empty-list {
  padding: 24px;
}

.manual-submit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.manual-submit-state {
  font-size: 13px;
}

.manual-feed {
  display: grid;
  gap: 10px;
}

.manual-feed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.manual-feed-row div,
.manual-feed-row strong {
  min-width: 0;
}

.manual-feed-row div {
  display: grid;
  gap: 4px;
}

.manual-feed-row strong {
  overflow-wrap: anywhere;
}

.account-example-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-example-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  background: #fbfdff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.account-example-card h3,
.account-example-card p {
  margin-bottom: 0;
}

.floating-actions {
  position: sticky;
  bottom: 16px;
  z-index: 5;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  padding: 12px;
  margin-top: 18px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(0, 1.3fr);
  gap: 20px;
  align-items: start;
}

.focused-review {
  margin-top: 22px;
}

.raw-card,
.review-card {
  padding: clamp(20px, 3vw, 28px);
}

.sms-body {
  padding: 16px;
  line-height: 1.58;
  white-space: pre-wrap;
}

.review-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.field-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
}

.full-field {
  grid-column: 1 / -1;
}

.transfer-mode-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: #f7fbff;
  border: 1px solid #cfe5ff;
  border-radius: var(--radius);
}

.transfer-mode-panel[hidden] {
  display: none;
}

.transfer-mode-head,
.transfer-picker-grid {
  display: grid;
  gap: 14px;
}

.transfer-mode-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.transfer-mode-head h3,
.transfer-mode-head p {
  margin-bottom: 0;
}

.transfer-picker-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.transfer-picker {
  position: relative;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.transfer-picker::after {
  position: absolute;
  top: 10px;
  right: 12px;
  content: attr(data-transfer-role);
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(2px);
}

.transfer-picker:hover,
.transfer-picker:focus-within {
  border-color: #94caff;
  box-shadow: 0 8px 22px rgba(10, 132, 255, 0.1);
}

.transfer-picker:hover::after,
.transfer-picker:focus-within::after {
  opacity: 1;
  transform: translateY(0);
}

.is-disabled-field {
  opacity: 0.48;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 940px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hero,
  .split-panel,
  .review-layout,
  .setup-map {
    grid-template-columns: 1fr;
  }

  .feature-grid,
  .stats-grid,
  .metric-strip,
  .field-grid,
  .account-example-list,
  .transfer-picker-grid {
    grid-template-columns: 1fr;
  }

  .product-surface {
    min-height: auto;
  }

  .focused-deck-top,
  .focused-card-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .focused-amount {
    justify-items: start;
  }

  .focused-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .focused-actions {
    align-items: stretch;
  }

  .focused-actions .button,
  .focused-actions form {
    width: 100%;
  }

  .focused-actions .button {
    justify-content: center;
  }

  .transaction-row {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 10px;
  }

  .transaction-amount,
  .status-pill,
  .transaction-date,
  .danger-link {
    grid-column: 2 / -1;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .button,
  input,
  select,
  textarea,
  .slide-dot,
  .transaction-row {
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
  }
}
