/* Project registration: the same four product fields on customer and admin. */
#customerProjectFormModal .customer-project-dialog { width: min(820px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; }
#customerProjectFormModal .customer-project-form-grid { grid-template-columns: minmax(0, 2fr) minmax(180px, 1fr); gap: 10px 14px; }
#customerProjectFormModal .customer-project-form-grid > label { gap: 7px; font-size: 14px; }
#customerProjectFormModal .customer-project-form-grid input, #adminProjectForm .admin-project-grid input, #adminProjectForm .admin-project-grid select { min-width: 0; height: 38px; padding: 7px 10px; font-size: 14px; }
#customerProjectFormModal .customer-project-form-grid > label small, .project-form-help { display: block; margin-top: 5px; color: #7989a4; font-size: 12px; font-weight: 400; line-height: 1.6; }
#customerProjectFormModal .customer-project-note-field textarea, #adminProjectNote { height: 58px; min-height: 58px; padding: 7px 10px; font-size: 14px; resize: vertical; }
.project-products-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
#adminProjectForm .admin-project-dialog { width: min(820px, calc(100vw - 32px)); }
#adminProjectForm .admin-project-products { grid-column: 1 / -1; }
#customerProjectItems, #adminProjectItems { display: grid; gap: 12px; margin: 8px 0; }
#customerProjectItems .project-item-editor, #adminProjectItems .project-item-editor { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 12px; border: 1px solid #dde5f0; border-radius: 10px; background: #f9fbfe; align-items: end; }
#customerProjectItems .project-item-editor > label, #adminProjectItems .project-item-editor > label { grid-column: auto; display: grid; gap: 5px; min-width: 0; margin: 0; color: #63758f; font-size: 12px; font-weight: 500; }
#customerProjectItems .project-item-editor input, #customerProjectItems .project-item-editor select, #adminProjectItems .project-item-editor input, #adminProjectItems .project-item-editor select { width: 100%; min-width: 0; height: 38px; padding: 7px 9px; border: 1px solid #ced9ec; border-radius: 7px; background: #fff; color: #30425b; font-size: 14px; }
.project-item-editor .project-product-picker { position: relative; grid-column: 1 / -1; min-width: 0; padding-right: 38px; }
.project-item-editor > button { position: absolute; top: 12px; right: 12px; width: 30px; height: 38px; padding: 0; color: #c44141; border: 1px solid #f2cece; border-radius: 7px; background: #fff5f5; }
.project-item-source { grid-column: 1 / -1; color: #8091a8; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.project-product-results { position: absolute; z-index: 65; left: 0; right: 0; top: calc(100% + 4px); max-height: 270px; overflow-y: auto; padding: 4px; color: #4c5f7a; background: #fff; border: 1px solid #cbd8ec; border-radius: 9px; box-shadow: 0 10px 28px #1f355523; }
.project-product-results > button { display: grid; width: 100%; gap: 4px; padding: 9px 10px; text-align: left; border: 0; border-bottom: 1px solid #edf1f7; border-radius: 5px; background: #fff; color: #314661; font-size: 13px; }
.project-product-results > button:hover, .project-product-results > button:focus { background: #eff5ff; }
.project-product-results small { color: #7b8da5; font-size: 11px; }
.project-product-results p { padding: 10px; font-size: 13px; }
.project-product-pages { display: flex; align-items: center; justify-content: flex-end; gap: 10px; position: sticky; bottom: -4px; padding: 8px; background: #f8faff; font-size: 12px; }
.project-product-pages button { height: 30px; padding: 4px 9px; border: 1px solid #d9e2ef; border-radius: 5px; background: #fff; color: #41699e; font-size: 12px; }
.project-product-pages button:disabled { color: #a6b0be; }
.project-report-links { display: grid; gap: 8px; margin-top: 12px; padding: 12px; border: 1px solid #dfe8f4; border-radius: 8px; background: #f4f8ff; font-size: 13px; }
.project-report-links a { color: #315ccc; text-decoration: none; }
.project-report-links small { color: #7789a4; }
.project-report-product-table { width: 100%; min-width: 0; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.project-report-product-table th, .project-report-product-table td { padding: 9px 7px; border-bottom: 1px solid #e8edf4; text-align: left; overflow-wrap: anywhere; white-space: normal; height: auto; max-width: none; }
.project-report-product-table th { color: #728198; background: #f6f8fc; font-size: 12px; }
.project-report-product-table-wrap { min-width: 0; width: 100%; overflow: visible; }
.project-report-product-table .product-attribute-col { width: 30%; }
.project-report-product-table .product-brand-col { width: 17%; }
.project-report-product-table .product-model-col { width: 35%; }
.project-report-product-table .product-quantity-col { width: 18%; }
.project-report-product-table td small { display: block; margin-top: 3px; color: #8491a4; font-size: 11px; font-weight: 400; }
.project-report-table td:nth-child(3) strong { color: #285ac2; }
@media (max-width: 760px) {
  #customerProjectFormModal .customer-project-dialog { width: calc(100vw - 20px); padding: 16px; max-height: calc(100dvh - 24px); }
  #customerProjectFormModal .customer-project-form-grid { grid-template-columns: 1fr; gap: 12px; }
  #customerProjectItems .project-item-editor, #adminProjectItems .project-item-editor { grid-template-columns: 1fr 1fr; gap: 9px; padding: 10px; }
  .project-item-editor > button { position: absolute; top: 11px; right: 10px; width: 30px; height: 34px; }
  .project-item-editor .project-product-picker { padding-right: 40px; }
  .project-product-results { right: 0; }
  #customerProjectFormModal .customer-project-dialog-actions { flex-wrap: wrap; gap: 8px; }
  #customerProjectFormModal .customer-project-dialog-actions > span { flex-basis: 100%; }
  .project-report-product-table th, .project-report-product-table td { padding: 8px 5px; }
}
.project-batch-note { grid-column: 1 / -1; color: #73849c; font-size: 12px; }
.project-batch-note summary { cursor: pointer; margin-bottom: 7px; }
.project-batch-note input { width: 100%; }
/* This modal is mounted on body: transformed/scrolling workspaces must not clip it. */
#customerProjectFormModal {
  position: fixed; inset: 0; z-index: 2600; width: 100%; height: 100dvh;
  min-width: 0; min-height: 0; margin: 0; padding: 16px; box-sizing: border-box;
  display: grid; place-items: center; overflow: hidden;
  background: rgba(24, 34, 54, .5); backdrop-filter: blur(2px);
}
#customerProjectFormModal.hidden { display: none !important; }
#customerProjectFormModal > .customer-project-dialog {
  display: flex; flex-direction: column; width: min(820px, 100%); max-width: 100%;
  min-width: 0; min-height: 0; max-height: calc(100dvh - 32px); margin: 0;
  overflow: hidden; padding: 20px; box-sizing: border-box; background: #fff;
  border: 1px solid #dce4f0; border-radius: 14px;
}
#customerProjectFormModal .customer-project-dialog-head {
  flex: 0 0 auto; min-width: 0; margin-bottom: 12px; padding-bottom: 12px;
}
#customerProjectFormModal .customer-project-dialog-head h3 { font-size: 20px; }
#customerProjectFormModal { color: #30425b; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
#customerProjectFormModal .customer-project-form-grid > label input,
#customerProjectFormModal .customer-project-form-grid textarea,
#customerProjectFormModal .project-batch-note input {
  width: 100%; box-sizing: border-box; border: 1px solid #ced9ec; border-radius: 8px;
  background: #fff; color: #30425b; font: inherit; padding: 9px 11px;
}
#customerProjectFormModal input:focus, #customerProjectFormModal textarea:focus, #customerProjectFormModal select:focus {
  outline: 2px solid #a8bbff; outline-offset: 1px; border-color: #6c8ef0;
}
#customerProjectFormModal .project-products-head > button,
#customerProjectFormModal .customer-project-dialog-actions > button {
  min-height: 38px; padding: 8px 17px; border: 1px solid #d7e1f1; border-radius: 8px;
  background: #f7f9fd; color: #466083; font-size: 14px; font-weight: 600; cursor: pointer;
}
#customerProjectFormModal .customer-project-dialog-actions > .primary {
  border-color: #3d63db; background: #3d63db; color: #fff;
}
#customerProjectFormModal .customer-project-dialog-head p { overflow-wrap: anywhere; }
#customerProjectFormModal .customer-project-form-grid {
  flex: 1 1 auto; min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain; padding: 3px 5px 5px 0; scrollbar-gutter: stable;
}
#customerProjectFormModal .customer-project-form-grid > * { min-width: 0; }
#customerProjectFormModal .customer-project-dialog-actions {
  flex: 0 0 auto; min-width: 0; margin-top: 12px; padding-top: 12px; background: #fff;
}
#customerProjectFormModal .customer-project-dialog-actions > span { min-width: 0; overflow-wrap: anywhere; }
.project-products-heading, .project-category-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; min-width: 0; }
.project-category-tags:empty { display: none; }
.project-category-tag { display: inline-flex; padding: 3px 8px; border-radius: 5px; background: #edf2ff; color: #4765c4; font-size: 12px; line-height: 1.5; font-weight: 500; overflow-wrap: anywhere; }
.project-category-tag.pending { background: #fff5e6; color: #977032; }
.project-quantity-control { position: relative; display: flex; align-items: center; min-width: 0; }
.project-quantity-control > [data-project-unit-suffix] { position: absolute; right: 9px; color: #7d8da1; font-size: 12px; pointer-events: none; }
.project-quantity-control:has(> [data-project-unit-suffix]:not([hidden])) input { padding-right: 38px !important; }
.project-window-actions, #customerProjectFormModal .customer-project-dialog-head > .project-window-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.project-window-actions > .ghost { min-height: 32px; padding: 5px 10px; border: 1px solid #dce4f0; border-radius: 7px; color: #617594; background: #f7f9fc; font-size: 12px; cursor: pointer; white-space: nowrap; }
#customerProjectFormModal .customer-project-products-label { font-size: 14px; }
#customerProjectFormModal #addCustomerProjectItemBtn { min-height: 32px; padding: 5px 10px; border: 1px solid #dce4f0; border-radius: 7px; color: #466083; background: #f7f9fc; font-size: 12px; white-space: nowrap; }
/* Keep the existing detail IDs and event bindings while presenting a centered window. */
#projectReportDetailDrawer { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; z-index: 2500; overflow: hidden; }
#projectReportDetailDrawer.hidden { display: none; }
#projectReportDetailDrawer > .project-report-drawer-mask { width: 100%; height: 100%; border-radius: 0; }
#projectReportDetailDrawer > .project-report-drawer-panel { position: relative; inset: auto; width: min(860px, calc(100vw - 40px)); max-width: 100%; height: auto; max-height: 80dvh; min-width: 0; min-height: 0; box-sizing: border-box; border: 1px solid #dce4f0; border-radius: 14px; overflow: hidden; box-shadow: 0 22px 60px #14203a40; }
#projectReportDetailDrawer .project-report-drawer-panel > header { padding: 15px 20px; align-items: flex-start; }
#projectReportDetailDrawer .project-report-drawer-panel > header > div:first-child { min-width: 0; }
#projectReportDetailDrawer .project-report-drawer-panel > header h2 { font-size: 19px; line-height: 1.5; overflow-wrap: anywhere; }
#projectReportDetailDrawer .project-report-drawer-body { min-width: 0; padding: 14px 20px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
#projectReportDetailDrawer .project-report-detail-owner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border: 1px solid #dfE7f3; border-radius: 8px; background: #f7f9fd; }
#projectReportDetailDrawer .project-report-detail-owner > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
#projectReportDetailDrawer .project-report-detail-owner small, #projectReportDetailDrawer .project-report-detail-owner span { color: #7f8fa7; font-size: 12px; }
#projectReportDetailDrawer .project-report-detail-owner strong { color: #294466; font-size: 15px; overflow-wrap: anywhere; }
#projectReportDetailDrawer .project-report-detail-owner .project-status { flex: 0 0 auto; }
#projectReportDetailDrawer .project-report-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 8px; gap: 0 20px; }
#projectReportDetailDrawer .project-report-detail-grid > div { display: grid; gap: 4px; min-width: 0; padding: 9px 0; border: 0; border-bottom: 1px solid #eef1f6; border-radius: 0; background: transparent; }
#projectReportDetailDrawer .project-report-detail-grid small { color: #7c8ca3; font-size: 11px; }
#projectReportDetailDrawer .project-report-detail-grid strong { font-size: 13px; line-height: 1.5; font-weight: 500; overflow-wrap: anywhere; }
#projectReportDetailDrawer .project-report-detail-section { margin-top: 14px; }
#projectReportDetailDrawer .project-report-detail-section h4 { margin: 0; font-size: 14px; }
#projectReportDetailDrawer .project-report-detail-section > .project-products-heading { margin-bottom: 8px; }
#projectReportDetailDrawer .project-report-detail-note { padding: 8px 0 0; border: 0; background: transparent; font-size: 13px; line-height: 1.6; }
#projectReportDetailDrawer .project-report-links { margin-top: 12px; padding: 10px 12px; gap: 6px; overflow-wrap: anywhere; }
#projectReportDetailDrawer .project-report-links > button { justify-self: end; min-height: 32px; padding: 5px 12px; font-size: 12px; }
#projectReportDetailDrawer .project-report-drawer-panel > footer { padding: 10px 20px; flex-shrink: 0; }
#projectReportDetailDrawer .project-report-drawer-panel > footer input { min-width: 0; height: 34px; font-size: 12px; }
#projectReportDetailDrawer .project-report-detail-actions { flex-wrap: wrap; gap: 6px; }
#projectReportDetailDrawer .project-report-detail-actions button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
/* Natural column widths reserve room for the project and its purchase scope. */
#projectReports .project-report-table { width: 100%; min-width: 1050px; table-layout: auto; }
#projectReports .project-report-table th, #projectReports .project-report-table td { width: auto; padding-left: 6px; padding-right: 6px; box-sizing: border-box; text-align: center; vertical-align: middle; }
#projectReports .project-report-cell-stack { text-align: center; justify-items: center; }
#projectReports .project-report-table td:nth-child(2) { min-width: 158px; max-width: 260px; }
#projectReports .project-report-table td:nth-child(3) { min-width: 112px; max-width: 170px; }
#projectReports .project-report-table td:nth-child(4) { min-width: 186px; max-width: 290px; }
#projectReports .project-report-table td:nth-child(7) { max-width: 120px; }
#projectReports .project-report-table td:nth-child(7) .project-report-cell-stack { width: 100%; }
#projectReports .project-report-table td:nth-child(7) .project-report-cell-stack > span { width: 100%; }
#projectReports .project-report-table td:nth-child(1) .project-report-cell-stack { min-width: 102px; max-width: 126px; margin: auto; }
#projectReports .project-report-table td:nth-child(9) .project-report-cell-stack { min-width: 70px; max-width: 92px; margin: auto; }
#projectReports .project-report-table td:nth-child(1) .project-report-cell-stack > span,
#projectReports .project-report-table td:nth-child(9) .project-report-cell-stack > strong { white-space: normal; line-height: 1.5; }
#projectReports .project-report-table td:nth-child(2) .project-report-cell-stack > strong,
#projectReports .project-report-table td:nth-child(3) .project-report-cell-stack > strong { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
#projectReports .project-report-table td:nth-child(9) .project-report-cell-stack > strong { font-size: 11px; }
#projectReports .project-report-table .project-report-table-action { padding: 0 6px; font-size: 11px; white-space: nowrap; }
#projectReports .project-report-products-cell, #projectReports .project-report-quantities-cell { padding-top: 9px; padding-bottom: 9px; vertical-align: middle; }
#projectReports .project-report-line { height: auto; min-height: 46px; padding: 6px 0; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; gap: 4px; min-width: 0; text-align: center; }
#projectReports .project-report-line + .project-report-line { border-top: 1px solid #e9eef6; }
#projectReports .project-report-line strong, #projectReports .project-report-line small { display: block; overflow: visible; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; line-height: 16px; }
#projectReports .project-report-line strong { font-size: 12px; color: #253952; font-weight: 600; }
#projectReports .project-report-line small { font-size: 11px; color: #7d8ba1; }
#projectReports .project-report-line.quantity { text-align: center; font-variant-numeric: tabular-nums; }
#projectReports .project-report-line.quantity strong { white-space: nowrap; }
#projectReports .project-report-line .unit-pending { color: #997123; font-size: 10px; }
.project-protection-summary, .customer-project-card-summary .project-protection-summary { display: grid; align-content: start; gap: 3px; min-width: 0; line-height: 1.5; }
.project-protection-summary small { color: #7b8ba2; font-size: 11px; font-weight: 400; }
.project-protection-summary .project-protection-remaining { font-size: 12px; line-height: 1.6; font-weight: 600; color: #c83434; }
.project-protection-summary .project-protection-remaining.soon { color: #c83434; }
.project-protection-summary .project-protection-remaining.urgent,
.project-protection-summary .project-protection-remaining.today,
.project-protection-summary .project-protection-remaining.expired { color: #c04242; }
.customer-portal #customerProjectsView .customer-project-card-metrics { flex-wrap: wrap; }
.customer-portal #customerProjectsView .project-protection-summary .project-protection-remaining.normal { color: #c83434; }
.customer-portal #customerProjectsView .project-protection-summary .project-protection-remaining.soon { color: #c83434; }
.customer-portal #customerProjectsView .project-protection-summary .project-protection-remaining.urgent,
.customer-portal #customerProjectsView .project-protection-summary .project-protection-remaining.today,
.customer-portal #customerProjectsView .project-protection-summary .project-protection-remaining.expired { color: #c04242; }
#projectReports .project-report-renew-button { justify-self: center; min-height: 27px; padding: 3px 9px; border: 1px solid #cddcf7; border-radius: 6px; background: #f0f5ff; color: #3b63b1; font-size: 11px; cursor: pointer; }
#projectReports #projectReportStats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); width: 100%; gap: 8px; }
#projectReports #projectReportStats > button { width: 100%; min-width: 0; height: 52px; padding: 8px 12px; grid-column: auto; }
#projectReports #projectReportStats .stat-renewal_pending { color: #aa6b17; border-color: #edcf9c; background: #fff7e9; }
@media (max-width: 760px) {
  #customerProjectFormModal { padding: 10px; }
  #customerProjectFormModal > .customer-project-dialog { width: 100%; max-height: calc(100dvh - 20px); padding: 14px; }
  #customerProjectFormModal .customer-project-dialog-head h3 { font-size: 18px; }
  #customerProjectFormModal .customer-project-dialog-actions > span:empty { display: none; }
  #projectReportDetailDrawer { padding: 10px; }
  #projectReportDetailDrawer > .project-report-drawer-panel { width: 100%; max-height: calc(100dvh - 20px); }
  #projectReportDetailDrawer .project-report-drawer-panel > header, #projectReportDetailDrawer .project-report-drawer-body, #projectReportDetailDrawer .project-report-drawer-panel > footer { padding: 12px; }
  #projectReportDetailDrawer .project-report-drawer-panel > header h2 { font-size: 16px; }
  #projectReportDetailDrawer .project-report-detail-grid { gap: 0 12px; }
  #projectReportDetailDrawer .project-report-drawer-panel > footer { flex-direction: column; align-items: stretch; }
  #projectReportDetailDrawer .project-report-detail-actions { justify-content: flex-end; }
  #maximizeCustomerProjectFormBtn, #maximizeProjectReportDetailBtn { display: none; }
  #projectReports .project-report-table-wrap { border: 0; background: transparent; overflow: visible; }
  #projectReports .project-report-table { display: block; min-width: 0; width: 100%; }
  #projectReports .project-report-table thead { display: none; }
  #projectReports .project-report-table tbody { display: grid; width: 100%; gap: 12px; }
  #projectReports .project-report-table tbody tr { display: grid; width: 100%; box-sizing: border-box; grid-template-columns: minmax(0, 1fr) 100px; min-width: 0; padding: 10px; border: 1px solid #dfe7f2; border-radius: 10px; background: #fff; }
  #projectReports .project-report-table td { display: block; min-width: 0; max-width: none; height: auto; padding: 7px 5px; text-align: left; border: 0; }
  #projectReports .project-report-table td:nth-child(n) { min-width: 0; max-width: none; }
  #projectReports .project-report-table td:nth-child(1) .project-report-cell-stack,
  #projectReports .project-report-table td:nth-child(9) .project-report-cell-stack { min-width: 0; max-width: none; margin: 0; }
  #projectReports .project-report-table td::before { display: block; content: attr(data-label); margin-bottom: 5px; color: #8895a8; font-size: 10px; line-height: 1.5; }
  #projectReports .project-report-table td:nth-child(1), #projectReports .project-report-table td:nth-child(2), #projectReports .project-report-table td:nth-child(3), #projectReports .project-report-table td:nth-child(7), #projectReports .project-report-table td:nth-child(8) { grid-column: 1 / -1; }
  #projectReports .project-report-table td:nth-child(4) { grid-column: 1; }
  #projectReports .project-report-table td:nth-child(5) { grid-column: 2; }
  #projectReports .project-report-table td:nth-child(6) { grid-column: 1 / -1; }
  #projectReports .project-report-table td:nth-child(11) { align-self: end; text-align: right; }
  #projectReports .project-report-table td:nth-child(5)::before { text-align: right; }
  #projectReports .project-report-table td.empty { grid-column: 1 / -1; height: auto; min-height: 100px; }
  #projectReports .project-report-table td.empty::before { display: none; }
  #projectReports .project-report-cell-stack, #projectReports .project-report-cell-stack.project-report-center { text-align: left; justify-items: start; }
  #projectReports .project-report-line.product { text-align: left; }
  #projectReports .project-report-line.quantity { text-align: right; }
  #projectReports .project-report-table .project-status { margin: 0; }
  #projectReports .project-report-table td:nth-child(8) .project-report-cell-stack { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
  #projectReports .project-report-table td:nth-child(8) .project-report-renew-button { margin-left: auto; min-height: 32px; }
  #projectReports .project-report-cell-stack strong, #projectReports .project-report-cell-stack span { white-space: normal; overflow-wrap: anywhere; }
  #projectReports #projectReportStats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  #projectReports #projectReportStats > button:last-child { grid-column: 1 / -1; }
}
/* Customer cards use their content width; expanding one card never stretches its siblings. */
.customer-portal #customerProjectsView .customer-project-results-card { container-name: customer-project-cards; container-type: inline-size; }
.customer-portal #customerProjectsView #customerProjectList.project-report-list { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 12px; min-width: 0; }
.customer-portal #customerProjectsView #customerProjectList.project-report-list.empty { grid-template-columns: minmax(0, 1fr); }
@container customer-project-cards (min-width: 768px) {
  .customer-portal #customerProjectsView #customerProjectList.project-report-list:not(.empty) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container customer-project-cards (min-width: 1280px) {
  .customer-portal #customerProjectsView #customerProjectList.project-report-list:not(.empty) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@supports not (container-type: inline-size) {
  @media (min-width: 768px) {
    .customer-portal #customerProjectsView #customerProjectList.project-report-list:not(.empty) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (min-width: 1280px) {
    .customer-portal #customerProjectsView #customerProjectList.project-report-list:not(.empty) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  }
}
.customer-portal #customerProjectsView .customer-project-card-compact {
  position: relative; display: flex; flex-direction: column; align-self: start; gap: 0; min-width: 0;
  min-height: 0; height: auto; margin: 0; padding: 13px; box-sizing: border-box;
  border: 1px solid #dce5f1; border-radius: 12px; background: #fff; box-shadow: 0 3px 12px #24385707;
}
.customer-portal #customerProjectsView .customer-project-card-compact > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin: 0; }
.customer-portal #customerProjectsView .customer-project-card-compact > header > div { display: grid; gap: 4px; min-width: 0; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-unit-label { color: #8190a5; font-size: 10px; font-weight: 500; line-height: 1.5; }
.customer-portal #customerProjectsView .customer-project-card-compact .project-card-name { display: block; overflow: visible; max-width: 100%; color: #273a56; font-size: 14px; line-height: 1.6; font-weight: 700; white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
.customer-portal #customerProjectsView .customer-project-card-compact > header .project-status { flex: 0 0 auto; margin: 0; padding: 4px 7px; border-radius: 6px; font-size: 10px; line-height: 1.4; }
.customer-portal #customerProjectsView .customer-project-card-compact > header > .customer-project-card-status { flex: 0 0 auto; justify-items: end; gap: 7px; padding: 2px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-expiry-stamp { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 92px; height: 40px; border: 4px double #d83232; border-radius: 5px; color: #d83232; background: #fffafa; font-size: 20px; font-weight: 800; letter-spacing: 3px; line-height: 1; white-space: nowrap; transform: rotate(-7deg); pointer-events: none; }
.customer-portal #customerProjectsView .customer-project-card-compact [data-project-expiry-stamp][hidden],
.customer-portal #customerProjectsView .customer-project-card-compact [data-project-protection-status][hidden],
.customer-portal #customerProjectsView .customer-project-card-compact [data-project-countdown][hidden] { display: none !important; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-facts { display: grid; min-width: 0; gap: 7px; margin: 11px 0; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-fact { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: start; gap: 7px; min-width: 0; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-fact > small { padding-top: 2px; color: #8190a5; font-size: 11px; line-height: 1.5; white-space: nowrap; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-fact > b,
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-fact > span { display: block; min-width: 0; max-width: 100%; color: #34465f; font-size: 12px; font-weight: 500; line-height: 1.65; white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-fact > .customer-project-brand-tags { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 5px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-brand-tag { display: inline-block; max-width: 100%; padding: 2px 7px; border: 1px solid #dce7fc; border-radius: 5px; background: #f1f5ff; color: #4269b8; font-size: 11px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-models { min-width: 0; margin: 1px 0; border: 1px solid #e1e8f3; border-radius: 8px; background: #f8faff; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-models > summary { display: flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 9px; box-sizing: border-box; color: #61738f; font-size: 11px; line-height: 1.5; list-style: none; cursor: pointer; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-models > summary::-webkit-details-marker,
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcements > summary::-webkit-details-marker { display: none; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-model-label { color: #8190a5; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-models > summary > b { font-size: 11px; font-weight: 600; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-model-toggle { margin-left: auto; color: #4973ba; font-size: 10px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-models[open] .when-closed,
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-models:not([open]) .when-open { display: none; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-model-list { padding: 0 9px; min-width: 0; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-model-row { display: grid; grid-template-columns: minmax(0, 62px) minmax(0, 1fr); align-items: start; gap: 8px; min-width: 0; padding: 8px 0; border-top: 1px solid #e3eaf5; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-model-brand { padding: 2px 0; color: #5173a8; font-size: 11px; font-weight: 600; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-model-info { display: grid; min-width: 0; gap: 3px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-model-info > strong { display: block; min-width: 0; color: #30445f; font-size: 12px; font-weight: 600; line-height: 1.55; white-space: normal; overflow: visible; overflow-wrap: anywhere; word-break: normal; text-overflow: clip; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-model-info > small { min-width: 0; color: #8390a3; font-size: 10px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-protection { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; min-width: 0; margin-top: 2px; padding: 7px 9px; border: 1px solid #f2dddd; border-radius: 8px; background: #fff8f7; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-protection > span { display: grid; gap: 3px; min-width: 0; color: #7f8b9d; font-size: 10px; line-height: 1.5; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-protection time { color: #596980; font-size: 12px; font-variant-numeric: tabular-nums; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-countdown { color: #df3735; font-size: 14px; font-weight: 700; line-height: 1.4; font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-countdown > strong { color: inherit; font-size: 16px; font-weight: 750; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-protection.normal > span:first-child { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-countdown[data-project-countdown] { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; width: 100%; color: #df3735; font-size: 14px; font-variant-numeric: tabular-nums; }
.customer-portal #customerProjectsView .customer-project-card-compact [data-project-countdown-days],
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-countdown > [data-project-countdown-clock] { color: inherit; font-size: 18px; font-weight: 750; line-height: 1.4; }
.customer-portal #customerProjectsView .customer-project-card-compact [data-project-countdown-clock] { display: inline-block; min-width: 8ch; white-space: nowrap; letter-spacing: .4px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-protection.expired { border-color: #efcccc; background: #fff5f4; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-protection.inactive { border-color: #e3e7ed; background: #f7f9fc; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-protection.inactive .customer-project-countdown { color: #8994a4; font-size: 14px; }
.customer-portal #customerProjectsView .customer-project-card-compact [data-customer-project-renew] { min-height: 27px; padding: 4px 8px; border: 1px solid #c9d9f7; border-radius: 6px; background: #f4f7ff; color: #4169b0; font-size: 11px; font-weight: 600; line-height: 1.5; white-space: nowrap; cursor: pointer; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-protection > .customer-project-renewal-pending { display: inline-block; max-width: 100%; padding: 3px 7px; border-radius: 5px; background: #fff0d7; color: #a16a20; font-size: 11px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcements { min-width: 0; margin-top: 10px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcements > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; color: #577198; font-size: 11px; line-height: 1.6; list-style: none; cursor: pointer; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcements > summary::before { content: "›"; flex: 0 0 auto; color: #6483b2; font-size: 16px; line-height: 1; transition: transform .15s; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcements[open] > summary::before { transform: rotate(90deg); }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-review-badge { padding: 1px 5px; border-radius: 4px; color: #ae741e; background: #fff2d9; font-size: 10px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-list { display: grid; gap: 7px; margin-top: 6px; padding: 8px; border: 1px solid #e3eaf5; border-radius: 7px; background: #f8faff; font-size: 11px; line-height: 1.7; white-space: normal; overflow-wrap: anywhere; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-list > div { min-width: 0; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-list a { color: #456ab2; text-decoration: none; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-list small { display: block; color: #8693a6; font-size: 10px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-no-announcements { margin: 9px 0 0; color: #8b97a8; font-size: 11px; line-height: 1.5; }
.customer-portal #customerProjectsView .customer-project-card-compact > footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; padding-top: 9px; border-top: 1px solid #e9eef5; }
.customer-portal #customerProjectsView .customer-project-card-compact > .customer-project-card-footer-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-toggle { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: flex-start; gap: 3px; min-width: 0; min-height: 28px; padding: 0; border: 0; background: transparent; color: #5274a5; font: inherit; font-size: 11px; line-height: 1.6; text-align: left; white-space: normal; overflow-wrap: anywhere; cursor: pointer; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-toggle::before { content: "›"; flex: 0 0 auto; color: #6483b2; font-size: 15px; line-height: 1; transition: transform .15s; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }
.customer-portal #customerProjectsView .customer-project-card-compact > .customer-project-card-footer-row .customer-project-no-announcements { margin: 0; }
.customer-portal #customerProjectsView .customer-project-card-compact > .customer-project-card-footer-row > [data-customer-project-edit] { justify-self: end; white-space: nowrap; }
.customer-portal #customerProjectsView .customer-project-card-compact > .customer-project-card-footer-row > .project-report-actions { margin: 0; flex: 0 0 auto; justify-self: end; }
.customer-portal #customerProjectsView .customer-project-card-compact > .customer-project-card-footer-row > .project-report-actions > button { white-space: nowrap; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-panel { min-width: 0; margin-top: 8px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-panel[hidden] { display: none; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-panel > small { display: block; color: #8290a4; font-size: 10px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-note { min-width: 0; margin-top: 8px; color: #7b8b9f; font-size: 11px; line-height: 1.7; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-note > summary { cursor: pointer; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-note > p { margin: 5px 0 0; padding: 7px 9px; border: 1px solid #e2e9f3; border-radius: 6px; background: #f8faff; white-space: pre-wrap; overflow-wrap: anywhere; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-renewal-feedback { flex: 1 1 100%; color: #a26937; font-size: 10px; line-height: 1.6; overflow-wrap: anywhere; }
.customer-portal #customerProjectsView .customer-project-card-compact > footer .customer-project-card-tools { margin-left: auto; flex-wrap: wrap; gap: 7px; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-card-detail { position: static; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-card-detail > div { position: absolute; inset: auto 12px 46px; width: auto; max-width: none; max-height: min(320px, calc(100% - 60px)); overflow: auto; box-sizing: border-box; }
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-models > summary:focus-visible,
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcements > summary:focus-visible,
.customer-portal #customerProjectsView .customer-project-card-compact .customer-project-announcement-toggle:focus-visible,
.customer-portal #customerProjectsView .customer-project-card-compact [data-customer-project-renew]:focus-visible { outline: 2px solid #93ace7; outline-offset: 2px; border-radius: 4px; }
/* The renewal dialog is shared by customer requests and administrator review. */
#projectRenewalModal.project-renewal-dialog { width: min(620px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); padding: 0; box-sizing: border-box; overflow: hidden; color: #30425b; border: 1px solid #dce5f1; border-radius: 12px; background: #fff; box-shadow: 0 20px 70px #14213b38; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
#projectRenewalModal.project-renewal-dialog[open] { display: flex; flex-direction: column; }
#projectRenewalModal::backdrop { background: rgba(24, 34, 54, .5); backdrop-filter: blur(2px); }
#projectRenewalModal .project-renewal-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex: 0 0 auto; min-width: 0; padding: 14px 18px; border-bottom: 1px solid #e5ebf4; }
#projectRenewalModal .project-renewal-heading h3 { margin: 0; color: #2d4261; font-size: 18px; line-height: 1.5; }
#projectRenewalModal .project-renewal-heading > div { display: flex; flex: 0 0 auto; gap: 7px; }
#projectRenewalModal .project-renewal-dialog-body { display: grid; gap: 12px; flex: 1 1 auto; min-height: 0; overflow: auto; padding: 15px 18px; overscroll-behavior: contain; }
#projectRenewalModal .project-renewal-summary { padding: 10px 12px; border: 1px solid #e1e8f3; border-radius: 8px; background: #f7f9fd; color: #65758e; font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
#projectRenewalModal .project-renewal-summary > strong { display: block; color: #304661; font-size: 13px; }
#projectRenewalModal .project-renewal-summary > p { margin: 5px 0 0; }
#projectRenewalModal .project-renewal-dialog-body > label { display: grid; gap: 7px; min-width: 0; color: #576b86; font-size: 13px; line-height: 1.5; }
#projectRenewalModal textarea { display: block; width: 100%; min-height: 84px; max-height: 240px; box-sizing: border-box; padding: 9px 11px; border: 1px solid #ccd9ec; border-radius: 7px; background: #fff; color: #30425b; font: inherit; font-size: 13px; line-height: 1.6; resize: vertical; }
#projectRenewalModal textarea:focus { outline: 2px solid #a8baff; outline-offset: 1px; border-color: #6b88dc; }
#projectRenewalModal .project-renewal-result { color: #af5047; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
#projectRenewalModal .project-renewal-result:empty { display: none; }
#projectRenewalModal .project-renewal-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; flex: 0 0 auto; margin: 0; padding: 11px 18px; border-top: 1px solid #e5ebf4; background: #fff; }
#projectRenewalModal button { min-height: 32px; padding: 6px 11px; border: 1px solid #d4dff0; border-radius: 7px; color: #587195; background: #f7f9fd; font: inherit; font-size: 12px; line-height: 1.5; cursor: pointer; }
#projectRenewalModal #submitProjectRenewalBtn { padding-left: 16px; padding-right: 16px; color: #fff; background: #4166d8; border-color: #4166d8; }
#projectRenewalModal #rejectProjectRenewalBtn { color: #b64f48; background: #fff4f2; border-color: #f0d3d0; }
#projectRenewalModal button:disabled { opacity: .55; cursor: default; }
#projectRenewalModal [hidden] { display: none !important; }
@media (max-width: 760px) {
  #projectRenewalModal.project-renewal-dialog { width: calc(100vw - 20px); max-width: calc(100vw - 20px); max-height: calc(100dvh - 20px); }
  #projectRenewalModal .project-renewal-heading, #projectRenewalModal .project-renewal-dialog-body, #projectRenewalModal .project-renewal-actions { padding: 12px; }
  #projectRenewalModal .project-renewal-heading h3 { font-size: 16px; }
  #projectRenewalModal #maximizeProjectRenewalBtn { display: none; }
}

/* Project status colors are shared across cards, the table, and detached dialogs. */
.project-status.protected, .project-report-detail-owner .project-status.protected { color: #2855c6; background: #e9efff; }
.project-status.done, .project-report-detail-owner .project-status.done { color: #137a47; background: #e4f7ed; }
.project-status.expired { color: #bb3636; background: #fff0ef; }
#projectReports #projectReportStats .stat-protected, .customer-project-stats .stat-protected { color: #2855c6; border-color: #bfd0ff; background: #edf3ff; }
#projectReports #projectReportStats .stat-done, .customer-project-stats .stat-done { color: #137a47; border-color: #bce4cc; background: #edf9f1; }
#projectReports #projectReportStats .stat-expiring_7 { color: #bb3636; border-color: #efc6c6; background: #fff3f2; }
#projectReportDetailDrawer .project-report-drawer-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
#projectReportDetailDrawer .project-report-drawer-body { min-height: 0; }
#projectReportDetailDrawer .project-report-detail-grid .wide { grid-column: 1 / -1; }
#adminProjectForm .admin-project-dialog { box-sizing: border-box; }
#adminProjectForm .admin-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px; }
#adminProjectForm .admin-project-dialog > label { margin-top: 10px; }
#adminProjectForm #adminProjectNote { box-sizing: border-box; }
#customerProjectFormModal .customer-project-dialog-head { margin-bottom: 10px; padding-bottom: 10px; }
#customerProjectFormModal .customer-project-dialog-actions { margin-top: 10px; padding-top: 10px; }
#customerProjectFormModal .customer-project-form-grid { align-content: start; }
/* Single-name creation shares the library's list, so duplicate names remain visible. */
#projectNameLibraryModal .project-name-library-tools { grid-template-columns: minmax(180px, 1fr) auto 160px 72px; align-items: center; }
#projectNameLibraryModal .project-name-library-tools > button { white-space: nowrap; }
#projectNameLibraryModal .project-name-library-create { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; margin: 12px 0 0; padding: 14px; border: 1px solid #dce6f5; border-radius: 9px; background: #f7faff; }
#projectNameLibraryModal .project-name-library-create[hidden] { display: none; }
#projectNameLibraryModal .project-name-library-create > label { display: block; min-width: 0; color: #617491; font-size: 12px; font-weight: 500; }
#projectNameLibraryModal .project-name-library-create input { display: block; width: 100%; height: 36px; min-width: 0; box-sizing: border-box; margin-top: 6px; padding: 7px 9px; font-size: 13px; }
#projectNameLibraryModal .project-name-library-create-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 8px; }
#projectNameLibraryModal .project-name-library-create-actions button { min-height: 32px; padding: 6px 12px; font-size: 12px; }
#projectNameLibraryModal #projectNameLibraryCreateStatus { grid-column: 1 / -1; margin: 0; color: #687b98; font-size: 12px; overflow-wrap: anywhere; }
#projectNameLibraryModal #projectNameLibraryCreateStatus:empty { display: none; }
#projectNameLibraryModal #projectNameLibraryCreateStatus.success { color: #24754b; }
#projectNameLibraryModal #projectNameLibraryCreateStatus.error { color: #bf3838; }
#projectNameLibraryModal .project-name-library-row.is-highlighted { background: #edf4ff; box-shadow: inset 3px 0 #426cd4; }
#projectNameLibraryModal .project-name-library-row strong { white-space: normal; overflow-wrap: anywhere; }
#projectNameLibraryModal .project-name-library-row { grid-template-columns: minmax(170px,1.2fr) minmax(120px,1fr) 76px 64px 132px; gap: 10px; }
#projectNameLibraryModal .project-name-library-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; }
#projectNameLibraryModal .project-name-library-row-actions button { min-width: 60px; padding: 7px 10px; }
#projectNameLibraryModal .project-name-library-row-actions .project-name-library-delete { border-color: #edc7cc; color: #bc3447; background: #fff7f8; }
#projectNameLibraryModal .project-name-library-row-actions .project-name-library-delete:hover:not(:disabled) { border-color: #d47380; background: #ffedef; }
#projectNameLibraryModal .project-name-library-form-title { grid-column: 1 / -1; color: #2a4268; font-size: 14px; }
@media (max-width: 760px) {
  #projectNameLibraryModal .project-name-library-tools { grid-template-columns: minmax(0, 1fr) auto; }
  #projectNameLibraryModal .project-name-library-tools > input { grid-column: 1 / -1; }
  #projectNameLibraryModal .project-name-import { min-width: 0; }
  #projectNameLibraryModal .project-name-library-create { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  #projectNameLibraryModal .project-name-library-row { grid-template-columns: minmax(0,1fr) 64px; gap: 8px; }
  #projectNameLibraryModal .project-name-library-row > span { grid-column: 1 / -1; grid-row: 2; white-space: normal; overflow-wrap: anywhere; }
  #projectNameLibraryModal .project-name-library-row > small { display: none; }
  #projectNameLibraryModal .project-name-library-row > [data-use-project-name] { grid-column: 2; grid-row: 1; }
  #projectNameLibraryModal .project-name-library-row-actions { grid-column: 1 / -1; grid-row: 3; }
  #adminProjectForm .admin-project-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Scoped procurement comparison: current record stays left, one candidate right. */
.project-comparison-badge { display: grid; gap: 3px; max-width: 260px; margin-top: 7px; padding: 7px 9px; border: 1px solid #efd2a6; border-radius: 7px; background: #fff8ed; color: #945b13; text-align: left; white-space: normal; cursor: pointer; font: inherit; font-size: 12px; line-height: 1.5; }
.project-comparison-badge span { overflow-wrap: anywhere; }
.project-comparison-badge small { color: #315eb9; text-decoration: underline; }
.project-comparison-badge.reviewed { color: #287052; border-color: #c4dfd0; background: #f0faf5; }
#projectComparisonModal { width: min(1220px, calc(100vw - 36px)); max-width: calc(100vw - 36px); max-height: calc(100dvh - 36px); padding: 0; box-sizing: border-box; border: 1px solid #dce4ef; border-radius: 14px; background: #fff; color: #293e59; box-shadow: 0 22px 80px #18283b38; font: 13px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow: hidden; }
#projectComparisonModal[open] { display: flex; flex-direction: column; }
#projectComparisonModal::backdrop { background: #14223888; backdrop-filter: blur(2px); }
#projectComparisonModal .project-comparison-heading { display: flex; flex: 0 0 auto; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 15px 20px; border-bottom: 1px solid #e3eaf3; }
#projectComparisonModal h3 { margin: 0; font-size: 19px; }
#projectComparisonModal .project-comparison-heading p { margin: 5px 0 0; color: #697d98; font-size: 12px; }
#projectComparisonModal .project-comparison-body { min-height: 0; padding: 14px 20px; overflow: auto; overscroll-behavior: contain; }
#projectComparisonModal #projectComparisonStatus { margin: 0 0 12px; padding: 9px 12px; border: 1px solid #e9d7b9; border-radius: 7px; background: #fff9ef; color: #8a5d20; overflow-wrap: anywhere; }
#projectComparisonModal .project-comparison-selector { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 600; }
#projectComparisonModal select { flex: 1; min-width: 0; max-width: 100%; height: 36px; padding: 6px 9px; border: 1px solid #ccd9ea; border-radius: 6px; background: #fff; color: #304969; font: inherit; }
#projectComparisonModal .project-comparison-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 14px; }
#projectComparisonModal .project-comparison-report { min-width: 0; border: 1px solid #dce5ef; border-radius: 9px; overflow: hidden; }
#projectComparisonModal .project-comparison-report h4 { margin: 0; padding: 10px 13px; color: #275baf; background: #eef4ff; border-bottom: 1px solid #dce5ef; font-size: 15px; }
#projectComparisonModal .project-comparison-report.original h4 { color: #566c8a; background: #f5f7fb; }
#projectComparisonModal .project-comparison-report h4 small { display: block; margin-top: 3px; font-size: 11px; color: #6d819e; font-weight: 400; }
#projectComparisonModal dl { margin: 0; padding: 3px 13px; }
#projectComparisonModal dl > div { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 9px; padding: 9px 0; border-bottom: 1px solid #ecf0f6; }
#projectComparisonModal dt { color: #70839d; }
#projectComparisonModal dd { margin: 0; min-width: 0; color: #293f5b; overflow-wrap: anywhere; white-space: pre-wrap; }
#projectComparisonModal h5 { margin: 0; padding: 10px 13px 6px; color: #536d91; font-size: 12px; }
#projectComparisonModal .project-comparison-products { display: grid; gap: 8px; padding: 0 12px 12px; }
#projectComparisonModal .project-comparison-product { display: grid; gap: 3px; min-width: 0; padding: 10px 11px; border: 1px solid #e1e8f1; border-radius: 7px; background: #fbfcfe; overflow-wrap: anywhere; }
#projectComparisonModal .project-comparison-product.matched { border-color: #eccb8f; background: #fff8e9; box-shadow: inset 3px 0 #e0a339; }
#projectComparisonModal .project-comparison-product strong { font-size: 13px; }
#projectComparisonModal .project-comparison-model { color: #4d6585; font-weight: 500; }
#projectComparisonModal .project-comparison-product small { color: #7c6b43; }
#projectComparisonModal .project-comparison-product .quantity-different { color: #a66316; font-weight: 600; }
#projectComparisonModal .project-comparison-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 5px; color: #325a95; font-weight: 600; }
#projectComparisonModal input[type="checkbox"] { width: 17px; height: 17px; flex: 0 0 auto; margin: 0; }
#projectComparisonModal #projectComparisonDecision { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e4eaf2; }
#projectComparisonModal #projectComparisonDecision > label { display: block; margin-bottom: 6px; font-weight: 600; }
#projectComparisonModal textarea { width: 100%; min-height: 78px; max-height: 180px; padding: 9px 11px; box-sizing: border-box; border: 1px solid #cbd8e9; border-radius: 7px; color: #2d4565; font: inherit; resize: vertical; }
#projectComparisonModal #projectComparisonProgress, #projectComparisonModal .project-comparison-reviewed, #projectComparisonModal .project-comparison-audit { margin: 7px 0 0; color: #657b99; font-size: 12px; overflow-wrap: anywhere; }
#projectComparisonModal .project-comparison-audit { padding: 0 13px 12px; }
#projectComparisonModal .project-comparison-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #e0e8f2; background: #fff; }
#projectComparisonModal button { min-height: 34px; padding: 7px 11px; border: 1px solid #d3deee; border-radius: 7px; background: #f7f9fd; color: #4b6487; font: inherit; cursor: pointer; }
#projectComparisonModal button.primary { color: #fff; background: #3d63d8; border-color: #3d63d8; }
#projectComparisonModal button.danger { color: #b44942; background: #fff4f2; border-color: #edcecb; }
#projectComparisonModal button:disabled { opacity: .5; cursor: default; }
#projectComparisonModal button:focus-visible, #projectComparisonModal select:focus, #projectComparisonModal textarea:focus { outline: 2px solid #a5baff; outline-offset: 2px; }
#projectComparisonModal [hidden] { display: none !important; }
.customer-project-review-feedback { margin: 8px 0 0; padding: 8px 10px; border-radius: 6px; color: #935e27; background: #fff7e9; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  #projectComparisonModal { width: calc(100vw - 18px); max-width: calc(100vw - 18px); max-height: calc(100dvh - 18px); }
  #projectComparisonModal .project-comparison-heading, #projectComparisonModal .project-comparison-body, #projectComparisonModal .project-comparison-actions { padding: 12px; }
  #projectComparisonModal h3 { font-size: 17px; }
  #projectComparisonModal .project-comparison-columns { grid-template-columns: minmax(0, 1fr); }
  #projectComparisonModal .project-comparison-selector { display: grid; gap: 5px; }
  #projectComparisonModal select { width: 100%; }
  #projectComparisonModal dl > div { grid-template-columns: 100px minmax(0, 1fr); }
  #projectComparisonModal .project-comparison-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #projectComparisonModal .project-comparison-actions button { padding: 8px 6px; font-size: 12px; }
}
#projectReports .project-report-products-cell .project-comparison-badge { width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; }
#projectComparisonModal .project-comparison-history-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 7px; background: #f1f5fb; color: #617591; }
