/* Shared type scale. Load after component styles; keep layout and data displays local. */
:root {
  --type-hero: 48px;
  --type-section: 30px;
  --type-page: 24px;
  --type-group: 20px;
  --type-card: 16px;
  --type-dialog: 20px;
  --type-price: 32px;
  --type-body: 14px;
  --type-table: 13px;
  --type-helper: 12px;
  --type-chart: 11px;
  --type-weight-normal: 400;
  --type-weight-medium: 500;
  --type-weight-semibold: 600;
  --type-weight-bold: 700;
  --type-leading-title: 1.35;
  --type-leading-body: 1.7;
  --type-leading-control: 1.5;
  --type-leading-table: 1.6;
}

/* Exclude the overview from inherited changes to retain its established rhythm. */
#home,
#auth .auth-card,
#reset-password .auth-card,
#dashboard .dashboard-section:not(.overview-section),
#ops .ops-shell,
#modal-content,
#modal-content .account-management,
#modal-content .member-detail-block {
  font-size: var(--type-body);
  line-height: var(--type-leading-body);
}

#home .hero h1 {
  font-size: var(--type-hero);
  font-weight: var(--type-weight-bold);
  line-height: 1.2;
  letter-spacing: -.02em;
}

#home :is(.heading h2, .developers h2, .security h2, .contact h2) {
  font-size: var(--type-section);
  font-weight: var(--type-weight-bold);
  line-height: var(--type-leading-title);
  letter-spacing: -.02em;
}

#home :is(.hero p, .feature > p, .developers > div > p, .contact > div > p,
  .heading > p, .price-grid p, .price-grid ul, .member-public-invite p),
#pricing .heading > div > p {
  font-size: var(--type-body);
  line-height: var(--type-leading-body);
}

/* The centered pricing heading nests its paragraph one level deeper. */
#pricing .heading > div > p {
  max-width: 62ch;
  margin: 12px auto 0;
  color: var(--muted);
}

#home :is(.feature h3, .price-grid h3, .member-public-invite h3) {
  font-size: var(--type-card);
  font-weight: var(--type-weight-semibold);
  line-height: var(--type-leading-control);
}

#home .price-grid > article > strong,
#dashboard .member-plan > strong {
  font-size: var(--type-price);
  font-weight: var(--type-weight-bold);
  line-height: 1.25;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}

#home .price-grid > article > strong > small,
#dashboard .member-plan > strong > small {
  font-size: var(--type-body);
  font-weight: var(--type-weight-normal);
  letter-spacing: 0;
}

#home :is(.eyebrow, .price-grid h3 > small, .price-grid label, .note, .pills span),
#pricing > .settings-note {
  font-size: var(--type-helper);
  line-height: var(--type-leading-table);
}

#pricing > .settings-note {
  max-width: 88ch;
  margin: 20px auto 0;
  color: var(--muted);
}

/* Page context is stronger than card titles, without touching sidebar branding. */
#dashboard .workbench-heading h1,
#ops .ops-header h1 {
  font-size: var(--type-page);
  font-weight: var(--type-weight-bold);
  line-height: var(--type-leading-title);
  letter-spacing: -.02em;
}

#dashboard .dashboard-section:not(.overview-section) > .section-heading h2,
#ops .ops-readiness-heading h2 {
  font-size: var(--type-group);
  font-weight: var(--type-weight-semibold);
  line-height: 1.4;
  letter-spacing: -.01em;
}

#dashboard .dashboard-section:not(.overview-section) .panel h3,
#dashboard .dashboard-section:not(.overview-section) .docs-reference h3,
#ops .panel :is(h2, h3),
#ops .ops-readiness-next :is(h3, h4),
#modal-content .account-management .account-card :is(h3, h4) {
  font-size: var(--type-card);
  font-weight: var(--type-weight-semibold);
  line-height: var(--type-leading-control);
  letter-spacing: 0;
}

#dashboard .member-plan :is(p, ul),
#dashboard .member-rule-card p,
#dashboard .member-invite > p,
#dashboard .dashboard-section:not(.overview-section) :is(.ticket-row p, .recon-card > p),
#ops .ops-ticket p {
  font-size: var(--type-body);
  line-height: var(--type-leading-body);
}

#home .btn,
#auth .btn,
#reset-password .btn,
#dashboard .dash-tools .btn,
#dashboard .dashboard-section:not(.overview-section) .btn,
#dashboard .dashboard-section:not(.overview-section) .link-button,
#ops .ops-shell .btn,
#ops .ops-shell .link-button,
#ops .ops-panel-error button,
#ops .ops-page-button,
#ops .ops-shortcut-grid b,
#ops .ops-todo > span:first-child b,
#ops .ops-activity-item b,
#modal-content .btn,
#modal-content .link-button,
#modal-content .account-tabs > button {
  font-size: var(--type-body);
  font-weight: var(--type-weight-semibold);
  line-height: var(--type-leading-control);
}

#modal-content .account-tabs > button.active {
  font-weight: var(--type-weight-bold);
}

#auth .auth-card label,
#reset-password .auth-card label,
#dashboard .dashboard-section:not(.overview-section) :is(label:not(.status), .onboarding-panel label:not(.status)),
#ops .ops-filter-field > span,
#modal-content label {
  font-size: var(--type-body);
  line-height: var(--type-leading-control);
}

#auth .auth-card :is(input:not([type=checkbox]), select, textarea),
#reset-password .auth-card :is(input:not([type=checkbox]), select, textarea),
#dashboard .dashboard-section:not(.overview-section) :is(input:not([type=checkbox]), select, textarea),
#dashboard .mobile-section select,
#ops .ops-shell :is(input:not([type=checkbox]), select, textarea),
#modal-content :is(input:not([type=checkbox]), select, textarea) {
  font-family: inherit;
  font-size: var(--type-body);
  line-height: var(--type-leading-control);
}

#dashboard .workbench-heading .eyebrow,
#dashboard .dashboard-section:not(.overview-section) :is(.eyebrow, .section-heading p,
  .panel > header small, .member-note, .member-current p, .member-current > div > small,
  .member-plan > small, .member-balance-grid small, .member-rate-headline > span,
  .member-rate-details summary, .member-rate-item, .member-rate-item b,
  .member-rule-card small, .app-meta small, .wallet-card small, .wallet-card > span,
  .transaction-row small, .ticket-row time, .fee-cards small, .fee-cards span,
  .referral-summary small, .referral-summary span, .merchant-detail-sync,
  .merchant-settlement-panel header small, .merchant-settlement-panel .settings-note,
  .recon-sync-bar small, .provider-match, .terminal-summary small, .terminal-summary span,
  .terminal-form-note, .terminal-notice, .onboarding-notice, .onboarding-notice small,
  .onboarding-task span, .onboarding-task small, .onboarding-step small,
  .onboarding-panel-heading p, .onboarding-gated-note, .onboarding-channel-grid span,
  .onboarding-upload-placeholder span, .onboarding-sync-placeholder span,
  .onboarding-form-footer > span, .onboarding-file-status, .onboarding-default-settlement) {
  font-size: var(--type-helper);
  line-height: var(--type-leading-table);
}

/* ID-scoped overrides also win over the legacy 10px operations captions. */
#ops .ops-muted,
#ops .ops-panel .panel > p.ops-muted,
#ops .ops-panel header .ops-muted,
#ops .ops-header p,
#ops .ops-header .eyebrow,
#ops .ops-stat-heading small,
#ops .ops-stat-caption,
#ops .ops-section-kicker,
#ops .panel header p,
#ops .ops-todo small,
#ops .ops-shortcut-grid span,
#ops .ops-readiness-heading p,
#ops .ops-readiness-heading .eyebrow,
#ops .ops-readiness-meta,
#ops .ops-readiness-link,
#ops .ops-readiness-gate small,
#ops .ops-activity-item small,
#ops .ops-activity-item time,
#ops .ops-pagination,
#ops .ops-page-size,
#ops .account-list-summary small {
  font-size: var(--type-helper);
  line-height: var(--type-leading-table);
}

#dashboard .dashboard-section:not(.overview-section) .ops-muted,
#dashboard .dashboard-section:not(.overview-section) .status,
#ops .ops-panel .status,
#modal-content :is(.modal-subtitle, .member-note, .settings-note, .ops-muted, .status,
  .account-note, .account-chip, .account-shell-heading > small, .account-shell-heading p,
  .account-stat > span, .account-data-row dt, .account-data-row dd,
  .account-card label small, .account-table-wrap td > small,
  .account-timeline p, .account-timeline small, .account-timeline time,
  .account-pagination, .member-form-error, .account-form-error) {
  font-size: var(--type-helper);
  line-height: var(--type-leading-table);
}

/* Dialogs are outside #ops; style both merchant and administrator dialogs here. */
#modal-content > h2,
#modal-content .account-management h2 {
  font-size: var(--type-dialog);
  font-weight: var(--type-weight-bold);
  line-height: 1.4;
  letter-spacing: -.01em;
}

#modal-content > p,
#modal-content [data-member-form] > p:not(.member-note):not(.member-form-error) {
  font-size: var(--type-body);
  line-height: var(--type-leading-body);
}

/* Keep captions quieter than the main text even when they are direct children. */
#modal-content > :is(.modal-subtitle, .member-note, .settings-note, .ops-muted) {
  font-size: var(--type-helper);
  line-height: var(--type-leading-table);
}

#modal-content .account-copy {
  font-size: var(--type-helper);
  line-height: var(--type-leading-control);
}

/* Table copy shares one scale; numeric amounts, identifiers and secrets keep their own styles. */
#dashboard .dashboard-section:not(.overview-section) table,
#ops .ops-panel table,
#modal-content:not(:has(.account-management)) .table-scroll table,
#modal-content .account-management table {
  font-size: var(--type-table);
  line-height: var(--type-leading-table);
}

#dashboard .dashboard-section:not(.overview-section) td,
#ops .ops-panel td,
#ops .ops-panel td b,
#modal-content:not(:has(.account-management)) .table-scroll td,
#modal-content .account-management td {
  font-size: var(--type-table);
}

#dashboard .dashboard-section:not(.overview-section) th,
#ops .ops-panel th,
#modal-content:not(:has(.account-management)) .table-scroll th,
#modal-content .account-management th {
  font-size: var(--type-helper);
  font-weight: var(--type-weight-semibold);
  line-height: var(--type-leading-table);
}

#dashboard .overview-section :is(.overview-chart-y, .overview-chart-labels,
  .overview-chart-tooltip, .overview-chart-tooltip strong) {
  font-size: var(--type-chart);
}

/* Later layout guardrails formerly restored two columns between 701 and 800px. */
@media (max-width: 800px) {
  #dashboard .member-current,
  #dashboard .member-plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 650px) {
  :root {
    --type-hero: 36px;
    --type-section: 26px;
    --type-page: 22px;
    --type-group: 18px;
    --type-dialog: 18px;
    --type-price: 28px;
  }
}
