/* Shared finishing layer for internal pages only. The public homepage is intentionally excluded. */
:root {
  --rb-space-1: 8px;
  --rb-space-2: 16px;
  --rb-space-3: 24px;
  --rb-space-4: 32px;
  --rb-surface-radius: 16px;
  --rb-control-radius: 10px;
  --rb-control-height: 40px;
  --rb-control-height-large: 44px;
}

body.catalog-page,
body.detail-page,
body.account-page,
body.docs-page,
body.chat-page,
body.workspace-page,
body.seo-page {
  --radius-card: 16px;
  --radius-dialog: 20px;
  --control-height: 40px;
  --control-height-large: 44px;
  font-size: 14px;
  line-height: 1.6;
}

body.detail-page {
  --bg: #0a0a0b;
  --panel: #111112;
  --panel-2: #171719;
  --line: #29292d;
  --line-strong: #414147;
}
:root[data-theme="light"] body.detail-page {
  --bg: #fafafa;
  --panel: #f3f3f5;
  --panel-2: #ededf0;
  --line: #e2e2e7;
  --line-strong: #c9c9d2;
}

/* The selectors below remain page-scoped so index.html keeps its exact styling. */

body.catalog-page :is(input, select, textarea, button),
body.detail-page :is(input, select, textarea, button),
body.account-page :is(input, select, textarea, button),
body.docs-page :is(input, select, textarea, button),
body.chat-page :is(input, select, textarea, button),
body.workspace-page :is(input, select, textarea, button),
body.seo-page :is(input, select, textarea, button) {
  font-family: var(--font-sans, Onest, sans-serif);
}

body.catalog-page :is(input, select),
body.account-page :is(input, select),
body.docs-page :is(input, select),
body.workspace-page :is(input, select),
body.seo-page :is(input, select) {
  min-height: var(--rb-control-height);
  border-radius: var(--rb-control-radius);
}

body.catalog-page .catalog-search input,
body.catalog-page .catalog-sort select { height: var(--rb-control-height-large); }

body.catalog-page .catalog-card,
body.catalog-page .catalog-card.is-featured,
body.detail-page .metric-card,
body.detail-page .spec-card,
body.detail-page .chart-card,
body.account-page .account-card,
body.account-page .finance-balance-card,
body.account-page .finance-small-card,
body.account-page .settings-card,
body.account-page .master-info,
body.docs-page .docs-search,
body.docs-page .docs-reading,
body.workspace-page .rb-panel,
body.seo-page .seo-table-scroll {
  border-radius: var(--rb-surface-radius);
}

body.catalog-page .catalog-grid { gap: 16px; }
body.catalog-page .catalog-card,
body.catalog-page .catalog-card.is-featured { padding: 24px; }
body.catalog-page .catalog-head h1 { font-size: 32px; line-height: 1.2; }
body.catalog-page .catalog-name-row h2 { font-size: 18px; }

body.detail-page .detail-main > .shell { max-width: 1080px !important; }
body.detail-page .hero-title-row h1 { font-size: 40px; line-height: 1.2; }
body.detail-page .section-heading h2 { font-size: 24px; line-height: 1.3; }
body.detail-page .caching-section .section-heading h2 { font-size: 18px; line-height: 1.2; }
body.detail-page .content-section { margin-bottom: 40px; }
body.detail-page .pricing-section { margin-bottom: 8px; }
body.detail-page .pricing-panel,
body.detail-page .caching-section,
body.detail-page .metric-card,
body.detail-page .capability-item,
body.detail-page .cache-rates > div,
body.detail-page .table-wrap,
body.detail-page .table-card,
body.detail-page .spec-uptime,
body.detail-page .model-stability-card { border-radius: var(--rb-surface-radius); }
body.detail-page .model-tags { gap: 8px; }

body.account-page .account-head h1 { font-size: 32px; line-height: 1.25; }
body.account-page .account-head { margin-bottom: 24px; }
body.account-page :is(.account-card, .spend-card, .model-spend-card) { padding: 24px; }
body.account-page .account-card-head { padding: 20px 24px; }
body.account-page .account-head-actions .btn,
body.account-page .stats-filterbar .btn { min-height: var(--rb-control-height); height: var(--rb-control-height); font-size: 13px; }
body.account-page .account-select { min-height: var(--rb-control-height); height: var(--rb-control-height); font-size: 13px; }
body.account-page .date-field-button { min-height: var(--rb-control-height); height: var(--rb-control-height); font-size: 12px; }

body.docs-page .docs-shell { gap: 32px; }
body.docs-page .docs-reading { line-height: 1.7; }
body.docs-page .docs-reading :is(h1, h2, h3) { line-height: 1.3; }
body.docs-page .docs-reading h1 { font-size: 36px; }
body.docs-page .docs-reading h2 { font-size: 26px; }
body.docs-page .docs-search input { min-height: 0; }

body.chat-page .chat-layout { font-size: 14px; }
body.chat-page .chat-composer,
body.chat-page .chat-picker,
body.chat-page .chat-delete-dialog { border-radius: var(--rb-surface-radius); }
body.chat-page .chat-send,
body.chat-page .chat-attach,
body.chat-page .chat-icon-button { min-width: 40px; min-height: 40px; }

body.workspace-page:not(.docs-page):not(.chat-page) .rb-page-head h1 { font-size: 36px; line-height: 1.25; }
body.workspace-page:not(.docs-page):not(.chat-page) .rb-panel { padding: 24px; }
body.workspace-page[data-section="connections"] .rb-pages { max-width: 1280px; }
body.workspace-page[data-section="connections"] .rb-pages :is(.rb-panel, .rb-code) { border-radius: var(--rb-surface-radius); }
body.workspace-page[data-section="connections"] .rb-tool { border-radius: var(--rb-control-radius); }
body.workspace-page[data-section="connections"] .rb-actions .btn { min-height: var(--rb-control-height); }
body.workspace-page[data-section="connections"] .rb-field :is(input, select) { min-height: var(--rb-control-height); }
body.workspace-page[data-section="connections"] .rb-tabs button,
body.workspace-page[data-section="connections"] .rb-code-head button { min-height: 36px; }

body.seo-page .seo-heading h1 { font-size: 40px; line-height: 1.2; }
body.seo-page .seo-heading p,
body.seo-page .seo-prose p,
body.seo-page .seo-prose li { line-height: 1.7; }
body.seo-page .seo-prose h2 { font-size: 25px; line-height: 1.3; }
body.seo-page .seo-table-scroll { border: 1px solid var(--line); }

@media (max-width: 760px) {
  body.catalog-page .catalog-card,
  body.catalog-page .catalog-card.is-featured { padding: 20px 18px; }
  body.catalog-page .catalog-head h1 { font-size: 28px; }
  body.detail-page .hero-title-row h1 { font-size: 32px; }
  body.detail-page .section-heading h2 { font-size: 22px; }
  body.detail-page .content-section { margin-bottom: 32px; }
  body.detail-page .pricing-section { margin-bottom: 8px; }
  body.account-page .account-head h1 { font-size: 27px; }
  body.account-page :is(.account-card, .spend-card, .model-spend-card) { padding: 18px; }
  body.account-page .account-card-head { padding: 18px; }
  body.docs-page .docs-shell { gap: 20px; }
  body.docs-page .docs-reading h1 { font-size: 30px; }
  body.docs-page .docs-reading h2 { font-size: 22px; }
  body.workspace-page[data-section="connections"] .rb-page-head h1 { font-size: 30px; }
  body.seo-page .seo-heading h1 { font-size: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  body.catalog-page *,
  body.detail-page *,
  body.account-page *,
  body.docs-page *,
  body.chat-page *,
  body.workspace-page *,
  body.seo-page *,
  body.catalog-page *::before,
  body.catalog-page *::after,
  body.detail-page *::before,
  body.detail-page *::after,
  body.account-page *::before,
  body.account-page *::after,
  body.docs-page *::before,
  body.docs-page *::after,
  body.chat-page *::before,
  body.chat-page *::after,
  body.workspace-page *::before,
  body.workspace-page *::after,
  body.seo-page *::before,
  body.seo-page *::after {
    scroll-behavior: auto;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
