/* Shared reading hierarchy, independent of appearance. Keep review geometry intact. */
body[data-theme] {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body[data-theme] :is(button, input, select, textarea) { font-family: inherit; }
/* One hierarchy for every Settings tab, including dynamically loaded metrics. */
body[data-theme] .settings-page { font-size: 14px; line-height: 1.5; }
body[data-theme] .settings-page .page-title { font-size: 30px; font-weight: 600; line-height: 1.2; }
body[data-theme] .settings-page .settings-card-heading h2 { font-size: 18px; font-weight: 600; line-height: 1.35; }
body[data-theme] .settings-page :is(.settings-eyebrow, .settings-card-heading span) {
    font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: .1em;
}
body[data-theme] .settings-page :where(button, select, input, .settings-account-row a, .profile-edit-link) {
    font-size: 14px; line-height: 1.5; font-weight: 500;
}
body[data-theme] .settings-page :is(select, input) { font-weight: 400; }
body[data-theme] .settings-page :is(.settings-field > span, .settings-preference-row strong, .settings-topics-toggle strong, .settings-import-modes legend, .settings-import-modes strong, .settings-account-row strong, .settings-readiness-overview strong, .settings-readiness-row strong, .settings-evaluation-result strong) {
    font-size: 14px; font-weight: 500; line-height: 1.5; text-transform: none; letter-spacing: normal;
}
body[data-theme] .settings-page :is(.settings-card-description, .settings-message, .settings-inline-error) {
    font-size: 13px; font-weight: 400; line-height: 1.6;
}
body[data-theme] .settings-page :is(small, .settings-account-row span, .settings-actions > span, .settings-local-warning, .settings-readiness-overview span, .settings-readiness-row span, .settings-profile-state, .settings-evaluation-result span, .settings-import-progress > div, .settings-readiness-row b) {
    font-size: 12px; font-weight: 400; line-height: 1.5;
}
body[data-theme] .settings-page :is(.settings-topics-panel span, .settings-topics-toggle > span:last-child) { font-size: 13px; font-weight: 500; }
body[data-theme] .settings-page .settings-nav { align-items: stretch; }
body[data-theme] .settings-page .settings-nav button {
    flex: 1 0 0; justify-content: center; padding: 12px 8px; white-space: normal;
}
body[data-theme] .settings-page .settings-nav button.active { font-weight: 600; }
body[data-theme] .settings-page .settings-learning-actions { flex-wrap: wrap; }
body[data-theme] .settings-page .settings-account-row > div { min-width: 0; overflow-wrap: anywhere; }
body[data-theme] .settings-page .settings-card-heading > i { flex-shrink: 0; }
body[data-theme] .settings-page .settings-card + .settings-card { margin-top: 16px; }
@media (max-width: 600px) {
    body[data-theme] .settings-page .settings-nav button { flex: 0 0 auto; max-width: 190px; }
}
body[data-theme] :is(main h1, .login-card h1) {
    font-size: clamp(26px, 3vw, 32px);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.025em;
}
body[data-theme] main h2 { font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
body[data-theme] main h3 { font-weight: 500; line-height: 1.4; }
body[data-theme] :is(input, textarea)::placeholder { color: var(--night-muted, #667085); opacity: 1; }
body[data-theme] :is(.menu-item, .settings-submenu-item) { font-size: 14px; font-weight: 400; line-height: 1.4; }
body[data-theme] :is(.study-plan-hero p, .dashboard-header p, .settings-header p, .profile-header p, .competition-header p, .library-page-header p) { font-size: 14px; line-height: 1.6; }
body[data-theme] :is(.study-plan-eyebrow, .dashboard-eyebrow, .settings-eyebrow, .competition-header > div:first-child > span) { font-size: 11px; font-weight: 600; letter-spacing: .1em; }
body[data-theme] :is(.study-plan-section-heading h2, .study-plan-schedule h2, .fsrs-dashboard-heading h2) { font-size: 20px; }
body[data-theme] :is(.study-item-content h3, .study-item-content h4, .deck-name, .lib-deck-name, .video-title) { font-size: 14px; font-weight: 500; line-height: 1.45; }
body[data-theme] :is(.study-summary-stat strong, .fsrs-summary-grid strong, .vocabulary-status-grid strong, .vocab-stat-number) { font-weight: 500; font-variant-numeric: tabular-nums; }
body[data-theme] :is(.study-item-content p, .study-bridge-context, .deck-word-count, .lib-deck-meta, .library-words-table, .settings-field label) { font-size: 13px; line-height: 1.5; }
body[data-theme] :is(.study-item-badges span, .study-day-meta, .study-item-action, .study-item-completion-hint) { font-size: 12px; font-weight: 500; }
body[data-theme] :is(.dashboard-metric span, .dashboard-metric small, .competition-summary span, .competition-ranking li > strong, .fsrs-due-row span) { font-size: 12px; line-height: 1.5; }
body[data-theme] :is(.study-plan-primary, .study-plan-secondary, .settings-nav button, .dashboard-tabs button, .btn-study) { font-weight: 500; }
/* Plan accent text must differ from the solid primary button's brand fill. */
body[data-theme="dark"] .study-plan-page :is(.study-plan-eyebrow, .study-plan-secondary, .study-time-control strong) { color: var(--night-blue); }
@media (prefers-color-scheme: dark) {
    body[data-theme="system"] .study-plan-page :is(.study-plan-eyebrow, .study-plan-secondary, .study-time-control strong) { color: var(--night-blue); }
}

/* Dashboard metrics share the full card width, including on phones. */
body[data-theme] .dashboard-metric { flex-direction: column; gap: 12px; padding: 18px; }
body[data-theme] .dashboard-metric > div { flex: 1; }
body[data-theme] .dashboard-metric strong { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
body[data-theme] .dashboard-metric > div > span { margin: 6px 0; font-size: 13px; font-weight: 500; line-height: 1.45; }
body[data-theme] .dashboard-metric small { overflow: visible; white-space: normal; text-overflow: clip; font-size: 12px; line-height: 1.5; }
body[data-theme] .dashboard-metric strong .dashboard-duration-major { margin: 0; font-size: 26px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
body[data-theme] .dashboard-metric strong .dashboard-duration-minor { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
body[data-theme] .dashboard-plan-link { font-size: 13px; font-weight: 500; }
body[data-theme] .dashboard-card-title > div > span { font-size: 11px; font-weight: 600; letter-spacing: .1em; }
body[data-theme] .bottom-nav button span { font-size: 11px; line-height: 1.3; }
@media (min-width: 360px) and (max-width: 430px) {
    body[data-theme] .dashboard-metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
    body[data-theme] .dashboard-metric { padding: 14px; }
}
