/* Shared CRM typography: UI text scales; document contents keep their own layout. */
:root {
 --crm-system-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
 --crm-ui-font:var(--crm-system-font);
 --crm-text-caption-small:.705882rem;
 --crm-text-caption:.764706rem;
 --crm-text-footnote:.823529rem;
 --crm-text-subhead:.882353rem;
 --crm-text-body:1rem;
 --crm-text-title-3:1.176471rem;
 --crm-text-title-2:1.294118rem;
 --crm-text-title-1:1.529412rem;
 --crm-text-heading:2rem;
 --crm-text-display:2.352941rem;
 --crm-text-display-large:2.823529rem;
 font-family:var(--crm-ui-font);
 font-size:16px;
 -webkit-text-size-adjust:100%;
 text-size-adjust:100%;
}
:root[data-crm-font="brand"] {--crm-ui-font:Montserrat,var(--crm-system-font)}
:root[data-crm-text-size="large"] {font-size:18px}
:root[data-crm-text-size="xlarge"] {font-size:20px}
@media(max-width:680px) {
 :root {font-size:17px}
 :root[data-crm-text-size="auto"] {font-size:var(--crm-os-body,17px)}
 :root[data-crm-text-size="large"] {font-size:19px}
 :root[data-crm-text-size="xlarge"] {font-size:21px}
 :root[data-crm-text-size="auto"] {
  --crm-text-caption-small:var(--crm-os-captionSmall,.705882rem);
  --crm-text-caption:var(--crm-os-caption,.764706rem);
  --crm-text-footnote:var(--crm-os-footnote,.823529rem);
  --crm-text-subhead:var(--crm-os-subhead,.882353rem);
  --crm-text-title-3:var(--crm-os-title3,1.176471rem);
  --crm-text-title-2:var(--crm-os-title2,1.294118rem);
  --crm-text-title-1:var(--crm-os-title1,1.529412rem);
  --crm-text-heading:var(--crm-os-heading,2rem);
 }
}
:root[data-crm-native="ios"][data-crm-text-size="auto"] {font-size:var(--crm-os-body,17px)}
body {line-height:1.5}
input:not([type="radio"]):not([type="checkbox"]),select,textarea {font-size:max(16px,1rem);line-height:1.5}
h1,h2,h3,h4 {text-wrap:balance}
h1,h2 {letter-spacing:-.025em}
.fields dd,.form-section p,.deal-card h3,.task-description,.board-card-title {overflow-wrap:anywhere}
.fields dd {font-size:var(--crm-text-body);line-height:1.5}
.fields dt,label {line-height:1.5}
.tabs,.owner-filter,.inline,.form-actions,.task-composer-actions {flex-wrap:wrap}
.tabs button,.page-heading>button,.stage-heading button {white-space:normal}
.chat-composer textarea {line-height:1.5}
.typography-settings {scroll-margin-top:110px}
.typography-settings fieldset {border:0;padding:0;margin:20px 0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;min-width:0}
.typography-settings legend {padding:0;margin-bottom:10px}
.typography-option {display:flex;align-items:center;gap:10px;min-width:0;padding:14px;border:1px solid var(--crm-line);border-radius:14px;background:var(--crm-control);color:var(--crm-text);font-size:1rem;cursor:pointer}
.typography-option input {width:20px;height:20px;min-height:20px;flex:none;margin:0;accent-color:var(--crm-text)}
.typography-option>span {min-width:0;overflow-wrap:anywhere;line-height:1.4}
.typography-option small {display:block;font-size:var(--crm-text-footnote);font-weight:400;color:var(--crm-muted);margin-top:3px}
.typography-option:has(input:checked) {border-color:var(--crm-focus);box-shadow:inset 0 0 0 1px var(--crm-focus);background:var(--crm-inset)}
.typography-option:focus-within {outline:2px solid var(--crm-focus);outline-offset:3px}
.typography-preview {border:1px solid var(--crm-line);border-radius:16px;padding:20px;background:var(--crm-inset)}
.typography-preview h4 {font-size:var(--crm-text-title-3);line-height:1.3;font-weight:600;margin:12px 0 8px}
.typography-preview p {font-size:1rem;line-height:1.5;margin:0 0 16px}
#typography-reset {margin-top:8px;max-width:100%;white-space:normal}
/* The native tab bar grows with its labels. Keep form actions above it. */
:root[data-crm-native="ios"]:is([data-crm-theme="liquid-glass"],[data-crm-theme="light"]) {--crm-dialog-bottom-space:calc(var(--crm-native-menu-space,104px) + env(safe-area-inset-bottom,0px))}
:root[data-crm-native="ios"]:is([data-crm-theme="liquid-glass"],[data-crm-theme="light"]) .workspace {padding-bottom:calc(var(--crm-native-menu-space,104px) + env(safe-area-inset-bottom,0px))}
@media(max-width:680px) {
 .typography-settings fieldset {gap:8px}
 .typography-option {padding:12px 10px;gap:8px}
 .typography-preview {padding:16px}
 .page-heading {flex-wrap:wrap}
 .tabs button {min-height:44px}
 .fields {gap:18px}
 .chat-emoji-toggle {font-size:24px}
}
@media(max-width:1000px) {
 :root[data-crm-large-text="true"] .form-grid,:root[data-crm-large-text="true"] .fields {grid-template-columns:minmax(0,1fr)}
 :root[data-crm-large-text="true"] .typography-settings fieldset {grid-template-columns:minmax(0,1fr)}
 :root[data-crm-large-text="true"] .owner-filter {width:100%}
 :root[data-crm-large-text="true"] .owner-filter button {flex:1}
 :root[data-crm-large-text="true"] .overview-metrics {grid-template-columns:minmax(0,1fr)}
 :root[data-crm-large-text="true"] .tabs {display:flex;gap:6px;flex-wrap:wrap}
 :root[data-crm-large-text="true"] .task-info-fields>div {grid-template-columns:minmax(0,1fr)}
}
.modal-head {align-items:flex-start;min-width:0}
.modal-head h2 {min-width:0;overflow-wrap:anywhere;flex:1}
.modal-head>button {flex:none}
#chat-details textarea[name="message"] {line-height:1.5;min-height:calc(1.5em + 16px);max-height:min(10rem,30dvh)}

/* Smaller controls and room between fields and actions. */
:root {--crm-text-button:max(12px,calc(1rem - 1px))}
.overview-channel-periods {gap:10px;margin:16px 0 20px}
.overview-channel-periods button {font-size:var(--crm-text-button);font-weight:500;line-height:1.35;padding:9px 12px;min-height:44px;max-width:100%;overflow-wrap:anywhere}
.overview-channel-periods button[aria-pressed="true"] {font-weight:500}
.overview-channel-total {margin:0 0 16px}
.overview-channel-cards {gap:12px}
.overview-channel-cards article {padding:16px;border-radius:14px}
.overview-channel-cards h3 {margin-bottom:10px}
.overview-channel-cards dl {margin-top:12px;gap:8px}
.overview-channel-note {margin-top:20px;line-height:1.6}
.tabs {gap:10px;margin-block:28px 20px;padding-bottom:18px}
.inline,.task-page-actions,.task-composer-actions,.deal-activity-actions {gap:12px}
.form-actions {gap:12px;margin-top:32px;padding-top:24px}
.form-actions button {min-width:0;max-width:100%;overflow-wrap:anywhere}
.form-grid+.form-actions {margin-top:32px}
.chat-link-controls,.chat-contact-actions,.deal-contact-actions {gap:12px}
.typography-settings fieldset {margin-block:24px;gap:12px}
#typography-reset {margin-top:16px}
@media(max-width:680px) {
 .tabs {gap:10px}
 .overview-channel-cards article {padding:14px}
 .overview-channel-periods {gap:10px 12px}
}
