.crm-home-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.crm-home-rows, .crm-timeline, .crm-quick-metrics { margin: 0; padding: 0; list-style: none; }
.crm-home-rows li, .crm-section-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 12px 18px; border-top: 1px solid var(--border); }
.crm-home-rows li p, .crm-section-row p { overflow-wrap: anywhere; }
.crm-home-rows li > div:first-child, .crm-section-row > div:first-child { min-width: 0; overflow-wrap: anywhere; }
.crm-home-rows li .muted { font-size: 12px; }
.crm-home-rows .text-link { flex: 0 0 auto; }
.crm-home-update { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.crm-row-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: end; align-items: center; gap: 8px; }
.crm-section-row > .crm-row-actions { flex: 0 1 auto; }
.crm-card-action { padding: 11px 18px; border-top: 1px solid var(--border); }
.crm-view-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.crm-view-toolbar > nav { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.crm-view-toolbar nav button { min-height: 36px; padding: 6px 11px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--muted); font-weight: 640; white-space: nowrap; }
.crm-view-toolbar nav button:hover { color: var(--accent); }
.crm-view-toolbar nav button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); }
.crm-view-toolbar > .crm-row-actions { flex: 0 1 auto; }
.crm-customer-layout { display: grid; grid-template-columns: minmax(200px, 270px) minmax(0, 1fr); align-items: start; gap: 18px; }
.crm-customer-layout > *, .crm-customer-detail > * { min-width: 0; }
.crm-customer-list { position: sticky; top: 16px; }
.crm-customer-list .card-head { padding: 14px 13px 12px; gap: 8px; }
.crm-customer-search { padding: 0 13px 9px; }
.crm-customer-rows { max-height: min(50vh, 420px); overflow: auto; }
.crm-customer-rows > [data-crm-customer-row]:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding-inline-end: 13px; border-top: 1px solid var(--border); }
.crm-customer-rows [data-action="open-customer"] { display: grid; min-width: 0; gap: 2px; width: 100%; padding: 11px 15px; border: 0; background: var(--paper); color: var(--ink); text-align: left; overflow-wrap: anywhere; }
.crm-customer-rows [data-action="open-customer"]:hover, .crm-customer-rows [data-action="open-customer"][aria-current="true"] { background: var(--accent-soft); color: var(--accent); }
.crm-customer-rows small { color: var(--muted); }
.crm-customer-rows .crm-customer-code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-customer-header .crm-customer-code { overflow-wrap: anywhere; }
.crm-list-footer { padding: 11px 13px; border-top: 1px solid var(--border); }
.crm-customer-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px; }
.crm-customer-header > div:first-child { flex: 1 1 140px; min-width: 0; }
.crm-customer-header h2 { overflow-wrap: anywhere; }
.crm-customer-header > .crm-row-actions { flex: 0 1 auto; }
.crm-customer-story { width: min(100%, 1120px); margin-inline: auto; }
.crm-customer-fold > summary { cursor: pointer; padding: 13px 16px; font-weight: 650; }
.crm-more-contacts > summary { border-top: 1px solid var(--border); }
.crm-customer-fold > .section-stack { padding: 0 16px 16px; }
.crm-customer-story .crm-customer-header { padding-inline: 16px; }
.crm-customer-management { flex: 0 0 100%; color: var(--muted); font-size: 13px; }
.crm-customer-management summary { cursor: pointer; width: fit-content; }
.crm-customer-management .inline-actions { margin-block-start: 8px; }
.crm-record-history { list-style: none; margin: 0 0 8px; padding: 0; }
.crm-record-history li { border-top: 1px solid var(--border); padding: 12px 20px; overflow-wrap: anywhere; }
.crm-record-history li p { font-size: 12px; }
.crm-record-history dl { display: grid; gap: 4px; margin: 6px 0 0; }
.crm-record-history dl > div { display: grid; grid-template-columns: minmax(80px, auto) minmax(0, 1fr); gap: 9px; }
.crm-record-history dt { color: var(--muted); }
.crm-record-history dd { margin: 0; }
.crm-timeline li { display: grid; grid-template-columns: 105px minmax(0, 1fr); gap: 12px; padding: 13px 18px; border-top: 1px solid var(--border); }
.crm-timeline-date { display: grid; align-content: start; font-size: 12px; font-variant-numeric: tabular-nums; }
.crm-timeline-body { display: grid; justify-items: start; gap: 4px; overflow-wrap: anywhere; min-width: 0; }
.crm-timeline-body .button-small { min-height: 25px; padding: 3px 7px; color: var(--accent); }
.crm-timeline-body p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; white-space: pre-wrap; }
.crm-source { scroll-margin-block: 12px; }
.crm-source:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.crm-original-body, .crm-manual-note { padding: 0 18px 13px; overflow-wrap: anywhere; }
.crm-manual-note form { padding-inline: 0; }
.crm-funnel-batch { border-top: 1px solid var(--border); }
.crm-funnel-batch .crm-section-row { border: 0; padding-bottom: 6px; }
.crm-funnel-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(102px, 1fr)); gap: 10px; margin: 0; padding: 9px 18px 15px; }
.crm-funnel-stages > div { padding-block-start: 8px; border-top: 2px solid var(--accent-soft); }
.crm-funnel-stages dt, .crm-funnel-stages small { color: var(--muted); font-size: 12px; }
.crm-funnel-stages dd { margin: 3px 0; font-weight: 720; }
.crm-quick-context { color: var(--accent); font-weight: 610; }
.crm-quick-storage:empty { display: none; }
.crm-quick-check { padding: 9px; border: 1px solid #e1cc9d; border-radius: 8px; background: var(--paper); }
.crm-quick-check > p { margin-block: 5px; font-size: 12px; }
.crm-quick-preview { white-space: pre-wrap; overflow-wrap: anywhere; }
.crm-quick-dialog [data-quick-options] > .crm-quick-fields { margin-top: 9px; font-size: 14px; }
.crm-quick-metrics li { padding-block: 9px; border-top: 1px solid var(--border); }
.crm-cal-agenda-actions { flex-wrap: wrap; }
.crm-progress { min-width: 0; }
.crm-progress-form { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.crm-progress-form .field { flex: 0 1 145px; }
.crm-feedback-requirements, .crm-feedback-adjust { flex: 1 0 100%; min-width: 0; }
.crm-feedback-requirements, .crm-feedback-common { padding: 12px 14px; border: 1px solid #cddacd; background: #edf2e9; border-radius: 5px; }
.crm-feedback-requirements h3, .crm-feedback-requirements p, .crm-feedback-common h4, .crm-feedback-person h4 { margin: 0 0 4px; }
.crm-feedback-adjust { padding-block: 8px; border-top: 1px solid var(--border); }
.crm-feedback-adjust summary, .crm-progress-body summary { cursor: pointer; }
.crm-feedback-adjust .field, .crm-feedback-adjust details { margin-top: 10px; }
.crm-feedback-person { border-top: 1px solid var(--border); padding-top: 10px; }
.crm-progress-status { margin: 0; }
.crm-progress-status:empty { display: none; }
.crm-progress-report { overflow-wrap: anywhere; }
.crm-progress-body { display: grid; gap: 21px; }
.crm-progress-body > section { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--border); }
.crm-progress-body p, .crm-progress-body h3, .crm-progress-body blockquote { margin: 0; }
.crm-progress-coverage { display: grid; gap: 5px; }
.crm-progress-lines, .crm-progress-sources { margin: 0; }
.crm-progress-lines { display: grid; gap: 12px; padding-inline-start: 20px; }
.crm-progress-lines > li > p + p { margin-top: 4px; }
.crm-progress-sources { display: grid; gap: 5px; margin-top: 6px; padding: 0; list-style: none; }
.crm-progress-sources li { padding-inline-start: 9px; border-inline-start: 2px solid var(--border); }
.crm-progress-sources blockquote { white-space: pre-wrap; }
.crm-progress-sources .text-link { display: inline-block; margin-top: 3px; white-space: normal; text-align: left; }
.crm-progress-body > [data-progress-overview] { padding-top: 0; border: 0; gap: 14px; }
.crm-progress-body [data-progress-overview] h4 { margin: 0 0 7px; }
.progress-overview-text { font-size: 1.06rem; line-height: 1.65; }
.progress-common-item, .progress-change-item { margin-top: 6px; padding: 12px 16px; background: var(--surface-alt, #f2f5f0); border-inline-start: 3px solid #5e7964; }
.progress-common-item > strong { font-size: 1.13rem; }
.progress-customer-item { display: grid; grid-template-columns: minmax(7em, 18%) 1fr; gap: 12px; align-items: baseline; padding-block: 10px; border-top: 1px solid var(--border); }
.progress-evidence { margin-top: 5px; }
.progress-evidence > summary { width: fit-content; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.progress-change-item { border-color: #93713e; background: var(--surface-alt, #f7f4ee); }
.progress-chronology { margin-top: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 650px) {
  .progress-customer-item, .progress-chronology { grid-template-columns: 1fr; gap: 5px; }
}

@media (max-width: 1050px) {
  .crm-customer-layout { grid-template-columns: minmax(176px, 225px) minmax(0, 1fr); }
  .crm-home-rows li .crm-row-actions { flex-direction: column; align-items: flex-end; }
}
@media (max-width: 790px) {
  .crm-home-grid { grid-template-columns: minmax(0, 1fr); }
  .crm-customer-layout { grid-template-columns: minmax(0, 1fr); }
  .crm-customer-list { position: static; }
  .crm-customer-layout-selected > .crm-customer-list { display: none; }
  .crm-view-toolbar > nav { flex: 1 1 auto; flex-wrap: nowrap; max-width: 100%; overflow: auto; padding-block-end: 5px; }
  .crm-view-toolbar { flex-wrap: wrap; }
  .crm-view-toolbar nav button { min-height: 44px; }
}
@media (max-width: 570px) {
  #shell-search-button { min-height: 32px; font-size: 12px; white-space: nowrap; }
  .crm-home-rows li, .crm-section-row { padding-inline: 12px; }
  .crm-customer-header { flex-wrap: wrap; padding: 14px; }
  .crm-customer-header .crm-row-actions { justify-content: flex-start; }
  .crm-timeline li { grid-template-columns: minmax(0, 1fr); gap: 3px; padding-inline: 12px; }
  .crm-timeline-date { display: flex; gap: 5px; }
  .crm-section-row:has(.crm-row-actions) { flex-wrap: wrap; }
  .crm-section-row > .crm-row-actions { justify-content: flex-start; }
  .crm-quick-dialog .crm-quick-actions .button, .crm-customer-header .button, .crm-cal-agenda-actions button { min-height: 44px; }
  .crm-progress-form .field { flex: 1 1 106px; }
  .crm-progress-form > button { flex: 1 0 100%; min-height: 44px; }
}
