/* One semantic scale for authenticated workspaces AND public account screens.
   Module styles use these tokens; headings and icon-only glyphs keep their hierarchy. */
:root {
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --ui-body: 16px;
  --ui-input: 16px;
  --ui-control: 14px;
  --ui-secondary: 13px;
  --ui-navigation: 16px;
}
body { font-family: var(--ui-font); font-size: var(--ui-body); line-height: 1.5; }

/* Content, not metadata: consistent reading size without flattening headings. */
html body :is(.prose,.hub-prose,.hub-comment,.ib-description,.ib-comment,
  .conversation .chat-message,.task-card .tc-description,.task-card .tc-properties dd,
  .task-card .tc-check,.task-card .tc-file-list>li>div,.task-route .tr-facts dd,
  .task-route .tr-fallback,.about-service p,.about-service li,
  .lc-cabinet p,.lc-cabinet td,.page-heading p,.facility-card p,
  .login-copy p,.login-form>p,.signup-form>p,.signup-notice,
  .checkout-heading>p,.section-menu-dialog>form>p) {
  font-size: var(--ui-body); line-height: 1.5;
}
html body :is(.ib-title,.ws-task-table .ib-title,.ib[data-density=compact] .ib-title,
  .row-title,.hub-request-card>a,.home-center .hc-task-copy strong,
  .home-center .hc-project h3,.home-center .hc-object h3,.ma-object strong) {
  font-size: var(--ui-body); line-height: 1.45;
}

/* Real text controls; icon-only close/drag/palette controls retain their glyph sizes. */
html body :is(.button,button[type=submit],input[type=submit],
  .field>label,.work-form label,.hub-form label,.profile-form label,
  .chat-message-actions a,.chat-message-actions button,.chat-message>button,
  .chat-help .button,.conversation-status button,.composer-toolbar .button.primary,
  .task-card .tc-discussion .composer-toolbar .button.primary,
  .task-card .tc-discussion .chat-message>button,.ma-method summary,.ma-current summary,
  .cb-head .ib-overview button,.cb-toolbar .ib-overview button,
  .dialog-filters button,.cb-quick button,.ib-menu button,.ib-menu a,
  .work-tabs a,.hub-nav>a,.hub-more>summary,.sticker-tabs button) {
  font-family: var(--ui-font); font-size: var(--ui-control); line-height: 1.45;
}
html body :is(input:not([type=hidden]):not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]):not([type=color]):not([type=range]),select,textarea) {
  font-family: var(--ui-font); font-size: var(--ui-input) !important; line-height: 1.45;
}
html body :is(.chat-message-meta small,.chat-message-meta time,
  .conversation-status,.chat-queue-status,.task-card .tc-discussion .conversation-status,
  .task-card .tc-discussion .chat-message time,.task-route .tr-phase,
  .task-route .tr-kicker,.task-route .tr-person,.task-route .tr-explanation,
  .ma-asof,.ma-note,.ma-chart-bucket>span,.ma-chart-bucket>strong,
  .ma-kpi>em,.ma-kpi>span:not(:first-child),.login-form .pill,.login-story .brand small) {
  font-size: var(--ui-secondary); line-height: 1.5;
}

/* Larger text must wrap within existing surfaces, never be clipped to fixed heights. */
.login-form .button,.signup-form .button { white-space: normal; height: auto; min-height: 46px; }
.login-form .field label,.signup-form .field label { font-size: var(--ui-control); line-height: 1.45; }
.login-form .login-note,.signup-form .login-note { font-size: var(--ui-secondary); line-height: 1.5; }
.conversation .chat-message-meta,.conversation .chat-message-actions { flex-wrap: wrap; }
.ma-chart-bucket>span,.ma-chart-bucket>strong { overflow-wrap: anywhere; }
@media (min-width:701px) {
  html:not([data-ws-rail-mode=compact]) .sidebar nav .ws-nav-label {
    white-space: normal; overflow-wrap: normal; line-height: 1.35;
  }
}

@media (max-width:700px) {
  /* Keep the existing horizontally continuing navigation; do not shrink its labels. */
  html[data-theme-user] .sidebar nav a,
  html[data-theme-user] .sidebar .cab-primary-nav>a {
    font-size: var(--ui-secondary); line-height: 1.25;
  }
  html[data-theme-user] .sidebar>nav[data-cabinet-navigation]>a {
    flex: 0 0 auto; min-width: max-content; padding-inline: 10px;
  }
  html[data-theme-user] .sidebar nav .ws-nav-label {
    white-space: nowrap; overflow-wrap: normal; max-width: none;
  }
  .login-copy p { font-size: var(--ui-body); }
  html body .cb-head .ib-overview button { min-height: 32px !important; height: auto !important; }
}
