:root {
    --pca-ink: #132238;
    --pca-muted: #64748b;
    --pca-line: #dfe7ef;
    --pca-soft: #f6f9fc;
    --pca-blue: #2563eb;
    --pca-navy: #16355c;
    --pca-teal: #0f766e;
    --pca-amber: #b45309;
    --pca-red: #b91c1c;
}

.pca-page { background: #f3f6f9; }
.pca-dashboard { width: 100%; max-width: 1720px; }
.pca-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.pca-header-asof { color: #53657a; font-size: .78rem; font-weight: 700; }
.pca-subnav { display: inline-flex; gap: 3px; margin-right: 12px; padding: 3px; border-radius: 9px; background: #eaf0f6; }
.pca-subnav-btn { padding: 6px 12px; border-radius: 7px; color: #52647a; font: 700 .72rem Inter, sans-serif; text-decoration: none; }
.pca-subnav-btn:hover { color: var(--pca-navy); }
.pca-subnav-btn.active { background: #fff; color: var(--pca-navy); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.pca-main { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; gap: 16px; padding: 18px 24px 32px; }
.pca-main > * { min-width: 0; }

.pca-control-strip {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 14px 16px; border: 1px solid var(--pca-line); border-radius: 12px; background: #fff;
}
.pca-eyebrow { color: #73849a; font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.pca-lens-control { display: grid; gap: 7px; min-width: 210px; }
.pca-lens-title { display: flex; align-items: center; gap: 6px; }
.pca-lens-select {
    width: 100%; min-width: 210px; height: 38px; padding: 0 34px 0 11px; border: 1px solid #cdd9e6; border-radius: 8px;
    background: #f8fbfe; color: var(--pca-navy); font: 750 .74rem/1.2 Inter, sans-serif; cursor: pointer;
}
.pca-lens-select:disabled { opacity: .55; cursor: wait; }
.pca-segmented { display: inline-flex; gap: 3px; margin-top: 7px; padding: 3px; border-radius: 9px; background: #eaf0f6; }
.pca-segment { border: 0; border-radius: 7px; padding: 7px 14px; background: transparent; color: #52647a; font: 700 .74rem Inter, sans-serif; cursor: pointer; }
.pca-segment:hover { color: var(--pca-navy); }
.pca-segment.active { background: #fff; color: var(--pca-navy); box-shadow: 0 1px 3px rgba(15, 23, 42, .14); }
.pca-segment:disabled { opacity: .55; cursor: wait; }
.pca-contract-summary { max-width: 74%; color: var(--pca-muted); font-size: .72rem; line-height: 1.5; text-align: right; }
.pca-contract-summary span, .pca-contract-summary strong { display: block; }
.pca-contract-summary strong { margin-top: 3px; color: #315f8f; font-weight: 750; }

.pca-status { overflow-wrap: anywhere; border-radius: 10px; padding: 10px 13px; font-size: .72rem; font-weight: 650; }
.pca-status--loading { color: #1d4ed8; background: #eff6ff; border: 1px solid #bfdbfe; }
.pca-status--ok { display: none; }
.pca-status--warning { color: #92400e; background: #fffbeb; border: 1px solid #fde68a; }
.pca-status--error { color: #991b1b; background: #fef2f2; border: 1px solid #fecaca; }

.pca-kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.pca-kpi { min-width: 0; padding: 13px 14px; border: 1px solid var(--pca-line); border-radius: 11px; background: #fff; box-shadow: 0 1px 2px rgba(15,23,42,.03); }
.pca-kpi-title { display: flex; min-height: 18px; align-items: center; justify-content: space-between; gap: 6px; }
.pca-kpi-title span { display: block; color: #6c7d91; font-size: .61rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.pca-kpi strong { display: block; margin-top: 4px; color: var(--pca-ink); font: 800 1.35rem Manrope, sans-serif; font-variant-numeric: tabular-nums; }
.pca-kpi small { display: block; overflow: hidden; margin-top: 2px; color: #8a99aa; font-size: .61rem; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.pca-kpi--tail { border-color: #ead8b5; background: linear-gradient(145deg, #fff, #fffbf2); }
.pca-kpi--tail strong { color: #9a5d16; }

.pca-card { min-width: 0; border: 1px solid var(--pca-line); border-radius: 12px; background: #fff; box-shadow: 0 2px 8px rgba(15,23,42,.035); }
.pca-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px 9px; }
.pca-card-heading h2 { margin: 3px 0 0; color: var(--pca-ink); font: 750 .96rem Manrope, sans-serif; }
.pca-help { display: inline-grid; width: 20px; height: 20px; padding: 0; place-items: center; border: 1px solid #ccd8e5; border-radius: 50%; background: #fff; color: #74859a; font: 700 .68rem Inter, sans-serif; cursor: pointer; }
.pca-help:hover, .pca-help[aria-expanded="true"] { border-color: #7ba3cb; background: #eef6ff; color: #245781; }
.pca-help--small { width: 17px; height: 17px; flex: 0 0 17px; font-size: .58rem; }
.pca-inline-help { color: #52667d; font-size: .61rem; font-weight: 550; line-height: 1.45; }
.pca-inline-help[hidden] { display: none; }
.pca-lens-help { max-width: 430px; padding: 8px 9px; border: 1px solid #cfe0f1; border-radius: 7px; background: #f4f9ff; }
.pca-kpi-help { margin-top: 8px; padding-top: 7px; border-top: 1px solid #dfe7ef; }
.pca-chart-help { display: grid; gap: 4px; margin: 0 16px 7px; padding: 9px 11px; border: 1px solid #cfe0f1; border-radius: 8px; background: #f4f9ff; color: #52667d; font-size: .63rem; line-height: 1.45; }
.pca-chart-help[hidden] { display: none; }
.pca-chart-help strong { color: #254766; font-size: .66rem; }
.pca-card-note, .pca-count { color: #8291a3; font-size: .64rem; font-weight: 650; }
.pca-chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pca-chart { width: 100%; min-width: 0; height: 285px; }

.pca-analysis-grid { display: grid; grid-template-columns: minmax(560px, .92fr) minmax(600px, 1.08fr); gap: 12px; align-items: stretch; }
.pca-component-list-card, .pca-detail-card { min-height: 650px; }
.pca-table-scroll { overflow: auto; }
.pca-component-scroll { height: 582px; }
.pca-excluded-scroll { max-height: 330px; }
.pca-table { width: 100%; border-collapse: separate; border-spacing: 0; color: #334155; font-size: .67rem; }
.pca-table th { position: sticky; top: 0; z-index: 2; padding: 8px 10px; border-bottom: 1px solid #dbe4ee; background: #f7f9fc; color: #718198; font-size: .57rem; font-weight: 800; letter-spacing: .045em; text-align: right; text-transform: uppercase; white-space: nowrap; }
.pca-table th:first-child, .pca-table th:nth-child(2), .pca-table td:first-child, .pca-table td:nth-child(2) { text-align: left; }
.pca-table td { padding: 8px 10px; border-bottom: 1px solid #edf1f5; text-align: right; font-variant-numeric: tabular-nums; vertical-align: middle; }
.pca-component-table tbody tr { cursor: pointer; transition: background .12s ease; }
.pca-component-table tbody tr:hover { background: #f7faff; }
.pca-component-table tbody tr.active { background: #eaf2ff; box-shadow: inset 3px 0 0 var(--pca-blue); }
.pca-pc-badge { display: inline-flex; min-width: 31px; justify-content: center; padding: 3px 6px; border-radius: 6px; background: #e9eff7; color: #294664; font-weight: 800; }
.pca-bucket { display: inline-flex; margin-left: 4px; padding: 2px 4px; border-radius: 4px; font-size: .45rem; font-weight: 850; letter-spacing: .04em; vertical-align: middle; }
.pca-bucket--structured { color: #245781; background: #e8f1fa; }
.pca-bucket--pca_tail { color: #985d16; background: #fff3dc; }
.pca-component-label { max-width: 260px; color: #263b52; font-weight: 650; line-height: 1.25; }
.pca-selected-tail-row { background: #fff8e8; }
.pca-stability { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px; border-radius: 999px; font-size: .56rem; font-weight: 800; text-transform: uppercase; }
.pca-stability::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.pca-stability--stable { color: #047857; background: #ecfdf5; }
.pca-stability--moderate { color: #b45309; background: #fffbeb; }
.pca-stability--unstable { color: #b91c1c; background: #fef2f2; }
.pca-stability--na { color: #64748b; background: #f1f5f9; }

.pca-detail-card { overflow: hidden; }
.pca-empty { display: grid; height: 100%; place-items: center; color: #8795a7; font-size: .75rem; }
.pca-detail-head { padding: 16px; border-bottom: 1px solid var(--pca-line); background: linear-gradient(135deg, #f8fbff, #fff); }
.pca-detail-title-row { display: flex; align-items: center; gap: 10px; }
.pca-detail-title-row h2 { margin: 0; color: var(--pca-ink); font: 800 1.08rem Manrope, sans-serif; }
.pca-detail-description { margin: 7px 0 0; color: #687a8f; font-size: .68rem; line-height: 1.45; }
.pca-rank-explainer { display: flex; gap: 8px; margin-top: 10px; padding: 8px 10px; border-left: 3px solid #d49a43; border-radius: 6px; background: #fffbf3; color: #63533e; font-size: .66rem; line-height: 1.4; }
.pca-rank-explainer strong { flex: 0 0 auto; color: #8d5614; }
.pca-detail-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
.pca-detail-metric { padding: 8px; border: 1px solid #e0e7ef; border-radius: 8px; background: rgba(255,255,255,.85); }
.pca-detail-metric span { display: block; color: #7a899b; font-size: .53rem; font-weight: 800; text-transform: uppercase; }
.pca-detail-metric strong { display: block; margin-top: 3px; color: #253a52; font-size: .78rem; font-variant-numeric: tabular-nums; }
.pca-section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pca-section-heading h3 { margin: 2px 0 0; color: #253a52; font: 780 .78rem Manrope, sans-serif; }
.pca-section-help { margin: 0 0 9px; padding: 8px 9px; border: 1px solid #cfe0f1; border-radius: 7px; background: #f4f9ff; }
.pca-evidence-line { margin: 6px 0 0; color: #44586f; font-size: .62rem; line-height: 1.4; }
.pca-evidence-line strong { color: #1d3a5b; font-size: .56rem; letter-spacing: .05em; text-transform: uppercase; margin-right: 4px; }
.pca-factor-index-section { padding: 10px 12px 8px; border-top: 1px solid #e8edf3; }
.pca-factor-series-chart { width: 100%; min-width: 0; height: 215px; }
.pca-scenario-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.pca-scenario-chip { display: grid; gap: 1px; padding: 6px 10px; border: 1px solid #dfe7ef; border-radius: 8px; background: #fbfcfe; }
.pca-scenario-chip span { color: #7a899b; font-size: .52rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.pca-scenario-chip strong { color: #22364d; font-size: .72rem; font-variant-numeric: tabular-nums; }
.pca-scenario-chip--muted strong { color: #64768a; }
.pca-quadrant-chart { width: 100%; min-width: 0; height: 300px; margin-bottom: 10px; }
.pca-quadrant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pca-camp-column { overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; border: 1px solid #dfe7ef; border-radius: 9px; background: #fff; }
.pca-quadrant--adds { box-shadow: inset 3px 0 0 #0f766e; }
.pca-quadrant--reduces { box-shadow: inset 3px 0 0 #ce7187; }
.pca-camp-compare-scroll { max-height: 252px; border-top: 1px solid #eef2f6; }
.pca-camp-group-row td { border-top: 1px solid #e3eaf1; border-bottom: 1px solid #e8edf3; background: #f4f7fb; color: #33475e; font-size: .57rem; font-weight: 800; }
.pca-camp-group-row td:first-child { text-transform: uppercase; letter-spacing: .03em; }
.pca-camp-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 8px 9px 6px 11px; }
.pca-camp-card-head > div { display: grid; min-width: 0; gap: 1px; }
.pca-camp-card-head span { color: #7b8a9b; font-size: .53rem; font-weight: 800; text-transform: uppercase; }
.pca-camp-card-head strong { overflow: hidden; color: #253a52; font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.pca-camp-card-head > small { max-width: 46%; color: #8795a6; font-size: .52rem; line-height: 1.35; text-align: right; }
.pca-section-heading-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.pca-name-search-wrap { display: inline-flex; align-items: center; gap: 6px; }
.pca-name-search { width: 118px; height: 26px; padding: 0 8px; border: 1px solid #cdd9e6; border-radius: 7px; background: #f8fbfe; color: var(--pca-navy); font: 650 .6rem Inter, sans-serif; }
.pca-name-search:focus { outline: none; border-color: #7ba3cb; background: #fff; }
.pca-name-search-wrap small { min-width: 52px; color: #7a899b; font-size: .54rem; font-weight: 700; }
.pca-row-hit td { background: #fff6d6; }
.pca-quadrant--nomatch { opacity: .45; }
.pca-name-sort { margin-top: 0; }
.pca-name-sort .pca-segment { padding: 4px 10px; font-size: .58rem; }
.pca-contrib-positive { color: #08715d; font-weight: 700; }
.pca-contrib-negative { color: #be123c; font-weight: 700; }


.pca-persistence-compact { padding: 9px 16px; border-bottom: 1px solid var(--pca-line); background: #f8fbff; }
.pca-persistence-compact-main { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.pca-persistence-compact-main > div { display: grid; gap: 2px; }
.pca-persistence-compact-main > div strong { color: #08715d; font-size: .66rem; text-transform: capitalize; }
.pca-persistence-compact-main p { margin: 0; color: #6f8093; font-size: .57rem; text-align: right; }
.pca-persistence-compact .pca-section-help { margin-top: 8px; margin-bottom: 0; }

.pca-name-table-section { padding: 10px 12px 6px; border-top: 1px solid #e8edf3; }
.pca-name-table { font-size: .64rem; }
.pca-name-table th, .pca-name-table td { padding: 6px 9px; }
.pca-name-table th:not(:first-child), .pca-name-table td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.pca-index-badge { margin-left: 6px; padding: 1px 5px; border: 1px solid #c9b47f; border-radius: 5px; background: #fdf7e7; color: #8a6d1f; font-size: .46rem; font-weight: 850; letter-spacing: .05em; vertical-align: 1px; }

.pca-leg-note { margin: 0; padding: 7px 2px 2px; color: #8a98a9; font-size: .54rem; }

.pca-correlation-chart { width: 100%; min-width: 0; height: 650px; }
.pca-quality-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pca-methodology { padding: 3px 16px 16px; color: #53657a; font-size: .68rem; line-height: 1.55; }
.pca-methodology-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 8px 0 12px; }
.pca-methodology-item { padding: 8px 9px; border: 1px solid #e3e9f0; border-radius: 8px; background: #f9fbfd; }
.pca-methodology-item span { display: block; color: #8290a1; font-size: .54rem; font-weight: 800; text-transform: uppercase; }
.pca-methodology-item strong { display: block; margin-top: 2px; color: #33475e; font-size: .65rem; }
.pca-warning-list { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.pca-warning-list li { padding: 7px 9px; border-left: 3px solid #e5a32e; border-radius: 5px; background: #fffbeb; color: #80520a; }
.pca-no-warnings { padding: 8px 9px; border-left: 3px solid #10b981; border-radius: 5px; background: #ecfdf5; color: #076b52; }
.pca-reason { display: inline-flex; padding: 3px 6px; border-radius: 5px; background: #f2f5f8; color: #637388; font-size: .56rem; font-weight: 750; text-transform: capitalize; }

@media (max-width: 1200px) {
    .pca-kpi-grid { grid-template-columns: repeat(3, 1fr); }
    .pca-analysis-grid { grid-template-columns: 1fr; }
    .pca-component-list-card, .pca-detail-card { min-height: 620px; }
    .pca-component-scroll { height: 552px; }
}
@media (max-width: 800px) {
    .pca-main { padding: 12px; }
    .pca-control-strip { align-items: flex-start; flex-direction: column; }
    .pca-contract-summary { max-width: none; text-align: left; }
    .pca-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .pca-chart-grid, .pca-quality-grid { grid-template-columns: 1fr; }
    .pca-analysis-grid { display: block; }
    .pca-detail-card { margin-top: 12px; }
    .pca-detail-metrics { grid-template-columns: repeat(2, 1fr); }
    .pca-rank-explainer { align-items: flex-start; flex-direction: column; gap: 3px; }
    .pca-correlation-chart { height: 500px; }
}
@media (max-width: 560px) {
    .pca-header { align-items: flex-start; }
    .pca-header .header-left { min-width: 0; gap: 8px; }
    .pca-header .header-logo { height: 28px; }
    .pca-header .title-row { flex-wrap: wrap; gap: 4px 6px; }
    .pca-header h1 { font-size: 1.05rem; }
    .pca-header .title-divider { display: none; }
    .pca-header-asof { width: 100%; font-size: .65rem; }
    .pca-header .date-range { display: none; }
    .pca-header .user-controls { gap: 5px; margin-left: 0; padding-left: 7px; }
    .pca-control-strip { gap: 12px; }
    .pca-lens-control, .pca-lens-select { width: 100%; min-width: 0; }
    .pca-kpi-grid { grid-template-columns: 1fr 1fr; }
    .pca-kpi { padding: 11px; }
    .pca-chart { height: 320px; }
    .pca-chart-card .pca-card-heading { padding-right: 12px; padding-left: 12px; }
    .pca-detail-title-row { flex-wrap: wrap; }
    .pca-detail-metrics { grid-template-columns: 1fr 1fr; }
    .pca-persistence-compact-main { grid-template-columns: 1fr auto; }
    .pca-persistence-compact-main p { grid-column: 1 / -1; text-align: left; }
    .pca-methodology-grid { grid-template-columns: 1fr; }
}
