.crm-filter-toolbar {
  display:flex!important; flex-wrap:wrap!important; align-items:end!important;
  gap:.45rem; width:100%; min-width:0; overflow:visible!important; padding-block:.25rem;
}
.crm-filter-toolbar > :not([type=hidden]):not(.crm-filter-icon) {
  flex:0 1 9rem!important; min-width:0!important; width:auto!important;
}
.crm-filter-toolbar > .crm-filter-search { flex:1 1 8rem!important; }
.crm-filter-toolbar :is(label,.search-select) { min-width:0; }
.crm-filter-toolbar :is(.crm-filter-search input,input.crm-filter-search,.search-select-input,select:not(.search-select-native),.crm-filter-icon) {
  box-sizing:border-box; height:2.65rem!important; min-height:2.65rem!important;
}
.crm-filter-toolbar :is(.crm-filter-search input,.search-select-input,select:not(.search-select-native)) { width:100%!important; min-width:0!important; }
.crm-filter-toolbar .search-select-toggle {
  inset:50% auto auto 4px!important; transform:translateY(-50%);
  height:1.65rem!important; min-height:0!important; padding:0!important;
  background:transparent!important; display:grid; place-items:center; line-height:1;
}
.crm-filter-toolbar .crm-filter-icon {
  display:inline-grid!important; place-items:center; flex:0 0 2.65rem!important;
  width:2.65rem!important; padding:0!important; white-space:nowrap;
}
.crm-filter-toolbar [hidden],.crm-filter-status:empty { display:none!important; }
@media(min-width:1000px){
  .crm-filter-toolbar {flex-wrap:nowrap!important;}
}

/* Long prose cannot set the minimum width of a list column. */
.crm-description-heading { width:18%; }
td.crm-description-preview {
  max-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap!important;
}
td.crm-description-preview :is(a,span,p,div) { white-space:inherit!important; }
td.crm-description-preview br { display:none; }
td.crm-description-preview :is(p,div) { display:inline; }

.crm-phone-cell {
  display:grid;
  grid-template-columns:minmax(14ch,1fr) 24px;
  min-width:calc(14ch + 24px + .6rem);
  width:100%;
  box-sizing:border-box;
  align-items:center;
  gap:.6rem;
  text-align:start;
  white-space:nowrap;
}
.crm-phone-cell > span { direction:ltr; unicode-bidi:isolate; white-space:nowrap; text-align:right; font-variant-numeric:tabular-nums; }
td:has(> .crm-phone-cell) { white-space:nowrap; }
.crm-phone-cell > button { margin:0; }

.crm-filter-toolbar:has(input[name="p"][value="sales_targets"]) :is(input:not([type="hidden"]), button) {
  box-sizing:border-box;
  height:2.65rem!important;
  min-height:2.65rem!important;
  margin-block-end:0!important;
}

/* The result count is informational and must not reserve a filter-sized slot. */
.crm-filter-toolbar.list-search > .muted[aria-live] {
  flex:0 0 auto!important;
  white-space:nowrap;
}
.crm-filter-toolbar.list-search > .muted[aria-live]:empty { display:none!important; }
.crm-filter-toolbar > .crm-filter-search:not(.crm-filter-icon) { flex:1 1 8rem!important; }

main .crm-page-heading {
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:.75rem 1.25rem;
  margin-block:0 1.25rem;
}
main .crm-page-heading h1 { margin:0; }
main .crm-page-heading p { margin:.35rem 0 0; }
main .crm-page-heading .eyebrow { display:none; }
main .crm-page-heading :is(.actions,.quick-links) {
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
  margin:0;
}
main .crm-page-heading .primary { display:inline-flex; }
main a[hidden].crm-archive-shortcut { display:none!important; }
.crm-filter-toolbar {
  box-sizing:border-box;
  inline-size:100%!important;
  max-inline-size:none!important;
}
.crm-filter-toolbar > .crm-filter-search:not(.crm-filter-icon) {
  flex:1 1 8rem!important;
  max-inline-size:none!important;
}
.crm-filter-toolbar > .crm-filter-search input,
.crm-filter-toolbar > input.crm-filter-search {
  max-inline-size:none!important;
}
.crm-filter-toolbar > .crm-filter-icon { min-width:0!important; }

main .crm-ticket-view-tabs {
  display:flex;
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:.75rem;
  margin:0 0 .65rem;
  border-block-end:1px solid var(--ui-border,#cbd5e1);
}
main .crm-ticket-view-tabs a {
  display:inline-flex;
  align-items:center;
  gap:.4rem;
  padding:.55rem .7rem;
  border-block-end:3px solid transparent;
}
main .crm-ticket-view-tabs a[aria-current="page"] {
  border-block-end-color:var(--ui-accent,#159b83);
  font-weight:700;
}
main .crm-ticket-view-tabs b {
  border-radius:1rem;
  padding:.08rem .42rem;
  background:var(--ui-panel,#eaf1f5);
  border:1px solid var(--ui-border,#cbd5e1);
}

/* Keep dropdown values and choices compact without shrinking labels or arrows. */
main :is(select:not(.search-select-native), input.search-select-input, .search-select-options li) {
  font-size:.8125em!important;
}


main .search-select-toggle { font-size:0!important; }
main .search-select-toggle::before {
  content:"";
  display:block;
  width:7px;
  height:7px;
  border:solid currentColor;
  border-width:0 1.6px 1.6px 0;
  transform:translateY(-2px) rotate(45deg);
}
main .search-select:has([aria-expanded="true"]) .search-select-toggle::before {
  transform:translateY(2px) rotate(225deg);
}

main .search-select .search-select-toggle {
  top:50%!important;
  bottom:auto!important;
  height:1.65rem!important;
  transform:translateY(-50%);
}
main .search-select-toggle::before,
main .search-select:has([aria-expanded="true"]) .search-select-toggle::before {
  position:absolute;
  top:50%;
  left:50%;
  width:12px;
  height:8px;
  border:0;
  background:currentColor;
  clip-path:polygon(0 16%, 12% 0, 50% 63%, 88% 0, 100% 16%, 50% 100%);
  transform:translate(-50%,-50%);
}
main .search-select:has([aria-expanded="true"]) .search-select-toggle::before {
  transform:translate(-50%,-50%) rotate(180deg);
}

/* Compact call action; fixed track keeps every row aligned. */
.crm-phone-cell > button.button {
 display:inline-flex;align-items:center;justify-content:center;
 width:24px!important;height:24px!important;min-width:24px!important;min-height:24px!important;
 padding:0!important;margin:0;border:0!important;border-radius:4px;
 background:transparent!important;color:var(--ui-text)!important;font-size:14px;line-height:1;
}
.crm-phone-cell > button.button:hover { background:var(--ui-hover)!important; }

/* Portal account columns fit the available width, with complete wrapped text. */
.table-wrap:has(> .portal-accounts-table){min-width:0;max-width:100%}
table.portal-accounts-table{table-layout:fixed!important;width:100%!important;min-width:0!important}
.portal-accounts-table :is(th,td){min-width:0!important;white-space:normal!important;overflow-wrap:anywhere;word-break:normal;padding:10px 7px}
.portal-accounts-table :is(th,td)>*{max-width:100%;box-sizing:border-box}
.portal-accounts-table td:last-child .button,.portal-accounts-table td:last-child button{display:block;width:100%;min-width:0;white-space:normal!important;padding:6px;font-size:11px;margin:4px 0}
.portal-accounts-table td:last-child form{min-width:0;max-width:100%;margin:0}
.portal-accounts-table :is(th,td):last-child{width:100px}
.portal-accounts-table :is(th,td):nth-last-child(2){width:64px}
.portal-accounts-table :is(th,td):nth-last-child(5){width:90px}
@media(max-width:640px){.portal-accounts-table :is(th,td){width:auto!important;padding:8px 3px;font-size:11px}.portal-accounts-table td:last-child .button,.portal-accounts-table td:last-child button{font-size:10px;padding:4px 2px}}

.portal-accounts-table td:last-child{white-space:nowrap!important}
.portal-accounts-table td:last-child .portal-account-action{
 display:inline-flex;align-items:center;justify-content:center;
 width:32px;height:32px;min-height:32px;min-width:32px;padding:0;margin:3px;
 vertical-align:middle;
}
.portal-account-action svg{display:block;flex-shrink:0}
