/* =============================================================
   PEER ANALYSIS — Enhanced Dynamic Analysis Page
   peer-analysis.css  v1
   ============================================================= */

/* ───────────────────────────────────────────────────────────
   Peer Groups Page (custom-peer-group.html)
   ─────────────────────────────────────────────────────────── */
.peer-analysis-container {
    max-width: 1320px;
    margin: 0 auto;
}

.peer-analysis-card {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 28px 32px;
    margin-bottom: 24px;
}

.peer-analysis-card h2 {
    font-size: 1.3em;
    color: #1f2937;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.peer-analysis-card h2 i {
    color: #0056d2;
}

.peer-analysis-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* ───────────────────────────────────────────────────────────
   Controls card
   ─────────────────────────────────────────────────────────── */
.pa-controls-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.08);
    padding: 24px 28px 20px;
    margin-bottom: 24px;
}

/* Single search bar: [bank input]  [period]  [run btn] */
.pa-search-bar {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 14px;
}

.pa-sb-bank   { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.pa-sb-period { flex-shrink: 0; display: flex; flex-direction: column; gap: 5px; }
.pa-sb-run    { flex-shrink: 0; display: flex; flex-direction: column; gap: 5px; }

.pa-sb-lbl {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.pa-sb-lbl i { color: #0056d2; }

/* Labels */
.pa-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}
.pa-label i { color: #0056d2; width: 14px; }
.pa-hint {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
    margin-left: auto;
}

/* Bank search input */
.pa-bank-input-wrap { position: relative; }

.pa-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #1f2937;
    background: #fff;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pa-input:focus {
    border-color: #0056d2;
    box-shadow: 0 0 0 3px rgba(0,86,210,.08);
}

/* Autocomplete dropdown */
.pa-autocomplete {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.13);
    z-index: 200;
    max-height: 380px;
    overflow-y: auto;
}

/*
 * Collapse the inner .autocomplete-container so the outer .pa-autocomplete
 * is the single scroll surface. Without this, styles.css sets max-height:200px
 * and overflow-y:auto on the inner container, burying the Load-more button
 * at the very bottom of a tiny nested scroller.
 */
.pa-autocomplete .autocomplete-container {
    max-height: none  !important;
    overflow-y: visible !important;
    border: none      !important;
    border-radius: 0  !important;
    padding: 0        !important;
    background: transparent !important;
    margin: 0         !important;
}

/* Items injected by shared.js searchBankByName */
.pa-autocomplete .autocomplete-item,
.pa-autocomplete .pa-ac-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f9fafb;
    transition: background 0.1s;
}
.pa-autocomplete .autocomplete-item:hover,
.pa-autocomplete .pa-ac-item:hover { background: #f0f5ff; }

/* Load more is sticky so it's always visible without scrolling */
.pa-autocomplete .autocomplete-load-more {
    position: sticky;
    bottom: 0;
    padding: 9px 14px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: #0056d2;
    cursor: pointer;
    background: #f8faff;
    border-top: 1px solid #e5e7eb;
    transition: background 0.1s;
}
.pa-autocomplete .autocomplete-load-more:hover { background: #e8f0fe; }

/* Content classes used by paBankRenderer */
.pa-ac-name  { font-size: 14px; font-weight: 500; color: #1f2937; }
.pa-ac-meta  { font-size: 12px; color: #6b7280; margin-top: 1px; }
.pa-ac-asset { font-size: 12px; color: #9ca3af; white-space: nowrap; margin-left: 8px; }

/* ───────────────────────────────────────────────────────────
   Peer Groups quick-add panel
   ─────────────────────────────────────────────────────────── */
.pa-pg-panel {
    margin-top: 10px;
    border-top: 1px dashed #e5e7eb;
    padding-top: 10px;
}
.pa-pg-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.pa-pg-header i { color: #0056d2; }
.pa-pg-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
}
.pa-pg-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fafafa;
    transition: background 0.1s, border-color 0.1s;
}
.pa-pg-card:hover { background: #f0f5ff; border-color: #bfdbfe; }
.pa-pg-info { flex: 1; min-width: 0; }
.pa-pg-name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pa-pg-desc {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pa-pg-meta {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 1px;
}
.pa-pg-add-btn {
    flex-shrink: 0;
    padding: 6px 13px;
    font-size: 13px;
    font-weight: 600;
    color: #0056d2;
    background: #eff6ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.13s, border-color 0.13s;
    white-space: nowrap;
}
.pa-pg-add-btn:hover { background: #dbeafe; border-color: #93c5fd; }

/* Bank chips */
.pa-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 30px;
    margin-top: 4px;
}
.pa-chips-placeholder {
    font-size: 12px;
    color: #9ca3af;
    align-self: center;
}

.pa-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px 5px 13px;
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    max-width: 220px;
}
.pa-chip-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.pa-chip-cert  { opacity: 0.7; font-size: 11px; flex-shrink: 0; }
.pa-chip-rm {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    padding: 0;
    transition: background 0.15s;
}
.pa-chip-rm:hover { background: rgba(255,255,255,0.45); }

/* Period (From / To) selects */
.pa-period-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pa-period-sel {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.pa-period-arrow {
    flex-shrink: 0;
    color: #d1d5db;
    font-size: 18px;
    user-select: none;
}
.pa-select {
    width: 100%;
    padding: 10px 10px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    outline: none;
    cursor: pointer;
    appearance: auto;
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.pa-select:focus {
    border-color: #0056d2;
    box-shadow: 0 0 0 3px rgba(0,86,210,.08);
}

/* Run button */
.pa-run-btn {
    padding: 9px 20px;
    background: #0056d2;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    white-space: nowrap;
    width: 100%;
}
.pa-run-btn:hover {
    background: #004cbf;
    box-shadow: 0 4px 14px rgba(0,86,210,0.3);
}
.pa-run-btn:active  { transform: translateY(1px); }
.pa-run-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ───────────────────────────────────────────────────────────
   Asset type pills
   ─────────────────────────────────────────────────────────── */
.pa-asset-row {
    border-top: 1px solid #f0f2f5;
    padding-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.pa-asset-row-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.pa-toggle-all-btn {
    margin-left: auto;
    background: none;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.pa-toggle-all-btn:hover { border-color: #0056d2; color: #0056d2; }

.pa-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pa-pills-loading { font-size: 12px; color: #9ca3af; }

.pa-pill {
    padding: 5px 13px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: 1.5px solid #e5e7eb;
    background: #fff;
    color: #374151;
    transition: all 0.13s;
    user-select: none;
}
.pa-pill:hover            { border-color: #0056d2; color: #0056d2; }
.pa-pill.active {
    background: #0056d2;
    border-color: #0056d2;
    color: #fff;
}

/* ───────────────────────────────────────────────────────────
   Message bar
   ─────────────────────────────────────────────────────────── */
.pa-message {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
}
.pa-message.error   { background:#fef2f2; color:#b91c1c; border:1px solid #fecaca; }
.pa-message.warning { background:#fffbeb; color:#b45309; border:1px solid #fde68a; }
.pa-message.success { background:#f0fdf4; color:#15803d; border:1px solid #bbf7d0; }
.pa-message.info    { background:#eff6ff; color:#1e40af; border:1px solid #bfdbfe; }

/* ───────────────────────────────────────────────────────────
   Loading overlay
   ─────────────────────────────────────────────────────────── */
.pa-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.75);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.pa-loading-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    font-size: 15px;
    font-weight: 500;
    color: #0056d2;
}
.pa-loading-box i { font-size: 34px; }

/* ───────────────────────────────────────────────────────────
   Snapshot summary card
   ─────────────────────────────────────────────────────────── */
#pa-results {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.pa-snapshot-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.08);
    padding: 20px 28px;
}
.pa-snap-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 16px;
}
.pa-snap-header h3 {
    font-size: 14.5px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}
.pa-snap-meta { font-size: 12px; color: #9ca3af; }

.pa-snap-banks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.pa-snap-bank {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px 16px;
    border-left: 4px solid transparent;
    min-width: 170px;
    flex: 1;
}
.pa-snap-bank-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.pa-snap-cert { font-size: 11px; color: #9ca3af; margin-bottom: 8px; }

.pa-snap-metrics { display: flex; gap: 16px; }
.pa-snap-metric  { display: flex; flex-direction: column; }
.pa-snap-val     { font-size: 15px; font-weight: 700; color: #1f2937; }
.pa-snap-lbl     { font-size: 10px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }

/* ───────────────────────────────────────────────────────────
   Asset-type accordion section
   ─────────────────────────────────────────────────────────── */
.pa-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.08);
    overflow: hidden;
}

.pa-sec-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: #f7f9ff;
    border-bottom: 1px solid #e8edfb;
    cursor: pointer;
    user-select: none;
    gap: 12px;
}
.pa-sec-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    flex: 1;
    min-width: 0;
}
.pa-code-badge {
    font-size: 11px;
    font-weight: 700;
    font-family: monospace;
    padding: 2px 8px;
    border-radius: 4px;
    background: #dce8ff;
    color: #0056d2;
    flex-shrink: 0;
}
.pa-sec-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.pa-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.pa-icon-btn:hover { border-color: #0056d2; color: #0056d2; }

.pa-chevron { color: #9ca3af; transition: transform 0.2s; }
.pa-section.collapsed .pa-chevron { transform: rotate(-90deg); }
.pa-section.collapsed .pa-sec-body { display: none; }

.pa-sec-body { padding: 24px; }

/* Charts grid: 2×2 */
.pa-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 28px;
}
.pa-chart-box {
    background: #fafafa;
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    padding: 16px;
}
.pa-chart-lbl {
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.pa-chart-lbl-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.pa-chart-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    font-size: 11px;
    font-weight: 600;
    color: #374151;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    transition: background 0.13s, border-color 0.13s, color 0.13s;
    white-space: nowrap;
}
.pa-chart-toggle-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}
.pa-chart-toggle-btn--off {
    color: #0056d2;
    background: #eff6ff;
    border-color: #bfdbfe;
}
.pa-chart-toggle-btn--off:hover {
    background: #dbeafe;
    border-color: #93c5fd;
}
.pa-chart-expand-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #9ca3af;
    font-size: 12px;
    padding: 2px 4px;
    border-radius: 4px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}
.pa-chart-expand-btn:hover { color: #0056d2; background: #e8f0fe; }

/* ─── Chart expand modal ─── */
.pa-chart-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.pa-chart-modal {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 95vw;
    max-width: 1500px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pa-chart-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.pa-chart-modal-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.pa-chart-modal-title {
    font-size: 14px;
    font-weight: 700;
    color: #1a202c;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pa-chart-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #6b7280;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}
.pa-chart-modal-close:hover { background: #fee2e2; color: #dc2626; }
.pa-chart-modal-body {
    flex: 0 0 auto;
    height: 460px;
    padding: 20px 24px 12px;
    min-height: 0;
    position: relative;
}
.pa-chart-modal-body canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ─── Slider section ─── */
.pa-chart-modal-slider-wrap {
    padding: 10px 24px 18px;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.pa-slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #374151;
    font-weight: 600;
    margin-bottom: 6px;
}
.pa-slider-hint {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
}
.pa-slider-hint::before {
    content: '\2194';   /* ↔ */
    font-size: 13px;
}
/* Dual-range wrapper — stacks the two range inputs on top of each other */
.pa-dual-slider {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}
.pa-slider {
    position: absolute;
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    outline: none;
}
/* Track */
.pa-slider::-webkit-slider-runnable-track {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
}
.pa-slider::-moz-range-track {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
}
/* Thumbs */
.pa-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0056d2;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,86,210,0.35);
    pointer-events: all;
    cursor: grab;
    margin-top: -7px;
    transition: box-shadow 0.15s;
}
.pa-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #0056d2;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,86,210,0.35);
    pointer-events: all;
    cursor: grab;
}
.pa-slider:active::-webkit-slider-thumb { cursor: grabbing; box-shadow: 0 2px 8px rgba(0,86,210,0.5); }
.pa-slider:active::-moz-range-thumb     { cursor: grabbing; }
.pa-chart-box canvas { max-height: 260px; }
.pa-chart-box--full  { grid-column: 1 / -1; }
.pa-chart-box--full canvas { max-height: 340px; }

/* Metric tab switcher */
.pa-tab-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 0 20px;
    gap: 16px;
}
.pa-tab-lbl  { font-size: 13px; font-weight: 600; color: #374151; white-space: nowrap; flex-shrink: 0; }
.pa-tabs {
    display: flex;
    gap: 3px;
    background: #f3f4f6;
    border-radius: 8px;
    padding: 3px;
}
.pa-tab {
    padding: 5px 13px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    background: none;
    color: #6b7280;
    transition: all 0.13s;
}
.pa-tab.active {
    background: #fff;
    color: #0056d2;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* Data table */
.pa-tbl-wrap {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}
.pa-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}
.pa-tbl thead th {
    padding: 9px 14px;
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}
.pa-tbl thead th.num { text-align: right; min-width: 110px; }
.pa-tbl thead th.qtr { min-width: 75px; }

.pa-tbl tbody tr:hover { background: #f9fafb; }
.pa-tbl tbody td {
    padding: 8px 14px;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
    color: #1f2937;
}
.pa-tbl tbody td.qtr-cell {
    font-weight: 600;
    color: #374151;
}
.pa-tbl tbody td.num-cell {
    text-align: right;
    font-family: 'SF Mono', 'Consolas', monospace;
}
.pa-tbl tbody td.na-cell {
    text-align: right;
    color: #d1d5db;
    font-size: 11px;
}

/* Bank column header chip */
.pa-col-hdr {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 5px;
}
.pa-col-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}

/* Loss-rate heat colours */
.lr-neg  { color: #15803d; font-weight: 600; }  /* negative = net recovery */
.lr-zero { color: #6b7280; }
.lr-low  { color: #15803d; }                    /* < 0.5% */
.lr-med  { color: #b45309; }                    /* 0.5–1.5% */
.lr-high { color: #b91c1c; font-weight: 600; }  /* > 1.5% */

/* ───────────────────────────────────────────────────────────
   Asset-type tab bar (results navigator)
   ─────────────────────────────────────────────────────────── */
.pa-at-tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 20px 12px;
    background: #fff;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 14px rgba(0,0,0,0.08);
    border-bottom: 2px solid #f0f2f5;
    margin-top: 10px;
}

.pa-at-tab {
    padding: 6px 15px;
    font-size: 12.5px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    border: 1.5px solid transparent;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.13s;
    white-space: nowrap;
}
.pa-at-tab:hover  { background: #e8f0fe; color: #0056d2; }
.pa-at-tab.active { background: #0056d2; color: #fff; border-color: #0056d2; }

/* Panel below the tabs connects flush (no top-radius gap) */
#pa-main-panel > .pa-section {
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 14px rgba(0,0,0,0.08);
}

/* Home bank chip variant — subtle white outline ring */
.pa-chip-home {
    outline: 2px solid rgba(255,255,255,0.55);
    outline-offset: 1px;
}

/* ───────────────────────────────────────────────────────────
   Chips bar (chips + Save as Group button row)
   ─────────────────────────────────────────────────────────── */
.pa-chips-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 10px;
}

.pa-chips-bar > #selected-banks {
    flex: 1;
    min-width: 0;
}

.pa-save-pg-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 500;
    color: #0056d2;
    background: #e8f0fe;
    border: 1.5px solid #b3c8f5;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.13s;
}
.pa-save-pg-btn:hover { background: #d0e3ff; border-color: #0056d2; }

/* Mini chip used inside the save modal bank summary */
.pa-modal-chip {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    margin: 2px 2px 2px 0;
}

.pa-modal-bank-summary {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    line-height: 1.6;
}

/* ───────────────────────────────────────────────────────────
   Current Bank fixed label (inside bank-search column)
   ─────────────────────────────────────────────────────────── */
.pa-home-bank {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin-top: 6px;
    margin-bottom: 8px;
    background: #f0f6ff;
    border: 1px solid #c3d9f8;
    border-radius: 8px;
    font-size: 14px;
    overflow: hidden;
    min-width: 0;
}

.pa-home-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pa-home-label {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    flex-shrink: 0;
}

.pa-home-name {
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.pa-home-cert {
    color: #9ca3af;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ───────────────────────────────────────────────────────────
   Peer view toggle bar
   ─────────────────────────────────────────────────────────── */
.pa-peer-view-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px 10px;
    background: #f8f9fb;
    border-bottom: 1px solid #e9ecf0;
    flex-wrap: wrap;
    border-radius: 0;
}

.pa-pv-lbl {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
    margin-right: 2px;
}

.pa-pv-btn {
    padding: 4px 13px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    border: 1.5px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.13s;
    white-space: nowrap;
}
.pa-pv-btn:hover  { background: #e8f0fe; color: #0056d2; }
.pa-pv-btn.active { background: #0056d2; color: #fff; border-color: #0056d2; }

.pa-pv-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-left: 6px;
    font-style: italic;
}

/* ───────────────────────────────────────────────────────────
   Responsive tweaks
   ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .pa-search-bar    { flex-direction: column; }
    .pa-sb-period,
    .pa-sb-run        { width: 100%; }
    .pa-charts-grid   { grid-template-columns: 1fr; }
}

/* ── Balance Basis selector ───────────────────────────────────────────────── */
#v2-basis-ending-lbl:has(input:checked)          { border-color: #3b82f6; background: #eff6ff; }
#v2-basis-beginning-lbl:has(input:checked)       { border-color: #3b82f6; background: #eff6ff; }
#v2-basis-ending-lbl:has(input:not(:checked))    { border-color: #e5e7eb; background: #fff; }
#v2-basis-beginning-lbl:has(input:not(:checked)) { border-color: #e5e7eb; background: #fff; }

/* ── Balance Basis info icon ──────────────────────────────────────────────── */
.pa-basis-info {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 11px;
    cursor: help;
    margin-left: 5px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* ── Balance Basis floating tooltip ──────────────────────────────────────── */
#pa-basis-tooltip {
    display: none;
    position: fixed;
    background: #1e293b;
    border-radius: 10px;
    padding: 12px 16px;
    width: 300px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    z-index: 9999;
    pointer-events: none;
    font-size: 13px;
    line-height: 1.5;
}
#pa-basis-tooltip .tt-title-end   { font-weight: 700; color: #93c5fd; }
#pa-basis-tooltip .tt-title-begin { font-weight: 700; color: #fcd34d; }
#pa-basis-tooltip .tt-desc        { color: #cbd5e1; font-size: 12px; margin-top: 2px; display: block; }
#pa-basis-tooltip .tt-section     { margin-bottom: 10px; }
#pa-basis-tooltip .tt-section:last-child { margin-bottom: 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   PEER GROUP MANAGEMENT PAGE - Enhanced Styling
   ═══════════════════════════════════════════════════════════════════════════ */

/* Card header with actions */
