/* 客户与报价界面；通用客户样式同时适用于电脑和手机。 */
.client-history-field,
[data-client-cooperation-summary] {
  grid-column: 1 / -1;
  min-width: 0;
}

.client-history-field {
  display: grid;
  align-content: start;
  gap: 6px;
  margin: 0;
}

.client-history-field > span {
  color: #43525c;
  font-size: 12px;
  font-weight: 700;
}

.client-history-field > textarea {
  width: 100%;
  min-width: 0;
  min-height: 74px;
  margin: 0;
  box-sizing: border-box;
  font-weight: 400;
}

.client-cooperation-summary,
.client-cooperation-supplement {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #43525c;
  font-size: 13px;
  line-height: 1.6;
}

.client-cooperation-summary h4,
.client-cooperation-supplement h4,
body.pc-ui-preview .client-form-section .client-cooperation-summary h4 {
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  color: #1d3d43;
  font-size: 13px;
  font-weight: 700;
}

.client-cooperation-summary p {
  margin: 4px 0 0;
}

.client-cooperation-count {
  font-weight: 600;
}

.client-cooperation-summary ul {
  margin: 6px 0;
  padding-left: 18px;
}

.client-cooperation-summary li + li {
  margin-top: 3px;
}

.client-history-field > small,
.client-cooperation-help,
.client-cooperation-empty {
  color: #697983;
  font-size: 12px;
  line-height: 1.6;
  font-weight: 400;
}

[data-client-cooperation-summary] {
  padding-bottom: 12px;
  border-bottom: 1px solid #e6ebed;
}

.client-cooperation-supplement {
  margin-top: 14px;
}

.client-survey-summary {
  margin-top: 8px;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.6;
}

.client-survey-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.client-survey-time,
.client-demand-note {
  color: #697983;
}

.client-survey-result {
  margin-top: 4px;
  color: #263f4e;
}

.client-survey-record > button {
  margin-top: 6px;
}

.client-survey-history {
  margin-top: 8px;
}

.client-survey-history > summary {
  color: #697983;
  cursor: pointer;
}

.client-survey-history .client-survey-record {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e6ebed;
}

#clientSurveyModal {
  z-index: 150;
}

.client-survey-modal-card {
  width: min(720px, calc(100vw - 28px));
  max-width: calc(100vw - 28px);
  max-height: calc(100dvh - 28px);
  box-sizing: border-box;
  padding: 20px;
  overflow: auto;
}

.client-survey-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.client-survey-modal-head h3 {
  margin: 0 0 6px;
}

.client-survey-modal-head p {
  margin: 0;
  color: #697983;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.client-survey-modal-head > button {
  flex: 0 0 auto;
  width: auto;
}

.client-survey-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.client-survey-fields label {
  display: grid;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: #43525c;
  font-size: 13px;
}

.client-survey-fields input,
.client-survey-fields select,
.client-survey-fields textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  font-weight: 400;
  box-sizing: border-box;
}

.client-survey-wide {
  grid-column: 1 / -1;
}

.client-survey-guide {
  margin: 12px 0;
  color: #697983;
  font-size: 12px;
  line-height: 1.6;
}

.client-survey-modal-card .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.client-survey-modal-card .modal-actions > button {
  width: auto;
  min-width: 96px;
}

.client-survey-modal-card button {
  min-height: 36px;
  border-radius: 6px;
}

.client-survey-quote-reference {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #dce6ed;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.client-survey-quote-reference > small {
  display: block;
  margin-top: 4px;
  color: #697983;
}

@media (max-width: 768px) {
  #clientEditModal,
  #clientFollowProjectEditModal {
    z-index: 150;
  }

  .client-survey-modal-card { padding: 14px; }
  .client-survey-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .client-survey-modal-card button { min-height: 40px; }
  .client-survey-modal-card .modal-actions > button { flex: 1; min-width: 0; }

  .client-detail-workspace .client-follow-project-table { display: block; width: 100%; min-width: 0; }
  .client-detail-workspace .client-follow-project-table thead { display: none; }
  .client-detail-workspace .client-follow-project-table tbody { display: block; }
  .client-detail-workspace .client-follow-project-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid #e6ebed;
  }
  .client-detail-workspace .client-follow-project-table tr:last-child { border-bottom: 0; }
  .client-detail-workspace .client-follow-project-table td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .client-detail-workspace .client-follow-project-table td:first-child,
  .client-detail-workspace .client-follow-project-table td:nth-child(n + 4) { grid-column: 1 / -1; }
  .client-detail-workspace .client-follow-project-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 3px;
    color: #697983;
    font-size: 12px;
  }
  .client-detail-workspace .client-follow-project-table td:first-child::before,
  .client-detail-workspace .client-follow-project-table td:last-child::before { display: none; }
  .client-detail-workspace .client-follow-project-table .table-action-group { display: flex; flex-wrap: wrap; gap: 6px; }
  .client-detail-workspace .client-follow-project-table .table-action-group > button { min-height: 36px; }
}

@media (min-width: 769px) {
  body.pc-ui-preview .client-page-panel,
  body.pc-ui-preview .quote-list-panel {
    min-width: 0;
  }

  body.pc-ui-preview .client-form-a {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
  }

  body.pc-ui-preview .client-form-section {
    min-width: 0;
    padding: 14px;
    border: 1px solid #dfe6e8;
    border-radius: 8px;
    background: #fff;
  }

  body.pc-ui-preview .client-form-section h4 {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9edef;
    color: #1d3d43;
    font-size: 14px;
  }

  body.pc-ui-preview .client-form-section-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 14px;
    min-width: 0;
  }

  body.pc-ui-preview .client-form-field {
    display: grid;
    gap: 6px;
    align-content: start;
    min-width: 0;
    margin: 0;
  }

  body.pc-ui-preview .client-form-field > span {
    color: #43525c;
    font-size: 12px;
    font-weight: 700;
  }

  body.pc-ui-preview .client-form-field > input,
  body.pc-ui-preview .client-form-field > select,
  body.pc-ui-preview .client-form-field > textarea {
    width: 100%;
    min-width: 0;
    margin: 0;
    border-radius: 6px;
    background: #fff;
  }

  body.pc-ui-preview .client-form-field-siteLocations,
  body.pc-ui-preview .client-form-field-cooperationHistory,
  body.pc-ui-preview .client-form-field-notes {
    grid-column: 1 / -1;
  }

  body.pc-ui-preview .client-form-field textarea {
    min-height: 74px;
  }

  body.pc-ui-preview .client-form-actions-a {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 12px 4px 2px;
    border-top: 1px solid #e6ebed;
  }

  body.pc-ui-preview .client-form-actions-a > button {
    width: auto;
    min-width: 112px;
    margin: 0;
  }

  body.pc-ui-preview .client-edit-modal-card-a {
    width: min(94vw, 980px);
    max-width: calc(100vw - 24px);
  }

  body.pc-ui-preview .client-edit-modal-card-a .preview-modal-close {
    position: static;
  }

  body.pc-ui-preview #clientEditModal,
  body.pc-ui-preview #clientDeleteResolverModal,
  body.pc-ui-preview #clientTransferModal,
  body.pc-ui-preview #clientFollowProjectEditModal {
    z-index: 100;
  }

  body.pc-ui-preview .client-current-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
  }

  body.pc-ui-preview .client-current-strip > div {
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid #dce7e7;
    border-radius: 6px;
    background: #f7fbfa;
  }

  body.pc-ui-preview .client-current-strip span,
  body.pc-ui-preview .client-current-strip strong {
    display: block;
    overflow-wrap: anywhere;
  }

  body.pc-ui-preview .client-current-strip span {
    margin-bottom: 5px;
    color: #52646c;
    font-size: 12px;
  }

  body.pc-ui-preview .client-current-strip strong {
    color: #1d3d43;
    font-size: 13px;
    line-height: 1.45;
  }

  body.pc-ui-preview .client-list-table-a {
    min-width: 980px;
    table-layout: fixed;
  }

  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(1) { width: 19%; }
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(2) { width: 16%; }
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(3) { width: 12%; }
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(4) { width: 14%; }
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(5) { width: 14%; }
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(6) { width: 10%; }
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(7) { width: 15%; }

  body.pc-ui-preview .client-list-table-a > thead > tr > th,
  body.pc-ui-preview .client-list-table-a > tbody > tr[data-row-id] > td {
    padding: 11px 10px;
    vertical-align: top;
    overflow-wrap: anywhere;
  }

  body.pc-ui-preview .client-list-table-a > thead > tr > th:last-child,
  body.pc-ui-preview .client-list-table-a > tbody > tr[data-row-id] > td:last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    background: #fff;
    box-shadow: -6px 0 12px -11px #546775;
  }

  body.pc-ui-preview .client-list-table-a > thead > tr > th:last-child {
    z-index: 2;
    background: #f5f6f7;
  }

  body.pc-ui-preview .client-list-table-a > tbody > tr[data-row-id]:hover > td:last-child {
    background: #fbfdfd;
  }

  body.pc-ui-preview .client-list-table-a .cell-sub {
    line-height: 1.45;
  }

  body.pc-ui-preview .client-row-actions {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 5px;
  }

  body.pc-ui-preview .client-row-actions > button {
    white-space: nowrap;
  }

  body.pc-ui-preview .client-row-more,
  body.pc-ui-preview .quote-row-more-a {
    width: 100%;
  }

  body.pc-ui-preview .client-row-more summary,
  body.pc-ui-preview .quote-row-more-a summary {
    width: fit-content;
    min-height: 28px;
    padding: 4px 9px;
    border: 1px solid #cad8d9;
    border-radius: 5px;
    color: #176963;
    background: #f4faf9;
    font-size: 12px;
    cursor: pointer;
    list-style: none;
  }

  body.pc-ui-preview .client-row-more summary::-webkit-details-marker,
  body.pc-ui-preview .quote-row-more-a summary::-webkit-details-marker {
    display: none;
  }

  body.pc-ui-preview .client-row-more summary::after,
  body.pc-ui-preview .quote-row-more-a summary::after {
    content: " ▾";
  }

  body.pc-ui-preview .client-row-more[open] summary::after,
  body.pc-ui-preview .quote-row-more-a[open] summary::after {
    content: " ▴";
  }

  body.pc-ui-preview .client-row-more-menu,
  body.pc-ui-preview .quote-row-more-content-a {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    padding-top: 6px;
  }

  body.pc-ui-preview .quote-list-table-a > thead > tr > th:last-child,
  body.pc-ui-preview .quote-list-table-a > tbody > tr[data-row-id] > td:last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    background: #fff;
    box-shadow: -6px 0 12px -11px #546775;
  }

  body.pc-ui-preview .quote-list-table-a > thead > tr > th:last-child {
    z-index: 2;
    background: #f5f6f7;
  }

  body.pc-ui-preview .quote-list-table-a > tbody > tr[data-row-id]:hover > td:last-child {
    background: #fbfdfd;
  }

  body.pc-ui-preview .quote-list-table-a .quote-row-actions-a {
    align-items: flex-start;
  }

  body.pc-ui-preview .quote-list-table-a .quote-row-actions-a > button {
    white-space: nowrap;
  }
}

body.pc-ui-preview .quote-row-compact-meta{display:none}

@media (min-width:769px) and (max-width:1199px){
  body.pc-ui-preview .quote-list-table-a{min-width:0;width:100%;table-layout:fixed}
  body.pc-ui-preview .quote-list-table-a > thead > tr > th:nth-child(1),
  body.pc-ui-preview .quote-list-table-a > tbody > tr[data-row-id] > td:nth-child(1),
  body.pc-ui-preview .quote-list-table-a > thead > tr > th:nth-child(4),
  body.pc-ui-preview .quote-list-table-a > tbody > tr[data-row-id] > td:nth-child(4){display:none}
  body.pc-ui-preview .quote-list-table-a > thead > tr > th:nth-child(2),
  body.pc-ui-preview .quote-list-table-a > tbody > tr[data-row-id] > td:nth-child(2){width:26%}
  body.pc-ui-preview .quote-list-table-a > thead > tr > th:nth-child(3),
  body.pc-ui-preview .quote-list-table-a > tbody > tr[data-row-id] > td:nth-child(3){width:19%}
  body.pc-ui-preview .quote-list-table-a > thead > tr > th:nth-child(5),
  body.pc-ui-preview .quote-list-table-a > tbody > tr[data-row-id] > td:nth-child(5){width:13%}
  body.pc-ui-preview .quote-list-table-a > thead > tr > th:nth-child(6),
  body.pc-ui-preview .quote-list-table-a > tbody > tr[data-row-id] > td:nth-child(6){width:18%}
  body.pc-ui-preview .quote-list-table-a > thead > tr > th:nth-child(7),
  body.pc-ui-preview .quote-list-table-a > tbody > tr[data-row-id] > td:nth-child(7){width:24%}
  body.pc-ui-preview .quote-list-table-a > tbody > tr[data-row-id] > td{overflow-wrap:anywhere}
  body.pc-ui-preview .quote-list-table-a .quote-row-compact-meta{display:block}
}

@media (max-width:768px){
  .quote-page-stack{display:flex;flex-direction:column;gap:10px}
  .quote-page-head-panel{display:block;order:0;padding:10px 12px;border:1px solid #dce5ef;border-radius:8px;background:#fff}
  .quote-page-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
  .quote-page-title{font-size:16px;font-weight:700}
  .quote-page-subtitle{font-size:12px;color:#64748b;line-height:1.4}
  .quote-create-toggle{width:auto;min-width:90px;margin:0;padding:8px 10px;border-radius:6px}
  .quote-page-stack > .quote-list-panel{order:1}
  .quote-page-stack > .quote-create-panel{order:2}
  .quote-page-stack > .quote-base-panel{order:3}
  .quote-page-stack > .quote-create-panel:not(.is-open){display:none}
}

/* 手机端：客户与报价页面保持单列，宽表只在自己的区域内横向查看。 */
@media (max-width:768px){
  .client-page-panel,
  .quote-page-stack,
  .quote-page-stack > *,
  .quote-list-panel,
  .client-create-panel,
  .client-edit-modal-card-a {
    min-width:0;
    max-width:100%;
    box-sizing:border-box;
  }

  .client-page-panel { overflow:hidden; }
  .client-page-head,
  .quote-page-head {
    align-items:flex-start;
    flex-wrap:wrap;
    gap:8px;
  }
  .client-page-head > * { min-width:0; }
  .client-page-head > button,
  .quote-page-head > button,
  .quote-page-actions > button { width:auto; max-width:100%; }

  .client-page-panel > .cards,
  .client-current-strip,
  .client-detail-panel > .cards {
    grid-template-columns:repeat(2,minmax(0,1fr));
    min-width:0;
  }
  .client-page-panel > .cards > *,
  .client-current-strip > *,
  .client-detail-panel > .cards > * { min-width:0; }

  .client-create-form,
  .client-form-a,
  .client-form-section-grid,
  .client-filter-grid,
  .quote-basic-info-fields,
  .quote-form-layout-preview,
  .quote-form-save-actions {
    grid-template-columns:minmax(0,1fr)!important;
    min-width:0;
  }
  .client-create-form > *,
  .client-form-field-siteLocations,
  .client-form-field-cooperationHistory,
  .client-form-field-notes,
  .client-create-form > button[type="submit"],
  .quote-basic-info-fields > div,
  .quote-form-layout-preview > *,
  .quote-form-save-actions > * { grid-column:1 / -1!important; min-width:0; }
  .client-create-form input,
  .client-create-form select,
  .client-create-form textarea,
  .client-filter-grid input,
  .client-filter-grid select,
  .client-filter-grid button { width:100%; max-width:100%; box-sizing:border-box; }
  .client-create-form > button[type="submit"] { justify-self:stretch; }
  .client-form-actions-a { justify-content:stretch; flex-wrap:wrap; }
  .client-form-actions-a > button { flex:1 1 120px; min-width:0; }

  #clientViewHost .table-scroll,
  .quote-list-panel .table-scroll {
    display:block;
    width:100%;
    max-width:100%;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
  }
  #clientViewHost .client-list-table,
  #clientViewHost .client-list-table-a,
  .quote-list-panel .quote-list-table,
  .quote-list-panel .quote-list-table-a {
    width:700px;
    min-width:700px;
    table-layout:fixed;
  }
  #clientViewHost .client-list-table th,
  #clientViewHost .client-list-table td,
  .quote-list-panel .quote-list-table th,
  .quote-list-panel .quote-list-table td { overflow-wrap:anywhere; white-space:normal; }

  /* 报价卡片沿用桌面表格单元格，切为网格后重置原百分比列宽。 */
  body .mobile-system-shell .quote-list-panel .quote-list-table > tbody > tr[data-row-id] > td { width:auto; }
  body .mobile-system-shell .quote-list-panel button.secondary { color:#142b43; background:#fff; }
  body .mobile-system-shell .quote-list-panel button.secondary:hover,
  body .mobile-system-shell .quote-list-panel button.secondary:focus-visible { color:#142b43; background:#edf5f8; border-color:#98aebd; }
  body .mobile-system-shell .quote-list-panel .quote-list-table > tbody,
  body .mobile-system-shell .quote-list-panel .quote-list-table > tbody > tr.client-detail-row,
  body .mobile-system-shell .quote-list-panel .quote-list-table > tbody > tr.client-detail-row > td { min-width:0; }

  /* 版本明细仍是横向表格，不继承外层报价卡片的 tbody 网格和隐藏表头。 */
  body .mobile-system-shell .quote-list-panel .client-detail-panel .table-scroll { overflow-x:auto; overflow-y:hidden; }
  body .mobile-system-shell .quote-list-panel .client-detail-panel table thead { display:table-header-group; }
  body .mobile-system-shell .quote-list-panel .client-detail-panel table tbody { display:table-row-group; }

  .client-edit-modal-card-a,
  .client-edit-modal-card-a .client-form-section-grid,
  .quote-action-dialog-card { width:100%; }
  .client-edit-modal-card-a { padding:14px; }
  .client-detail-panel,
  .client-detail-block,
  .client-detail-list,
  .quote-settings-content { min-width:0; max-width:100%; overflow-wrap:anywhere; }
  .quote-settings-content .muted { flex:1 1 100%; }
}

.quote-base-create-details { margin: 12px 0; }
.quote-base-create-details > summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
.quote-base-create-details > form { margin-top: 8px; }
.quote-service-extra { margin: 10px 0; border: 1px solid #dbe3e8; border-radius: 5px; padding: 0 10px; }
.quote-service-extra > summary { cursor: pointer; padding: 11px 0; color: #244a60; font-weight: 600; }
.quote-service-extra > summary span { font-size: 12px; font-weight: 400; color: #526c7e; margin-left: 8px; }
.quote-service-extra[open] > summary { border-bottom: 1px solid #e2e8ed; margin-bottom: 10px; }
.quote-list-panel .quote-followup-owner { color: #405a6e; }
.quote-list-panel .quote-followup-date { color: #334e63; }
.quote-list-panel .quote-followup-date-value { white-space: nowrap; }
#quotePlanReviewNotice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
#quotePlanReviewNotice.hidden { display: none; }
.quote-list-panel .quote-list-count { white-space: nowrap; }
.quote-list-panel .quote-search-toolbar { min-width: 0; max-width: 100%; }
.quote-list-panel .quote-search-toolbar > input,
.quote-list-panel .quote-search-toolbar > select { min-width: 0; width: 100%; margin: 0; box-sizing: border-box; }
.quote-list-panel .quote-search-toolbar > button { margin: 0; white-space: nowrap; }
@media (min-width: 769px) {
  body.pc-ui-preview .quote-list-panel .quote-search-toolbar {
    grid-template-columns: minmax(180px, 1.8fr) repeat(5, minmax(110px, 1fr)) max-content;
    overflow-x: auto;
  }
  body.pc-ui-preview .quote-list-panel .quote-search-toolbar > input { grid-column: auto; }
  body.pc-ui-preview .quote-list-panel .quote-search-toolbar > button { min-height: 34px; }
  body.pc-ui-preview #quoteForm [id$="Section"] { scroll-margin-top: 132px; }
}

@media (max-width: 768px) {
  body .quote-list-panel .quote-search-toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  body .quote-list-panel .quote-search-toolbar > input { grid-column: 1 / -1; }
  body .quote-list-panel .quote-search-toolbar > select { min-width: 0; width: 100%; }
  body .quote-list-panel .quote-search-toolbar > button { width: 100%; }
}

@media (min-width: 769px) and (max-width: 1199px) {
  body.pc-ui-preview .client-form-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.pc-ui-preview .client-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.pc-ui-preview .quote-list-panel .quote-search-toolbar {
    grid-template-columns: minmax(120px, 1.35fr) minmax(76px, .8fr) minmax(84px, .9fr) minmax(80px, .85fr) minmax(96px, 1fr) minmax(108px, 1.15fr) 64px;
    gap: 6px;
    padding: 8px;
  }
  body.pc-ui-preview .quote-list-panel .quote-search-toolbar > input,
  body.pc-ui-preview .quote-list-panel .quote-search-toolbar > select,
  body.pc-ui-preview .quote-list-panel .quote-search-toolbar > button { font-size: 12px; padding-left: 6px; padding-right: 6px; }

  body.pc-ui-preview .client-list-table-a {
    min-width: 940px;
  }

  body.pc-ui-preview .client-list-table-a .client-detail-panel {
    max-width: calc(100vw - 340px);
  }

  body.pc-ui-preview .client-detail-panel > .cards,
  body.pc-ui-preview .client-current-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.pc-ui-preview .client-current-strip > div:last-child {
    grid-column: 1 / -1;
  }
}

.client-duplicate-hint {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid #e6cf9c;
  border-radius: 6px;
  background: #fffbeb;
  color: #604b20;
  font-size: 13px;
  line-height: 1.5;
}

.client-duplicate-hint > strong,
.client-duplicate-hint > small {
  display: block;
}

.client-duplicate-hint > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 5px 12px 0 0;
}

.client-duplicate-hint > small {
  margin-top: 5px;
}

.client-follow-date-field.is-inactive {
  opacity: 0.55;
}

/* 客户列表：主操作、辅助操作与状态标签保持独立层级。 */
.client-page-panel .client-page-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.client-page-panel .client-page-head h3 {
  margin: 0;
}

.client-page-panel .client-page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.client-page-panel .client-page-actions > button,
.client-page-panel #clientExport {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #cbd5df;
  border-radius: 6px;
  background: #fff;
  color: #40556b;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
}

.client-page-panel .client-page-actions > button:hover,
.client-page-panel #clientExport:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.client-page-panel .client-page-actions > .client-create-toggle {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

.client-page-panel .client-page-actions > .client-create-toggle:hover {
  background: #115e59;
  border-color: #115e59;
}

.client-page-panel #clientExport {
  justify-self: end;
  align-self: center;
}

.client-page-panel .client-filter-grid { margin-bottom: 12px; }

.client-page-panel .client-tag-list,
.client-page-panel .client-follow-reminders {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.client-page-panel .client-stage-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.client-page-panel .client-status-text {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #334155;
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.client-page-panel .client-status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: #64748b;
}

.client-page-panel .client-status-text.is-success .client-status-dot { background: #28714e; }
.client-page-panel .client-status-text.is-warn .client-status-dot { background: #a16a1d; }
.client-page-panel .client-status-text.is-danger { color: #b33d42; }
.client-page-panel .client-status-text.is-danger .client-status-dot { background: currentColor; }
.client-page-panel .client-status-text.is-light { color: #64748b; }

.client-page-panel .client-follow-note {
  color: #64748b;
  font-size: 12px;
  line-height: 18px;
}

.client-page-panel .client-stage-stack .cell-sub {
  margin: 0;
}

@media (min-width: 1200px) {
  body.pc-ui-preview .client-filter-grid {
    grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(140px, .8fr)) max-content;
    align-items: center;
  }
}

@media (max-width: 1199px) {
  .client-page-panel #clientExport { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .client-page-panel .client-page-head { margin-bottom: 12px; }
  .client-page-panel .client-page-actions > button,
  .client-page-panel #clientExport { min-height: 40px; }
  body .mobile-system-shell .mobile-client-card-badges { max-width: 46%; }
  body .mobile-system-shell .mobile-client-card-badges .client-stage-stack { align-items: flex-end; }
  body .mobile-system-shell .mobile-client-card-badges .client-follow-reminders,
  body .mobile-system-shell .mobile-client-card-badges .client-tag-list { align-items: flex-end; }
  body .mobile-system-shell .mobile-client-card-badges .client-follow-note,
  body .mobile-system-shell .mobile-client-card-badges .cell-sub { text-align: right; }
  body .mobile-system-shell .mobile-client-card-alert .client-tag-list { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
}

@media (min-width: 769px) {
  body.pc-ui-preview .client-list-table-a .client-compact-activity,
  body.pc-ui-preview .client-list-table-a .client-compact-risk {
    display: none;
  }

  body.pc-ui-preview .client-follow-project-guide {
    margin: 0 0 12px;
    padding: 9px 11px;
    border-radius: 6px;
    background: #f3f7fb;
    color: #526579;
    font-size: 12px;
    line-height: 1.6;
  }
}

@media (min-width: 769px) and (max-width: 1199px) {
  body.pc-ui-preview .client-list-table-a {
    width: 100%;
    min-width: 0;
  }

  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(1) { width: 24%; }
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(2) { width: 22%; }
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(3) { width: 13%; }
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(4) { width: 20%; }
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(7) { width: 21%; }

  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(5),
  body.pc-ui-preview .client-list-table-a > thead > tr > th:nth-child(6),
  body.pc-ui-preview .client-list-table-a > tbody > tr[data-row-id] > td:nth-child(5),
  body.pc-ui-preview .client-list-table-a > tbody > tr[data-row-id] > td:nth-child(6) {
    display: none;
  }

  body.pc-ui-preview .client-list-table-a .client-compact-activity {
    display: block;
    margin-top: 7px;
    color: #65758a;
  }

  body.pc-ui-preview .client-list-table-a .client-compact-risk {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 7px;
    color: #65758a;
    font-size: 12px;
  }
}

/* 客户详情工作区：联系与下一步优先，往来和资料按页签查看。 */
.client-detail-panel.client-detail-workspace {
  min-width: 0;
  max-width: 100%;
  padding: 18px;
  border: 1px solid #dce4ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: #334155;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.pc-ui-preview .client-list-table-a .client-detail-panel.client-detail-workspace {
  max-width: 100%;
}

.client-detail-workspace *,
.client-detail-workspace *::before,
.client-detail-workspace *::after {
  box-sizing: border-box;
}

.client-detail-workspace .client-detail-overview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px 24px;
  min-width: 0;
}

.client-detail-workspace .client-detail-identity {
  flex: 1 1 280px;
  min-width: 0;
}

.client-detail-workspace .client-detail-identity h4 {
  margin: 0 0 8px;
  color: #172b42;
  font-size: 16px;
  line-height: 1.5;
}

.client-detail-workspace .client-detail-contact-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.7;
}

.client-detail-workspace .client-detail-contact-line > span {
  min-width: 0;
  max-width: 100%;
}

.client-detail-workspace .client-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.client-detail-workspace .client-detail-actions > button,
.client-detail-workspace .client-detail-section-heading > button,
.client-detail-workspace .client-detail-compose-head > button,
.client-detail-workspace .business-link-actions > button {
  width: auto;
  max-width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 6px 11px;
  border: 1px solid #d5dee8;
  border-radius: 5px;
  background: #fff;
  color: #44576c;
  box-shadow: none;
  font-size: 12px;
  line-height: 20px;
}

.client-detail-workspace .client-detail-actions > button:hover,
.client-detail-workspace .client-detail-section-heading > button:hover,
.client-detail-workspace .client-detail-compose-head > button:hover,
.client-detail-workspace .business-link-actions > button:hover {
  border-color: #96adb7;
  background: #f5f8fa;
}

.client-detail-workspace .client-detail-actions > .client-detail-primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

.client-detail-workspace .client-detail-actions > .client-detail-primary:hover {
  border-color: #115e59;
  background: #115e59;
}

.client-detail-workspace button:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: 3px;
}

.client-detail-workspace .client-detail-next-step {
  display: flex;
  align-items: baseline;
  gap: 8px 14px;
  margin-top: 16px;
  padding: 10px 12px;
  border-left: 3px solid #52978f;
  border-radius: 0 4px 4px 0;
  background: #f4f8f8;
  font-size: 13px;
  line-height: 1.6;
}

.client-detail-workspace .client-detail-next-step > span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 12px;
}

.client-detail-workspace .client-detail-next-step > strong {
  min-width: 0;
  color: #21443f;
  font-weight: 600;
}

.client-detail-workspace .client-detail-latest {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.7;
}

.client-detail-workspace .client-detail-finance-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 16px 0 8px;
  padding: 0;
}

.client-detail-workspace .client-detail-finance-line > div {
  min-width: 0;
  padding: 0 16px;
  border-left: 1px solid #e4eaf0;
}

.client-detail-workspace .client-detail-finance-line > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.client-detail-workspace .client-detail-finance-line dt {
  margin: 0 0 5px;
  color: #64748b;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
}

.client-detail-workspace .client-detail-finance-line dd {
  margin: 0;
  color: #23374b;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.client-detail-workspace .client-detail-tabs {
  display: flex;
  gap: 24px;
  min-width: 0;
  margin-top: 16px;
  border-bottom: 1px solid #dfe7ee;
}

.client-detail-workspace .client-detail-tabs > button {
  flex: 0 1 auto;
  width: auto;
  min-width: 0;
  min-height: 44px;
  margin: 0 0 -1px;
  padding: 10px 2px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #64748b;
  box-shadow: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 22px;
  white-space: nowrap;
}

.client-detail-workspace .client-detail-tabs > button:hover {
  color: #0f766e;
  background: transparent;
}

.client-detail-workspace .client-detail-tabs > button[aria-selected="true"] {
  border-bottom-color: #0f766e;
  color: #0f766e;
  font-weight: 700;
}

.client-detail-workspace .client-detail-tab-panel {
  min-width: 0;
  padding-top: 16px;
}

.client-detail-workspace .client-detail-tab-panel[hidden],
.client-detail-workspace .client-detail-composer[hidden] {
  display: none;
}

.client-detail-workspace .client-detail-section {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.client-detail-workspace .client-detail-section + .client-detail-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e7edf2;
}

.client-detail-workspace .client-detail-section-heading,
.client-detail-workspace .client-detail-compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-width: 0;
  margin-bottom: 10px;
}

.client-detail-workspace .client-detail-section-heading h4,
.client-detail-workspace .client-detail-compose-head h4 {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.client-detail-workspace .client-detail-list {
  gap: 0;
  min-width: 0;
}

.client-detail-workspace .client-detail-item,
.client-detail-workspace .client-detail-note,
.client-detail-workspace .client-detail-empty,
.client-detail-workspace .client-detail-empty-inline {
  min-width: 0;
  margin: 0;
  padding: 8px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.7;
}

.client-detail-workspace .client-detail-item + .client-detail-item {
  border-top: 1px solid #edf1f5;
}

body.pc-ui-preview .client-detail-workspace .client-detail-item,
body.pc-ui-preview .client-detail-workspace .client-detail-note,
body.pc-ui-preview .client-detail-workspace .client-detail-empty {
  border-radius: 0;
}

.client-detail-workspace .client-detail-empty,
.client-detail-workspace .client-detail-empty-inline {
  color: #788697;
  font-size: 12px;
}

.client-detail-workspace .client-detail-item-collapsible {
  padding: 0;
}

.client-detail-workspace .client-detail-summary {
  padding: 10px 0;
}

.client-detail-workspace .client-detail-content {
  padding: 8px 0 10px;
  border-top: 1px solid #edf1f5;
}

.client-detail-workspace .business-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.client-detail-workspace .client-detail-composer {
  min-width: 0;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid #dfe7ec;
  border-radius: 6px;
  background: #f8fafb;
}

.client-detail-workspace .client-follow-form,
.client-detail-workspace .client-follow-project-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.client-detail-workspace .client-follow-form > *,
.client-detail-workspace .client-follow-project-form > * {
  min-width: 0;
  max-width: 100%;
}

.client-detail-workspace .client-follow-form > .form-span-2 {
  grid-column: 1 / -1;
}

.client-detail-workspace .client-follow-project-progress-field {
  grid-column: span 2;
}

.client-detail-workspace .client-follow-form input,
.client-detail-workspace .client-follow-form select,
.client-detail-workspace .client-follow-form textarea,
.client-detail-workspace .client-follow-project-form input,
.client-detail-workspace .client-follow-project-form select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
}

.client-detail-workspace .client-follow-form textarea {
  min-height: 74px;
  resize: vertical;
}

.client-detail-workspace .client-follow-form button[type="submit"],
.client-detail-workspace .client-follow-project-form button[type="submit"] {
  width: auto;
  min-width: 0;
  min-height: 36px;
  height: auto;
  margin: 0;
  padding: 7px 14px;
  border-radius: 5px;
  justify-self: start;
  font-size: 13px;
  line-height: 22px;
}

.client-detail-workspace .client-follow-project-guide {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  line-height: 1.6;
}

.client-detail-workspace .client-detail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 24px;
  min-width: 0;
  margin: 0;
}

.client-detail-workspace .client-detail-facts > div {
  min-width: 0;
}

.client-detail-workspace .client-detail-facts dt {
  margin: 0 0 4px;
  color: #788697;
  font-size: 12px;
  font-weight: 400;
}

.client-detail-workspace .client-detail-facts dd {
  margin: 0;
  color: #334155;
  font-size: 13px;
  line-height: 1.6;
}

.client-detail-workspace .table-scroll {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.client-detail-workspace .table-scroll th,
.client-detail-workspace .table-scroll td {
  padding: 10px;
  background: #fff;
  white-space: normal;
}

.client-detail-workspace .table-scroll th {
  background: #f7f9fb;
}

@media (max-width: 1199px) {
  .client-detail-workspace .client-detail-overview { flex-wrap: wrap; }
  .client-detail-workspace .client-detail-actions { justify-content: flex-start; }
  .client-detail-workspace .client-detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .client-detail-panel.client-detail-workspace { padding: 14px 12px; }
  .client-detail-workspace .client-detail-identity { flex-basis: 100%; }
  .client-detail-workspace .client-detail-actions { width: 100%; gap: 6px; }
  .client-detail-workspace .client-detail-actions > button { min-height: 40px; padding: 8px 10px; }
  .client-detail-workspace .client-detail-finance-line { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 14px; }
  .client-detail-workspace .client-detail-finance-line > div:nth-child(odd) { padding-left: 0; border-left: 0; }
  .client-detail-workspace .client-detail-finance-line > div { padding-right: 0; padding-left: 12px; }
  .client-detail-workspace .client-detail-finance-line dd { font-size: 17px; }
  .client-detail-workspace .client-detail-tabs { justify-content: space-between; gap: 8px; }
  .client-detail-workspace .client-detail-tabs > button { flex: 1 1 0; padding: 10px 0; font-size: 12px; }
  .client-detail-workspace .client-detail-composer { padding: 12px; }
  .client-detail-workspace .client-follow-form,
  .client-detail-workspace .client-follow-project-form,
  .client-detail-workspace .client-detail-facts { grid-template-columns: minmax(0, 1fr); }
  .client-detail-workspace .client-follow-form > *,
  .client-detail-workspace .client-follow-project-form > * { grid-column: 1 / -1; }
  .client-detail-workspace .client-follow-form button[type="submit"],
  .client-detail-workspace .client-follow-project-form button[type="submit"] { min-height: 40px; }
}

@media (max-width: 359px) {
  .client-detail-workspace .client-detail-finance-line {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .client-detail-workspace .client-detail-finance-line > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 0;
    border-left: 0;
  }

  .client-detail-workspace .client-detail-finance-line dt {
    min-width: 0;
    margin: 0;
  }

  .client-detail-workspace .client-detail-finance-line dd {
    flex: 0 0 auto;
    font-size: 15px;
    white-space: nowrap;
  }
}
.quote-special-terms { display: flex; align-items: center; gap: 8px; }
.quote-special-terms input { width: auto; }
.quote-action-dialog-card { max-width: 520px; }
.quote-action-dialog-card .system-dialog-message { white-space: pre-line; }
.quote-action-preview { margin-top: 14px; padding: 12px 14px; border: 1px solid #cbdff4; border-radius: 10px; background: #f4f8fd; color: #183b60; line-height: 1.7; white-space: pre-line; }
.quote-settings-panel { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e1e8f0; }
.quote-settings-panel summary { width: fit-content; cursor: pointer; color: #526579; font-size: 12px; }
.quote-settings-content { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 10px 0 2px; font-size: 13px; }
.quote-settings-content .muted { flex: 1 1 280px; }
.quote-settings-content button { width: auto; margin: 0; }

@media (min-width:769px) {
  body.pc-ui-preview #quoteActionModal,
  body.pc-ui-preview #quoteExportModal { z-index:1250; }
  body.pc-ui-preview .quote-list-panel.customer-fixed-list .customer-fixed-table {
    max-height:var(--list-page-height);
    min-height:0!important;
    overflow:auto;
    overscroll-behavior:contain;
  }
  body.pc-ui-preview .quote-list-panel.customer-fixed-list .customer-fixed-table th {
    position:sticky;
    top:0;
    z-index:2;
    white-space:nowrap;
    background:#f7f9fc;
  }
  body.pc-ui-preview .quote-list-panel.customer-fixed-list .customer-fixed-table th:last-child { z-index:3; }
  body.pc-ui-preview .quote-list-panel .customer-list-history-dialog .client-detail-panel table { min-width:1120px; table-layout:fixed; }
  body.pc-ui-preview .quote-list-panel .customer-list-history-dialog th { white-space:nowrap; }
  body.pc-ui-preview .quote-list-panel .customer-list-history-dialog th:nth-child(2) { width:240px; }
  body.pc-ui-preview .quote-list-panel .customer-list-history-dialog th:nth-child(8) { width:150px; }
  body.pc-ui-preview .quote-list-panel .customer-list-history-dialog td { overflow-wrap:anywhere; }
  body.pc-ui-preview .quote-list-panel .customer-list-history-dialog td:nth-child(n+4):nth-child(-n+7),
  body.pc-ui-preview .quote-list-panel .customer-list-history-dialog button { white-space:nowrap; }
  body.pc-ui-preview .quote-base-panel > .table-scroll { max-height:min(420px,55vh); overflow:auto; overscroll-behavior:contain; }
  body.pc-ui-preview .quote-base-panel .quote-base-list-table { min-width:1800px; table-layout:fixed; }
  body.pc-ui-preview .quote-base-panel .quote-base-list-table th { position:sticky; top:0; z-index:2; white-space:nowrap; background:#f7f9fc; }
  body.pc-ui-preview .quote-base-panel .quote-base-list-table th:nth-child(1) { width:54px; }
  body.pc-ui-preview .quote-base-panel .quote-base-list-table th:nth-child(2) { width:240px; }
  body.pc-ui-preview .quote-base-panel .quote-base-list-table th:nth-child(9) { width:130px; }
  body.pc-ui-preview .quote-base-panel .quote-base-list-table th:nth-child(14) { width:180px; }
  body.pc-ui-preview .quote-base-panel .quote-base-list-table th:nth-child(15) { width:150px; }
  body.pc-ui-preview .quote-base-panel .quote-base-list-table td { overflow-wrap:anywhere; }
  body.pc-ui-preview .quote-base-panel .quote-base-list-table button { white-space:nowrap; }
}
@media (min-width:769px) and (max-width:1000px) {
  body.pc-ui-preview .quote-list-panel .quote-search-toolbar {
    grid-template-columns:repeat(4,minmax(0,1fr));
    overflow:visible;
  }
  body.pc-ui-preview .quote-list-panel .quote-search-toolbar > input { grid-column:span 2; }
  body.pc-ui-preview .quote-list-panel.customer-fixed-list .customer-fixed-table > .quote-list-table-a { min-width:680px; }
}
.project-detail-extra-charge-block { grid-column: 1 / -1; }
.project-detail-extra-charge-block summary { cursor: pointer; font-weight: 700; color: #075b70; }
.project-extra-charge-form { margin-top: 12px; }
.project-extra-charge-form label { display: grid; gap: 5px; }

/* Customer summaries share source records; async refresh never replaces forms. */
.client-detail-workspace [data-workspace-fallback][hidden] { display: none !important; }
.client-detail-workspace .client-sync-status { display: flex; align-items: center; gap: 12px; justify-content: flex-end; color: #64748b; font-size: 12px; margin: 4px 0 10px; }
.client-detail-workspace .client-sync-status [role="alert"] { color: #b45309; }
.client-detail-workspace .client-sync-link { width: auto; min-width: 0; min-height: 32px; flex: 0 0 auto; padding: 5px 8px; border: 0; border-radius: 4px; background: transparent; color: #086c80; font-size: 12px; font-weight: 600; box-shadow: none; }
.client-detail-workspace .client-sync-link:hover { background: #eef6f8; }
.client-detail-workspace .client-sync-link:disabled { cursor: wait; opacity: .6; }
.client-detail-workspace .client-sync-next { display: grid; grid-template-columns: 54px minmax(0, 1fr); align-items: baseline; gap: 12px; padding: 10px 14px; border-left: 3px solid #0c7d87; background: #f4f9fa; border-radius: 4px; }
.client-detail-workspace .client-sync-next > span { color: #536779; font-size: 12px; }
.client-detail-workspace .client-sync-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid #edf1f5; }
.client-detail-workspace .client-sync-row:last-child { border-bottom: 0; }
.client-detail-workspace .client-sync-next .client-sync-row { padding-top: 0; }
.client-detail-workspace .client-sync-row-main { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.client-detail-workspace .client-sync-row-main > strong { display: block; color: #203c50; font-size: 13px; font-weight: 600; }
.client-detail-workspace .client-sync-meta { display: block; margin-top: 4px; font-size: 12px; line-height: 1.7; color: #62748a; white-space: normal; }
.client-detail-workspace .client-sync-result { margin: 5px 0 0; color: #324e64; font-size: 13px; white-space: pre-wrap; line-height: 1.65; }
.client-detail-workspace .client-sync-more > summary { width: fit-content; cursor: pointer; padding: 8px 0; color: #52697d; font-size: 12px; }
.client-detail-workspace .client-sync-related { margin-top: 8px; padding-left: 12px; border-left: 2px solid #e4edf0; }
.client-detail-workspace .client-communication-scope { display: grid; gap: 5px; margin: 0 0 14px; padding: 10px 12px; background: #f2f7f8; border-radius: 4px; overflow-wrap: anywhere; }
.client-detail-workspace .client-communication-scope strong { font-size: 13px; font-weight: 600; color: #203c50; }
.client-detail-workspace .client-communication-scope span { font-size: 12px; line-height: 1.65; color: #62748a; }
.client-detail-workspace .client-related-business { margin: 16px 0 8px; border-top: 1px solid #e2e8f0; }
.client-detail-workspace .client-related-business[hidden] { display: none; }
.client-detail-workspace .client-business-group { border-bottom: 1px solid #e2e8f0; margin: 0; }
.client-detail-workspace .client-business-group > summary { display: grid; grid-template-columns: 100px minmax(0, 1fr) 16px; align-items: center; gap: 14px; padding: 15px 0; list-style: none; cursor: pointer; }
.client-detail-workspace .client-business-group > summary::-webkit-details-marker { display: none; }
.client-detail-workspace .client-business-group > summary strong { color: #244454; font-size: 13px; font-weight: 600; }
.client-detail-workspace .client-business-group > summary > span { color: #62748a; font-size: 12px; }
.client-detail-workspace .client-business-group > summary > i { border-right: 1.5px solid #69828d; border-bottom: 1.5px solid #69828d; height: 6px; width: 6px; transform: rotate(45deg); justify-self: center; }
.client-detail-workspace .client-business-group[open] > summary > i { transform: rotate(225deg); }
.client-detail-workspace .client-business-group-body { padding: 0 10px 12px; }
.client-detail-workspace .client-detail-secondary { padding: 0; margin: 0; border: 0; }
.client-detail-workspace .client-project-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 18px; align-items: center; padding: 3px 0; }
.client-detail-workspace .client-project-summary > div { min-width: 0; }
.client-detail-workspace .client-project-summary strong { color: #203c50; }
.client-detail-workspace .client-project-summary span { display: block; color: #62748a; font-size: 12px; margin-top: 5px; }
.client-detail-workspace .client-project-summary > b { font-size: 13px; font-weight: 500; white-space: nowrap; }
.client-detail-workspace .client-project-history > summary { cursor: pointer; font-size: 12px; color: #62748a; padding: 10px 0; }
@media (max-width: 768px) {
  .client-detail-workspace .client-business-group > summary { grid-template-columns: minmax(0, 1fr) 12px; gap: 5px 8px; padding: 12px 0; }
  .client-detail-workspace .client-business-group > summary > span { grid-column: 1; }
  .client-detail-workspace .client-business-group > summary > i { grid-column: 2; grid-row: 1 / 3; }
  .client-detail-workspace .client-business-group-body { padding: 0 0 10px; }
  .client-detail-workspace .client-project-summary { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .client-detail-workspace .client-project-summary .business-link-button { justify-self: start; }
  .client-detail-workspace .client-sync-status { align-items: baseline; gap: 6px; justify-content: space-between; }
  .client-detail-workspace .client-sync-status > span { min-width: 0; overflow-wrap: anywhere; }
  .client-detail-workspace .client-sync-next { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px; }
  .client-detail-workspace .client-sync-row { flex-wrap: wrap; gap: 4px; }
  .client-detail-workspace .client-sync-row-main { flex-basis: 100%; }
  .client-detail-workspace .client-sync-link { min-height: 36px; padding-left: 0; }
}

/* 常用操作直接可达，低频操作集中到更多。 */
#clientViewHost .client-list-view .client-row-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; width: 100%; }
#clientViewHost .client-list-view .client-row-actions > button { width: 100%; min-width: 0; min-height: 32px; margin: 0; padding: 6px; border-radius: 4px; font-size: 12px; white-space: nowrap; }
#clientViewHost .client-list-view .client-row-actions > button.secondary { background: #fff; color: #31566c; border: 1px solid #cfdde5; box-shadow: none; }
#clientViewHost .client-list-view .client-row-more { width: 100%; min-width: 0; }
#clientViewHost .client-list-view .client-row-more[open] { grid-column: 1 / -1; }
#clientViewHost .client-list-view .client-row-more > summary { display: flex; align-items: center; justify-content: center; box-sizing: border-box; width: 100%; min-height: 32px; padding: 6px; border: 1px solid #d7e1e7; border-radius: 4px; background: #f7f9fb; color: #52697d; font-size: 12px; list-style: none; cursor: pointer; }
#clientViewHost .client-list-view .client-row-more > summary::-webkit-details-marker { display: none; }
#clientViewHost .client-list-view .client-row-more > summary::after { content: ' ▾'; margin-left: 4px; }
#clientViewHost .client-list-view .client-row-more[open] > summary::after { content: ' ▴'; }
.client-detail-view .client-ownership-actions { margin-top: 14px; }
@media (min-width: 769px) {
  #clientViewHost .client-list-table-a > thead > tr > th:first-child { width: auto; }
  #clientViewHost .client-list-table-a > thead > tr > th:last-child { width: 210px; }
}
@media (max-width: 768px) {
  #clientViewHost .client-list-view .client-row-actions > button,
  #clientViewHost .client-list-view .client-row-more > summary { min-height: 40px; }
}

/* 客户详情独立于列表：一位客户、一张工作页。 */
.client-page-panel .client-list-controls[hidden],
.client-page-panel .client-list-view[hidden] { display: none !important; }
.client-page-panel.is-detail-view > .cw-client-aux-toolbar { display: none !important; }
.client-page-panel .client-list-controls > .cards {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  max-width: 100%;
  margin: 0 0 12px;
  border: 1px solid #e1e8ee;
  border-radius: 6px;
  background: #fafbfc;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #d4dee7 transparent;
}
.client-page-panel .client-list-controls > .cards > * { min-width: 0; }
.client-page-panel .client-list-controls > .cards .stat {
  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
  min-height: 40px;
  padding: 8px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  white-space: nowrap;
}
.client-page-panel .client-list-controls > .cards .stat + .stat { border-left: 1px solid #e1e8ee; }
.client-page-panel .client-list-controls > .cards .stat-label { line-height: 20px; }
.client-page-panel .client-list-controls > .cards .stat .num { margin: 0; font-size: 17px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.client-page-panel .client-list-controls > .cards .stat-action:hover { background: #edf6f4; }
.client-page-panel .client-list-controls > .cards .stat-action:focus-visible { background: #edf6f4; outline: 2px solid #0f766e; outline-offset: -2px; }

.client-page-panel.is-detail-view {
  padding: 20px;
  border-color: transparent;
  background: #f3f6f9;
  box-shadow: none;
}

.client-detail-view {
  width: 100%;
  max-width: 1120px;
  min-width: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

.client-detail-view .client-detail-navigation {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  color: #6a7888;
  font-size: 12px;
}

.client-detail-view .client-back-to-list {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #cdd7e0;
  border-radius: 5px;
  background: #fff;
  box-shadow: none;
  color: #344d62;
  font-size: 13px;
  line-height: 20px;
}

.client-detail-view .client-back-to-list:hover { background: #eaf0f5; }
.client-detail-view .client-back-to-list:focus-visible { outline: 2px solid #0f766e; outline-offset: 3px; }

.client-detail-view .client-detail-panel.client-detail-workspace {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 24px;
  border: 1px solid #e0e7ee;
  border-radius: 8px;
  background: #fff;
}

.client-detail-view .client-detail-overview { align-items: center; gap: 16px 24px; }
.client-detail-view .client-detail-identity h4 { margin-bottom: 10px; font-size: 20px; font-weight: 700; line-height: 1.5; }
.client-detail-view .client-detail-contact-line { gap: 4px 18px; font-size: 13px; }
.client-detail-view .client-detail-actions { gap: 8px; }
.client-detail-view .client-detail-actions > button { min-height: 36px; }
.client-detail-view .client-detail-latest { margin-top: 10px; color: #788697; }


.client-detail-view .client-detail-finance-line {
  gap: 10px;
  margin: 20px 0 24px;
}

.client-detail-view .client-detail-finance-line > div,
.client-detail-view .client-detail-finance-line > div:first-child {
  display: block;
  padding: 14px 16px;
  border: 0;
  border-radius: 5px;
  background: #f5f7fa;
}

.client-detail-view .client-detail-finance-line dt { margin: 0 0 6px; color: #667587; }
.client-detail-view .client-detail-finance-line dd { font-size: 20px; line-height: 1.4; }

.client-detail-view .client-detail-tabs {
  gap: 8px;
  margin: 0;
  padding: 0 4px;
  border-bottom: 1px solid #d7e1e8;
  background: #f8fafb;
}

.client-detail-view .client-detail-tabs > button { min-height: 46px; padding: 11px 18px; font-size: 14px; }
.client-detail-view .client-detail-tabs > button[aria-selected="true"] { color: #0d655f; background: #fff; }
.client-detail-view .client-detail-tab-panel { margin: 0 -24px; padding: 18px 24px 8px; background: #f3f6f9; }

.client-detail-view .client-detail-tab-panel > .client-detail-section,
.client-detail-view .client-detail-tab-panel > .client-detail-section + .client-detail-section {
  margin: 0 0 14px;
  padding: 18px;
  border: 0;
  border-radius: 6px;
  background: #fff;
}

.client-detail-view .client-detail-section-heading { margin-bottom: 14px; }
.client-detail-view .client-detail-section-heading h4 { color: #263d50; font-size: 14px; }
.client-detail-view .client-detail-tab-panel > .business-link-actions { justify-content: flex-end; margin-bottom: 12px; }
.client-detail-view .client-detail-tab-panel > .client-detail-secondary { padding: 0; }
.client-detail-view .client-detail-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.client-detail-view .client-detail-facts > div { padding: 12px 0; border-bottom: 1px solid #edf1f5; }
.client-detail-view .client-detail-facts dt { font-size: 12px; color: #738293; }
.client-detail-view .client-detail-facts dd { font-size: 14px; color: #2b4053; }

.client-detail-view .client-communication-entry { padding: 16px 0; }
.client-detail-view .client-communication-entry + .client-communication-entry { border-top: 1px solid #e5ebf0; }
.client-detail-view .client-communication-entry > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 12px; color: #728193; font-size: 12px; }
.client-detail-view .client-communication-entry > header strong { color: #3b5265; font-weight: 500; }
.client-detail-view .client-communication-entry > p { margin: 9px 0; color: #233b50; font-size: 14px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.client-detail-view .client-communication-entry > footer { display: flex; flex-wrap: wrap; gap: 5px 16px; color: #6c7c8b; font-size: 12px; line-height: 1.7; }

.client-detail-view .client-project-summary { grid-template-columns: minmax(0, 1fr) 120px 88px; gap: 16px; padding: 4px 0; }
.client-detail-view .client-project-summary strong { font-size: 14px; font-weight: 600; }
.client-detail-view .client-project-summary span { margin-top: 4px; line-height: 1.6; }
.client-detail-view .client-project-summary > b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.client-detail-view .client-project-summary > button { justify-self: end; }
.client-detail-view .client-project-info [data-client-renewal-meta]:empty,
.client-detail-view .client-project-actions [data-client-renewal-action]:empty { display: none; }
.client-detail-view .client-project-summary .client-project-renewal-text { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin-top: 6px; padding-left: 11px; color: #607488; font-size: 12px; line-height: 1.7; }
.client-detail-view .client-project-summary .client-project-renewal-text > span { margin: 0; color: inherit; line-height: inherit; white-space: nowrap; }
.client-detail-view .client-project-renewal-text::before { content: ""; position: absolute; top: 8px; left: 0; width: 5px; height: 5px; border-radius: 50%; background: #a87930; }
.client-detail-view .client-project-renewal-text[data-status="negotiating"]::before { background: #0f766e; }
.client-detail-view .client-project-renewal-text[data-status="renewed"]::before { background: #28714e; }
.client-detail-view .client-project-renewal-text[data-status="lost"]::before { background: #8b97a4; }
.client-detail-view .client-project-summary > .client-project-actions { display: flex; flex-direction: column; align-items: stretch; justify-self: end; gap: 6px; min-width: 0; max-width: 100%; }
.client-detail-view .client-project-actions [data-client-renewal-action] { display: flex; margin: 0; }
.client-detail-view .client-project-actions button { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 36px; margin: 0; padding: 6px 10px; border: 1px solid #d5dee8; border-radius: 5px; background: #fff; color: #0f655f; box-shadow: none; font-size: 12px; line-height: 20px; white-space: nowrap; }
.client-detail-view .client-project-actions button:hover { border-color: #98b4b1; background: #f1f8f6; }
.client-detail-view .client-intent-history { margin-top: 14px; border-top: 1px solid #e5ebf0; background: #fff; }
.client-detail-view .client-intent-history + .client-intent-history { margin-top: 0; }
.client-detail-view .client-intent-history > summary { display: flex; align-items: center; gap: 8px; padding: 13px 0; list-style: none; cursor: pointer; color: #607488; font-size: 12px; line-height: 1.7; }
.client-detail-view .client-intent-history > summary::-webkit-details-marker { display: none; }
.client-detail-view .client-intent-history > summary > strong { color: #445c6e; font-size: 13px; font-weight: 500; }
.client-detail-view .client-intent-history > summary::after { content: ""; flex: 0 0 6px; width: 6px; height: 6px; margin-left: auto; margin-right: 4px; border-right: 1.5px solid #7d909e; border-bottom: 1.5px solid #7d909e; transform: rotate(45deg); }
.client-detail-view .client-intent-history[open] > summary::after { transform: rotate(225deg); }
.client-detail-view .client-intent-history > summary:hover > strong { color: #0f766e; }
.client-detail-view .client-intent-history > summary:focus-visible { outline: 2px solid #0f766e; outline-offset: 2px; }
.client-detail-view .client-intent-history-list { min-width: 0; padding-bottom: 4px; }
.client-detail-view .client-intent-history-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; padding: 14px 0; border-top: 1px solid #edf1f5; }
.client-detail-view .client-intent-history-info { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.client-detail-view .client-intent-history-info > strong { display: block; color: #344d62; font-size: 13px; font-weight: 600; line-height: 1.7; }
.client-detail-view .client-intent-history-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; margin-top: 5px; color: #758595; font-size: 12px; line-height: 1.8; }
.client-detail-view .client-intent-history-note { margin: 6px 0 0; color: #617588; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.client-detail-view .client-intent-history-actions { display: flex; flex: 0 1 auto; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; max-width: 40%; min-width: 0; }
.client-detail-view .client-intent-history-actions button { display: inline-flex; align-items: center; justify-content: center; width: auto; max-width: 100%; min-height: 36px; margin: 0; padding: 6px 10px; border: 1px solid #d5dee8; border-radius: 5px; background: #fff; color: #496477; box-shadow: none; font-size: 12px; line-height: 20px; white-space: normal; }
.client-detail-view .client-intent-history-actions button:hover { border-color: #98b4b1; background: #f1f8f6; color: #0f655f; }
.client-detail-view .business-link-button { display: inline-flex; align-items: center; justify-content: center; width: auto; min-height: 36px; margin: 0; padding: 6px 10px; border: 1px solid #d5dee8; border-radius: 5px; background: #fff; color: #0f655f; box-shadow: none; font-size: 12px; line-height: 20px; }
.client-detail-view .table-action-group { gap: 6px; }
.client-detail-view .table-action-group button { min-height: 32px; padding: 5px 9px; border: 1px solid #cfdbe4; border-radius: 4px; background: #fff; color: #445c6e; box-shadow: none; font-size: 12px; }
.client-detail-view .table-action-group button:hover { border-color: #98aebd; background: #f1f5f8; }
.client-detail-view .table-action-group button.danger { border-color: #ecc9cb; background: #fff8f8; color: #b04449; }
.client-detail-view .table-action-group button.danger:hover { border-color: #dcaaae; background: #fff0f0; }
.client-detail-view .client-detail-item:has(> .client-project-summary) { padding: 12px 0; }
.client-detail-view .client-project-history { border-top: 1px solid #edf1f5; }

.client-detail-view .client-related-business { margin: 0 0 14px; border: 0; border-radius: 6px; background: #fff; }
.client-detail-view .client-business-group { padding: 0 18px; }
.client-detail-view .client-related-business > :last-child > .client-business-group { border-bottom: 0; }
.client-detail-view .client-business-group > summary { grid-template-columns: 112px minmax(0, 1fr) 16px; gap: 12px; padding: 18px 0; }
.client-detail-view .client-business-group > summary strong { font-size: 14px; }
.client-detail-view .client-business-group > summary:hover strong { color: #0f766e; }
.client-detail-view .client-business-group[open] > summary { border-bottom: 1px solid #e5ebf0; }
.client-detail-view .client-business-group-body { padding: 0 0 12px; }
.client-detail-view .client-sync-row { padding: 16px 0; gap: 14px; border-bottom-color: #e5ebf0; }
.client-detail-view .client-sync-row-main > strong { font-size: 14px; line-height: 1.6; color: #263d50; }
.client-detail-view .client-sync-meta { max-width: 740px; margin-top: 6px; line-height: 1.8; color: #728193; }
.client-detail-view .client-sync-result { max-width: 740px; margin-top: 8px; color: #3c5367; }
.client-detail-view .client-sync-related { margin-top: 12px; padding: 0 12px; border: 0; border-radius: 4px; background: #f6f8fa; }
.client-detail-view .client-sync-related .client-sync-row { padding: 10px 0; }
.client-detail-view .client-sync-related .client-sync-row-main > strong { font-size: 12px; font-weight: 500; }
.client-detail-view .client-sync-related .client-sync-result { font-size: 12px; }
.client-detail-view .client-sync-status { margin: 16px 0 0; font-size: 11px; color: #81909e; }

.client-page-panel .client-list-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 0 4px;
  color: #6b7c8c;
  font-size: 12px;
}
.client-page-panel .client-list-pagination > span { margin-right: auto; }
.client-page-panel .client-list-pagination button { width: auto; min-height: 34px; margin: 0; padding: 6px 12px; border: 1px solid #d3dee7; border-radius: 4px; background: #fff; color: #40586a; box-shadow: none; font-size: 12px; }
.client-page-panel .client-list-pagination button:disabled { color: #9da8b4; background: #f5f7f9; cursor: default; }
body.pc-ui-preview .client-page-panel .client-list-table-a > tbody > tr[data-row-id] > td { padding-top: 16px; padding-bottom: 16px; border-bottom: 1px solid #dbe4ec; background: #fff; }
body.pc-ui-preview .client-page-panel .client-list-table-a > tbody > tr[data-row-id]:nth-child(even) > td { background: #f8fafc; }
body.pc-ui-preview .client-page-panel .client-list-table-a > tbody > tr[data-row-id]:hover > td { background: #f0f6f8; }
.client-page-panel .client-list-table-a .cell-sub { color: #768698; }
.client-page-panel .mobile-client-card { margin-bottom: 12px; border: 1px solid #d9e3eb; box-shadow: none; }

@media (max-width: 1199px) {
  .client-page-panel.is-detail-view { padding: 16px; }
  .client-detail-view .client-detail-overview { align-items: flex-start; }
  .client-detail-view .client-detail-actions { justify-content: flex-start; }
  .client-detail-view .client-detail-finance-line dd { font-size: 18px; }
}

@media (max-width: 768px) {
  .client-page-panel .client-list-controls > .cards .stat { min-height: 44px; padding: 10px 12px; }
  .client-page-panel.is-detail-view { padding: 10px; border-radius: 0; }
  .client-detail-view .client-detail-navigation { gap: 10px; margin-bottom: 12px; }
  .client-detail-view .client-back-to-list { min-height: 40px; }
  .client-detail-view .client-detail-panel.client-detail-workspace { padding: 16px 12px; border-radius: 6px; }
  .client-detail-view .client-detail-identity h4 { font-size: 18px; }
  .client-detail-view .client-detail-contact-line { gap: 4px 12px; font-size: 12px; }
  .client-detail-view .client-detail-actions { gap: 6px; }
  .client-detail-view .client-detail-actions > button { flex: 1 1 auto; min-height: 40px; padding: 8px; }
  .client-detail-view .client-detail-finance-line { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
  .client-detail-view .client-detail-finance-line > div,
  .client-detail-view .client-detail-finance-line > div:first-child { padding: 11px 10px; }
  .client-detail-view .client-detail-finance-line dd { font-size: 17px; }
  .client-detail-view .client-detail-tabs { gap: 0; padding: 0; }
  .client-detail-view .client-detail-tabs > button { padding: 10px 4px; font-size: 13px; }
  .client-detail-view .client-detail-tab-panel { margin: 0 -12px; padding: 12px 8px 2px; }
  .client-detail-view .client-detail-tab-panel > .client-detail-section,
  .client-detail-view .client-detail-tab-panel > .client-detail-section + .client-detail-section { padding: 14px 10px; margin-bottom: 10px; }
  .client-detail-view .client-detail-section-heading { margin-bottom: 10px; }
  .client-detail-view .client-detail-tab-panel > .client-detail-secondary { padding: 0; }
  .client-detail-view .client-detail-facts { grid-template-columns: minmax(0, 1fr); }
  .client-detail-view .client-detail-facts > div { padding: 10px 0; }
  .client-detail-view .client-project-summary { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; }
  .client-detail-view .client-project-summary > div { grid-column: 1 / -1; }
  .client-detail-view .client-project-summary > b { text-align: left; }
  .client-detail-view .client-project-summary > button { justify-self: end; }
  .client-detail-view .client-project-summary > .client-project-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-self: start; gap: 8px; }
  .client-detail-view .client-project-actions button { width: auto; min-height: 40px; }
  .client-detail-view .client-intent-history-item { align-items: stretch; flex-direction: column; gap: 10px; padding: 12px 0; }
  .client-detail-view .client-intent-history-actions { max-width: 100%; justify-content: flex-start; gap: 8px; }
  .client-detail-view .client-intent-history-actions button { min-height: 40px; }
  .client-detail-view .business-link-button,
  .client-detail-view .business-link-actions > .business-link-button,
  .client-detail-view .client-follow-project-table .table-action-group > button { min-height: 40px; }
  .client-detail-view .client-detail-tab-panel > .business-link-actions { gap: 6px; }
  .client-detail-view .client-detail-tab-panel > .business-link-actions .business-link-button { flex: 0 1 auto; padding: 6px 9px; }
  .client-detail-view .client-business-group { padding: 0 10px; }
  .client-detail-view .client-business-group > summary { grid-template-columns: minmax(0, 1fr) 12px; gap: 6px 8px; padding: 14px 0; }
  .client-detail-view .client-business-group > summary > span { grid-column: 1; }
  .client-detail-view .client-business-group > summary > i { grid-column: 2; grid-row: 1 / 3; }
  .client-detail-view .client-sync-row { padding: 13px 0; gap: 5px; }
  .client-detail-view .client-sync-related { padding: 0 9px; }
  .client-detail-view .client-sync-status { align-items: baseline; margin-top: 12px; }
  .client-page-panel .client-list-pagination > span { flex: 1 0 100%; }
  .client-page-panel .client-list-pagination button { min-height: 40px; }
}

@media (max-width: 359px) {
  .client-page-panel.is-detail-view { padding: 6px; }
  .client-detail-view .client-detail-navigation > span { font-size: 11px; }
  .client-detail-view .client-detail-finance-line { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .client-detail-view .client-detail-finance-line > div,
  .client-detail-view .client-detail-finance-line > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 9px 10px; }
  .client-detail-view .client-detail-finance-line dt { margin: 0; }
  .client-detail-view .client-detail-finance-line dd { font-size: 16px; }
}

/* 客户筛选：桌面紧凑单排，窄屏按可用宽度排列。 */
body .client-page-panel .client-filter-grid {
  grid-template-columns: minmax(0, 1fr) !important;
  align-items: stretch;
  gap: 14px;
  min-width: 0;
  margin: 0 0 10px;
  padding: 14px;
  border: 1px solid #e1e7ed;
  border-radius: 6px;
  background: #f8fafb;
}

.client-page-panel .client-filter-primary,
.client-page-panel .client-filter-secondary {
  display: grid;
  align-items: end;
  gap: 12px;
  min-width: 0;
}
.client-page-panel .client-filter-primary { grid-template-columns: minmax(220px, 1.7fr) repeat(3, minmax(0, 1fr)); }
.client-page-panel .client-filter-secondary { grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(220px, 1.4fr); }
.client-page-panel .client-filter-field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; margin: 0; }
.client-page-panel .client-filter-field > span { min-width: 0; color: #667b8d; font-size: 12px; font-weight: 400; line-height: 1.5; }
.client-page-panel .client-filter-field > input,
.client-page-panel .client-filter-field > select { width: 100%; min-width: 0; max-width: 100%; min-height: 38px; margin: 0; padding: 8px 10px; box-sizing: border-box; border-radius: 5px; background: #fff; font-size: 13px; }
.client-page-panel .client-filter-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.client-page-panel .client-filter-actions > button,
.client-page-panel .client-filter-actions #clientExport { flex: 0 1 auto; width: auto; max-width: 100%; min-height: 38px; margin: 0; padding: 8px 12px; border: 1px solid #cfdbe4; border-radius: 5px; background: #fff; box-shadow: none; color: #405a6e; font-size: 13px; line-height: 20px; }
.client-page-panel .client-filter-actions > button:hover { border-color: #99aebb; background: #f0f5f8; }
.client-page-panel .client-filter-summary { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; min-width: 0; margin: 0 0 14px; color: #718395; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.client-page-panel .client-filter-summary[hidden] { display: none; }
.client-page-panel #clientFilterResultCount { color: #405a6e; font-weight: 500; }

@media (max-width: 1023px) {
  .client-page-panel .client-filter-primary,
  .client-page-panel .client-filter-secondary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  body .client-page-panel .client-filter-grid { padding: 12px; gap: 12px; }
  .client-page-panel .client-filter-primary,
  .client-page-panel .client-filter-secondary { gap: 12px 10px; }
  .client-page-panel .client-filter-field > input,
  .client-page-panel .client-filter-field > select,
  .client-page-panel .client-filter-actions > button,
  .client-page-panel .client-filter-actions #clientExport { min-height: 40px; }
  .client-page-panel .client-filter-summary { margin-bottom: 12px; }
}

@media (max-width: 600px) {
  .client-page-panel .client-filter-primary,
  .client-page-panel .client-filter-secondary { grid-template-columns: minmax(0, 1fr); }
  .client-page-panel .client-filter-actions { justify-content: stretch; }
  .client-page-panel .client-filter-actions > button,
  .client-page-panel .client-filter-actions #clientExport { flex: 1 1 100px; min-width: 0; padding-right: 8px; padding-left: 8px; }
}

@media (min-width: 1360px) {
  body .client-page-panel .client-filter-grid {
    grid-template-columns: minmax(180px, 1.8fr) minmax(95px, 1fr) minmax(100px, 1fr) minmax(88px, .85fr) minmax(105px, 1fr) minmax(95px, .9fr) minmax(100px, 1fr) max-content !important;
    align-items: center;
    gap: 8px;
    padding: 10px;
  }
  .client-page-panel .client-filter-primary,
  .client-page-panel .client-filter-secondary { display: contents; }
  .client-page-panel .client-filter-field { position: relative; display: block; }
  .client-page-panel .client-filter-field > span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .client-page-panel .client-filter-field > input,
  .client-page-panel .client-filter-field > select { height: 36px; min-height: 36px; padding: 7px 8px; }
  .client-page-panel .client-filter-actions { flex-wrap: nowrap; gap: 6px; }
  .client-page-panel .client-filter-actions > button,
  .client-page-panel .client-filter-actions #clientExport { min-height: 36px; padding: 7px 10px; white-space: nowrap; line-height: 20px; }
}
/* Quote progress remains compact beside the step actions. */
.quote-form-save-actions .quote-draft-save-state {
  flex: 1 1 220px;
  min-width: 0;
  margin-right: auto;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}
.quote-form-save-actions .quote-draft-save-state.is-error { color: #b91c1c; }
.quote-form-save-actions .hidden { display: none !important; }

/* Keep the desktop quote workflow quiet; reserve emphasis for the final price. */
@media (min-width: 769px) {
  body.pc-ui-preview .quote-basic-info-fields > div {
    align-content: start;
  }
  body.pc-ui-preview .quote-editor-refined {
    padding: 22px 24px 16px;
    border-color: #e0e7ee;
    border-radius: 10px;
    font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-head {
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-head h3 {
    color: #233448;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.5;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-head-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-head-actions button {
    width: auto;
    min-height: 30px;
    margin: 0;
    padding: 5px 10px;
    border: 1px solid #e2e8ef;
    border-radius: 5px;
    background: #fff;
    color: #64748b;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-head-actions button:hover {
    background: #f5f8fa;
    color: #0f766e;
    border-color: #b5cecb;
  }
  body.pc-ui-preview .quote-editor-refined #quoteForm { row-gap: 22px; }
  body.pc-ui-preview .quote-editor-refined :is(#quoteBasicInfoSection, #quoteServicePlanSection, #quoteCostEstimateSection, #quoteEditorSection, #quoteResultSection) {
    scroll-margin-top: 148px;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav {
    gap: 6px;
    padding: 6px;
    border: 1px solid #edf1f5;
    border-radius: 8px;
    background: #f6f8fa;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a {
    min-height: 46px;
    padding: 8px 12px;
    gap: 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #64748b;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid #dce4eb;
    border-radius: 50%;
    background: #fff;
    color: #8492a5;
    font-size: 11px;
    font-weight: 600;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a > strong {
    font-size: 13px;
    font-weight: 500;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a:hover { background: #eef3f5; }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a.is-active {
    background: #e5f3ef;
    color: #086b61;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a.is-active > span {
    border-color: #0f766e;
    background: #0f766e;
    color: #fff;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a.is-active > strong { font-weight: 700; }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a:focus-visible,
  body.pc-ui-preview .quote-editor-refined .quote-form-head-actions button:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: 2px;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-layout,
  body.pc-ui-preview .quote-editor-refined .quote-summary-layout:has(.quote-summary-sheet-customer) {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 0;
    border: 1px solid #e1e7ed;
    border-radius: 7px;
    background: #fff;
    overflow: hidden;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet {
    min-width: 0;
    padding: 22px 24px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-title.quote-section-heading {
    display: block;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #6f7d8e;
    line-height: 1.6;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-customer .quote-summary-sheet-title { display: none; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-title strong {
    color: #6f7d8e;
    font-size: 13px;
    font-weight: 500;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-title span { display: none; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table {
    display: block;
    margin: 0;
    border: 0;
    background: transparent;
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table tbody {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    align-items: center;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-customer tbody {
    grid-template-columns: minmax(210px, 1.35fr) repeat(3, minmax(0, 1fr));
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table tr {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
    padding: 0 24px;
    border: 0;
    background: transparent;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-customer tr:first-child {
    border-left: 1px solid #e5ebf0;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table th,
  body.pc-ui-preview .quote-editor-refined .quote-summary-table td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    line-height: 1.5;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table th {
    color: #778497;
    font-size: 12px;
    font-weight: 400;
    white-space: normal;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table td {
    color: #344256;
    font-size: 18px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table tr.quote-customer-total {
    order: -1;
    grid-column: auto;
    gap: 4px;
    margin: 0;
    padding: 0 24px 0 0;
    border: 0;
  }
  body.pc-ui-preview .quote-editor-refined .quote-customer-total th { color: #526477; }
  body.pc-ui-preview .quote-editor-refined .quote-customer-total td {
    color: #0d6f66;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -.5px;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-internal {
    display: grid;
    grid-template-columns: minmax(210px, 1.35fr) minmax(0, 3fr);
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid #e9eef3;
    background: #fafbfd;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-internal .quote-summary-table { margin: 0; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-internal .quote-summary-table td { font-size: 16px; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-internal tbody { row-gap: 20px; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-layout:not(:has(.quote-summary-sheet-customer)) .quote-summary-sheet-internal {
    display: block;
    border-top: 0;
    background: #fff;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-layout:not(:has(.quote-summary-sheet-customer)) .quote-summary-sheet-title { margin-bottom: 16px; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-layout:not(:has(.quote-summary-sheet-customer)) .quote-summary-table tbody {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
  }
  body.pc-ui-preview .quote-editor-refined .quote-summary-layout:not(:has(.quote-summary-sheet-customer)) .quote-summary-table tr {
    padding: 0;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-save-actions {
    align-items: center;
    gap: 10px;
    padding: 16px 0 0;
    margin: 0;
    border-color: #e7edf2;
    background: #fff;
    bottom: 0;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-save-actions button {
    width: auto;
    min-width: 104px;
    min-height: 36px;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 18px;
  }
  body.pc-ui-preview .quote-editor-refined .quote-form-save-actions button.secondary {
    border: 1px solid #d4dee9;
    background: #fff;
    color: #52657b;
  }
}
@media (min-width: 769px) and (max-width: 1199px) {
  body.pc-ui-preview .quote-editor-refined { padding: 18px; }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a { padding: 7px; gap: 6px; }
  body.pc-ui-preview .quote-editor-refined .quote-form-step-nav a > strong { font-size: 12px; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet { padding: 18px; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-customer tbody { grid-template-columns: minmax(170px, 1.35fr) repeat(3, minmax(0, 1fr)); }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-internal { grid-template-columns: minmax(170px, 1.35fr) minmax(0, 3fr); }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table tr { padding-right: 10px; padding-left: 16px; }
  body.pc-ui-preview .quote-editor-refined .quote-customer-total td { font-size: 27px; }
}
@media (min-width: 769px) and (max-width: 999px) {
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-customer tbody { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 18px; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-table tr.quote-customer-total { grid-column: 1 / -1; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-customer tr:first-child { padding-left: 0; border-left: 0; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-internal { display: block; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-internal .quote-summary-sheet-title { margin-bottom: 14px; }
  body.pc-ui-preview .quote-editor-refined .quote-summary-sheet-internal tr:first-child { padding-left: 0; }
}

.quote-draft-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e4eaf0;
  color: #52657b;
  font-size: 13px;
}
.quote-draft-notice-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-draft-notice-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.quote-draft-notice-actions button { width: auto; min-height: 30px; margin: 0; white-space: nowrap; }
.quote-draft-notice.is-error .quote-draft-notice-text { color: #a43b32; }

@media (min-width: 769px) {
  .client-page-panel #clientCreateToggle:hover:not(:disabled) {
    background: #124b9c;
    border-color: #124b9c;
    color: #fff;
  }

  #clientFollowProjectEditModal .system-dialog-header > div,
  #clientTransferModal .system-dialog-header > div {
    flex: 1;
    min-width: 0;
  }

  #clientFollowProjectEditModal #clientFollowProjectEditClose,
  #clientTransferModal #clientTransferClose {
    flex: 0 0 auto;
    width: auto;
    white-space: nowrap;
  }

  [data-client-draft-tools] {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
  }

  [data-client-draft-tools] > button {
    flex: 0 1 auto;
    width: auto;
    min-height: 32px;
    margin: 0;
    padding: 6px 10px;
    border: 1px solid #d4dee9;
    border-radius: 6px;
    background: #fff;
    color: #38516f;
    font-size: 13px;
    line-height: 18px;
    white-space: normal;
  }

  [data-client-draft-tools] > button:hover:not(:disabled) {
    background: #eef4fb;
    border-color: #aebfd4;
    color: #124b9c;
  }

  [data-client-draft-tools] > [data-client-latest] {
    flex-basis: 100%;
  }
}
/* Customer detail and new project intention keep the list underneath in place. */
.client-detail-dialog,.client-intent-dialog { position:fixed; inset:0; z-index:90; display:flex; align-items:center; justify-content:center; padding:20px; box-sizing:border-box; background:rgba(15,23,42,.55); }
.client-intent-dialog { z-index:95; }
.client-detail-dialog[hidden],.client-intent-dialog[hidden] { display:none; }
.client-detail-dialog-card { display:flex; flex-direction:column; width:min(1180px,100%); height:min(860px,calc(100dvh - 40px)); min-height:0; min-width:0; margin:0; border:1px solid #d5dee8; border-radius:10px; background:white; box-shadow:0 18px 60px #0f172a40; overflow:hidden; }
.client-detail-dialog-card > .client-detail-navigation { flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0; padding:12px 18px; border-bottom:1px solid #e2e8f0; }
.client-detail-dialog-card > .client-detail-navigation > button { margin:0; }
.client-detail-dialog-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:0; }
.client-detail-dialog-body .client-detail-panel.client-detail-workspace { margin:0; border:0; border-radius:0; padding:18px 24px; }
.client-intent-dialog .client-intent-dialog-card { width:min(760px,100%); max-height:calc(100dvh - 40px); min-height:0; overflow:auto; overscroll-behavior:contain; box-sizing:border-box; margin:0; padding:18px; border:1px solid #d5dee8; border-radius:10px; background:#fff; box-shadow:0 18px 60px #0f172a40; }
.client-intent-dialog .client-detail-compose-head { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin:0 0 12px; }
.client-intent-dialog .client-detail-compose-head h4 { margin:0; overflow-wrap:anywhere; }
.client-intent-dialog .client-detail-compose-head button { flex:none; margin:0; }
.client-intent-dialog .client-follow-project-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.client-intent-dialog .client-follow-project-form label { display:flex; flex-direction:column; gap:5px; min-width:0; margin:0; }
.client-intent-dialog .client-follow-project-form :is(input,select,button) { width:100%; min-width:0; box-sizing:border-box; margin:0; }
.client-intent-dialog .client-follow-project-progress-field,.client-intent-dialog [data-client-draft-status],.client-intent-dialog [data-client-draft-tools] { grid-column:1/-1; }
.client-intent-dialog [data-client-draft-tools] button { width:auto; }
body:has(.client-detail-dialog:not([hidden]),.client-intent-dialog:not([hidden])) { overflow:hidden; }
/* New customers use a bounded editor; the existing customer edit form is unchanged. */
#clientCreatePanel.client-create-dialog { position:fixed; inset:0; z-index:90; display:flex; align-items:center; justify-content:center; padding:20px; margin:0; box-sizing:border-box; border:0; border-radius:0; background:rgba(15,23,42,.55); }
#clientCreatePanel.client-create-dialog[hidden] { display:none; }
#clientCreatePanel .client-create-dialog-card { width:min(980px,100%); max-height:calc(100dvh - 40px); min-height:0; display:flex; flex-direction:column; overflow:hidden; border:1px solid #d5dee8; border-radius:10px; background:white; box-shadow:0 18px 60px #0f172a40; }
#clientCreatePanel .client-create-dialog-head { display:flex; flex:none; align-items:center; justify-content:space-between; gap:16px; padding:12px 18px; border-bottom:1px solid #e2e8f0; }
#clientCreatePanel .client-create-dialog-head h3 { flex:1; margin:0; font-size:17px; }
#clientCreatePanel .client-create-dialog-head button { flex:none; width:auto; margin:0; }
#clientCreatePanel #clientForm { display:flex; flex-direction:column; min-height:0; overflow:hidden; gap:0; margin:0; }
#clientCreatePanel .client-create-dialog-body { min-height:0; overflow:auto; overscroll-behavior:contain; padding:16px 18px; }
#clientCreatePanel .client-create-main-fields,#clientCreatePanel .client-create-more-fields { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px 14px; min-width:0; }
#clientCreatePanel .client-form-field { display:flex; flex-direction:column; min-width:0; gap:5px; margin:0; }
#clientCreatePanel .client-form-field > span { color:#43525c; font-size:12px; font-weight:600; }
#clientCreatePanel .client-form-field :is(input,select,textarea) { width:100%; min-width:0; margin:0; box-sizing:border-box; border-radius:6px; }
#clientCreatePanel .client-form-field small { color:#6a7889; font-size:12px; font-weight:400; line-height:1.5; }
#clientCreatePanel .client-create-owner-options { flex:none; max-height:112px; overflow:auto; overscroll-behavior:contain; border:1px solid #c6d4e5; border-radius:5px; background:#fff; }
#clientCreatePanel .client-create-owner-options[hidden] { display:none; }
#clientCreatePanel .client-create-owner-options > button { display:block; width:100%; min-height:30px; padding:6px 8px; margin:0; border:0; border-radius:0; background:#fff; color:#2e4663; text-align:left; font-size:13px; white-space:normal; overflow-wrap:anywhere; }
#clientCreatePanel .client-create-owner-options > button:hover,#clientCreatePanel .client-create-owner-options > button[aria-selected="true"] { background:#edf4fd; color:#145ac4; }
#clientCreatePanel .client-create-owner-options > small { display:block; padding:8px; }
#clientCreatePanel .client-form-field-name { grid-column:span 2; }
#clientCreatePanel .client-duplicate-hint { grid-column:1/-1; margin:0; }
#clientCreatePanel .client-create-more { margin-top:14px; border-top:1px solid #e2e8f0; padding-top:10px; }
#clientCreatePanel .client-create-more > summary { cursor:pointer; color:#354d69; font-size:13px; font-weight:600; }
#clientCreatePanel .client-create-more-fields { grid-template-columns:repeat(2,minmax(0,1fr)); padding-top:12px; }
#clientCreatePanel .client-create-more-fields .client-form-field { grid-column:auto; }
#clientCreatePanel .client-create-more-fields textarea { min-height:66px; resize:vertical; }
#clientCreatePanel .client-create-dialog-footer { display:flex; flex:none; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; padding:10px 18px; border-top:1px solid #e2e8f0; background:#f8fafc; }
#clientCreatePanel [data-client-create-feedback] { flex:1 1 300px; min-width:0; max-height:116px; overflow:auto; overscroll-behavior:contain; }
#clientCreatePanel [data-client-draft-status],#clientCreatePanel .client-form-error { margin:0 0 4px; font-size:12px; line-height:1.5; }
#clientCreatePanel [data-client-draft-tools] { display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; margin:0; font-size:12px; }
#clientCreatePanel [data-client-draft-tools] button { margin:0; padding:3px 7px; min-height:26px; font-size:12px; }
#clientCreatePanel .client-create-dialog-actions { display:flex; flex:none; gap:8px; }
#clientCreatePanel .client-create-dialog-actions button { width:auto; margin:0; min-height:34px; }
body:has(#clientCreatePanel:not([hidden])) { overflow:hidden; }
@media(min-width:769px) {
  body.pc-ui-preview:not(.mobile-ui-active):has(#clientCreatePanel:not([hidden])) .client-detail-dialog { z-index:91; }
}
@media(max-width:768px) {
  .client-detail-dialog,.client-intent-dialog { z-index:145; padding:8px; }
  .client-intent-dialog { z-index:150; }
  .client-detail-dialog-card { height:calc(100dvh - 16px); }
  .client-intent-dialog .client-intent-dialog-card { max-height:calc(100dvh - 16px); padding:14px; }
  .client-detail-dialog-body .client-detail-panel.client-detail-workspace { padding:14px 12px; }
  .client-intent-dialog .client-follow-project-form { grid-template-columns:minmax(0,1fr); }
  #clientCreatePanel.client-create-dialog { z-index:140; padding:8px; }
  #clientCreatePanel .client-create-dialog-card { max-height:calc(100dvh - 16px); }
  #clientCreatePanel .client-create-main-fields,#clientCreatePanel .client-create-more-fields { grid-template-columns:minmax(0,1fr); }
  #clientCreatePanel .client-form-field-name { grid-column:auto; }
  #clientCreatePanel .client-create-dialog-head,#clientCreatePanel .client-create-dialog-footer { padding:10px 12px; }
  #clientCreatePanel .client-create-dialog-body { padding:12px; }
  #clientCreatePanel .client-create-dialog-actions { flex-wrap:wrap; }
}
