:root {
  --ui-micro: 10px;
  --ui-caption: 11px;
  --ui-small: 12px;
  --ui-body: 14px;
  --ui-control: 14px;
}

/* Paragraphs stay clearly readable without turning utility labels into body copy. */
body p:not(.eyebrow):not(.today-label):not(.privacy-note):not(.receipt-footnote):not(.editor-kicker):not(.overview-status):not(.form-message):not(.budget-form-message):not(.field-error):not(.caps-warning):not(.app-field-error):not(.edit-error):not(.budget-field-error):not(.input-hint):not(.budget-field-note):not(.delete-warning) {
  font-size: 16px !important;
  line-height: 1.6;
}

.story-description { font-size: 21px !important; }
.form-intro > p:last-child,
.page-heading > div:first-child > p:last-child,
.overview-heading > div:first-child > p:last-child,
.budget-heading > div:first-child > p:last-child,
.archive-heading > div > p:last-child { font-size: 18px !important; }

/* Shared application frame */
.app-shell { grid-template-columns: 280px minmax(0, 1fr); }
.app-sidebar { padding: 35px 24px 23px; }
.app-brand { font-size: 28px; }
.brand-mark { width: 30px; height: 30px; }
.side-nav { gap: 9px; margin-top: 58px; }
.nav-item { gap: 13px; padding: 14px 15px; font-size: 15px; }
.nav-item svg { width: 21px; }
.sidebar-note { padding: 19px; }
.sidebar-note-mark { width: 33px; height: 33px; }
.sidebar-note p { font-size: 13px; }
.user-menu { grid-template-columns: 39px 1fr 19px; gap: 11px; padding: 12px 10px; }
.user-avatar { width: 39px; height: 39px; font-size: 14px; }
.user-menu strong { font-size: 13px; }
.user-menu small { font-size: 11px; }
.app-topbar { min-height: 86px; }
.today-label { font-size: var(--ui-caption); }
.welcome-line { font-size: 15px; }
.app-content { width: min(100%, 1380px); padding-bottom: 92px; }
.eyebrow { font-size: 12px; }

/* Login */
.login-shell { grid-template-columns: minmax(450px, .9fr) minmax(560px, 1.1fr); }
.story-copy h1 { font-size: clamp(50px, 5vw, 80px); }
.story-description { font-size: 19px; }
.ledger-card { width: min(100%, 520px); padding: 26px 28px 20px; }
.ledger-heading { font-size: 12px; }
.ledger-balance span { font-size: 14px; }
.ledger-balance strong { font-size: clamp(24px, 2.25vw, 31px); }
.entry-copy b,
.ledger-row > strong { font-size: 14px; }
.entry-copy small,
.privacy-note { font-size: 12px; }
.form-wrap { width: min(100%, 510px); }
.form-intro h2 { font-size: clamp(40px, 3.6vw, 54px); }
.form-intro > p:last-child { font-size: 17px; }
.field label,
.label-row { font-size: 15px; }
.secure-label { font-size: 11px; }
.input-wrap input { height: 61px; font-size: 17px; }
.field-error,
.caps-warning { font-size: 14px; }
.check-label { font-size: 15px; }
.custom-check { width: 21px; height: 21px; }
.help-text { font-size: 13px; }
.form-alert { font-size: 15px; }
.submit-button { height: 62px; font-size: 16px; }
.security-footnote p { font-size: 13px; }
.form-panel footer { font-size: 11px; }

/* Entry page and shared dialogs */
.page-heading h1 { font-size: clamp(48px, 5.2vw, 74px); }
.page-heading > div:first-child > p:last-child { font-size: 16px; }
.month-stamp span { font-size: var(--ui-caption); }
.month-stamp strong { font-size: 15px; }
.app-field > label { font-size: 13px; }
.plain-input,
.app-select-wrap select { height: 50px; font-size: var(--ui-control); }
.amount-wrap input { font-size: 17px; }
.input-hint { font-size: var(--ui-caption); }
.app-field-error { font-size: var(--ui-small); }
.primary-action { min-height: 48px; font-size: 14px; }
.text-action,
.form-message { font-size: 13px; }
.receipt-top { font-size: var(--ui-micro); }
.receipt-last > span { font-size: var(--ui-small); }
.receipt-last p { font-size: 15px; }
.receipt-last strong { font-size: 13px; }
.receipt-footnote { font-size: var(--ui-micro); }
.section-heading h2 { font-size: 37px; }
.history-count { font-size: var(--ui-micro); }
.transaction-symbol { width: 40px; height: 40px; font-size: 14px; }
.transaction-main strong { font-size: 14px; }
.transaction-category small,
.transaction-date { font-size: var(--ui-caption); }
.category-pill { font-size: var(--ui-small); }
.transaction-amount { font-size: 14px; }
.empty-state strong { font-size: 14px; }
.empty-state p { font-size: var(--ui-small); }
.dialog-header h2 { font-size: 40px; }
.dialog-header > div > p:last-child { font-size: 13px; }
.category-editor-panel h3 { font-size: 15px; }
.small-action,
.manager-category-item,
.subcategory-chip,
.empty-subcategory,
.manager-message { font-size: var(--ui-small); }
.manager-delete,
.subcategory-form button { min-height: 42px; font-size: var(--ui-small); }
.editor-kicker { font-size: var(--ui-micro); }
.delete-dialog h2 { font-size: 35px; }
.delete-dialog-card > p:not(.editor-kicker),
.delete-dialog-card > strong { font-size: 13px; }
.delete-dialog-actions button { min-height: 46px; font-size: var(--ui-small); }

/* Analytics */
.overview-heading h1 { font-size: clamp(52px, 5.4vw, 76px); }
.overview-heading > div:first-child > p:last-child { font-size: 15px; }
.period-filter { min-width: 400px; padding: 17px; }
.filter-field label { font-size: var(--ui-micro); }
.overview-select select,
.filter-field input { height: 48px; font-size: 13px; }
.overview-status { font-size: var(--ui-micro); }
.metric-card { min-height: 190px; padding: 27px 28px; }
.metric-kicker { font-size: var(--ui-micro); }
.total-card > strong { font-size: clamp(30px, 2.8vw, 42px); }
.total-card p { font-size: var(--ui-caption); }
.status-card h2 { font-size: 26px; }
.rule-chip { font-size: 9px; }
.status-pair strong { font-size: 28px; }
.status-pair span,
.status-card > p { font-size: var(--ui-micro); }
.chart-head { min-height: 112px; padding: 25px 28px; }
.chart-head .eyebrow { font-size: 13px; }
.chart-head h2 { font-size: 32px; }
.chart-head > div > p:last-child { font-size: 16px; }
.chart-total span,
.subcategory-key span { font-size: 11px; }
.chart-total strong,
.subcategory-key strong { font-size: 14px; }
.chart-grid-lines text { font-size: 14px; }
.bar-label,
.bar-amount,
.subcat-label,
.subcat-amount { font-size: 16px; }
.subcategory-group > header strong { font-size: 15px; }
.subcategory-group > header > span { font-size: 14px; }
.chart-empty strong { font-size: 16px; }
.chart-empty p { font-size: 15px; }
.heat-legend,
.heat-weekdays,
.month-heat-day > span,
.year-heat-row strong { font-size: 11px; }
.year-heat-head span { font-size: 9px; }
.analytics-tooltip { min-width: 185px; padding: 14px 16px; }
.analytics-tooltip strong { font-size: 14px; }
.analytics-tooltip span { font-size: 13px; }
.telegram-card { margin-top: 15px; overflow: hidden; border: 1px solid #d9e4eb; border-radius: 16px; background: #fff; box-shadow: 0 14px 38px rgba(16,42,67,.04); }
.telegram-mark { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; background: #dff2ff; color: #138aca; font-family: var(--data-font); font-size: 13px; font-weight: 800; }
.telegram-body { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 23px 28px; }
.telegram-body > p { margin: 0; color: #61788a; }
.telegram-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.telegram-actions button { white-space: nowrap; }
.telegram-open-link { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; }
.telegram-message { flex-basis: 100%; color: var(--success) !important; }
.telegram-message:empty { display: none; }

/* Budget */
.budget-heading h1 { font-size: clamp(51px, 5.6vw, 78px); }
.budget-heading > div:first-child > p:last-child { font-size: 15px; }
.budget-period span,
.budget-period small,
.budget-overview span { font-size: var(--ui-micro); }
.budget-period strong { font-size: 25px; }
.budget-overview > div { min-height: 138px; padding: 25px 28px; }
.budget-overview strong { font-size: 31px; }
.budget-overview small { font-size: var(--ui-caption); }
.budget-overview-action button { font-size: 15px; }
.budget-ledger-head h2 { font-size: 32px; }
.budget-ledger-head > p { max-width: 280px; font-size: var(--ui-caption); }
.budget-row { min-height: 160px; }
.budget-category-cell strong { font-size: 14px; }
.budget-category-cell small { font-size: var(--ui-caption); }
.budget-measure-labels,
.budget-percentage span,
.budget-result > div span { font-size: var(--ui-micro); }
.budget-measure-labels strong { font-size: 13px; }
.budget-percentage strong,
.budget-result > div strong { font-size: var(--ui-small); }
.budget-status { font-size: var(--ui-micro); }
.budget-actions button { min-height: 38px; font-size: var(--ui-caption); }
.budget-state strong { font-size: 14px; }
.budget-state p,
.budget-state button { font-size: var(--ui-small); }
.budget-toast { font-size: 13px; }
.budget-dialog-header h2 { font-size: 40px; }
.budget-dialog-header > div > p:last-child,
.budget-amount-wrap > span,
.budget-field-note,
.budget-field-error,
.budget-form-message { font-size: var(--ui-small); }
.budget-delete-card h2 { font-size: 35px; }
.budget-delete-card > p:not(.eyebrow) { font-size: 13px; }

/* Transaction archive */
.archive-heading h1 { font-size: clamp(51px, 5.6vw, 78px); }
.archive-heading > div > p:last-child { font-size: 15px; }
.archive-add-button { min-width: 190px; padding: 17px 20px; }
.archive-add-button span { font-size: 14px; }
.archive-add-button small { font-size: var(--ui-caption); }
.archive-summary > div { min-height: 140px; padding: 26px 28px; }
.archive-summary span { font-size: var(--ui-micro); }
.archive-summary strong { font-size: 29px; }
.archive-summary small { font-size: var(--ui-caption); }
.archive-toolbar { min-height: 106px; }
.archive-toolbar h2 { font-size: 30px; }
.archive-toolbar > div:first-child p { font-size: var(--ui-caption); }
.search-box input,
.filter-box select { height: 48px; font-size: 13px; }
.search-box input { width: 250px; }
.filter-box select { width: 190px; }
.archive-table-head { min-height: 48px; font-size: var(--ui-micro); }
.archive-row { min-height: 86px; }
.archive-date,
.archive-purpose small,
.archive-category small { font-size: var(--ui-caption); }
.archive-purpose strong { font-size: 14px; }
.archive-category span,
.archive-amount { font-size: var(--ui-small); }
.archive-actions button { width: 39px; height: 39px; }
.archive-empty strong { font-size: 14px; }
.archive-empty p { font-size: var(--ui-small); }
.archive-toast { font-size: 13px; }
.edit-dialog-header h2 { font-size: 40px; }
.edit-dialog-header > div > p:last-child,
.edit-amount-wrap > span,
.edit-error,
.edit-message { font-size: var(--ui-small); }
.secondary-action,
.danger-action { min-height: 46px; font-size: var(--ui-small); }
.delete-dialog h2 { font-size: 35px; }
.delete-dialog-card > p:not(.eyebrow, .delete-warning) { font-size: 13px; }
.delete-warning { font-size: var(--ui-caption); }

@media (max-width: 760px) {
  :root {
    --ui-micro: 9px;
    --ui-caption: 10px;
    --ui-small: 11px;
  }

  body p:not(.eyebrow):not(.today-label):not(.privacy-note):not(.receipt-footnote):not(.editor-kicker):not(.overview-status):not(.form-message):not(.budget-form-message):not(.field-error):not(.caps-warning):not(.app-field-error):not(.edit-error):not(.budget-field-error):not(.input-hint):not(.budget-field-note):not(.delete-warning) {
    font-size: 15px !important;
  }

  .form-intro > p:last-child,
  .page-heading > div:first-child > p:last-child,
  .overview-heading > div:first-child > p:last-child,
  .budget-heading > div:first-child > p:last-child,
  .archive-heading > div > p:last-child { font-size: 16px !important; }

  .app-shell { display: block; }
  .app-sidebar { padding: 19px 21px; }
  .app-brand { font-size: 24px; }
  .page-heading h1,
  .overview-heading h1,
  .budget-heading h1,
  .archive-heading h1 { font-size: 49px; }
  .overview-heading > div:first-child > p:last-child,
  .budget-heading > div:first-child > p:last-child,
  .archive-heading > div > p:last-child { font-size: 14px; }
  .metric-card { min-height: 178px; }
  .chart-head { min-height: 106px; padding: 22px 20px; }
  .chart-head h2 { font-size: 29px; }
  .chart-head .eyebrow { font-size: 12px; }
  .chart-head > div > p:last-child { font-size: 15px; }
  .chart-grid-lines text { font-size: 15px; }
  .bar-label,
  .bar-amount,
  .subcat-label,
  .subcat-amount { font-size: 17px; }
  .heat-weekdays,
  .month-heat-day > span { font-size: 10px; }
  .telegram-body { align-items: flex-start; flex-direction: column; padding: 22px 20px; }
  .telegram-actions { justify-content: flex-start; }
  .archive-summary > div,
  .budget-overview > div { min-height: 116px; }
  .archive-row { min-height: 92px; }
}

@media (max-width: 430px) {
  .page-heading h1,
  .overview-heading h1,
  .budget-heading h1,
  .archive-heading h1 { font-size: 43px; }
  .form-intro h2 { font-size: 40px; }
  .period-filter { min-width: 0; }
  .archive-summary strong { font-size: 19px; }
}
