/* Buckler typography consistency and readability pass — 2026-08-14.
   Only typography/rendering and overflow safeguards: no palette or visual-theme changes. */

:root{
  --buckler-type-body:16px;
  --buckler-type-body-compact:14px;
  --buckler-type-caption:13px;
  --buckler-type-micro:12.5px;
  --buckler-type-control:14px;
}

html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  text-rendering:optimizeLegibility;
}

body{
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
  font-kerning:normal;
}

/* Long Russian labels and user-entered values must wrap inside their cards. */
:is(
  .crm-card-title-group,
  .crm-list-copy,
  .crm-stage-copy,
  .crm-participant-copy,
  .crm-permission-copy,
  .crm-object-value,
  .crm-message-bubble,
  .internal-section-head,
  .internal-panel__head,
  .internal-record-card,
  .internal-table-title,
  .internal-table-sub,
  .project-card,
  .deal-card,
  .card,
  .modal,
  .drawer
){
  min-width:0;
  overflow-wrap:anywhere;
  word-break:normal;
}

:is(.crm-page,.crm-internal-page) :is(p,li,td,th,label,small),
body.search-page :is(p,li,td,th,label,small){
  line-height:1.45;
}

/* Keep controls readable and prevent iOS focus zoom without altering their styling. */
@media (max-width:980px){
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea{
    font-size:16px !important;
  }
}

/* Text buttons may wrap, but icon-only controls remain untouched. */
:is(.crm-button,.crm-mini-button,.internal-button,.btn-small,.btn,.button){
  text-wrap:balance;
}
