.project-cost-analysis-entry { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-top: 10px; }
.project-cost-analysis-entry > span { color: #738092; font-size: 12px; }
.project-cost-analysis-entry > button { width: auto; margin: 0; white-space: nowrap; }
.pca-dialog {
  width: min(1180px, calc(100vw - 40px)); max-width: 1180px; height: min(860px, calc(100dvh - 40px)); max-height: calc(100dvh - 40px);
  margin: auto; padding: 0; border: 1px solid #dce3ec; border-radius: 12px; background: #fff; color: #293548;
  box-shadow: 0 22px 70px #10203335; overflow: hidden; box-sizing: border-box;
}
.pca-dialog[open] { display: flex; flex-direction: column; }
.pca-dialog::backdrop, .pca-confirm::backdrop { background: #14223565; }
.pca-dialog *, .pca-confirm * { box-sizing: border-box; }
.pca-dialog .pca-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 22px 13px; border-bottom: 1px solid #e7ebf0; flex: 0 0 auto; }
.pca-dialog .pca-head > div:first-child { min-width: 0; }
.pca-dialog .pca-head h3 { margin: 0; color: #273649; font-size: 18px; line-height: 1.5; font-weight: 600; }
.pca-dialog .pca-head p { margin: 4px 0 0; color: #718094; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.pca-dialog .pca-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.pca-dialog button, .pca-confirm button { width: auto; min-height: 32px; margin: 0; padding: 5px 11px; border: 1px solid #cdd8e5; border-radius: 5px; background: #fff; color: #365879; font-size: 12px; line-height: 1.5; font-weight: 500; cursor: pointer; box-shadow: none; }
.pca-dialog button:hover, .pca-confirm button:hover { background: #f1f6fa; border-color: #9fb5cb; }
.pca-dialog button:disabled, .pca-confirm button:disabled { opacity: .45; cursor: default; }
.pca-dialog :is(button, input, select, summary):focus-visible, .pca-confirm button:focus-visible { outline: 2px solid #3178bd; outline-offset: 2px; }
.pca-dialog .pca-status { flex: 0 0 auto; margin: 0; padding: 0 22px; font-size: 13px; color: #69778a; }
.pca-dialog .pca-status:empty { display: none; }
.pca-dialog .pca-status p { margin: 12px 0 0; padding: 9px 12px; background: #fff6e8; color: #8b6026; border-radius: 5px; line-height: 1.65; }
.pca-dialog .pca-status p.pca-notice-success { background: #eef7f3; color: #326e57; }
.pca-dialog .pca-status p.pca-notice-error { background: #fff1ed; color: #a34e39; }
.pca-dialog .pca-status button { margin-left: 10px; }
.pca-dialog .pca-body.project-cost-analysis-panel { flex: 1 1 auto; min-height: 150px; min-width: 0; margin: 0; padding: 16px 22px 20px; border: 0; background: #fff; overflow-y: auto; overscroll-behavior: contain; font-size: 13px; color: #293548; }
.pca-dialog .pca-body[aria-busy="true"] { opacity: .65; }
.pca-dialog .project-cost-analysis-body { min-width: 0; }
.pca-dialog .project-cost-analysis-empty { gap: 10px; margin: 0; padding: 12px; border: 0; border-radius: 6px; color: #738092; background: #f7f9fb; font-size: 13px; line-height: 1.6; }
.pca-dialog .project-cost-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 10px; }
.pca-dialog .project-cost-summary-grid > div { min-width: 0; padding: 11px 13px; border: 1px solid #e5eaf0; border-radius: 7px; background: #f7f9fb; box-shadow: none; }
.pca-dialog .project-cost-summary-grid > div:last-child { grid-column: auto; }
.pca-dialog .project-cost-summary-grid span { display: block; color: #738092; font-size: 12px; line-height: 1.6; }
.pca-dialog .project-cost-summary-grid strong { display: block; margin-top: 4px; color: #293548; font-size: 20px; font-weight: 600; line-height: 1.5; font-variant-numeric: tabular-nums; }
.pca-dialog .project-cost-summary-grid .project-cost-amount-link { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; width: auto; min-height: 0; margin: 0; padding: 0; background: transparent; border: 0; color: #2469a5; text-align: left; }
.pca-dialog .project-cost-summary-grid .project-cost-amount-link strong { color: #2469a5; }
.pca-dialog .project-cost-amount-link small { color: #738092; font-size: 11px; font-weight: 400; }
.pca-dialog .project-cost-amount-link:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.pca-dialog .project-cost-record-note { margin: 6px 0 10px; color: #738092; font-size: 12px; line-height: 1.6; }
.pca-dialog .project-cost-summary-grid strong > small { display: block; margin-top: 2px; color: #738092; font-size: 12px; line-height: 1.6; font-weight: 400; }
.pca-dialog .project-cost-readiness { display: flex; flex-wrap: wrap; gap: 3px 10px; padding: 8px 11px; margin: 6px 0 10px; border-left: 2px solid #d5a45e; background: #fff9ee; color: #89642f; font-size: 12px; line-height: 1.65; }
.pca-dialog .project-cost-readiness strong { font-weight: 600; }
.pca-dialog .project-cost-readiness > span:last-child { flex-basis: 100%; color: #7b756d; font-size: 11px; }
.pca-dialog .project-cost-candidate-table td small { display: block; color: #738092; font-size: 11px; }
.pca-dialog .project-cost-secondary { margin: 8px 0 0; padding: 0; border: 0; background: transparent; }
.pca-dialog .project-cost-secondary > summary { padding: 9px 0; color: #526779; font-size: 13px; line-height: 1.6; font-weight: 500; cursor: pointer; }
.pca-dialog .project-cost-secondary > p { margin: 4px 0 9px; color: #738092; font-size: 12px; line-height: 1.65; }
.pca-dialog .project-cost-comparison, .pca-dialog .project-cost-rules { border-top: 1px solid #e8edf2; }
.pca-dialog .project-cost-comparison > summary { color: #365879; font-weight: 600; }
.pca-dialog .project-cost-section-title { margin: 14px 0 7px; color: #394d60; font-size: 13px; font-weight: 600; }
.pca-dialog .table-scroll { min-width: 0; max-width: 100%; margin: 8px 0 10px; border: 1px solid #e1e7ef; border-radius: 6px; overflow-x: auto; overscroll-behavior-inline: contain; }
.pca-dialog .project-cost-table { width: 100%; min-width: 640px; margin: 0; border: 0; border-collapse: collapse; table-layout: auto; color: #34475a; font-size: 12px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.pca-dialog .project-cost-table :is(th, td) { padding: 8px 11px; border: 0; border-bottom: 1px solid #edf0f4; color: inherit; font-size: 12px; line-height: 1.6; text-align: left; vertical-align: middle; white-space: normal; overflow-wrap: anywhere; }
.pca-dialog .project-cost-table th { background: #f5f7fa; color: #738092; font-size: 11px; font-weight: 500; }
.pca-dialog .project-cost-table td { background: #fff; }
.pca-dialog .project-cost-table tbody > tr:last-child > td { border-bottom: 0; }
.pca-dialog .project-cost-table tbody > tr:hover > td { background: #fafcfe; }
.pca-dialog .project-cost-category-table { min-width: 530px; }
.pca-dialog .project-cost-category-link { display: inline-flex; align-items: baseline; gap: 8px; flex-wrap: wrap; width: auto; min-height: 0; padding: 0; border: 0; color: #2469a5; background: transparent; text-align: left; font-size: 12px; }
.pca-dialog .project-cost-category-link > span { color: #7a8b9c; font-size: 11px; }
.pca-dialog .project-cost-category-link:hover { background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.pca-dialog .project-cost-comparison > .table-scroll { max-height: 340px; overflow: auto; }
.pca-dialog .project-cost-candidate-table { min-width: 850px; }
.pca-dialog .project-cost-candidate-table th { position: sticky; top: 0; z-index: 1; background: #f5f7fa; }
.pca-dialog .project-cost-candidate-table th:first-child { width: 25%; }
.pca-dialog .project-cost-candidate-table td:last-child { white-space: nowrap; width: 90px; }
.pca-dialog .project-cost-candidate-table button { min-height: 28px; padding: 3px 9px; white-space: nowrap; }
.pca-dialog .project-cost-table :is(input, select) { min-height: 30px; margin: 0; padding: 4px 7px; border: 1px solid #d3dce7; border-radius: 5px; color: #34475a; background: #fff; font-size: 12px; line-height: 20px; font-variant-numeric: tabular-nums; }
.pca-dialog .project-cost-notes { display: flex; flex-direction: column; gap: 4px; margin: 3px 0 0; }
.pca-dialog .project-cost-notes span { padding: 0; color: #738092; background: transparent; font-size: 11px; line-height: 1.7; }
.pca-dialog .project-cost-table .project-cost-over, .pca-dialog .project-cost-over { color: #ae563c; font-weight: 500; }
.pca-dialog .project-cost-table .project-cost-save, .pca-dialog .project-cost-save { color: #347663; font-weight: 500; }
.pca-dialog .muted { color: #7a8796; }
.pca-confirm { width: min(460px, calc(100vw - 32px)); max-width: 460px; margin: auto; padding: 22px; border: 1px solid #dce3ec; border-radius: 10px; background: #fff; color: #293548; box-shadow: 0 22px 70px #10203335; }
.pca-confirm h3 { margin: 0 0 10px; color: #293548; font-size: 17px; line-height: 1.5; }
.pca-confirm p { margin: 0; color: #617087; font-size: 13px; line-height: 1.7; white-space: pre-wrap; }
.pca-confirm > div { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.pca-confirm .pca-confirm-submit { border-color: #2c69a5; color: #fff; background: #2c69a5; }
.pca-confirm .pca-confirm-submit:hover { border-color: #245b92; background: #245b92; }
@media (max-width: 700px) {
  .pca-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 20px); border-radius: 8px; }
  .pca-dialog .pca-head { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .pca-dialog .pca-head h3 { font-size: 17px; }
  .pca-dialog .pca-status { padding: 0 14px; }
  .pca-dialog .pca-body.project-cost-analysis-panel { padding: 12px 14px 16px; }
  .pca-dialog .project-cost-summary-grid { gap: 7px; }
  .pca-dialog .project-cost-summary-grid > div { padding: 9px; }
  .pca-dialog .project-cost-summary-grid strong { font-size: 17px; }
  .pca-dialog .project-cost-summary-grid .project-cost-amount-link { gap: 0; }
}
@media (max-width: 430px) {
  .pca-dialog .pca-actions { width: 100%; justify-content: flex-end; }
  .pca-dialog .project-cost-summary-grid { grid-template-columns: 1fr; }
  .pca-dialog .project-cost-summary-grid > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .pca-dialog .project-cost-summary-grid strong { margin-top: 0; }
}
/* Mobile navigation stays before the title; the original actions and focus remain intact. */
body.mobile-ui-active .pca-dialog .pca-head {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;}
body.mobile-ui-active .pca-dialog .pca-head>div:first-child {grid-column:1/-1;grid-row:2;}
body.mobile-ui-active .pca-dialog .pca-head .pca-actions {display:contents;}
body.mobile-ui-active .pca-dialog .pca-head [data-pca-action="close"] {grid-column:1;grid-row:1;justify-self:start;width:auto;margin:0;}
body.mobile-ui-active .pca-dialog .pca-head [data-pca-action="refresh"] {grid-column:2;grid-row:1;justify-self:end;width:auto;margin:0;}
