/* Shared type scale. Page styles own colours and layout, these tokens own size. */
:root {
  --type-page-title: clamp(42px, 6.5vw, 88px);
  --type-section-title: clamp(30px, 4vw, 46px);
  --type-card-title: 22px;
  --type-body: 16px;
  --type-intro: 20px;
  --type-control: 16px;
  --type-label: 14px;
  --type-caption: 13px;
  --type-metric: 28px;
  --type-nav: 14px;
  --type-footer: 12px;
}
body { font-size: var(--type-body); }
body.dashboard-wallpaper :is(#analysis, #financial-report, #trade-history, #statistics, #backtest, #tradingeye) :is(.analysis-title, .trade-history-title, .api-page-heading h2, .backtest-heading h2, .tradingeye-heading h2),
body #landing-screen :is(#landing-title, #landing-title span), body .legal-page > h1 {
  font-size: var(--type-page-title); line-height: 1.08; letter-spacing: -.025em; font-weight: 400;
}
body #landing-screen .landing-description,
body #backtest .backtest-intro { font-size: var(--type-intro); line-height: 1.45; letter-spacing: 0; }
body :is(#analysis, #financial-report) .article-header h3,
body #statistics :is(.panel-title, .chart-header h3),
body #backtest :is(.backtest-chart-panel, .backtest-table-panel) h3,
body .legal-page :is(h2, h3) { font-size: var(--type-card-title); line-height: 1.35; }
body #backtest .backtest-results-title, body #financial-report .report-empty h3 { font-size: var(--type-section-title); line-height: 1.2; }
body :is(#analysis, #financial-report) .article-body,
body #financial-report .report-empty p { font-size: var(--type-body); line-height: 1.65; }
body :is(#analysis, #financial-report) :is(.analysis-topic, .analysis-admin-field),
body #statistics .stat-card h3, body #backtest .backtest-metric span,
body #landing-screen :is(.stat-label, .landing-stat-unit),
body #backtest .backtest-form label, body .strategy-admin-fields label {
  font-size: var(--type-label); line-height: 1.4; letter-spacing: 0;
}
body #landing-screen .stat-label { min-height: 2.8em; }
body #statistics .stat-card .stat-value, body #backtest .backtest-metric strong,
body #landing-screen .stat-val { font-size: var(--type-metric); line-height: 1.2; letter-spacing: -.025em; font-weight: 400; }
body #landing-screen #land-status { font-size: var(--type-card-title); }
body :is(#analysis, #financial-report) .article-header small,
body #landing-screen .landing-api-name,
body #statistics :is(.allocation-percent, .muted-text),
body #backtest :is(.backtest-note, .backtest-status), body .post-form-status { font-size: var(--type-caption); line-height: 1.5; }
body #statistics .allocation-row { font-size: var(--type-label); }
body :is(#statistics, #trade-history, #backtest) .trades-table :is(th, td) { font-size: var(--type-label); line-height: 1.4; }
body #trade-history .trades-table :is(.badge, .muted-cell) { font-size: var(--type-caption); }
body #landing-screen .btn-explore, body #tradingeye .tradingeye-expand,
body #backtest :is(#backtest-run, .backtest-advanced-toggle, .backtest-categories .nav-btn),
body #trade-history :is(.api-history-source, .trade-search, .trade-side-filter button),
body #statistics .api-preset-picker .glass-select-trigger,
body #backtest .backtest-field-control :is(input, .glass-select-trigger, .glass-date-trigger),
body :is(.admin-form, .strategy-admin-fields, .capital-form) :is(input, textarea, select, button),
body :is(.glass-select-trigger, .glass-date-trigger, .pagination-controls button) {
  font-size: var(--type-control); line-height: 1.4;
}
body .pagination-controls { font-size: var(--type-label); }
body.dashboard-wallpaper .platform-header nav .nav-btn { font-size: var(--type-nav); line-height: 1.4; }
body.dashboard-wallpaper .sidebar-menu .sidebar-link { font-size: var(--type-control); line-height: 1.4; }
body.dashboard-wallpaper .sidebar-menu :is(#sidebar-title, .sidebar-group-label) { font-size: var(--type-label); line-height: 1.4; }
body :is(.copyright, .footer-link, .footer-link-btn) { font-size: var(--type-footer); line-height: 1.5; }
@media (max-width: 640px) {
  :root { --type-card-title: 20px; --type-intro: 18px; --type-metric: 24px; --type-nav: 13px; }
}
/* Compact chart mode deliberately preserves space for the plot. */
body.tradingeye-expanded #tradingeye .tradingeye-heading h2 { font-size: var(--type-card-title); }
body.tradingeye-expanded .platform-header nav .nav-btn { font-size: var(--type-caption); }
body.tradingeye-expanded :is(.footer-link, .footer-link-btn) { font-size: var(--type-footer); }
body :is(.glass-select-option, .glass-date-month, .glass-date-year),
body #backtest .backtest-indicator-fields input,
body :is(.admin-login-dialog, .strategy-delete-dialog) :is(input, button) { font-size: var(--type-control); }
body #backtest .backtest-indicator-fields label { font-size: var(--type-label); }
body :is(.admin-login-dialog, .strategy-delete-dialog) h3 { font-size: var(--type-card-title); }
body :is(.admin-login-dialog, .strategy-delete-dialog) p { font-size: var(--type-body); line-height: 1.5; }
body :is(.backtest-admin, .api-admin) > summary { font-size: var(--type-control); }
body #statistics .tf-btn { font-size: var(--type-label); }

@media (max-width: 640px) { body #landing-screen #land-status { font-size: var(--type-control); } }
