/*
 * Customer workspace typography
 * Loaded after the workspace styles so the signed-in product uses one calm,
 * predictable three-weight hierarchy without changing layout or state colors.
 */

/* The dialogs live beside #appShell, so give them the same local font token. */
#appShell,
#appShell ~ :is(
  #apiGuideDialog,
  #goalDialog,
  #goalSuccessDialog,
  #renewalDialog,
  #languagePreferenceDialog,
  #toast
) {
  --workspace-font: "BrainOff UI", "BrainOff TC", "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-family: var(--workspace-font);
  font-weight: 400;
}

/* Native controls do not consistently inherit the surrounding font. */
#appShell :is(button, input, select, textarea),
#appShell ~ :is(
  #apiGuideDialog,
  #goalDialog,
  #goalSuccessDialog,
  #renewalDialog,
  #languagePreferenceDialog
) :is(button, input, select, textarea) {
  font-family: var(--workspace-font);
}

/* Reading copy stays regular throughout every signed-in view. */
#appShell .view-panel :is(p, li, dt, small),
#appShell :is(.lead, .section-copy, .muted, .setting-field-hint),
#appShell #brainlog .brainlog-hero p,
#appShell #campaign :is(.campaign-hero-copy p, .campaign-action-band p, .campaign-flow small),
#appShell #subscription :is(p, li, small),
#appShell #benefits :is(p, small),
#appShell #workspaceMarketDetails :is(p, small),
#appShell ~ :is(
  #apiGuideDialog,
  #goalDialog,
  #goalSuccessDialog,
  #renewalDialog,
  #languagePreferenceDialog
) :is(p, small) {
  font-weight: 400;
}

/* Navigation, labels, controls and data use the medium weight. */
#appShell :is(
  .nav-item,
  .sidebar-section-label,
  .current-strategy-label,
  .sidebar-auto-status,
  .sidebar-subscription-head span,
  .sidebar-account-line span,
  .sidebar-subscription-time,
  .badge,
  .eyebrow,
  .live-pill,
  .updated,
  .site-language-toggle,
  .mobile-funding-picker,
  .currency-picker-button,
  .currency-picker-option,
  .currency-picker-value,
  .funding-sort-caption,
  .funding-sort-btn,
  .funding-sort-select,
  .funding-sort-direction,
  .settings-tab,
  .setting-field > span,
  .period-picker label,
  .switch-row,
  .language-preference-row,
  .primary-action,
  .secondary-action,
  .primary-btn,
  .secondary-btn,
  .ghost-btn,
  .icon-btn,
  button,
  input,
  select,
  textarea,
  summary,
  label,
  th,
  td
) {
  font-weight: 500;
}

#appShell .view-panel :is(strong, b),
#appShell .sidebar :is(
  .sidebar-strategy-summary strong,
  .sidebar-subscription-head strong,
  .sidebar-account-line strong,
  .sidebar-subscription-label,
  .sidebar-subscription-time
),
#appShell .topbar :is(.currency-picker-value, .currency-option-copy strong, .current-currency-status strong) {
  font-weight: 500;
}

#appShell #overview :is(.goal-title-line-soft, .goal-title-line-soft b, .goal-title-line-strong) {
  font-weight: 600;
}

#appShell #overview :is(.workspace-section-heading .eyebrow, .workspace-goal-amount > span) {
  font-family: var(--workspace-font);
  font-weight: 500;
}

#appShell #overview :is(
  .goal-ring small,
  .goal-ring strong,
  .goal-progress-copy span,
  .goal-earnings-head span,
  .goal-earning-item small,
  .goal-earning-item b
) {
  font-weight: 500;
}

#appShell :is(
  .performance-card > strong,
  .metric > strong,
  .reference-card strong,
  .qye-card strong,
  .chart-stat strong,
  .workspace-goal-amount > strong,
  .workspace-goal-data b,
  .workspace-strategy-rows dd,
  .goal-earning-item b,
  .funding-cell,
  .funding-currency,
  .funding-principal,
  .funding-rate,
  .funding-period,
  .funding-state,
  .rate-cell,
  .earning-value,
  .pricing-value,
  .referral-code strong,
  .brainlog-summary-card strong,
  .qye-history-top strong,
  .campaign-price-value,
  .campaign-progress-head b,
  .renewal-note span
) {
  font-family: var(--workspace-font);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* Titles form the top and only strong tier in the workspace. */
#appShell :is(h1, h2, h3, h4, h5, h6),
#appShell :is(.section-head h3, .settings-panel h3, .service-section h3),
#appShell ~ :is(
  #apiGuideDialog,
  #goalDialog,
  #goalSuccessDialog,
  #renewalDialog,
  #languagePreferenceDialog
) :is(h1, h2, h3, h4, h5, h6) {
  font-family: var(--workspace-font);
  font-weight: 600;
}

/* Match later workspace rules that use two IDs or deeply scoped selectors. */
#appShell #workspaceMarketDetails :is(
  summary,
  .qye-card > span,
  .reference-card > span,
  .chart-stat span,
  .heat-label,
  .rate-cell,
  th
) {
  font-weight: 500;
}

#appShell #workspaceMarketDetails :is(
  .metric > strong,
  .qye-card strong,
  .reference-card strong,
  .chart-stat strong
) {
  font-family: var(--workspace-font);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

#appShell #workspaceMarketDetails :is(.section-head h3, summary strong) {
  font-weight: 600;
}

#appShell .settings-center :is(
  .settings-tab,
  .setting-field > span,
  .setting-field input,
  .permission-strip span,
  .period-picker label,
  .mode-row b,
  .api-save-btn,
  #saveStrategyBtn,
  #saveAutoLendingBtn,
  #saveLineNotificationBtn
) {
  font-weight: 500;
}

#appShell .settings-center .api-guide-thumbnail span {
  font-weight: 500;
}

#appShell #settingsPanelLending .mode-row b,
#appShell #settingsPanelLending #autoMaxOfferAmountLabel,
#appShell #settingsPanelLending #autoMaxOfferAmountLabel span,
#appShell #settingsPanelAccount :is(#lineAccountConnectionStatus, #googleAccountConnectionStatus),
#appShell #settingsPanelAccount :is(#lineAccountConnectionStatus, #googleAccountConnectionStatus).connection-status.available {
  font-weight: 500;
}

/* Provider marks are brand artwork rendered as text; retain their own weight. */

#appShell .settings-center :is(.settings-panel-title h3, .section-head h3),
#appShell #settingsPanelApi :is(.api-guide-summary-copy b, .api-guide-summary > strong) {
  font-weight: 600;
}

#appShell #brainlog :is(
  .brainlog-hero .eyebrow,
  .brainlog-hero-status small,
  .brainlog-summary-card span,
  .brainlog-summary-card strong,
  .brainlog-filter,
  .brainlog-entry-top,
  .brainlog-entry small
) {
  font-weight: 500;
}

#appShell #brainlog .brainlog-hero h3 {
  font-weight: 600;
}

#appShell #activity :is(
  .strategy-status-card small,
  .qye-history-time,
  .qye-history-top strong,
  .qye-history-top .heat-label,
  .qye-history-main small,
  .auto-execution-row .timeline-top small,
  .auto-execution-main small,
  .list-title,
  .status-pill
) {
  font-weight: 500;
}

#appShell #campaign :is(
  .campaign-status-badge,
  .campaign-batch-badge,
  .campaign-hero-copy .eyebrow,
  .campaign-price-line,
  .campaign-price-value,
  .campaign-hero-mark span,
  .campaign-hero-mark small,
  #campaignPrice,
  .campaign-progress-head span,
  .campaign-progress-head strong,
  .campaign-progress-head b,
  .campaign-progress-summary span,
  .campaign-batch-scale,
  .campaign-actions > button,
  .campaign-actions > a,
  .campaign-flow b,
  .campaign-flow span
) {
  font-weight: 500;
}

#appShell #campaign :is(.campaign-hero-copy h3, .campaign-action-band h3) {
  font-weight: 600;
}

#appShell #subscription :is(
  .eyebrow,
  .pricing-tier-note span,
  .pricing-card-head span,
  .pricing-card-badge,
  .pricing-value,
  .pricing-value small,
  .pricing-value em,
  .pricing-action,
  .renewal-flow span,
  .subscription-record-row time,
  .subscription-record-row span,
  .subscription-record-row b,
  .subscription-record-row strong,
  th,
  td strong
) {
  font-weight: 500;
}

#appShell #subscription :is(.subscription-current-band h3, .service-section h3, .pricing-card h3) {
  font-weight: 600;
}

#appShell #benefits :is(
  .benefit-tab,
  .platform-badge,
  .referral-code span,
  .referral-code strong,
  .referral-code button,
  .benefit-actions a
) {
  font-weight: 500;
}

#appShell #benefits :is(.benefit-intro-band h3, .platform-title-row h3) {
  font-weight: 600;
}

#appShell .sidebar .nav-new-badge {
  font-weight: 500;
}

/* Customer dialogs are outside #appShell and need their own complete tier. */
#appShell ~ :is(
  #apiGuideDialog,
  #goalDialog,
  #goalSuccessDialog,
  #renewalDialog,
  #languagePreferenceDialog
) :is(
  button,
  input,
  select,
  textarea,
  label,
  .eyebrow,
  .goal-field > span,
  .goal-style-picker span,
  .goal-dialog-note,
  .goal-success-mark,
  .renewal-note span,
  .api-guide-warning,
  .language-choice
) {
  font-weight: 500;
}

#appShell ~ #toast {
  font-family: var(--workspace-font);
  font-weight: 500;
}
