:root {
  --bg-body: #0A0A0A;
  --bg-surface: #141414;
  --bg-surface-alt: #111111;
  --bg-elevated: #1A1A1A;
  --bg-inset: #0A0A0A;
  --foreground: #FFFFFF;
  --text-body: #E0E0E0;
  --text-secondary: #848484;
  --text-dim: #666666;
  --text-muted: #4A4A4A;
  --text-table: #C0C0C0;
  --border-primary: #2A2A2A;
  --border-subtle: #1E1E1E;
  --accent: #0D6E6E;
  --accent-hover: #0B5C5C;
  --bg-matched: #0F1514;
  --bg-matched-alt: #0C1211;
  --border-matched: #1A2A28;
  --accent-unmatched: #C97A2E;
  --accent-unmatched-subtle: rgba(201, 122, 46, 0.08);
  --accent-unmatched-bg: rgba(201, 122, 46, 0.12);
  --accent-unmatched-border: rgba(201, 122, 46, 0.3);
  --bg-unmatched: #1A1408;
  --border-unmatched: #2A1E0F;
  --bg-hover: rgba(255, 255, 255, 0.05);
  --bg-dropzone-active: #0F1A1A;
  --text-on-accent: #FFFFFF;
  --accent-success: #4ade80;
  --sidebar-active-bg: rgba(13, 110, 110, 0.12);
  /* Tokens mirrored from Pencil vaudr.pen — see CLAUDE.md "Design system" section */
  --border: #2E2E2E;
  --destructive: #FF5C33;
  --muted: #2E2E2E;
  --secondary: #2E2E2E;
  --accent-foreground: #F2F3F0;
  --card: #1A1A1A;
  --card-foreground: #FFFFFF;
  --popover: #1A1A1A;
  --popover-foreground: #FFFFFF;
  --secondary-foreground: #FFFFFF;
  --muted-foreground: #B8B9B6;
  --color-error: #24100B;
  --color-error-foreground: #FF5C33;
  --color-info: #222229;
  --color-info-foreground: #B2B2FF;
  --color-success: #222924;
  --color-success-foreground: #B6FFCE;
  --color-warning: #291C0F;
  --color-warning-foreground: #FF8400;
  --input: #2E2E2E;
  --ring: #666666;
  --sidebar: #18181b;
  --sidebar-accent: #2a2a30;
  --sidebar-accent-foreground: #fafafa;
  --sidebar-border: #ffffff1a;
  --sidebar-foreground: #fafafa;
  --sidebar-primary: #18181b;
  --sidebar-primary-foreground: #fafafa;
  --sidebar-ring: #71717a;
  --font-primary: "JetBrains Mono";
  --font-secondary: "Geist";
  --radius-pill: 999px;
  --white: #FFFFFF;
  --black: #000000;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 999px;
  --radius-circle: 50%;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
}

[data-theme="light"] {
  --bg-body: #FAFAFA;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F5F5F5;
  --bg-elevated: #F0F0F0;
  --bg-inset: #FFFFFF;
  --foreground: #111111;
  --text-body: #333333;
  --text-secondary: #666666;
  --text-dim: #888888;
  --text-muted: #AAAAAA;
  --text-table: #444444;
  --border-primary: #E0E0E0;
  --border-subtle: #ECECEC;
  --accent: #0D6E6E;
  --accent-hover: #0B5C5C;
  --bg-matched: #EBF5F0;
  --bg-matched-alt: #F2FAF6;
  --border-matched: #C8E8E0;
  --accent-unmatched: #C97A2E;
  --accent-unmatched-subtle: rgba(201, 122, 46, 0.08);
  --accent-unmatched-bg: rgba(201, 122, 46, 0.12);
  --accent-unmatched-border: rgba(201, 122, 46, 0.3);
  --bg-unmatched: #FFF5EB;
  --border-unmatched: #F0E0D0;
  --bg-hover: rgba(0, 0, 0, 0.03);
  --bg-dropzone-active: #E8F5F5;
  --text-on-accent: #FFFFFF;
  --accent-success: #16a34a;
  --sidebar-active-bg: rgba(13, 110, 110, 0.08);
  --border: #CBCCC9;
  --destructive: #D93C15;
  --muted: #F2F3F0;
  --secondary: #E7E8E5;
  --accent-foreground: #111111;
  --card: #FFFFFF;
  --card-foreground: #111111;
  --popover: #FFFFFF;
  --popover-foreground: #111111;
  --secondary-foreground: #111111;
  --muted-foreground: #666666;
  --color-error: #E5DCDA;
  --color-error-foreground: #8C1C00;
  --color-info: #DFDFE6;
  --color-info-foreground: #000066;
  --color-success: #DFE6E1;
  --color-success-foreground: #004D1A;
  --color-warning: #E9E3D8;
  --color-warning-foreground: #804200;
  --input: #CBCCC9;
  --sidebar: #E7E8E5;
  --sidebar-accent: #CBCCC9;
  --sidebar-accent-foreground: #18181b;
  --sidebar-border: #CBCCC9;
  --sidebar-foreground: #666666;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ── Shared property clusters ────────────────────────── */
.loading-screen,
.loading-pulse,
.onboarding-content,
.step-number,
.join-banner,
.user-avatar,
.hero > form,
.success-toast__icon,
.success-toast__dismiss,
.estimate-view__file-icon,
.extract-progress-card__spinner,
.insufficient-credits-modal__icon,
.drop-zone,
.reconciling-status,
.pulse-icon,
.pulse-icon-inner,
.pagination,
.modal-overlay,
.candidate-check,
.disambig-overlay,
.disambig-radio,
.pdf-review-nav,
.page-dot,
.pdf-review-divider,
.tour-dots,
.react-datepicker__navigation
{
  display: flex;
  align-items: center;
  justify-content: center;
}

.field-input:focus,
.hero > form input:focus,
.preview-table .column-filter:focus,
.column-mapping select:focus,
.actions select:focus
{
  border-color: var(--accent);
}

.form-actions .onboarding-cta,
.admin-table,
.org-switcher-item,
.dropdown-item,
.estimate-view,
.cost-estimate-card__bar,
.extract-progress-card,
.extract-progress-card__header,
.extract-progress-card__bar,
.extract-stats-row,
.insufficient-credits-modal,
.insufficient-credits-modal__title-group,
.insufficient-credits-modal__breakdown,
.insufficient-credits-modal__actions,
.insufficient-credits-modal__secondary,
.preview-table,
.preview-table table,
.preview-table .column-filter,
.column-mapping select,
.picker-search input,
.pdf-review,
.pdf-review-image img,
.pdf-review-table .preview-table table,
.pdf-review-table td.editing input,
.review-table,
.usage-chart-bars
{
  width: 100%;
}

body {
  font-family: "Geist", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-body);
  color: var(--text-body);
  min-height: 100vh;
}

/* ── Loading screen ───────────────────────────────────── */

.loading-screen {
  flex-direction: column;
  flex: 1;
  min-height: calc(100vh - 64px);
  gap: 32px;
}

.loading-pulse {
  width: 80px;
  height: 80px;
}

.loading-pulse svg {
  animation: loading-spin 3s linear infinite;
}

.loading-ring {
  color: var(--text-secondary);
}

.loading-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.loading-heading {
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--foreground);
  letter-spacing: 1px;
}

.loading-subtext {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
}

@keyframes loading-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Onboarding ──────────────────────────────────────── */

.onboarding-content {
  flex-direction: column;
  flex: 1;
  min-height: calc(100vh - 64px);
  gap: 48px;
  padding: 0 80px;
}

.onboarding-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.onboarding-headline {
  font-family: "Playfair Display", serif;
  font-size: 48px;
  font-weight: 500;
  color: var(--foreground);
  text-align: center;
}

.onboarding-subtitle {
  font-family: "Geist", sans-serif;
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
  max-width: 560px;
}

.onboarding-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  padding: 16px 20px;
  background: rgba(201, 122, 46, 0.06);
  border: 1px solid rgba(201, 122, 46, 0.19);
  border-radius: 8px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--accent-unmatched);
  line-height: 1.5;
}

.onboarding-steps {
  display: flex;
  gap: 24px;
}

.onboarding-step {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 280px;
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-circle);
  background: var(--accent);
}

.step-number span {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-on-accent);
}

.step-title {
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.step-desc {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.onboarding-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
}

.onboarding-cta:hover {
  background: var(--accent-hover);
}

.onboarding-headline--sm {
  font-size: 36px;
}

.onboarding-subtitle--sm {
  font-size: 16px;
  max-width: 480px;
  line-height: 1.5;
}

.stepper {
  display: flex;
  gap: 8px;
}

.stepper-dot {
  width: 32px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-primary);
}

.stepper-dot--active {
  background: var(--accent);
}

.step-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text-secondary);
}

.onboarding-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 420px;
  max-width: 100%;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
}

.field-input {
  height: 48px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  color: var(--foreground);
  font-family: "Geist", sans-serif;
  font-size: 15px;
}

.field-input::placeholder {
  color: var(--text-dim);
}

.field-input:focus {
  outline: none;
}

.role-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 12px 16px;
  background: rgba(13, 110, 110, 0.08);
  border: 1px solid rgba(13, 110, 110, 0.25);
  border-radius: 6px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--accent);
}

.form-error {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--accent-unmatched);
}

.form-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
}

.form-actions .onboarding-cta {
}

.skip-link {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.skip-link:hover {
  color: var(--foreground);
}

.invite-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.example-cards {
  display: flex;
  gap: 24px;
}

.example-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  width: 280px;
  padding: 28px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

.example-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.example-card-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.example-card-file {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-secondary);
}

.example-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
}

.example-download:hover {
  text-decoration: underline;
}

.example-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.example-secondary {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 14px 24px;
}

.example-secondary:hover {
  color: var(--foreground);
  border-color: var(--text-secondary);
}

.add-another {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  padding: 0;
}

.add-another-icon {
  font-size: 16px;
  line-height: 1;
}

.add-another:hover {
  opacity: 0.8;
}

.invite-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(13, 110, 110, 0.06);
  border: 1px solid rgba(13, 110, 110, 0.15);
  border-radius: 6px;
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--accent);
  line-height: 1.4;
}

@media (max-width: 768px) {
  .onboarding-content {
    padding: 24px 16px;
    gap: 24px;
  }

  .onboarding-cta {
    width: 100%;
  }

  .onboarding-headline {
    font-size: 32px;
  }

  .onboarding-subtitle {
    font-size: 16px;
  }

  .onboarding-steps {
    flex-direction: column;
  }

  .onboarding-step {
    width: 100%;
  }

  .onboarding-headline--sm {
    font-size: 28px;
  }

  .onboarding-form {
    width: 100%;
  }

  .example-cards {
    flex-direction: column;
  }

  .example-card {
    width: 100%;
  }

  .example-actions {
    flex-direction: column;
    gap: var(--space-3);
    width: 100%;
  }

  .example-actions form {
    width: 100%;
  }

  .example-secondary {
    width: 100%;
    text-align: center;
  }
}

/* ── Admin panel ─────────────────────────────────────── */

.admin-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 240px;
  min-width: 240px;
  padding: 24px 16px;
  background: var(--bg-surface-alt);
  border-right: 1px solid var(--border-subtle);
}

.admin-sidebar-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 4px;
}

.admin-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}

.admin-sidebar-item--active {
  background: var(--bg-elevated);
  color: var(--foreground);
  font-weight: 500;
}

.admin-sidebar-item:hover {
  background: var(--bg-elevated);
}

.admin-sidebar-icon {
  font-size: 16px;
  width: 16px;
  text-align: center;
}

.admin-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 40px;
}

.admin-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.admin-title {
  font-family: "Playfair Display", serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--foreground);
}

.admin-title--sm {
  font-family: "Geist", sans-serif;
  font-size: 18px;
  font-weight: 600;
}

.pending-invitations {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.invite-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.invite-cancel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 6px;
  border: 1px solid var(--border-primary);
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
}

.invite-cancel:hover {
  border-color: var(--accent);
  color: var(--foreground);
}

.admin-subtitle {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.admin-table {
  border-collapse: collapse;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  overflow: hidden;
}

.admin-table-header {
  background: var(--bg-surface);
}

.admin-table-th {
  text-align: left;
  padding: 12px 20px;
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-table-row {
  border-top: 1px solid var(--border-subtle);
}

.admin-table-row:hover {
  background: var(--bg-hover);
}

.admin-table-cell {
  padding: 16px 20px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-body);
}

.admin-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-success);
  background: rgba(74, 222, 128, 0.1);
}

.admin-stats {
  display: flex;
  gap: var(--space-4);
}

.admin-stat-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

.admin-stat-value {
  font-family: "JetBrains Mono", monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--foreground);
}

.admin-stat-label {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
}

.admin-error {
  padding: 12px 16px;
  background: rgba(217, 60, 21, 0.1);
  border: 1px solid rgba(217, 60, 21, 0.3);
  border-radius: 6px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--destructive);
}

.admin-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}

.admin-delete-btn:hover {
  opacity: 1;
}

.admin-env-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(201, 122, 46, 0.06);
  border: 1px solid rgba(201, 122, 46, 0.19);
  border-radius: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-unmatched);
}

@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
    min-height: calc(100vh - 52px);
  }

  .admin-sidebar {
    display: none;
  }

  .admin-content {
    padding: 24px 16px;
    gap: 16px;
  }

  .admin-stats {
    flex-direction: column;
    gap: 8px;
  }

  .admin-stat-value {
    font-size: 24px;
  }
}

/* ── Mobile top bar (signed-in) ─────────────────────── */

.mobile-top-bar {
  display: none;
}

@media (max-width: 768px) {
  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 16px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
  }

  .mobile-top-bar-hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--foreground);
    cursor: pointer;
  }

  .mobile-top-bar-hamburger-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
  }

  .mobile-top-bar-logo {
    font-family: "JetBrains Mono", monospace;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--foreground);
    text-decoration: none;
  }

  .mobile-top-bar-right {
    display: inline-flex;
    align-items: center;
    gap: 12px;
  }
}

/* ── Mobile drawer (signed-in) ──────────────────────── */

body.mobile-drawer-open {
  overflow: hidden;
}

.mobile-drawer[hidden] {
  display: none;
}

.mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
}

.mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.mobile-drawer-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 320px;
  max-width: 88vw;
  height: 100%;
  padding: 24px 20px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
}

.mobile-drawer--open .mobile-drawer-backdrop {
  opacity: 1;
}

.mobile-drawer--open .mobile-drawer-panel {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 8px;
}

.mobile-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
}

.mobile-drawer-close:hover {
  color: var(--foreground);
}

.mobile-drawer-profile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
}

.mobile-drawer-profile-name {
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.mobile-drawer-profile-email {
  font-family: "Geist", sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
}

.mobile-drawer-divider {
  height: 1px;
  background: var(--border-subtle);
  margin-bottom: 16px;
}

.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-drawer-spacer {
  flex: 1 1 auto;
}

.mobile-drawer-signout {
  margin-top: 16px;
}

.mobile-drawer-signout button {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-secondary);
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.mobile-drawer-signout button:hover {
  color: var(--foreground);
  border-color: var(--accent);
}

/* ── Shared nav ───────────────────────────────────────── */

.site-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px;
  padding: 16px 80px;
}

.site-nav .nav-left { justify-self: start; }
.site-nav .nav-center { justify-self: center; }
.site-nav .nav-links { justify-self: end; }

.site-nav .logo {
  font-family: "JetBrains Mono", monospace;
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: 4px;
  text-decoration: none;
}

.site-nav .nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.site-nav .nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
}

.site-nav .nav-links a:hover {
  color: var(--foreground);
}

/* ── Org switcher ────────────────────────────────────── */

.nav-left {
  display: flex;
  align-items: center;
  gap: 0;
}

.org-switcher {
  position: relative;
}

.org-switcher summary {
  list-style: none;
}

.org-switcher summary::-webkit-details-marker {
  display: none;
}

.org-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  cursor: pointer;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.org-switcher-btn:hover {
  background: var(--bg-elevated);
}

.org-switcher-chevron {
  font-size: 12px;
  color: var(--text-secondary);
}

.org-switcher-single {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.org-switcher-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 100;
}

.org-switcher-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  text-align: left;
}

.org-switcher-item:hover {
  background: var(--bg-hover);
}

.org-switcher-item--active {
  color: var(--foreground);
  font-weight: 500;
}

.org-switcher-check {
  color: var(--accent);
  font-size: 14px;
  width: 14px;
}

.org-switcher-spacer {
  width: 14px;
}

[data-theme="light"] .org-switcher-dropdown {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ── Join banner ─────────────────────────────────────── */

.join-banner {
  gap: var(--space-4);
  height: 56px;
  padding: 0 80px;
  background: rgba(13, 110, 110, 0.08);
  border-bottom: 1px solid rgba(13, 110, 110, 0.19);
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}

.join-banner-switch {
  padding: 4px 12px;
  background: var(--accent);
  color: var(--text-on-accent);
  border: none;
  border-radius: 4px;
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.join-banner-switch:hover {
  background: var(--accent-hover);
}

/* ── Org members ─────────────────────────────────────── */

.org-members-content {
  flex: 1;
  min-width: 0;
  padding: 20px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.org-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-primary);
}

.org-tab {
  padding: 10px 20px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
}

.org-tab--active {
  color: var(--foreground);
  font-weight: 500;
  border-bottom: 2px solid var(--accent);
}

.role-badge-admin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(13, 110, 110, 0.12);
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
}

.role-badge-member {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--bg-hover);
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.role-cards {
  display: flex;
  gap: var(--space-4);
}

.role-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

.role-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-card-desc {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .admin-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .admin-top-bar .onboarding-cta {
    width: 100%;
  }

  .admin-title {
    font-size: 24px;
  }

  /* Card-per-row layout for admin tables */
  .admin-table {
    border: none;
    border-radius: 0;
    width: 100%;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table tbody tr {
    display: block;
    margin-bottom: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border-primary);
    border-radius: 8px;
    background: var(--bg-surface);
  }

  .admin-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border: none;
    font-size: 13px;
    text-align: right;
  }

  .admin-table tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-right: 12px;
    text-align: left;
  }

  .role-cards {
    flex-direction: column;
  }

  .invite-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }

  .invite-actions .onboarding-cta {
    width: 100%;
  }

  .invite-cancel {
    width: 100%;
    text-align: center;
  }

  .usage-cards {
    flex-direction: column;
  }

  .usage-card {
    padding: 16px;
  }

  .usage-card-value {
    font-size: 28px;
  }

  .usage-chart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-2);
  }

  .usage-chart {
    height: 140px;
    gap: 4px;
  }

  .usage-chart-label {
    font-size: 10px;
  }

  .payments-content {
    padding: 24px 16px;
    gap: 16px;
  }

  .payments-card {
    padding: 20px;
    gap: 16px;
  }

  .payments-plan-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .payments-price-amt {
    font-size: 28px;
  }

  .payments-balance-row {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .payments-topup-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Sign-in button ──────────────────────────────────── */

.sign-in-menu {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.sign-in-btn {
  display: inline-block;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1f1f1f;
  background: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  list-style: none;
}

.sign-in-btn::-webkit-details-marker {
  display: none;
}

.sign-in-btn:hover {
  background: #f0f0f0;
  color: #1f1f1f;
}

.sign-in-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 100;
  padding: 0;
}

.sign-in-dropdown .dropdown-item {
  color: #e0e0e0;
  white-space: nowrap;
}

.sign-in-dropdown .dropdown-item:hover {
  color: #ffffff;
}

[data-theme="light"] .sign-in-dropdown {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ── User menu ───────────────────────────────────────── */

.user-menu {
  position: relative;
  cursor: pointer;
  user-select: none;
}

.user-menu summary {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-circle);
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: "Geist", sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-transform: uppercase;
}

.user-name {
  font-size: 14px;
  color: #e0e0e0;
  font-weight: 500;
}

.user-arrow {
  font-size: 12px;
  color: #848484;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  width: 160px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 100;
  padding: 0;
}

.dropdown-item {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  color: #e0e0e0;
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.dropdown-item:hover {
  background: #2a2a2a;
  color: var(--foreground);
}

.dropdown-item--admin {
  color: #C97A2E;
}

.dropdown-item--admin:hover {
  color: #C97A2E;
}

.org-badge-nav {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(13, 110, 110, 0.12);
  border: 1px solid rgba(13, 110, 110, 0.25);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent);
}

[data-theme="light"] .org-badge-nav {
  background: rgba(13, 110, 110, 0.08);
  border-color: rgba(13, 110, 110, 0.2);
}

.admin-badge-nav {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(201, 122, 46, 0.12);
  border: 1px solid rgba(201, 122, 46, 0.25);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1px;
  color: #C97A2E;
  margin-left: 4px;
}

[data-theme="light"] .admin-badge-nav {
  background: rgba(201, 122, 46, 0.08);
  border-color: rgba(201, 122, 46, 0.2);
}

[data-theme="light"] .user-name {
  color: #333333;
}

[data-theme="light"] .user-arrow {
  color: #888888;
}

[data-theme="light"] .user-dropdown {
  background: #ffffff;
  border-color: #e0e0e0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .dropdown-item {
  color: #333333;
}

[data-theme="light"] .dropdown-item:hover {
  background: #f0f0f0;
  color: #111111;
}

/* ── Hero (landing page) ─────────────────────────────── */

/* --- Legal pages --- */

.legal-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
  font-family: "Geist", sans-serif;
  color: var(--text-body);
  line-height: 1.7;
}

.legal-title {
  font-family: "Playfair Display", serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 8px;
}

.legal-updated {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.legal-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 32px;
  margin-bottom: 12px;
}

.legal-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--foreground);
  margin-top: 20px;
  margin-bottom: 8px;
}

.legal-content p {
  margin-bottom: 12px;
}

.legal-content ul {
  margin-bottom: 12px;
  padding-left: 24px;
}

.legal-content li {
  margin-bottom: 4px;
}

.legal-content a {
  color: var(--accent);
}

@media (max-width: 768px) {
  .legal-content {
    padding: 32px 16px 40px;
    line-height: 1.65;
  }

  .legal-title {
    font-size: 28px;
  }

  .legal-updated {
    margin-bottom: 24px;
  }

  .legal-content h2 {
    font-size: 16px;
    margin-top: 24px;
  }

  .legal-content h3 {
    font-size: 14px;
    margin-top: 16px;
  }

  .legal-content p,
  .legal-content li {
    font-size: 14px;
  }
}

.hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.hero h1,
.hero .subline,
.hero > form,
.hero .success,
.hero .trust {
  padding: 0 80px;
}

.hero h1 {
  font-family: "Playfair Display", serif;
  font-size: 60px;
  font-weight: 500;
  color: var(--foreground);
  text-align: center;
  letter-spacing: -1px;
  max-width: 800px;
  margin: auto auto 0;
  padding-bottom: 32px;
}

.hero .subline {
  font-size: 20px;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 32px;
}

.hero .success {
  font-size: 18px;
  color: var(--accent);
  text-align: center;
  margin: 0 auto 32px;
}

.hero > form {
  gap: var(--space-3);
  margin: 0 auto 32px;
}

.hero > form input {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--foreground);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: 0;
  padding: 12px 16px;
  width: 320px;
  height: 48px;
  outline: none;
}

.hero > form input::placeholder {
  color: var(--text-dim);
}

.hero > form input:focus {
}

.hero > form button {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-on-accent);
  background: var(--accent);
  border: none;
  border-radius: 0;
  padding: 12px 28px;
  height: 48px;
  cursor: pointer;
}

.hero > form button:hover {
  background: var(--accent-hover);
}

.hero .trust {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin: 0 auto auto;
  padding-top: 0;
  padding-bottom: 80px;
}

@media (max-width: 768px) {
  .site-nav {
    display: none;
  }

  .site-nav .nav-center {
    display: none;
  }

  .site-nav .nav-links {
    gap: var(--space-3);
  }

  .user-name {
    display: none;
  }

  .user-arrow {
    display: none;
  }

  .hero h1,
  .hero .subline,
  .hero > form,
  .hero .success,
  .hero .trust {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero h1 {
    font-size: 36px;
    letter-spacing: -1px;
    line-height: 1.15;
  }

  .hero .subline {
    font-size: 15px;
    line-height: 1.55;
  }

  .hero > form {
    flex-direction: column;
    width: 100%;
    max-width: 360px;
  }

  .hero > form input,
  .hero > form button {
    width: 100%;
    max-width: none;
  }

  .hero .trust {
    font-size: 12px;
    padding-bottom: 40px;
  }
}

/* ── Reconciliation ─────────────────────────────────────── */

@keyframes fadeSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reconcile {
  min-height: 100vh;
}

.reconcile .content > div {
  animation: fadeSlideIn 300ms ease-out;
}

.reconcile .content {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px 80px;
}

.reconcile h1 {
  font-family: "Playfair Display", serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--foreground);
  text-align: center;
  margin-bottom: 32px;
}

.reconcile .subline,
.reconcile .help-text {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 32px;
}


.theme-toggle {
  background: none;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 10px;
  transition: border-color 0.2s, color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--foreground);
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(13, 110, 110, 0.12);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  line-height: 1;
  transition: background-color 0.2s;
}

.balance-pill:hover {
  background: rgba(13, 110, 110, 0.2);
}

.balance-pill-icon {
  font-size: 12px;
  line-height: 1;
}

.balance-pill--warning {
  background: rgba(140, 28, 0, 0.12);
  border-color: #8C1C00;
  color: #8C1C00;
}

.balance-pill--warning:hover {
  background: rgba(140, 28, 0, 0.2);
}

@media (max-width: 768px) {
  /* Compact pill on mobile: icon + count only. Logo gets breathing room
     and the pill width stays predictable as the count grows. */
  .balance-pill-suffix {
    display: none;
  }
}

.success-toast {
  position: fixed;
  top: 88px;
  right: 32px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--accent, #0D6E6E);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(17, 17, 17, 0.13);
  animation: success-toast-in 0.25s ease-out;
}

@keyframes success-toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.success-toast__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(13, 110, 110, 0.18);
  color: var(--accent, #0D6E6E);
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
}

.success-toast__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.success-toast__headline {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground, #111111);
}

.success-toast__sub {
  font-size: 12px;
  color: var(--accent, #0D6E6E);
}

.success-toast__dismiss {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted, #999999);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.success-toast__dismiss:hover {
  color: var(--foreground, #111111);
}

@media (max-width: 768px) {
  .success-toast {
    top: 64px;
    left: 16px;
    right: 16px;
    padding: 12px 16px;
    gap: 12px;
  }

  .success-toast__icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }

  .success-toast__headline {
    font-size: 13px;
  }

  .success-toast__sub {
    font-size: 11px;
  }
}

.estimate-view {
  max-width: 720px;
  margin: 32px auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.estimate-view__file-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.estimate-view__file-info {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.estimate-view__file-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  background: rgba(13, 110, 110, 0.18);
  color: var(--accent, #0D6E6E);
  border: 1px solid var(--accent, #0D6E6E);
  font-size: 18px;
  line-height: 1;
}

.estimate-view__file-name {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--foreground, #111111);
}

.estimate-view__file-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-secondary, #666666);
}

.estimate-view__change-btn {
  border-radius: var(--radius-full);
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary, #666666);
  font-size: 13px;
  cursor: pointer;
}

.cost-estimate-card {
  padding: 24px;
  background: rgba(13, 110, 110, 0.08);
  border: 1px solid var(--accent, #0D6E6E);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cost-estimate-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent, #0D6E6E);
}

.cost-estimate-card__icon {
  font-size: 16px;
  line-height: 1;
}

.cost-estimate-card__label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
}

.cost-estimate-card__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.cost-estimate-card__headline {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  color: var(--foreground, #111111);
  line-height: 1.1;
}

.cost-estimate-card__sub {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary, #666666);
}

.cost-estimate-card__right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.cost-estimate-card__right-label {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--text-secondary, #666666);
}

.cost-estimate-card__right-value {
  font-size: 18px;
  font-weight: 500;
  color: var(--foreground, #111111);
}

.cost-estimate-card__bar-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cost-estimate-card__bar {
  height: 6px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.cost-estimate-card__bar-fill {
  height: 100%;
  background: var(--accent, #0D6E6E);
  border-radius: var(--radius-full);
  transition: width 0.3s ease-out;
}

.cost-estimate-card__bar-caption {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary, #666666);
}

.estimate-view__actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.estimate-view__secondary,
.estimate-view__primary {
  border-radius: var(--radius-full);
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.estimate-view__secondary {
  padding: 12px 18px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary, #666666);
}

.estimate-view__secondary:hover {
  border-color: var(--accent, #0D6E6E);
  color: var(--accent, #0D6E6E);
}

.estimate-view__primary {
  padding: 12px 22px;
  background: var(--accent, #0D6E6E);
  color: var(--text-on-accent);
  border: none;
  font-weight: 600;
}

.estimate-view__primary:hover {
  background: #0a5757;
}

@media (max-width: 768px) {
  .estimate-view__file-card {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 16px;
  }

  .estimate-view__change-btn {
    width: 100%;
    justify-content: center;
  }

  .cost-estimate-card {
    padding: 16px;
  }

  .cost-estimate-card__row {
    gap: 12px;
  }

  .cost-estimate-card__headline {
    font-size: 24px;
  }

  .cost-estimate-card__right-value {
    font-size: 14px;
  }

  .estimate-view__actions {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .estimate-view__secondary,
  .estimate-view__primary {
    width: 100%;
  }
}

.extract-progress-card {
  max-width: 720px;
  margin: 32px auto;
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: rgba(13, 110, 110, 0.08);
  border: 1px solid var(--accent, #0D6E6E);
  border-radius: var(--radius-lg);
}

.extract-progress-card__header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.extract-progress-card__header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--foreground, #111111);
}

.extract-progress-card__header .subline {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary, #666666);
}

.extract-progress-card__spinner {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: rgba(13, 110, 110, 0.18);
}

.extract-progress-card__title-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.extract-progress-card__page-of {
  font-size: 32px;
  font-weight: 600;
  color: var(--foreground, #111111);
  line-height: 1;
}

.extract-progress-card__percent {
  font-size: 13px;
  color: var(--accent, #0D6E6E);
  letter-spacing: 1px;
}

.extract-progress-card__bar {
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.extract-progress-card__bar-fill {
  height: 100%;
  background: var(--accent, #0D6E6E);
  border-radius: var(--radius-full);
  transition: width 0.3s ease-out;
}

.extract-stats-row {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.extract-stats-row__col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.extract-stats-row__num {
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground, #111111);
}

.extract-stats-row__num--accent {
  color: var(--accent, #0D6E6E);
}

.extract-stats-row__label {
  font-size: 11px;
  color: var(--text-secondary, #666666);
  letter-spacing: 1px;
  text-transform: lowercase;
}

.extract-progress-card__footnote {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary, #666666);
  text-align: center;
}

@media (max-width: 768px) {
  .extract-progress-card {
    margin: 16px auto;
    padding: 24px 20px;
    gap: 20px;
  }

  .extract-progress-card__header h1 {
    font-size: 18px;
    text-align: center;
  }

  .extract-progress-card__header {
    align-items: center;
  }

  .extract-progress-card__page-of {
    font-size: 24px;
  }

  .extract-stats-row {
    gap: 0;
    width: 100%;
    justify-content: space-between;
  }

  .extract-stats-row__col {
    flex: 1;
  }

  .extract-stats-row__num {
    font-size: 16px;
  }

  .extract-stats-row__label {
    font-size: 10px;
  }
}

.insufficient-credits-modal {
  max-width: 520px;
  margin: 64px auto;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(17, 17, 17, 0.12);
}

.insufficient-credits-modal__icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: rgba(140, 28, 0, 0.12);
  color: #8C1C00;
  font-size: 28px;
  line-height: 1;
}

.insufficient-credits-modal__title-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.insufficient-credits-modal__title {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: var(--foreground, #111111);
  text-align: center;
}

.insufficient-credits-modal__subtitle {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary, #666666);
  text-align: center;
}

.insufficient-credits-modal__breakdown {
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
}

.insufficient-credits-modal__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.insufficient-credits-modal__row:last-child {
  border-bottom: none;
}

.insufficient-credits-modal__row-label {
  color: var(--text-secondary, #666666);
}

.insufficient-credits-modal__row-value {
  color: var(--foreground, #111111);
  font-weight: 500;
}

.insufficient-credits-modal__row--shortfall .insufficient-credits-modal__row-label,
.insufficient-credits-modal__row--shortfall .insufficient-credits-modal__row-value {
  color: #8C1C00;
}

.insufficient-credits-modal__row--shortfall .insufficient-credits-modal__row-value {
  font-weight: 600;
}

.insufficient-credits-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.insufficient-credits-modal__primary,
.insufficient-credits-modal__secondary {
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.insufficient-credits-modal__primary {
  padding: 14px 22px;
  background: var(--accent, #0D6E6E);
  color: var(--text-on-accent);
  border: none;
}

.insufficient-credits-modal__primary:hover {
  background: #0a5757;
}

.insufficient-credits-modal__secondary {
  padding: 12px 22px;
  background: transparent;
  color: var(--text-secondary, #666666);
  border: 1px solid var(--border);
  font-weight: 500;
}

.insufficient-credits-modal__secondary[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

.insufficient-credits-modal__hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted, #999999);
  text-align: center;
}

@media (max-width: 768px) {
  .insufficient-credits-modal {
    margin: 16px auto;
    padding: 24px 20px;
    gap: 16px;
  }

  .insufficient-credits-modal__icon {
    width: 56px;
    height: 56px;
    font-size: 24px;
  }

  .insufficient-credits-modal__title {
    font-size: 20px;
  }

  .insufficient-credits-modal__row {
    padding: 12px 16px;
  }

  .insufficient-credits-modal__primary,
  .insufficient-credits-modal__secondary {
    width: 100%;
  }
}

.drop-zones {
  display: flex;
  gap: var(--space-8);
  margin-bottom: 32px;
  justify-content: center;
}

.drop-zone {
  flex-direction: column;
  width: 400px;
  min-height: 240px;
  padding: 32px;
  border: 2px dashed var(--border-primary);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover {
  border-color: var(--accent);
  background: var(--bg-surface-alt);
}

.drop-zone.active {
  border-color: var(--accent);
  background: var(--bg-dropzone-active);
}

.drop-zone .drop-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 16px;
}

.drop-zone .hint {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

.drop-zone .file-name {
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
  margin-bottom: 8px;
}

.drop-zone.processing {
  pointer-events: none;
  cursor: default;
  opacity: 0.7;
  border-color: var(--accent);
  border-style: solid;
}

.drop-zone-processing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-primary);
  border-top-color: var(--accent);
  border-radius: var(--radius-circle);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Reconciling (loading state) ──────────────────────── */

.reconciling-status {
  flex-direction: column;
  gap: var(--space-8);
  min-height: 400px;
}

.pulse-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-circle);
  background: rgba(13, 110, 110, 0.15);
  animation: pulse-glow 2s ease-in-out infinite;
}

.pulse-icon-inner {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-circle);
  background: rgba(13, 110, 110, 0.3);
}

.pulse-icon-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-circle);
  background: var(--accent);
}

@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

.reconciling-status .status-text {
  font-size: 15px;
  color: var(--text-body);
}

.reconciling-details {
  display: flex;
  gap: var(--space-4);
}

.reconciling-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 32px;
  text-align: center;
}

.reconciling-card .value {
  font-family: "JetBrains Mono", monospace;
  font-size: 24px;
  font-weight: 700;
  color: var(--foreground);
}

.reconciling-card .label {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 6px;
}

.preview-table {
  overflow-x: auto;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
}

.preview-table table {
  border-collapse: collapse;
  font-size: 13px;
}

.preview-table thead {
  background: var(--bg-elevated);
}

.preview-table th,
.preview-table td {
  min-width: 80px;
}

.preview-table th {
  padding: 10px 16px;
  text-align: left;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.preview-table thead tr.filter-row th {
  padding: 6px 16px;
  background: var(--bg-surface-alt);
  border-top: 1px solid var(--border-subtle);
}

.preview-table .column-filter {
  font-family: "Geist", sans-serif;
  font-size: 12px;
  color: var(--foreground);
  background: var(--bg-inset);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  outline: none;
  transition: border-color 0.2s;
}

.preview-table .column-filter::placeholder {
  color: var(--text-muted);
}

.preview-table .column-filter:focus {
}

.preview-table td {
  padding: 8px 16px;
  color: var(--text-table);
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  transition: background 0.15s;
}

.matched-section .preview-table tbody tr:hover td,
.unmatched-section .preview-table tbody tr:hover td {
  background: var(--bg-hover);
}

.matched-section .preview-table table {
  table-layout: fixed;
}

.matched-section .preview-table th:nth-child(1) { width: 36px; }
.matched-section .preview-table th:nth-child(2),
.matched-section .preview-table th:nth-child(3) { width: 12%; }
.matched-section .preview-table th:nth-child(4) { width: 10%; }
.matched-section .preview-table th:nth-child(5),
.matched-section .preview-table th:nth-child(6) { width: 26%; }
.matched-section .preview-table th:nth-child(7) { width: 8%; }

.matched-section.has-multi .preview-table th:nth-child(1) { width: 36px; }
.matched-section.has-multi .preview-table th:nth-child(2),
.matched-section.has-multi .preview-table th:nth-child(3) { width: 11%; }
.matched-section.has-multi .preview-table th:nth-child(4),
.matched-section.has-multi .preview-table th:nth-child(5) { width: 9%; }
.matched-section.has-multi .preview-table th:nth-child(6),
.matched-section.has-multi .preview-table th:nth-child(7) { width: 23%; }
.matched-section.has-multi .preview-table th:nth-child(8) { width: 7%; }

.preview-table tr:nth-child(even) td {
  background: var(--bg-surface-alt);
}

.column-mapping {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: 20px;
  margin-bottom: 20px;
}

.column-mapping .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 140px;
}

.column-mapping label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.column-mapping select {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--accent);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  height: 36px;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23848484' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.column-mapping select:focus {
}

.actions {
  display: flex;
  align-items: flex-end;
  gap: var(--space-6);
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-primary);
  margin-bottom: 40px;
}

.actions .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.actions label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.actions select {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--accent);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.actions select:focus {
}

.reconcile h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 20px;
}

.result-tabs {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  height: 44px;
  width: fit-content;
  margin: 0 auto 40px;
}

.result-tab {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  color: var(--text-dim);
  background: none;
  border: none;
  border-radius: var(--radius-md);
  height: 36px;
  padding: 0 16px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.result-tab:hover {
  color: var(--text-secondary);
}

.result-tab.active {
  background: var(--accent);
  color: var(--text-on-accent);
}

/* Default: full label visible, short label hidden. Mobile rule below
   inverts these so all three tabs fit within 390px without scrolling. */
.result-tab-short {
  display: none;
}

.results {
  margin-top: 0;
}

.match-rate {
  text-align: center;
  margin-bottom: 40px;
}

.match-rate .number {
  font-family: "JetBrains Mono", monospace;
  font-size: 56px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.match-rate .caption {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.matched-section {
  margin-bottom: 40px;
}

.matched-section h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--foreground);
}

.matched-section h3::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

.matched-section .preview-table td {
  background: var(--bg-matched);
  border-top-color: var(--border-matched);
}

.matched-section .preview-table tr:nth-child(even) td {
  background: var(--bg-matched-alt);
}

.matched-section .preview-table tr.multi-match td:first-child {
  box-shadow: inset 2px 0 0 var(--accent);
}

.matched-section .preview-table tr.multi-match-first td {
  border-top: 1px solid var(--border-matched);
}

.match-type {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

.unmatched-section {
  margin-bottom: 40px;
}

.unmatched-section h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--foreground);
}

.unmatched-section h3::before {
  content: "";
  width: 4px;
  height: 20px;
  background: var(--accent-unmatched);
  border-radius: 2px;
  flex-shrink: 0;
}

.unmatched-section .preview-table td {
  background: var(--bg-unmatched);
  border-top-color: var(--border-unmatched);
}

.unmatched-section .note {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  margin-bottom: 16px;
}

.pagination {
  gap: var(--space-4);
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination button {
  font-size: 13px;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
}

.pagination button:disabled {
  color: var(--text-muted);
  cursor: default;
  border-color: var(--border-subtle);
}

.btn,
.btn-secondary,
.btn-unmatch,
.btn-review,
.btn-apply,
.btn-match,
.btn-dismiss,
.btn-confirm-match {
  font-family: "Geist", sans-serif;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-on-accent);
  background: var(--accent);
  width: 160px;
  height: 44px;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  width: 160px;
  height: 44px;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  background: var(--accent);
  color: var(--text-on-accent);
}

@media (max-width: 768px) {
  .reconcile .content {
    padding: 32px 16px;
  }

  .reconcile h1 {
    font-size: 28px;
  }

  .drop-zones {
    flex-direction: column;
  }

  .column-mapping {
    flex-direction: column;
  }

  .column-mapping select {
    width: 100%;
  }

  .drop-zone {
    width: 100%;
  }

  .actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
    margin-top: 24px;
    padding-top: 16px;
  }

  .actions .field {
    width: 100%;
  }

  .actions select {
    width: 100%;
  }

  .actions .btn {
    width: 100%;
  }

  .reconciling-status {
    min-height: 320px;
    gap: var(--space-6);
  }

  .reconciling-details {
    width: 100%;
  }

  .reconciling-card {
    flex: 1;
    padding: 16px 12px;
    min-width: 0;
  }

  .reconciling-card .value {
    font-size: 22px;
  }

  .reconciling-card .label {
    font-size: 11px;
  }

  /* Compact match-rate header on mobile so the actual results sit
     closer to the fold. Pre-fix the block was ~150px+; target is <96px. */
  .match-rate {
    margin-bottom: 16px;
  }

  .match-rate .number {
    font-size: 28px;
  }

  .match-rate .caption {
    font-size: 12px;
    margin-top: 4px;
  }

  /* Card layout for results tables on mobile */
  .matched-section .preview-table,
  .unmatched-section .preview-table {
    border: none;
    border-radius: 0;
  }

  .matched-section .preview-table table,
  .unmatched-section .preview-table table {
    table-layout: auto;
  }

  .matched-section .preview-table thead,
  .unmatched-section .preview-table thead {
    display: none;
  }

  .matched-section .preview-table tbody tr,
  .unmatched-section .preview-table tbody tr {
    display: block;
    margin-bottom: 12px;
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .matched-section .preview-table td,
  .unmatched-section .preview-table td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 16px;
    text-align: right;
  }

  /* Override desktop fixed width so checkbox td fills the card */
  .matched-section .preview-table td.checkbox-col,
  .unmatched-section .preview-table td.checkbox-col {
    width: auto;
    justify-content: flex-start;
  }

  .matched-section .preview-table td::before,
  .unmatched-section .preview-table td::before {
    content: attr(data-label);
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 16px;
    flex-shrink: 0;
    text-align: left;
  }

  .matched-section .preview-table tr:nth-child(even) td {
    background: var(--bg-matched-alt);
  }

  .unmatched-section .preview-table tr:nth-child(even) td {
    background: var(--bg-unmatched);
  }

  /* Result tabs: full-width segmented control on mobile. Three tabs share
     the row evenly with shortened labels (per Pencil design fRnaB). */
  .result-tabs {
    width: 100%;
    max-width: 100%;
    padding: 4px;
    gap: 4px;
    height: 40px;
  }

  .result-tab {
    flex: 1;
    min-width: 0;
    padding: 0 8px;
    font-size: 11px;
    height: 32px;
  }

  .result-tab-full {
    display: none;
  }

  .result-tab-short {
    display: inline;
  }

  /* Larger tap target for the row-select checkbox on mobile cards. */
  .matched-section .preview-table input[type="checkbox"],
  .unmatched-section .preview-table input[type="checkbox"] {
    width: 24px;
    height: 24px;
  }

  /* Hide empty Type cells on mobile cards */
  .matched-section .preview-table td.match-type:empty,
  .matched-section .preview-table td.checkbox-col:empty {
    display: none;
  }

}

/* --- Checkbox column --- */

.checkbox-col {
  width: 36px;
  text-align: center;
}

.preview-table tr.selected td {
  background: var(--accent-unmatched-subtle);
}

/* --- Action bars --- */

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin-top: 12px;
  font-size: 13px;
  background: var(--accent-unmatched-bg);
  border: 1px solid var(--accent-unmatched-border);
  color: var(--accent-unmatched);
}

.action-bar span {
  font-weight: 500;
}

.btn-unmatch,
.btn-review,
.btn-apply {
  background: var(--accent-unmatched);
  color: var(--text-on-accent);
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
}

.btn-unmatch:hover,
.btn-review:hover,
.btn-apply:hover {
  opacity: 0.9;
}

/* --- Review tab badge --- */

.result-tab-review {
  gap: 6px;
}

.review-badge {
  background: var(--accent-unmatched);
  color: var(--text-on-accent);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.4;
}

/* --- Review tab content --- */

.review-section {
  padding: 0;
}

.review-section h2 {
  margin-bottom: 12px;
}

.review-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
}

.review-column h3,
.pending-matches-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.review-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}

.review-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.review-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.review-desc {
  font-size: 12px;
  color: var(--text-dim);
}

.review-row-actions {
  display: flex;
  gap: 6px;
}

.btn-dismiss {
  background: none;
  border: 1px solid var(--border-primary);
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.btn-dismiss:hover {
  border-color: var(--text-dim);
  color: var(--text-body);
}

.empty-review {
  color: var(--text-dim);
  font-size: 13px;
  font-style: italic;
  padding: 20px 0;
  text-align: center;
}

.action-bar-apply {
  margin-top: 20px;
}

.action-bar-buttons {
  display: flex;
  gap: var(--space-2);
}

.btn-apply {
  padding: 6px 20px;
}

.btn-match {
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 4px 12px;
  font-size: 12px;
}

.btn-match:hover {
  background: var(--accent-hover);
}

/* --- Pending matches --- */

.pending-matches-section {
  margin-top: 20px;
}

.pending-matches-section h3 {
  margin-bottom: 8px;
}

.pending-match {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  background: var(--accent-unmatched-subtle);
  border: 1px solid var(--accent-unmatched-border);
  border-radius: var(--radius-md);
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--accent-unmatched);
}

/* --- Match picker modal --- */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
}

.match-picker {
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  width: min(480px, calc(100vw - 32px));
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-primary);
}

.picker-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.picker-source {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--accent);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.picker-close {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}

.picker-close:hover {
  color: var(--text-secondary);
}

.picker-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-primary);
}

.picker-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
}

.picker-tab.active {
  color: var(--foreground);
  border-bottom-color: var(--accent);
}

.picker-search {
  padding: 8px 16px;
}

.picker-search input {
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-body);
  font-family: "Geist", sans-serif;
  box-sizing: border-box;
}

.picker-search input::placeholder {
  color: var(--text-dim);
}

.picker-candidates {
  padding: 0 16px;
  overflow-y: auto;
  max-height: 300px;
}

.picker-candidate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.picker-candidate:hover {
  border-color: var(--text-dim);
}

.picker-candidate.selected {
  background: rgba(13, 110, 110, 0.08);
  border-color: var(--accent);
}

.candidate-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.candidate-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.candidate-detail {
  font-size: 11px;
  color: var(--text-secondary);
}

.candidate-check {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-primary);
  border-radius: var(--radius-sm);
  font-size: 11px;
  color: var(--text-on-accent);
}

.candidate-check.checked {
  background: var(--accent);
  border-color: var(--accent);
}

.picker-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  padding: 10px 16px;
  border-top: 1px solid var(--border-primary);
}

.picker-total {
  font-size: 12px;
  color: var(--text-secondary);
}

.total-match {
  color: var(--accent-success);
  font-weight: 600;
}

.total-mismatch {
  color: var(--accent-unmatched);
  font-weight: 600;
}

.btn-confirm-match {
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 500;
}

.btn-confirm-match:hover {
  background: var(--accent-hover);
}

.btn-confirm-match.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============================================================
   Mobile overrides for review, action bars, and match picker.
   Placed AFTER all desktop rules so source order wins.
   ============================================================ */
@media (max-width: 768px) {
  .review-columns {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .review-row {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .review-row-info {
    min-width: 0;
    flex: 1;
  }

  .review-desc {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .action-bar {
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .action-bar-buttons {
    width: 100%;
  }

  .action-bar-buttons .btn-apply,
  .action-bar-buttons .btn-secondary {
    flex: 1;
  }

  .picker-header > div {
    min-width: 0;
    overflow: hidden;
  }

  .picker-total {
    min-width: 0;
  }
}

/* --- Disambiguation modal --- */

.disambig-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.67);
  z-index: 1000;
}

.disambig-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border-primary);
  border-radius: 12px;
  width: min(480px, calc(100vw - 32px));
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 48px rgba(0, 0, 0, 0.5);
}

.disambig-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-primary);
}

.disambig-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.disambig-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--accent);
  background: rgba(13, 110, 110, 0.15);
  padding: 4px 12px;
  border-radius: 12px;
  white-space: nowrap;
}

.disambig-anchor {
  padding: 16px 20px;
}

.disambig-section-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.disambig-bank-card {
  background: var(--bg-matched);
  border: 1px solid var(--border-matched);
  border-radius: 6px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.disambig-bank-card .disambig-desc {
  flex: 1;
  color: var(--foreground);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disambig-bank-card .disambig-date {
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.disambig-bank-card .disambig-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 16px;
  color: var(--accent);
  white-space: nowrap;
}

.disambig-candidates {
  padding: 0 20px 16px;
  overflow-y: auto;
  flex: 1;
}

.disambig-candidate {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  margin-top: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.disambig-candidate:hover {
  background: var(--bg-hover);
}

.disambig-candidate.selected {
  border-color: var(--accent);
  background: rgba(13, 110, 110, 0.1);
}

.disambig-candidate.selected .disambig-candidate-info .disambig-desc {
  color: var(--foreground);
}

.disambig-radio {
  width: 18px;
  height: 18px;
  border-radius: var(--radius-circle);
  border: 2px solid var(--border-primary);
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.disambig-candidate.selected .disambig-radio {
  border-color: var(--accent);
}

.disambig-radio-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-circle);
  background: transparent;
  transition: background 0.15s;
}

.disambig-candidate.selected .disambig-radio-dot {
  background: var(--accent);
}

.disambig-candidate-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.disambig-candidate-info .disambig-desc {
  font-size: 14px;
  color: var(--text-table);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disambig-candidate-info .disambig-date {
  font-size: 12px;
  color: var(--text-secondary);
}

.disambig-candidate .disambig-amount {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--text-table);
  white-space: nowrap;
}

.disambig-candidate.selected .disambig-amount {
  color: var(--foreground);
}

.disambig-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-primary);
  display: flex;
  justify-content: flex-end;
}

.disambig-confirm {
  background: var(--accent);
  color: var(--text-on-accent);
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.disambig-confirm:hover:not(:disabled) {
  background: var(--accent-hover);
}

.disambig-confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --- PDF Review Step --- */

.reconcile .content:has(.pdf-review) {
  max-width: 1600px;
}

.pdf-review {
}

.pdf-review h1 {
  text-align: center;
}

.pdf-review .subline {
  text-align: center;
  margin-bottom: 8px;
}

/* Editing-affordance hint shown under the subtitle on desktop. Mobile
   uses an explicit per-row pencil button so the hint would be noise
   there — hidden via the existing 768px media block below. */
.pdf-review .subline-hint {
  text-align: center;
  margin: 0 0 24px;
  font-size: 12px;
  color: var(--accent);
}

.pdf-review-nav {
  gap: 12px;
  margin-bottom: 24px;
}

.page-indicators {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Desktop shows the full strip; mobile swaps to a 3-dot window. The
   pdf-review nav renders both blocks; CSS just toggles which one is
   visible per viewport (Pencil OXggF, vaudr-ppwt). */
.page-indicators--compact {
  display: none;
}

.page-dot {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-circle);
  border: 1px solid var(--border-primary);
  background: transparent;
  color: var(--text-secondary);
  font-family: "Geist", sans-serif;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.page-dot.active {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
}

.page-dot.confirmed {
  background: var(--bg-matched);
  color: var(--accent);
  border-color: var(--accent);
}

.page-dot.confirmed.active {
  background: var(--accent);
  color: var(--text-on-accent);
}

.pdf-review-split {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  align-items: stretch;
}

.pdf-review-split.dragging {
  cursor: col-resize;
  user-select: none;
}

.pdf-review-divider {
  flex: 0 0 9px;
  cursor: col-resize;
  margin: 0 8px;
}

/* Grip-dots affordance — three vertical dots signal the divider is
   draggable at rest, not just on hover. Tile is 4px wide × 8px tall;
   24px target height shows three dots cleanly (centers at y=4/12/20).
   Pencil ref: PDF Review — Desktop Dark/Light frames, divider node. */
.pdf-review-divider::after {
  content: "";
  width: 4px;
  height: 24px;
  background-image: radial-gradient(circle, var(--text-secondary) 1.6px, transparent 1.8px);
  background-size: 4px 8px;
  background-repeat: repeat-y;
}

.pdf-review-divider:hover::after,
.pdf-review-split.dragging .pdf-review-divider::after {
  background-image: radial-gradient(circle, var(--accent) 2px, transparent 2.2px);
  height: 32px;
}

.pdf-review-image {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pdf-review-image .pdf-page-label {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 600;
  padding-bottom: 12px;
  line-height: 24px;
}

.pdf-review-image img {
  flex: 1;
  object-fit: contain;
  object-position: top;
  border-radius: 8px;
  border: 1px solid var(--border-primary);
}

.pdf-review-table {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pdf-review-table-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
}

.pdf-review-table-header .table-title {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.pdf-review-table-header .row-count {
  font-family: "Geist", sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--secondary);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.pdf-review-table .preview-table {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.pdf-review-table .preview-table table {
  /* Lock column widths at first layout so swapping a cell into edit mode
     (text → input) does not reflow the whole table. Widths are taken
     from the thead row below. */
  table-layout: fixed;
}

.pdf-review-table .preview-table td,
.pdf-review-table .preview-table th {
  white-space: normal;
  word-break: break-word;
}

.pdf-review-table .preview-table th:first-child {
  width: 110px;
}

.pdf-review-table .preview-table td:first-child,
.pdf-review-table .preview-table th:first-child {
  white-space: nowrap;
}

.pdf-review-table .preview-table th:nth-last-child(2),
.pdf-review-table .preview-table th:nth-last-child(3) {
  width: 110px;
}

.pdf-review-table .preview-table td:nth-last-child(2),
.pdf-review-table .preview-table td:nth-last-child(3),
.pdf-review-table .preview-table th:nth-last-child(2),
.pdf-review-table .preview-table th:nth-last-child(3) {
  white-space: nowrap;
  text-align: right;
}

.pdf-review-table .preview-table th:last-child,
.pdf-review-table .preview-table td:last-child {
  width: 44px;
}

.pdf-review-table .preview-table td {
  font-size: 14px;
}

.pdf-review-table .preview-table th {
  font-size: 13px;
}

.pdf-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 8px;
}

/* Editable cells (vaudr-m78r — discoverability):
   - At rest: subtle dashed underline signals "this is interactive".
     Background-image gradient gives crisper rendering than border-bottom
     and stays inside the cell padding box.
   - On hover: cell gets a fill highlight AND a ✎ icon in the right
     padding so the click-to-edit affordance is unambiguous.
   - Editing/row-action cells suppress both cues. */
.pdf-review-table td {
  cursor: pointer;
  transition: background 0.1s ease;
  position: relative;
}

.pdf-review-table tbody td:not(.row-actions):not(.editing) {
  background-image:
    linear-gradient(to right, var(--text-secondary) 50%, transparent 50%);
  background-size: 4px 1px;
  background-repeat: repeat-x;
  background-position: bottom 4px left 0;
}

.pdf-review-table td:hover {
  background-color: var(--secondary);
}

.pdf-review-table tbody td:not(.row-actions):not(.editing):hover::after {
  content: "✎";
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-secondary);
  pointer-events: none;
}

.pdf-review-table td.editing {
  padding: 0;
}

.pdf-review-table td.editing input {
  height: 100%;
  padding: 8px 16px;
  text-align: inherit;
  border: none;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  background: inherit;
  color: var(--foreground);
  font-family: "Geist", sans-serif;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}

.btn-undo-remove {
  margin-left: 0;
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-undo-remove:hover {
  background: var(--accent-hover);
}

.btn-add-row {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: 6px;
  border: none;
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.btn-add-row:hover {
  background: var(--accent-hover);
}

.row-actions {
  width: 32px;
  text-align: center;
}

.btn-delete-row {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}

.btn-delete-row:hover {
  color: var(--color-error-foreground);
  background: var(--secondary);
}

/* Per-row edit affordance, edit-form row, and mobile sticky footer are
   hidden on desktop; activated via mobile media query below. Pencil
   design OXggF. */
.btn-edit-row,
.preview-row-edit-form,
.pdf-review-actions-mobile {
  display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .pdf-review-split {
    flex-direction: column;
  }

  .pdf-review-image {
    /* The desktop splitter writes an inline `flex: <pct> 1 0` on this
       element. Inline styles win over external rules unless we mark
       these as !important — without that, the image collapses to ~0px
       on mobile and the user can't verify extracted data against the
       PDF. Pencil design OXggF specifies a 200px preview at the top. */
    flex: none !important;
    max-height: 252px !important;
    min-height: 200px;
    overflow: hidden;
  }

  .pdf-review-image img {
    max-height: 232px;
    object-fit: cover;
    object-position: top;
  }

  .pdf-review-nav {
    flex-wrap: wrap;
  }

  /* Compact pagination: full strip hidden, 3-dot window visible. */
  .page-indicators--full {
    display: none;
  }

  .page-indicators--compact {
    display: flex;
  }

  /* Hide the desktop actions stack on mobile — replaced by the sticky
     footer below (Pencil design OXggF). */
  .pdf-review-actions {
    display: none;
  }

  .pdf-review-actions-mobile {
    display: flex;
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    gap: 8px;
    padding: 12px 16px;
    margin: 0 -16px -16px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-primary);
    z-index: 10;
  }

  .pdf-review-actions-mobile button {
    flex: 1;
    min-height: 40px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .pdf-review-actions-mobile button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }

  /* Larger row-delete tap target on mobile (WCAG 2.5.5). */
  .btn-delete-row,
  .btn-edit-row {
    min-width: 32px;
    min-height: 32px;
    padding: 8px;
    font-size: 16px;
  }

  .btn-edit-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
  }

  /* When a row is in edit mode, hide the collapsed card and show the
     stacked-form variant in the sibling .preview-row-edit-form row. */
  .pdf-review-table .preview-table tbody tr[data-editing="true"]:not(.preview-row-edit-form) {
    display: none;
  }

  .preview-row-edit-form {
    display: block;
    margin-bottom: 8px;
    padding: 0;
    border: 1px solid var(--accent);
    border-radius: 8px;
    background: rgba(13, 110, 110, 0.08);
  }

  .preview-row-edit-form td {
    display: block;
    padding: 12px;
    border: none;
    text-align: left;
  }

  .preview-row-edit-form td::before {
    content: none;
  }

  .row-edit-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .row-edit-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .row-edit-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
  }

  .row-edit-input {
    height: 32px;
    padding: 4px 8px;
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    background: var(--bg-surface);
    color: var(--foreground);
    font-size: 13px;
    font-family: inherit;
  }

  .row-edit-input:focus {
    outline: none;
    border-color: var(--accent);
  }

  .row-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
  }

  .row-edit-actions button {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    min-height: 32px;
  }

  /* Card-per-row table layout for review on mobile */
  .pdf-review-table .preview-table {
    border: none;
  }

  .pdf-review-table .preview-table table {
    table-layout: auto;
  }

  .pdf-review-table .preview-table thead {
    display: none;
  }

  .pdf-review-table .preview-table tbody tr {
    display: block;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
  }

  .pdf-review-table .preview-table tbody td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border: none;
    font-size: 13px;
    text-align: right;
  }

  .pdf-review-table .preview-table tbody td::before {
    content: attr(data-label);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #666666);
    margin-right: 12px;
    text-align: left;
  }

  .pdf-review-table .preview-table tbody td:last-child {
    width: auto;
    justify-content: flex-end;
    padding-top: 8px;
  }

  .pdf-review-table .preview-table tbody td:last-child::before {
    content: none;
  }

  /* On mobile the per-cell click-to-edit affordance is replaced by the
     explicit pencil button in row-actions; suppress the desktop dashed
     underline + hover ✎ cues to avoid visual noise on stacked cards. */
  .pdf-review-table .preview-table tbody td:not(.row-actions):not(.editing) {
    background-image: none;
  }

  .pdf-review-table .preview-table tbody td:hover::after {
    content: none;
  }

  .pdf-review .subline-hint {
    display: none;
  }
}

/* --- App sidebar --- */

.app-layout {
  display: flex;
  min-height: calc(100vh - 64px);
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 240px;
  min-width: 240px;
  padding: 24px 16px;
  background: var(--bg-surface-alt);
  border-right: 1px solid var(--border-subtle);
}

.app-sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
}

.app-sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--foreground);
}

.app-sidebar-item--active {
  background: var(--sidebar-active-bg);
  color: var(--foreground);
  font-weight: 500;
}

.app-sidebar-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: inherit;
}

.app-sidebar-icon > svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 768px) {
  .app-layout {
    flex-direction: column;
    min-height: calc(100vh - 52px);
  }

  .app-sidebar {
    display: none;
  }

  .org-members-content {
    padding: 24px 16px;
    gap: 16px;
  }
}

.settings-section {
  max-width: 480px;
  padding: 24px 32px;
}

@media (max-width: 768px) {
  .settings-section {
    padding: 24px 16px;
    max-width: 100%;
  }

  .settings-radio {
    padding: 12px 16px;
    gap: 12px;
  }
}

.settings-label {
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  margin-bottom: 4px;
}

.settings-description {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.settings-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: border-color 0.15s;
}

.settings-radio:hover {
  border-color: var(--border-primary);
}

.settings-radio:has(input:checked) {
  border-color: var(--accent);
  background: var(--sidebar-active-bg);
}

.settings-radio input[type="radio"] {
  accent-color: var(--accent);
}

.settings-radio-label {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.settings-radio-example {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-secondary);
}

.settings-saved {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--accent);
  margin-top: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.settings-saved.visible {
  opacity: 1;
}

.app-content {
  flex: 1;
  min-width: 0;
}

/* --- Tour overlay --- */

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
}

.tour-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  pointer-events: auto;
}

.tour-spotlight {
  position: fixed;
  border: 2px solid var(--accent);
  border-radius: 12px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  background: transparent;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1;
}

.tour-tooltip {
  position: fixed;
  width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: auto;
  z-index: 2;
  transition: all 0.3s ease;
}

.tour-tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tour-step-counter {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--accent);
}

.tour-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.tour-close:hover {
  color: var(--foreground);
}

.tour-tooltip-title {
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.tour-tooltip-desc {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-body);
  margin: 0;
}

.tour-tooltip-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tour-skip {
  background: none;
  border: none;
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
}

.tour-skip:hover {
  color: var(--foreground);
}

.tour-tooltip-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tour-back {
  background: none;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 8px 16px;
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
}

.tour-back:hover {
  border-color: var(--accent);
  color: var(--foreground);
}

.tour-next {
  background: var(--accent);
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-family: "Geist", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-on-accent);
  cursor: pointer;
}

.tour-next:hover {
  background: var(--accent-hover);
}

.tour-dots {
  gap: 6px;
}

.tour-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-circle);
  background: #333;
  transition: all 0.2s ease;
}

.tour-dot--active {
  width: 8px;
  height: 8px;
  background: var(--accent);
}

/* --- PDF to Excel converter --- */

.review-pagination {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.review-page-info {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  color: var(--text-secondary);
}

.review-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-primary);
  border-radius: 8px;
}

.review-table {
  border-collapse: collapse;
  font-family: "Geist", sans-serif;
  font-size: 13px;
}

.review-table th {
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 12px;
  text-align: left;
  padding: 10px 16px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-primary);
}

.review-table td {
  padding: 10px 16px;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.review-table tr:last-child td {
  border-bottom: none;
}

/* --- Usage Page --- */

.usage-cards {
  display: flex;
  gap: var(--space-4);
}

.usage-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
}

.usage-card-label {
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.usage-card-value {
  font-family: "Geist", sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: var(--foreground);
}

.usage-card-sub {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-dim);
}

.usage-chart-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.usage-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.usage-chart-title {
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.usage-legend {
  display: flex;
  gap: var(--space-4);
}

.usage-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: "Geist", sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
}

.usage-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.usage-legend-dot--pdf {
  background: var(--accent);
}

.usage-legend-dot--rows {
  background: var(--accent-hover);
}

[data-theme="light"] .usage-legend-dot--rows {
  background: #4DB8B8;
}

.usage-chart {
  display: flex;
  gap: 8px;
  align-items: end;
  height: 180px;
}

.usage-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
}

.usage-chart-bars {
  display: flex;
  gap: 3px;
  align-items: end;
  flex: 1;
}

.usage-bar {
  flex: 1;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}

.usage-bar--pdf {
  background: var(--accent);
}

.usage-bar--rows {
  background: var(--accent-hover);
}

[data-theme="light"] .usage-bar--rows {
  background: #4DB8B8;
}

.usage-chart-label {
  font-family: "Geist", sans-serif;
  font-size: 11px;
  color: var(--text-dim);
}

/* --- Date Picker (react-datepicker) --- */

.date-cell-picker {
  position: relative;
  overflow: visible;
}

.date-cell-picker .react-datepicker-wrapper {
  display: none;
}

.react-datepicker {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-body);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  margin-top: 4px;
  display: inline-block;
  line-height: initial;
}

.react-datepicker__header {
  text-align: center;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 0 4px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}

.react-datepicker__current-month {
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
  padding: 4px 40px 8px;
  text-align: center;
}

.react-datepicker__day-names {
  text-align: center;
  white-space: nowrap;
  margin-bottom: -8px;
}

.react-datepicker__week {
  white-space: nowrap;
}

.react-datepicker__day-name {
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  width: 2.125em;
  line-height: 2.125em;
  display: inline-block;
  text-align: center;
  margin: 0.208em;
}

.react-datepicker__month {
  margin: 0.5em;
  text-align: center;
}

.react-datepicker__day {
  display: inline-block;
  width: 2.125em;
  line-height: 2.125em;
  text-align: center;
  border-radius: var(--radius-sm);
  color: var(--text-body);
  cursor: pointer;
  margin: 0.208em;
}

.react-datepicker__day:hover {
  background: var(--bg-hover);
  color: var(--foreground);
}

.react-datepicker__day--selected {
  background: var(--accent);
  color: var(--text-on-accent);
  font-weight: 600;
}

.react-datepicker__day--selected:hover {
  background: var(--accent-hover);
}

.react-datepicker__day--keyboard-selected {
  background: var(--sidebar-active-bg);
  color: var(--foreground);
}

.react-datepicker__day--today {
  font-weight: 700;
  color: var(--accent);
}

.react-datepicker__day--today.react-datepicker__day--selected {
  color: var(--text-on-accent);
}

.react-datepicker__day--outside-month {
  color: var(--text-muted);
}

.react-datepicker__navigation {
  background: none;
  text-align: center;
  cursor: pointer;
  position: absolute;
  top: 2px;
  padding: 0;
  border: none;
  z-index: 1;
  height: 32px;
  width: 32px;
  text-indent: -999em;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.react-datepicker__navigation:hover {
  background: var(--bg-hover);
}

.react-datepicker__navigation--previous {
  left: 2px;
}

.react-datepicker__navigation--next {
  right: 2px;
}

.react-datepicker__navigation-icon {
  position: relative;
  top: -1px;
  font-size: 20px;
  width: 0;
}

.react-datepicker__navigation-icon::before {
  content: "";
  display: block;
  position: absolute;
  top: 6px;
  border-color: var(--text-secondary);
  border-style: solid;
  border-width: 3px 3px 0 0;
  height: 9px;
  width: 9px;
}

.react-datepicker__navigation-icon--previous {
  right: -2px;
}

.react-datepicker__navigation-icon--previous::before {
  transform: rotate(225deg);
  right: -7px;
}

.react-datepicker__navigation-icon--next {
  left: -2px;
}

.react-datepicker__navigation-icon--next::before {
  transform: rotate(45deg);
  left: -7px;
}

.react-datepicker__month-container {
  float: left;
}

.react-datepicker__aria-live,
.react-datepicker__sr-only {
  position: absolute;
  clip-path: circle(0);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

h2.react-datepicker__current-month {
  padding: 0;
  margin: 0;
}

.payments-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 40px;
}

.payments-card {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-primary);
}

.payments-card-title {
  margin: 0;
  font-family: "Geist", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.payments-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.payments-plan-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payments-plan-label {
  font-family: "Geist", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.payments-plan-name {
  font-family: "Geist", sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--foreground);
}

.payments-plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.payments-price-amt {
  font-family: "JetBrains Mono", monospace;
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
}

.payments-price-per {
  font-family: "Geist", sans-serif;
  font-size: 14px;
  color: var(--text-dim);
}

.payments-plan-desc {
  margin: 0;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-dim);
}

.payments-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.payments-balance-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payments-balance-amt {
  font-family: "JetBrains Mono", monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--foreground);
}

.payments-balance-sub {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-dim);
}

.payments-topup-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md, 6px);
  background: var(--accent);
  color: var(--text-on-accent);
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease;
}

.payments-topup-btn:hover {
  background: var(--accent-hover);
}

.payments-member-note {
  font-family: "Geist", sans-serif;
  font-size: 13px;
  color: var(--text-dim);
  max-width: 280px;
  text-align: right;
  margin: 0;
  line-height: 1.4;
}

.payments-topup-plus {
  font-size: 16px;
  line-height: 1;
}

.payments-topup-btn[disabled] {
  opacity: 0.6;
  cursor: progress;
}

.payments-success-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 8px;
  background: rgba(13, 110, 110, 0.08);
  border: 1px solid rgba(13, 110, 110, 0.25);
}

.payments-success-banner-icon {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}

.payments-success-banner-text {
  flex: 1;
  font-family: "Geist", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}

.payments-success-banner-dismiss {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-dim);
  font-family: "Inter", sans-serif;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.payments-success-banner-dismiss:hover {
  color: var(--foreground);
}
