:root {
    --ui-font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --ui-text-sm: .75rem;
    --ui-text-body: .875rem;
    --ui-text-subtitle: 1rem;
    --ui-text-title: clamp(1.5rem, 1.2rem + 1vw, 2rem);
    --ui-weight-regular: 400;
    --ui-weight-medium: 500;
    --ui-weight-semibold: 600;
    --ui-weight-bold: 700;
    --ui-focus: #4f46e5;
}
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, button, input, select, textarea { font-family: var(--ui-font) !important; }
button, input, select, textarea { font-synthesis: none; }
:where(body) { font-size: var(--ui-text-body); line-height: 1.5; }
:where(button, input, select, textarea) { font-size: inherit; }
:where(.page-title, .dashboard-title, .wr-title) {
    font-size: var(--ui-text-title);
    font-weight: var(--ui-weight-bold);
    line-height: 1.2;
}
:where(.page-copy, .dashboard-subtitle, .wr-subtitle) { font-size: var(--ui-text-body); line-height: 1.6; }
:where(.field-label, .wr-field label) { font-size: var(--ui-text-body); font-weight: var(--ui-weight-semibold); }
:where(.panel-heading, .wr-card-title, .record-title) { font-size: var(--ui-text-subtitle); font-weight: var(--ui-weight-semibold); }
:where(.input, .select, .textarea, .wr-input, .wr-textarea) { font-size: var(--ui-text-body); line-height: 1.5; }
:where(.btn-primary, .btn-secondary, .btn-danger, .btn-success, .btn-warning) { font-size: var(--ui-text-body); font-weight: var(--ui-weight-semibold); }
:where(.input, .select, .textarea, .wr-input, .wr-textarea):focus-visible,
:where(button, a, select, input, textarea):focus-visible {
    outline: 2px solid var(--ui-focus);
    outline-offset: 2px;
}
:where(.dashboard-main, .page-hero, .form-panel, .list-panel, .panel, .wr-card, .wallet-mobile-card) { min-width: 0; }
:where(.surface-table, .table-shell, .desktop-table, .wallet-table-fixed) { font-size: var(--ui-text-body); }
:where(.surface-table, .table-shell, .desktop-table, .wallet-table-fixed) th { font-weight: var(--ui-weight-semibold); }
:where(.surface-table, .table-shell, .desktop-table, .wallet-table-fixed) td { vertical-align: top; }
@media (max-width: 639px) {
    :where(.page-title, .dashboard-title, .wr-title) { overflow-wrap: anywhere; }
    :where(.form-panel, .list-panel, .panel) { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Page components share the same type hierarchy. */
:is(.page-title, .dashboard-title, .wr-title, .wallet-page .page-title) {
    font-size: var(--ui-text-title) !important;
    font-weight: var(--ui-weight-bold) !important;
    line-height: 1.2;
}
:is(.panel-heading, .wr-card-title) {
    font-size: var(--ui-text-subtitle) !important;
    font-weight: var(--ui-weight-semibold) !important;
}
:is(.field-label, .wr-field label) {
    font-size: var(--ui-text-body) !important;
    font-weight: var(--ui-weight-semibold) !important;
}
:is(.wr-option-title) { font-size: var(--ui-text-body); font-weight: var(--ui-weight-semibold); }
