/* Unified type scale: clear hierarchy, comfortable reading, and stable financial figures. */
:root {
  --type-caption: 10px;
  --type-small: 12px;
  --type-body: 14px;
  --type-title: 18px;
  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;
}

body {
  font-size: var(--type-body);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
input,
select,
textarea { letter-spacing: 0; }

h1,
h2,
h3,
h4,
strong,
b { line-height: var(--leading-tight); }

.welcome-row h1,
.section-hero h1 {
  font-size: clamp(30px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -.04em;
}

.welcome-row > div > p:last-child,
.section-hero p:last-child {
  font-size: 13px;
  line-height: var(--leading-relaxed);
}

.eyebrow,
.panel-head small {
  font-size: var(--type-caption);
  line-height: 1.4;
  letter-spacing: .1em;
}

.page-heading small { font-size: 10px; line-height: 1.35; }
.page-heading strong { font-size: 16px; letter-spacing: -.015em; }
.card-head h3 { font-size: var(--type-title); line-height: 1.25; letter-spacing: -.02em; }

.primary-button,
.secondary-button,
.install-button {
  min-height: 42px;
  padding-inline: 16px;
  font-size: var(--type-small);
  line-height: 1.2;
}

.status { padding: 6px 9px; font-size: 10px; line-height: 1.2; }
.search-box { height: 44px; }
.search-box input { font-size: 12px; }
.period-tabs button,
.filter-chips button { height: 31px; font-size: 10px; }

.nav-label { font-size: 9px; line-height: 1.4; }
.nav-item b { font-size: 12px; }
.nav-item em { font-size: 9px; }
.brand strong { font-size: 15px; }
.brand span,
.workspace-card small { font-size: 10px; }
.workspace-card strong { font-size: 12px; }
.sidebar-support strong,
.sidebar-user strong { font-size: 11px; }
.sidebar-support small,
.sidebar-user small { font-size: 10px; }
.project-select select { font-size: 11px; }
.profile-copy b { font-size: 11px; }
.profile-copy small { font-size: 9px; }

.metric-card > p { font-size: 11px; line-height: 1.4; }
.metric-card h2 { font-size: 26px; }
.metric-card > small { font-size: 10px; line-height: 1.45; }
.trend { font-size: 9px; }
.panel-head button,
.text-button { font-size: 11px; }
.notification-panel article strong { font-size: 12px; }
.notification-panel article p { font-size: 11px; line-height: 1.55; }
.notification-panel article small { font-size: 10px; }

.form-grid label { font-size: 11px; line-height: 1.4; }
.form-grid input,
.form-grid select,
.form-grid textarea { font-size: 13px; line-height: 1.45; }
.field-help { color: #78909b; font-size: 10px; font-weight: 600; line-height: 1.4; }
input[readonly] {
  border-color: #c9dbe3;
  background: #eef5f8;
  color: #31596d;
  font-weight: 750;
  cursor: not-allowed;
}
.auto-percentage-preview small { font-size: 10px; }
.auto-percentage-preview b { font-size: 15px; }

.portfolio-analysis > article small { font-size: 11px; line-height: 1.4; }
.portfolio-analysis > article b { font-size: 23px; }
.portfolio-analysis > article span { font-size: 10px; line-height: 1.45; }
.portfolio-insight small { font-size: 10px; }
.portfolio-insight b { font-size: 12px; line-height: 1.55; }
.portfolio-insight-status { font-size: 10px; }
.project-portfolio-head { font-size: 10px; line-height: 1.35; }
.portfolio-project-name b { font-size: 12px; }
.portfolio-project-name small,
.portfolio-money small,
.portfolio-roi small,
.portfolio-return small { font-size: 9px; line-height: 1.4; }
.portfolio-money b,
.portfolio-roi b,
.portfolio-return b { font-size: 11px; }
.portfolio-progress b { font-size: 10px; }
.portfolio-progress small { font-size: 9px; }

.portfolio-analysis > article b,
.portfolio-money b,
.portfolio-roi b,
.portfolio-return b,
.metric-card h2,
.investment-summary b,
.calculation-metric b,
.income-result b,
.auto-percentage-preview b { font-variant-numeric: tabular-nums; }

.calculation-status { font-size: 10px; }
.calculation-metric span,
.income-result span { font-size: 10px; }
.calculation-note { font-size: 10px; }

@media (max-width: 700px) {
  .welcome-row h1,
  .section-hero h1 { font-size: 28px; }
  .welcome-row > div > p:last-child,
  .section-hero p:last-child { font-size: 12px; }
  .portfolio-analysis > article small { font-size: 10px; }
  .portfolio-analysis > article b { font-size: 19px; }
  .portfolio-analysis > article span { font-size: 9px; }
  .project-portfolio-head { font-size: 10px; }
  .portfolio-project-name b { font-size: 12px; }
  .portfolio-money b,
  .portfolio-roi b,
  .portfolio-return b { font-size: 11px; }
}

/* Project detail type scale: readable without making dense financial data feel crowded. */
#view-project-detail .project-page-back { font-size: 12px; }
#view-project-detail .project-page-hero .status,
#view-project-detail .project-health { font-size: 11px; }
#view-project-detail .project-page-hero .eyebrow { font-size: 11px; }
#view-project-detail .project-page-hero #projectPageDescription { font-size: 12px; line-height: 1.55; }
#view-project-detail .project-page-hero-actions button { font-size: 12px; }
#view-project-detail .project-page-metrics small { font-size: 11px; }
#view-project-detail .project-page-metrics b { font-size: 20px; }
#view-project-detail .project-page-metrics em { font-size: 10px; }
#view-project-detail .project-detail-tabs button { font-size: 11px; }
#view-project-detail .project-page-section .eyebrow { font-size: 10px; }
#view-project-detail .project-page-section h3 { font-size: 22px; }
#view-project-detail .project-page-section h4 { font-size: 17px; }
#view-project-detail .project-summary-section .detail-progress > span { font-size: 12px; }
#view-project-detail .project-roi-kicker { font-size: 10px; }
#view-project-detail .project-roi-card > small { font-size: 10px; }
#view-project-detail .project-roi-card footer { font-size: 9px; }
#view-project-detail .project-roi-card footer em { font-size: 9px; }
#view-project-detail .project-finance-table-head { font-size: 10px; }
#view-project-detail .project-finance-row > span b,
#view-project-detail .project-finance-row > strong { font-size: 12px; }
#view-project-detail .project-finance-row > span small { font-size: 10px; }
#view-project-detail .project-finance-row > em { font-size: 10px; }
.project-report-head > div > p:last-child,
.report-workflow small,
.report-aside-copy { font-size: 11px; }
.report-workflow b,
.project-progress-report-title b,
.project-expense-report b { font-size: 12px; }
.report-workflow article > span,
.progress-report-percent { font-size: 12px; }
.project-progress-report-title time,
.project-progress-blocker,
.project-progress-report-copy footer,
.project-expense-report small,
.report-list-heading > span,
.report-attachment-links a { font-size: 10px; }
.project-progress-report-copy p { font-size: 12px; }
.project-expense-report strong { font-size: 11px; }

@media (max-width: 700px) {
  #view-project-detail .project-page-metrics b { font-size: 18px; }
  #view-project-detail .project-page-section h3 { font-size: 20px; }
  #view-project-detail .project-roi-kicker { font-size: 9px; }
}

@media (max-width: 420px) {
  .portfolio-analysis { grid-template-columns: 1fr; }
  .portfolio-analysis > article { min-height: 92px; }
  .portfolio-analysis > article b { font-size: 20px; }
  .portfolio-insight { grid-template-columns: 36px minmax(0, 1fr); }
  .portfolio-insight-status { grid-column: 2; width: max-content; }
}

/* 0.21 — unified readable type scale across every workspace page. */
:root {
  --type-caption: 11px;
  --type-small: 12px;
  --type-body: 14px;
  --type-label: 13px;
  --type-title: 20px;
}

body { font-size: var(--type-body); }

.app-shell p { font-size: var(--type-body); line-height: 1.6; }
.app-shell small,
.app-shell time { font-size: var(--type-small); line-height: 1.45; }
.app-shell label { font-size: var(--type-label); line-height: 1.4; }
.app-shell input,
.app-shell select,
.app-shell textarea { font-size: var(--type-body); line-height: 1.45; }
.app-shell button:not(.icon-button) { font-size: var(--type-label); line-height: 1.2; }

.eyebrow,
.panel-head small,
.nav-label,
.project-portfolio-head,
.table-head,
.cashflow-table-head { font-size: var(--type-caption); line-height: 1.4; letter-spacing: .1em; }

.brand strong { font-size: 16px; }
.brand span { font-size: 12px; }
.workspace-card small { font-size: 12px; }
.workspace-card strong { font-size: 14px; }
.nav-item b { font-size: 13px; }
.nav-item em { min-width: 22px; height: 22px; font-size: 11px; }
.sidebar-support strong,
.sidebar-user strong { font-size: 13px; }
.sidebar-support small,
.sidebar-user small { font-size: 12px; }

.page-heading small { font-size: 12px; }
.page-heading strong { font-size: 17px; letter-spacing: -.015em; }
.project-select select { font-size: 13px; }
.profile-copy b { font-size: 13px; }
.profile-copy small { font-size: 11px; }
.notification-button i { font-size: 10px; }

.welcome-row h1,
.section-hero h1 { font-size: clamp(30px, 3vw, 38px); }
.welcome-row > div > p:last-child,
.section-hero p:last-child { font-size: 14px; }
.role-switcher > small { font-size: 12px; }
.role-switcher #activeRole { font-size: 12px; }

.metric-card > p { font-size: 13px; }
.metric-card h2 { font-size: clamp(24px, 2vw, 29px); }
.metric-card > small { font-size: 12px; }
.trend { font-size: 11px; }
.card-head h3 { font-size: var(--type-title); }
.panel-head h3 { font-size: 19px; }
.panel-head button,
.text-button { font-size: 13px; }
.notification-panel article strong { font-size: 14px; }
.notification-panel article p { font-size: 13px; }
.notification-panel article small { font-size: 12px; }

.period-tabs button,
.filter-chips button { min-height: 34px; font-size: 12px; }
.search-box input { font-size: 14px; }
.status { font-size: 12px; }
.chart-legend,
.chart-legend strong,
.y-labels,
.x-labels,
.allocation-list > div,
.donut small { font-size: 11px; }

.project-row b,
.expense-row b,
.user-row b,
.contract-row b,
.activity-row b { font-size: 13px; }
.project-row small,
.expense-row small,
.user-row small,
.contract-row small,
.activity-row small { font-size: 12px; }

.form-grid label,
.project-master-form label,
.project-parameter-form label,
.investment-form label,
.cashflow-form label { font-size: 13px; }
.form-grid input,
.form-grid select,
.form-grid textarea,
.project-master-form input,
.project-master-form select,
.project-master-form textarea,
.project-parameter-form input,
.investment-form input,
.investment-form select,
.cashflow-form input,
.cashflow-form select { font-size: 14px; }
.field-help,
.form-help { font-size: 12px; line-height: 1.55; }
.upload-zone b { font-size: 13px; }
.upload-zone small { font-size: 11px; }
.modal-head h2 { font-size: 22px; }

.portfolio-analysis > article small { font-size: 12px; }
.portfolio-analysis > article b { font-size: 24px; }
.portfolio-analysis > article span { font-size: 12px; }
.portfolio-insight small { font-size: 11px; }
.portfolio-insight b { font-size: 13px; }
.portfolio-insight-status { font-size: 12px; }
.portfolio-project-name b,
.portfolio-money b,
.portfolio-roi b,
.portfolio-return b { font-size: 13px; }
.portfolio-project-name small,
.portfolio-money small,
.portfolio-roi small,
.portfolio-return small,
.portfolio-progress small { font-size: 11px; }
.portfolio-progress b { font-size: 12px; }

.project-page-metrics small,
.investment-summary small,
.cashflow-summary .cashflow-stat small { font-size: 12px; }
.project-page-metrics b,
.investment-summary b { font-size: 18px; }
.project-detail-tabs button { font-size: 12px; }
.finance-detail-tabs button b { font-size: 14px; }
.finance-detail-tabs button small { font-size: 12px; }

.investment-entry-heading h4,
.calculation-heading h4,
.cashflow-form-heading h4,
.cashflow-history-head h4 { font-size: 18px; }
.investment-entry-heading small,
.cashflow-form-heading > span,
.cashflow-form-actions small { font-size: 12px; }
.calculation-status { font-size: 12px; }
.calculation-metric small,
.income-result small { font-size: 12px; }
.calculation-metric b { font-size: 22px; }
.income-result b { font-size: 21px; }
.calculation-metric span,
.income-result span,
.calculation-note { font-size: 11px; }
.investment-row b,
.cashflow-row b { font-size: 13px; }
.investment-row small,
.cashflow-row small,
.cashflow-row time { font-size: 11px; }
.investment-edit,
.cashflow-kind { font-size: 11px; }
.cashflow-row strong { font-size: 13px; }

.project-config-copy,
.detail-summary span,
.project-activity-row small,
.project-activity-row time,
.member-config-item small { font-size: 12px; }
.detail-summary b,
.project-activity-row b,
.member-config-item b { font-size: 13px; }
.project-master-result { font-size: 12px; }
.project-master-result b { font-size: 14px; }

.contract-number-preview small,
.contract-number-preview p,
.editor-head small,
.editor-status,
.policy-list span { font-size: 12px; }
.contract-number-preview strong,
.editor-head h2 { font-size: 18px; }

.auth-brand strong { font-size: 17px; }
.auth-brand span { font-size: 12px; }
.auth-intro > p:last-of-type { font-size: 15px; }
.auth-points span { font-size: 13px; }
.auth-card > div > p:last-child { font-size: 13px; }
.auth-card label { font-size: 13px; }
.auth-card input { font-size: 14px; }
.auth-submit { font-size: 13px; }
.auth-error { font-size: 12px; }
.auth-security { font-size: 11px; }

@media (max-width: 700px) {
  .app-shell p { font-size: 13px; }
  .app-shell small,
  .app-shell time { font-size: 11px; }
  .app-shell label,
  .app-shell button:not(.icon-button) { font-size: 12px; }
  .app-shell input,
  .app-shell select,
  .app-shell textarea { font-size: 14px; }
  .welcome-row h1,
  .section-hero h1 { font-size: 28px; }
  .metric-card h2 { font-size: 23px; }
  .mobile-nav button { font-size: 10px; }
  .portfolio-analysis > article b { font-size: 20px; }
  .project-page-metrics b { font-size: 17px; }
}

/* Dense operational metadata still needs to remain readable at a glance. */
.organization-card b { font-size: 13px; }
.organization-card > strong { font-size: 12px; }
.role-badge,
.user-row > span:not(.avatar):not(.status) { font-size: 11px; }

.audit-row b { font-size: 12px; }
.audit-row small,
.audit-row > span,
.audit-row time { font-size: 11px; line-height: 1.45; }

.realtime-pill,
.progress-ring { font-size: 11px; }
.progress-report-copy b { font-size: 12px; }
.progress-report-copy small,
.progress-report-meta { font-size: 11px; line-height: 1.45; }

.toast b { font-size: 12px; }
.toast small { font-size: 11px; }

/* Login page: balanced desktop composition and a focused mobile sign-in flow. */
.auth-gate {
  display: grid;
  min-height: 100svh;
  grid-template-rows: auto 1fr;
  padding: 28px clamp(24px, 5vw, 72px);
}

.auth-brand,
.auth-layout {
  width: min(100%, 1320px);
  margin-inline: auto;
}

.auth-brand img {
  width: 62px;
  height: 42px;
}

.auth-layout {
  min-height: 0;
  align-self: center;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 430px);
  gap: clamp(52px, 8vw, 118px);
  padding: 42px 0 52px;
}

.auth-intro { max-width: 620px; }

.auth-intro h1 {
  max-width: 620px;
  margin: 14px 0 18px;
  font-size: clamp(42px, 4.35vw, 62px);
  line-height: 1.03;
}

.auth-intro > p:last-of-type {
  max-width: 550px;
  font-size: 14px;
  line-height: 1.65;
}

.auth-points {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 12px 24px;
  margin-top: 28px;
}

.auth-points span:last-child { grid-column: 1 / -1; }
.auth-points span { font-size: 12px; }

.auth-card {
  gap: 14px;
  padding: 30px;
  border-radius: 22px;
  box-shadow: 0 28px 72px rgba(0, 22, 35, .28);
}

.auth-card h2 {
  margin: 5px 0;
  font-size: 24px;
}

.auth-card > div > p:last-child {
  font-size: 12px;
  line-height: 1.55;
}

.auth-card label { gap: 6px; font-size: 12px; }
.auth-card input { height: 48px; font-size: 14px; }
.auth-forgot { margin-top: -5px; font-size: 10px; }
.auth-submit { min-height: 48px; font-size: 12px; }

.auth-security { margin-top: 2px; font-size: 10px; line-height: 1.45; }

@media (max-width: 980px) {
  .auth-gate { padding-inline: clamp(20px, 6vw, 56px); }
  .auth-layout {
    width: min(100%, 620px);
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 42px 0 36px;
  }
  .auth-intro { max-width: 620px; }
  .auth-intro h1 { font-size: clamp(38px, 7vw, 50px); }
  .auth-card { justify-self: center; }
}

@media (max-width: 700px) {
  .auth-gate { padding: 18px 16px; }
  .auth-brand { gap: 10px; }
  .auth-brand img { width: 54px; height: 36px; }
  .auth-brand strong { font-size: 15px; }
  .auth-brand span { font-size: 10px; }
  .auth-layout { gap: 20px; padding: 28px 0 18px; }
  .auth-intro .eyebrow,
  .auth-points { display: none; }
  .auth-intro h1 {
    margin: 0 0 10px;
    font-size: clamp(29px, 9vw, 35px);
    line-height: 1.04;
  }
  .auth-intro > p:last-of-type {
    font-size: 13px;
    line-height: 1.55;
  }
  .auth-card { gap: 13px; padding: 22px; border-radius: 19px; }
  .auth-card h2 { font-size: 23px; }
}

/* Investor workspace type hierarchy. */
#view-project-detail .project-investor-form-heading h4,
#view-project-detail .project-investor-directory-head h4 { font-size: 18px; }

#view-project-detail .project-investor-form-heading small {
  font-size: 12px;
  line-height: 1.55;
}

#view-project-detail .project-investor-form label,
#view-project-detail .project-investor-form-note b { font-size: 11px; }

#view-project-detail .project-investor-form-note small,
#view-project-detail .project-investor-row small { font-size: 10px; }

#view-project-detail .project-investor-identity b { font-size: 13px; }
#view-project-detail .project-investor-metric b { font-size: 12px; }
#view-project-detail .project-investor-edit,
#view-project-detail .project-investor-delete { font-size: 10px; }
