/* Echo UI client and location compositions. */
.client-acs-tab {
  font-size: var(--ui-font-size-table);
}

.client-acs-card h3 {
  font-size: var(--ui-font-size-subsection);
  line-height: var(--ui-line-height-tight);
  margin-bottom: 2px;
}

.client-acs-card .ui-help,
.client-acs-card label {
  font-size: var(--ui-font-size-caption);
  line-height: var(--ui-line-height-normal);
}

.client-acs-card .ui-row {
  gap: 10px;
  margin-top: 10px;
}

.client-acs-card .ui-row > div {
  min-width: 210px;
}

.client-acs-card b {
  font-size: var(--ui-font-size-table);
  line-height: var(--ui-line-height-normal);
  overflow-wrap: anywhere;
}

.client-acs-form input,
.client-acs-form select {
  min-height: var(--ui-control-height);
  padding: var(--ui-control-padding);
  font-size: var(--ui-font-size-control);
}

.client-acs-form button {
  width: auto;
  min-height: var(--ui-control-height-compact);
  margin-top: 10px;
  padding: var(--ui-control-padding-compact);
  font-size: var(--ui-font-size-button);
}

.client-acs-radio-form {
  margin-top: 8px;
}

@media (max-width: 700px) {
  .client-acs-tab {
    font-size: var(--ui-font-size-secondary);
  }

  .client-acs-card .ui-row {
    gap: 7px;
  }

  .client-acs-card .ui-row > div {
    min-width: 100%;
  }
}

/* Extracted from client_detail.html */
  .job-summary{ cursor: pointer; display: grid; gap: 6px; grid-template-columns: 1fr auto; align-items: start; }
  .job-summary::-webkit-details-marker{ display: none; }
  .job-summary-main{ display: grid; gap: 6px; }
  .job-delete-btn{
    width: auto;
    padding: 4px 8px;
    min-height: auto;
    background: var(--ui-color-surface);
    border: 1px solid rgba(17,22,51,.18);
    color: var(--ui-color-text);
    font-size: var(--ui-font-size-secondary);
  }
  [data-client-detail-root] .ui-dialog{
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 40;
    padding: 20px;
  }
  [data-client-detail-root] .ui-dialog.hidden{ display: none; }
  [data-client-detail-root] .ui-dialog__panel{
    background: var(--ui-color-surface);
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius);
    padding: 18px;
    width: 100%;
    max-width: 420px;
  }
  .client-header-shell{
    position: relative;
    margin-bottom: 0;
  }
  .client-header-card{
    position: relative;
    margin-bottom: 0;
    overflow: visible;
  }
  .account-role-indicator{
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }
  .account-role-indicator .ui-help{
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }
  .client-header-actions{
    align-items: flex-end;
  }
  .client-sms-reminder-toggle{
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .equipment-serial-field{
    min-width: 260px;
    flex: 1 1 260px;
  }
  .equipment-serial-list{
    display: grid;
    gap: 6px;
  }
  .equipment-serial-row{
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px 34px;
    gap: 6px;
    align-items: center;
  }
  .equipment-serial-row input{
    width: 100%;
  }
  .equipment-serial-btn{
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    line-height: var(--ui-line-height-none);
    font-weight: var(--ui-font-weight-bold);
  }
  .client-edit-shell{
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .client-edit-header{
    margin-bottom: 0;
  }
  .client-edit-header-copy{
    margin-top: 4px;
    max-width: 720px;
  }
  .client-edit-form{
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .client-edit-grid{
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 12px;
  }
  .client-edit-section{
    grid-column: span 6;
    margin-bottom: 0;
    padding: 14px;
  }
  .client-edit-section-wide{
    grid-column: 1 / -1;
  }
  .client-edit-section-head{
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
  }
  .client-edit-section h4,
  .client-edit-contact-head h4{
    font-size: var(--ui-font-size-subsection);
  }
  .client-edit-fields{
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 10px 12px;
  }
  .client-edit-field{
    grid-column: span 3;
    min-width: 0;
  }
  .client-edit-field-lg{
    grid-column: span 4;
  }
  .client-edit-field-xl{
    grid-column: span 5;
  }
  .client-edit-form label{
    margin: 0 0 4px;
  }
  .client-edit-help{
    margin-top: 4px;
  }
  .client-edit-contact-grid{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .client-edit-contact-card{
    margin-bottom: 0;
    padding: 12px;
  }
  .client-edit-contact-head{
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
  }
  .client-edit-check{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: var(--ui-font-size-secondary);
    color: var(--ui-color-text);
  }
  .client-edit-check input[type="checkbox"]{
    margin-right: 0;
  }
  .client-edit-actions{
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .client-edit-error{
    margin-bottom: 0;
  }
  .client-alert-stack{
    position: fixed;
    top: auto;
    left: 20px;
    bottom: 20px;
    width: min(420px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    z-index: 120;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    pointer-events: none;
  }
  .client-alert-popup{
    border: 1px solid rgba(220,38,38,.82);
    background: rgba(254,226,226,.97);
    color: #111827;
    border-radius: var(--ui-radius);
    box-shadow: var(--ui-shadow-overlay);
    padding: 12px 14px;
    width: 100%;
    max-width: 100%;
    pointer-events: auto;
  }
  .notes-alert-text{ white-space: pre-wrap; overflow-wrap: anywhere; }
  .notes-box{ max-width: 320px; }
  .notes-header{ gap: 10px; margin-bottom: 8px; }
  .notes-entries{ max-height: 360px; overflow-y: auto; font-size: var(--ui-font-size-secondary); }
  .notes-entry-text{ white-space: pre-wrap; }
  .notes-entry-meta{ font-size: var(--ui-font-size-caption); margin-top: 4px; }
  .notes-delete-btn{
    border-color: rgba(17,22,51,.18);
    background: var(--ui-color-surface);
    color: var(--ui-color-text);
    min-height: auto;
    padding: 4px 8px;
  }
  .client-overview-card{
    font-size: var(--ui-font-size-body);
  }
  .client-overview-card .ui-help{
    font-size: var(--ui-font-size-caption);
  }
  .client-overview-card h4{
    font-size: var(--ui-font-size-section);
  }
  .client-overview-card .service-title b,
  .client-overview-card .ui-row b{
    font-size: var(--ui-font-size-body);
  }
  .changelog-box{ max-width: 320px; }
  .changelog-box h4{ font-size: var(--ui-font-size-table); margin-bottom: 8px; }
  .changelog-box b{ font-size: var(--ui-font-size-table); font-weight: var(--ui-font-weight-semibold); }
  .changelog-box b{ display:block; overflow-wrap:anywhere; }
  .changelog-box .ui-help{ font-size: var(--ui-font-size-caption); }
  .changelog-entries{ max-height: 360px; overflow-y: auto; font-size: var(--ui-font-size-table); }
  .client-changelog-detail summary{ cursor:pointer; }
  .client-changelog-detail__body{
    margin-top: var(--ui-space-2);
    padding-left: var(--ui-space-3);
    border-left: 2px solid var(--ui-color-border-strong);
    overflow-wrap:anywhere;
  }
  .service-header{ display:flex; align-items:center; gap:8px; }
  .service-title{ display:flex; align-items:center; gap:8px; }
  .service-line{ display:flex; flex-direction:column; gap:4px; }
  .service-icon-btn{
    list-style: none;
    cursor: pointer;
    border: 1px solid rgba(17,22,51,.18);
    background: var(--ui-color-surface);
    color: var(--ui-color-text);
    width: var(--ui-control-height-compact);
    height: var(--ui-control-height-compact);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--ui-font-weight-bold);
    font-size: var(--ui-font-size-secondary);
    line-height: var(--ui-line-height-none);
  }
  .service-add > summary::-webkit-details-marker,
  .service-edit > summary::-webkit-details-marker{
    display: none;
  }
  .service-list .divider-row:last-child{
    border-bottom: 0;
    padding-bottom: 0;
  }
  .client-doc-actions{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
  }
  .client-doc-upload-form{
    margin: 0;
  }
  .client-doc-action-row{
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .client-doc-file-row{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
  }
  .client-doc-file-main{
    flex: 1 1 auto;
    min-width: 0;
  }
  .client-doc-file-name{
    overflow-wrap: anywhere;
  }
  .client-doc-file-delete{
    flex: 0 0 auto;
    margin: 0;
  }
  .client-doc-file-delete button{
    white-space: nowrap;
  }
  @media (max-width: 700px){
    .client-doc-file-row{
      align-items: stretch;
      flex-direction: column;
    }
    .client-doc-file-delete button{
      width: 100%;
    }
  }
  .prorata-modal-card{
    max-width: 560px;
  }
  .prorata-modal-card input[type="number"],
  .prorata-modal-card input[type="date"]{
    width: 100%;
  }
  .prorata-modal-card .ui-row{
    gap: 10px;
  }
  .prorata-modal-card #prorata_result > div{
    margin-bottom: 4px;
  }
  .prorata-modal-card #prorata_result > div:last-child{
    margin-bottom: 0;
  }
  .accounting-report{
    display:flex;
    flex-direction:column;
  }
  .accounting-status-grid{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap:10px;
    margin-top:10px;
  }
  .zoho-account-statement{
    display:grid;
    gap:10px;
    padding-top:14px;
    border-top:1px solid var(--ui-color-border);
  }
  .zoho-account-statement-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    flex-wrap:wrap;
  }
  .zoho-account-statement-head h4{
    margin:0;
    font-size: var(--ui-font-size-subsection);
    line-height: var(--ui-line-height-tight);
  }
  .zoho-account-statement-refreshed{
    color:var(--ui-color-text-muted);
    font-size: var(--ui-font-size-secondary);
    line-height: var(--ui-line-height-normal);
  }
  .zoho-account-statement-net{
    display:flex;
    align-items:baseline;
    gap:8px;
    flex-wrap:wrap;
    line-height: var(--ui-line-height-tight);
  }
  .zoho-account-statement-net span{
    color:var(--ui-color-text-muted-strong);
    font-size: var(--ui-font-size-table);
    font-weight: var(--ui-font-weight-semibold);
  }
  .zoho-account-statement-net strong{
    font-size: var(--ui-font-size-display);
    font-weight: var(--ui-font-weight-bold);
  }
  .zoho-account-statement-grid{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(140px, 1fr));
    gap:10px 18px;
  }
  .zoho-account-statement-metric{
    min-width:0;
  }
  .zoho-account-statement-metric span{
    display:block;
    color:var(--ui-color-text-muted);
    font-size: var(--ui-font-size-secondary);
    line-height: var(--ui-line-height-snug);
  }
  .zoho-account-statement-metric b{
    display:block;
    margin-top:2px;
    font-size: var(--ui-font-size-body);
    font-weight: var(--ui-font-weight-semibold);
  }
  .accounting-recon-table th,
  .accounting-recon-table td{
    font-size: var(--ui-font-size-table);
  }
  .accounting-recon-link-row{
    cursor:pointer;
  }
  .accounting-recon-link-row:focus-visible td{
    outline:2px solid var(--ui-color-primary);
    outline-offset:-2px;
  }
  .direct-debit-recon-cell{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    max-width:100%;
  }
  .direct-debit-recon-summary{
    display:flex;
    align-items:center;
    gap:8px;
    min-width:0;
    flex:1 1 auto;
    flex-wrap:wrap;
  }
  .direct-debit-recon-summary > *{
    white-space:nowrap;
  }
  .direct-debit-capture-btn{
    flex:0 0 auto;
    white-space:nowrap;
  }
  .direct-debit-capture-btn:not(:disabled){
    border-color: rgba(0, 108, 146, .9);
    background: #006c92;
    color: #fff;
  }
  .direct-debit-capture-btn:not(:disabled):hover,
  .direct-debit-capture-btn:not(:disabled):focus-visible{
    border-color: rgba(0, 88, 120, 1);
    background: #005878;
    color: #fff;
  }
  @media (max-width: 980px){
    .direct-debit-recon-cell{
      align-items:flex-start;
      flex-direction:column;
      gap:6px;
    }
  }
  body.modal-open{
    overflow:hidden;
  }
  .payment-capture-modal-card{
    max-height:calc(100vh - 32px);
    overflow:auto;
    overscroll-behavior:contain;
  }
  .payment-capture-results{
    max-height:min(340px, 34vh);
    overflow:auto;
    overscroll-behavior:contain;
    border:1px solid var(--ui-color-border);
    border-radius:8px;
  }
  .payment-capture-results .ui-table-wrap,
  .payment-capture-results table{
    margin:0;
  }
  .payment-capture-mode-tabs .active{
    border-color:var(--ui-color-primary);
  }
  .payment-capture-invoice-row,
  .payment-capture-client-row{
    cursor:pointer;
  }
  .payment-capture-invoice-row.active td,
  .payment-capture-client-row.active td{
    background:var(--ui-color-surface-muted);
  }
  .payment-allocation-breakdown{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(150px, 1fr));
    gap:10px 18px;
  }
  .payment-allocation-breakdown > div{
    min-width:0;
  }
  .payment-allocation-breakdown span,
  .payment-allocation-breakdown b{
    display:block;
  }
  .payment-allocation-breakdown span{
    color:var(--ui-color-text-muted);
    font-size:var(--ui-font-size-secondary);
    line-height:var(--ui-line-height-snug);
  }
  .payment-allocation-breakdown b{
    margin-top:2px;
    font-size:var(--ui-font-size-body);
  }
  .payment-excess-confirm{
    display:flex;
    align-items:flex-start;
    gap:10px;
    cursor:pointer;
    line-height:var(--ui-line-height-normal);
  }
  .payment-excess-confirm input{
    flex:0 0 auto;
    margin-top:3px;
  }
  .credit-allocation-table .credit-allocation-amount{
    min-width:7rem;
  }
  .credit-allocation-mobile-detail{
    display:none;
  }
  .credit-allocation-table tr.active td{
    background:var(--ui-color-surface-muted);
  }
  @media (max-width: 980px){
    .payment-allocation-breakdown{
      grid-template-columns:repeat(2, minmax(0, 1fr));
    }
    .credit-allocation-table{
      min-width:0;
      width:100%;
    }
    .credit-allocation-table th:nth-child(3),
    .credit-allocation-table th:nth-child(4),
    .credit-allocation-table th:nth-child(5),
    .credit-allocation-table td:nth-child(3),
    .credit-allocation-table td:nth-child(4),
    .credit-allocation-table td:nth-child(5){
      display:none;
    }
    .credit-allocation-mobile-detail{
      display:block;
      overflow-wrap:anywhere;
    }
    .credit-allocation-table .credit-allocation-amount{
      min-width:5.5rem;
      width:5.5rem;
    }
  }
  @media (max-width: 560px){
    .payment-allocation-breakdown{
      grid-template-columns:1fr;
    }
    .credit-allocation-table thead{
      position:absolute;
      width:1px;
      height:1px;
      padding:0;
      margin:-1px;
      overflow:hidden;
      clip:rect(0, 0, 0, 0);
      white-space:nowrap;
      border:0;
    }
    .credit-allocation-table tbody{
      display:block;
    }
    .credit-allocation-table tbody tr{
      display:grid;
      grid-template-columns:auto minmax(0, 1fr) auto;
      gap:4px 10px;
      align-items:center;
      padding:10px;
      border-bottom:1px solid var(--ui-color-border);
    }
    .credit-allocation-table tbody td{
      display:block;
      padding:0;
      border:0;
    }
    .credit-allocation-table tbody td:nth-child(1){
      grid-column:1;
      grid-row:1 / span 2;
    }
    .credit-allocation-table tbody td:nth-child(2){
      grid-column:2;
      grid-row:1;
    }
    .credit-allocation-table tbody td:nth-child(6){
      grid-column:2;
      grid-row:2;
      font-size:var(--ui-font-size-secondary);
    }
    .credit-allocation-table tbody td:nth-child(6)::before{
      content:"Available ";
      color:var(--ui-color-text-muted);
    }
    .credit-allocation-table tbody td:nth-child(7){
      grid-column:3;
      grid-row:1 / span 2;
    }
  }
  .accounting-status-card{
    min-height:84px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
  }
  .accounting-status-value{
    line-height: var(--ui-line-height-none);
  }
  .accounting-report-table{
    table-layout:fixed;
  }
  .accounting-report-table th,
  .accounting-report-table td{
    vertical-align:top;
  }
  .accounting-report-table .accounting-col-account{
    width:8rem;
  }
  .accounting-report-table .accounting-col-client{
    width:22%;
  }
  .accounting-report-table .accounting-col-date{
    width:12rem;
  }
  .accounting-report-table .accounting-col-days{
    width:6rem;
  }
  .accounting-report-table .accounting-col-payment-day{
    width:8rem;
  }
  .accounting-report-table .accounting-col-payment-method{
    width:9rem;
  }
  .accounting-cell-account,
  .accounting-cell-date,
  .accounting-cell-day,
  .accounting-cell-method,
  .accounting-cell-number{
    white-space:nowrap;
  }
  .accounting-cell-account,
  .accounting-cell-date,
  .accounting-cell-number{
    font-variant-numeric: tabular-nums;
  }
  .accounting-col-number,
  .accounting-cell-number{
    text-align:right;
  }
  .accounting-cell-client,
  .accounting-cell-note{
    overflow-wrap:anywhere;
  }
  .threecx-admin{
    display:flex;
    flex-direction:column;
  }
  .threecx-admin-stat-grid{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap:10px;
  }
  .threecx-admin-stat-grid-compact{
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .threecx-admin-stat{
    min-height:72px;
    padding:9px 10px;
    border:1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-color-surface);
  }
  .threecx-admin-stat label{
    margin-top:0;
  }
  .threecx-admin-table{
    table-layout:fixed;
  }
  .threecx-admin-table th,
  .threecx-admin-table td{
    vertical-align:top;
  }
  .threecx-col-key{
    width:16rem;
  }
  .threecx-col-extension{
    width:10rem;
  }
  .threecx-col-updated{
    width:12rem;
  }
  .threecx-col-count{
    width:7rem;
  }
  .threecx-col-id{
    width:8rem;
  }
  .threecx-col-conversation{
    width:11rem;
  }
  .threecx-col-ticket{
    width:9rem;
  }
  .threecx-col-status{
    width:7rem;
  }
  .threecx-col-client{
    width:8rem;
  }
  .threecx-cell-code,
  .threecx-cell-date,
  .threecx-cell-status,
  .threecx-cell-client,
  .threecx-cell-ticket,
  .threecx-cell-number{
    white-space:nowrap;
  }
  .threecx-cell-code,
  .threecx-cell-date,
  .threecx-cell-number{
    font-variant-numeric: tabular-nums;
  }
  .threecx-col-number,
  .threecx-cell-number{
    text-align:right;
  }
  .threecx-admin-break{
    overflow-wrap:anywhere;
  }
  .workers-admin{
    display:flex;
    flex-direction:column;
  }
  .workers-admin .ui-row{
    display:grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap:10px;
  }
  .workers-admin .ui-row > div{
    min-width:0;
    padding:9px 10px;
    border:1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-sm);
    background: var(--ui-color-surface);
  }
  .workers-admin-table{
    table-layout:fixed;
  }
  .workers-admin-table th,
  .workers-admin-table td{
    vertical-align:top;
  }
  .workers-admin-table code{
    white-space:normal;
    overflow-wrap:anywhere;
  }
  .workers-admin-break{
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  .workers-admin-sql{
    max-width:720px;
    overflow-wrap:anywhere;
    word-break:break-word;
  }
  .zoho-admin{
    display:flex;
    flex-direction:column;
  }
  .zoho-admin-action-row{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin-top:12px;
    align-items:flex-end;
  }
  .zoho-admin-action-row form{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    align-items:flex-end;
    margin:0;
  }
  .zoho-admin-action-row input{
    width:auto;
    min-width:240px;
    max-width:100%;
  }
  .billing-custom-interval-row{
    flex-wrap:nowrap;
  }
  .billing-repeat-input{
    max-width:110px;
  }
  .billing-line-description{
    min-height:64px;
    line-height: var(--ui-line-height-normal);
    resize:vertical;
  }
  .billing-line-total-heading,
  .billing-line-row-total-cell{
    text-align:right;
  }
  .billing-line-row-total{
    font-weight: var(--ui-font-weight-bold);
    font-variant-numeric:tabular-nums;
  }
  .billing-item-picker{
    position:fixed;
    left:50%;
    top:clamp(76px, 14vh, 150px);
    width:min(560px, calc(100vw - 24px));
    transform:translateX(-50%);
    z-index:2000;
    max-height:260px;
    overflow:auto;
    padding:6px;
    min-width:min(280px, calc(100vw - 24px));
    box-sizing:border-box;
  }
  .billing-item-picker-empty{
    padding:8px;
  }
  .billing-item-picker-option{
    display:block;
    width:100%;
    text-align:left;
    margin:2px 0;
  }
  .monitoring-table{
    table-layout:fixed;
    width:100%;
  }
  .monitoring-table th,
  .monitoring-table td{
    vertical-align:top;
    word-break:break-word;
  }
  .monitoring-message{
    margin-bottom:10px;
  }
  .monitoring-message-notice{
    color:#b45309;
  }
  .monitoring-message-error{
    color:#b91c1c;
  }
  .catalog-item-row{
    display:grid;
    grid-template-columns:minmax(260px, 1fr) minmax(150px, auto) minmax(260px, max-content);
    align-items:start;
    gap:10px 16px;
  }
  .catalog-item-main{
    min-width:0;
  }
  .catalog-item-linked{
    justify-self:center;
    white-space:nowrap;
  }
  .catalog-item-meta{
    justify-self:end;
    min-width:0;
    text-align:right;
    overflow-wrap:anywhere;
  }
  .catalog-item-meta code{
    overflow-wrap:anywhere;
  }
  @media (max-width: 860px){
    .catalog-item-row{
      grid-template-columns:1fr;
      gap:6px;
    }
    .catalog-item-linked,
    .catalog-item-meta{
      justify-self:start;
      text-align:left;
      white-space:normal;
    }
  }
  .tickets-client .ui-list-item{ padding: 6px 7px; margin-bottom: 4px; }
  .tickets-client .ui-list-item .ui-help{ font-size: var(--ui-font-size-caption); }
  .tickets-client .ui-list-item .ui-title--subsection{ font-size: var(--ui-font-size-subsection); }
  .tickets-client .ui-list-item .ui-split{ gap:6px; }
  .bulk-actions{ display:none; padding: 6px 8px; margin-bottom: 5px; }
  body.selection-enabled .bulk-actions{ display:block; }
  .bulk-actions .ui-help{ font-size: var(--ui-font-size-caption); }
  .tickets-client .ticket-select{ width: 22px; }
  .tickets-client .ui-list-item .ui-split{ display:grid; grid-template-columns: 22px 1fr auto; align-items:flex-start; gap:8px; }
  .tickets-client .ticket-actions{ justify-self:end; }
  .tickets-client .ui-list-item .ui-title--subsection{ line-height: var(--ui-line-height-tight); }
  .tickets-client .ticket-actions{ min-width: auto; }
  .tickets-client .ticket-actions .ui-action-group{ gap: 4px; flex-wrap: nowrap; }
  .tickets-client .ticket-actions form{ flex: 0 0 auto; }
  .tickets-client .ticket-actions select{
    min-height: var(--ui-control-height-compact);
    height: var(--ui-control-height-compact);
    padding: var(--ui-control-padding-compact);
    font-size: var(--ui-font-size-control);
    line-height: var(--ui-line-height-tight);
  }
  .tickets-client .ticket-status-select{ width: 92px; }
  .tickets-client .ticket-category-select{ width: 122px; }
  .tickets-client .ticket-assignee-select{ width: 118px; }
  .tickets-client #enable_ticket_select,
  .tickets-client #select_all_tickets{
    width: 12px;
    height: 12px;
    margin-right: 4px;
  }
  .tickets-main .ticket-actions{ min-width: auto; }
  .tickets-main .ticket-actions .ui-action-group{ gap: 4px; flex-wrap: nowrap; }
  .tickets-main .ticket-actions form{ flex: 0 0 auto; }
  .tickets-main .ticket-actions select{
    min-height: var(--ui-control-height-compact);
    height: var(--ui-control-height-compact);
    padding: var(--ui-control-padding-compact);
    font-size: var(--ui-font-size-control);
    line-height: var(--ui-line-height-tight);
  }
  .tickets-main .ticket-status-select{ width: 92px; }
  .tickets-main .ticket-category-select{ width: 122px; }
  .tickets-main .ticket-assignee-select{ width: 118px; }
  body.selection-disabled .ticket-select input{
    visibility: hidden;
    pointer-events: none;
  }
  [data-client-detail-root] .ui-toast{
    position: fixed;
    right: 24px;
    bottom: 24px;
    background: var(--ui-color-surface);
    border: 1px solid var(--ui-color-border-strong);
    box-shadow: var(--ui-shadow-overlay);
    padding: 12px 14px;
    border-radius: 12px;
    font-size: var(--ui-font-size-secondary);
    z-index: 100;
    transition: transform .2s ease, opacity .2s ease;
  }
  .toast-hidden{ opacity: 0; transform: translateY(8px); pointer-events: none; }
  .toast-error{ border-color: rgba(239,68,68,.4); }
  .toast-success{ border-color: rgba(16,185,129,.4); }
  @media (max-width: 700px){
    .client-alert-stack{
      top: auto;
      left: 12px;
      bottom: 12px;
      width: calc(100vw - 24px);
      max-width: calc(100vw - 24px);
    }
  }

/* Client workspace tab composition. */
  .client-header-tabs{
    margin-top: var(--ui-space-7);
    padding-top: var(--ui-space-4);
    border-top: 1px solid var(--ui-color-border);
  }

/* Client account workspace: consistent composition across every profile tab. */
.client-workspace-panel {
  padding-top: var(--ui-space-5);
}

.client-workspace-panel > :last-child,
.client-workspace-panel > [data-client-tab-fragment] > :last-child,
.client-workspace-card > :last-child {
  margin-bottom: 0;
}

.client-workspace-card {
  min-width: 0;
  margin-bottom: var(--ui-space-5);
}

.client-workspace-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ui-space-5);
  margin-bottom: var(--ui-space-6);
}

.client-workspace-section-head .ui-title,
.client-workspace-section-head + .ui-title,
.client-workspace-card > .ui-split .ui-title {
  margin: 0;
}

.client-workspace-section-head .ui-text--secondary,
.client-workspace-card > .ui-split .ui-text--secondary {
  max-width: var(--ui-prose-width);
  margin: var(--ui-space-1) 0 0;
}

.client-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px) minmax(260px, 300px);
  gap: var(--ui-space-5);
  align-items: start;
}

.client-overview-layout .notes-box,
.client-overview-layout .changelog-box {
  max-width: none;
  min-width: 0;
}

.client-workspace-aside {
  top: 88px;
}

.client-fact-grid,
.client-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--ui-space-3);
}

.client-fact {
  min-width: 0;
  padding: var(--ui-space-4) var(--ui-space-5);
  border-left: 3px solid var(--ui-color-border-strong);
  border-radius: 0 var(--ui-radius-control) var(--ui-radius-control) 0;
  background: var(--ui-color-surface-muted);
}

.client-fact--wide {
  grid-column: 1 / -1;
}

.client-contact-grid .client-fact {
  min-height: 112px;
}

.client-accounting-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: var(--ui-space-5);
  align-items: start;
}

.client-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.client-metric {
  min-height: 82px;
  padding: var(--ui-space-4) var(--ui-space-5);
}

.client-metric > div:last-child {
  margin-top: var(--ui-space-1);
  overflow-wrap: anywhere;
}

.client-network-service {
  margin: var(--ui-space-4) 0 0;
}

.client-network-service:last-child {
  margin-bottom: 0;
}

.client-network-service-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-4);
  flex-wrap: wrap;
}

.client-network-service-head .ui-title {
  margin: 0;
}

.client-network-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--ui-space-3);
}

.client-network-fact {
  min-width: 0;
  padding: var(--ui-space-3) var(--ui-space-4);
  border: 1px solid var(--ui-color-border);
  border-radius: var(--ui-radius-control);
  background: var(--ui-color-surface);
}

.client-network-fact span,
.client-network-fact b {
  display: block;
}

.client-network-fact span {
  color: var(--ui-color-text-muted);
  font-size: var(--ui-font-size-secondary);
  line-height: var(--ui-line-height-snug);
}

.client-network-fact b {
  margin-top: var(--ui-space-1);
  overflow-wrap: anywhere;
  font-size: var(--ui-font-size-body);
}

.client-network-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--ui-space-3);
  align-items: center;
}

.client-create-panel {
  margin: 0 0 var(--ui-space-5);
}

.client-create-panel__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ui-space-5);
  list-style: none;
  cursor: pointer;
}

.client-create-panel__summary::-webkit-details-marker {
  display: none;
}

.client-create-panel__summary > span:first-child {
  display: flex;
  flex-direction: column;
  gap: var(--ui-space-1);
}

.client-create-panel[open] .client-create-panel__summary {
  padding-bottom: var(--ui-space-4);
  margin-bottom: var(--ui-space-5);
  border-bottom: 1px solid var(--ui-color-border);
}

.client-required-doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: var(--ui-space-4);
  margin-top: var(--ui-space-4);
}

.client-required-doc {
  min-width: 0;
  margin: 0;
}

.client-required-doc .client-doc-actions {
  max-width: min(100%, 320px);
}

.client-required-doc input[type="file"] {
  max-width: 100%;
}

.client-upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--ui-space-3);
  align-items: center;
}

.client-workspace-panel .tickets-client-layout,
.client-workspace-panel .tickets-main,
.client-workspace-panel .tickets-aside {
  min-width: 0;
}

@media (max-width: 1280px) {
  .client-overview-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-overview-card {
    grid-column: 1 / -1;
  }

  .client-workspace-aside {
    position: static;
  }
}

@media (max-width: 1050px) {
  .client-accounting-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .client-workspace-panel {
    padding-top: var(--ui-space-4);
  }

  .client-workspace-section-head,
  .client-workspace-card > .ui-split,
  .client-create-panel__summary {
    align-items: stretch;
    flex-direction: column;
  }

  .client-overview-layout,
  .client-required-doc-grid {
    grid-template-columns: 1fr;
  }

  .client-overview-card {
    grid-column: auto;
  }

  .client-fact-grid,
  .client-metric-grid {
    grid-template-columns: 1fr;
  }

  .client-contact-grid .client-fact,
  .client-metric {
    min-height: 0;
  }

  .client-network-search-row {
    grid-template-columns: 1fr;
  }

  .client-upload-row {
    grid-template-columns: 1fr;
  }

  .client-upload-row .ui-button {
    width: 100%;
  }

  .client-required-doc .client-doc-actions,
  .client-required-doc .client-doc-upload-form,
  .client-required-doc .ui-button {
    width: 100%;
    max-width: none;
  }
}
.acs-refresh-spinner {
  width: 0.9rem;
  height: 0.9rem;
  display: inline-block;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: acs-refresh-spin 0.8s linear infinite;
}

@keyframes acs-refresh-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .acs-refresh-spinner { animation-duration: 1.8s; }
}
