/* ═══════════════════════════════════════════
   HORIZONTAL COMPARISON TABLE
   Frozen client column + scrollable competitors
═══════════════════════════════════════════ */

:root {
    /* Surface */
    --hc-surface: #F7F5F0;
    --hc-border: #D8D4C8;
    --hc-text-primary: #1C1A16;
    --hc-text-secondary: #6A6760;
    --hc-text-muted: #A09D97;

    /* Client (Eagle Bank) – Gray */
    --hc-client-bg: #EAEBEC;
    --hc-client-accent: #B0ADA6;
    --hc-client-text: #1C1A16;
    --hc-client-muted: #6A6760;
    --hc-client-row-border: rgba(0, 0, 0, 0.06);
    --hc-client-row-hover: rgba(0, 0, 0, 0.04);

    /* Competitors – White */
    --hc-comp-bg: #FFFFFF;
    --hc-comp-header-bg: #FAFAFA;
    --hc-comp-row-border: #ECECEC;
    --hc-comp-row-hover: #F5F5F5;

    /* Semantic */
    --hc-up: #2E7D52;
    --hc-down: #C0392B;
    --hc-neutral: #8A8880;

    /* Layout */
    --hc-radius: 14px;
    --hc-shadow: 0 2px 8px rgba(0, 0, 0, 0.07), 0 8px 24px rgba(0, 0, 0, 0.05);
    --hc-row-height: 52px;
    --hc-client-width: 470px;
    /* Increased from 420px for Rank column */
    --hc-comp-width: 160px;
}

/* ── Accordion & Header ─────────────────── */
.hc-accordion {
    display: block;
    background: transparent;
}

.hc-summary {
    display: flex;
    align-items: flex-end;
    /* Match old header alignment */
    justify-content: space-between;
    list-style: none;
    cursor: pointer;
    margin-bottom: 20px;
    padding-right: 10px;
    /* Space for chevron if needed */
}

.hc-summary::-webkit-details-marker {
    display: none;
}

.hc-header-content {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    flex: 1;
}

/* Match positioning of toggle-icon in summary */
summary .toggle-icon {
    margin-left: 15px;
    display: flex;
    align-items: center;
}

/* Rotate when open */
.hc-accordion[open] .toggle-icon {
    transform: rotate(180deg);
}

.hc-header h2,
.hc-summary h2 {
    font-family: 'Sora', sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--hc-text-primary);
    margin: 0;
}

.hc-header .hc-subtitle {
    font-size: 11px;
    color: var(--hc-text-muted);
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 4px;
}

.hc-legend {
    display: none;
}

.hc-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: var(--hc-text-muted);
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.04em;
}

.hc-legend-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Table shell (outer container) ─────────── */
.hc-table-shell {
    display: flex;
    border-radius: var(--hc-radius);
    overflow: hidden;
    box-shadow: var(--hc-shadow);
    border: 1px solid var(--hc-border);
}

/* ═══════════════════════════════════════════
   FROZEN CLIENT COLUMN (Gray)
═══════════════════════════════════════════ */
.hc-col-client {
    flex-shrink: 0;
    width: var(--hc-client-width);
    background: var(--hc-client-bg);
    color: var(--hc-client-text);
    border-right: 1px solid var(--hc-border);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
}

/* — Bank header — */
.hc-col-client .hc-bank-header {
    height: 110px;
    padding: 12px 22px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(0, 0, 0, 0.07);
}

.hc-col-client .hc-top-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
}

.hc-col-client .hc-bank-name {
    font-family: 'Sora', sans-serif;
    font-size: 16px;
    font-weight: 600;
    min-height: 48px;
    display: flex;
    align-items: center;
}

.hc-rank-badge {
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 5px;
    letter-spacing: 0.04em;
    display: inline-block;
}

.hc-col-client .hc-rank-badge {
    color: var(--hc-client-muted);
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* — Sub-header: Type | Product Name | Rate% | Change | Rank — */
.hc-col-client .hc-sub-header {
    height: 36px;
    display: grid;
    grid-template-columns: 90px 1fr 68px 76px 50px;
    /* Swapped Rank and Change */
    align-items: center;
    padding: 0 22px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.025);
}

.hc-col-client .hc-sub-header span {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--hc-client-muted);
    text-align: left;
    /* Left-aligned by default (for Type and Name) */
}

.hc-col-client .hc-sub-header span:nth-child(3),
.hc-col-client .hc-sub-header span:nth-child(4),
.hc-col-client .hc-sub-header span:nth-child(5) {
    text-align: center;
}

/* — Product rows — */
.hc-col-client .hc-product-row {
    display: grid;
    grid-template-columns: 90px 1fr 68px 76px 50px;
    /* Match header */
    align-items: center;
    padding: 0 22px;
    height: var(--hc-row-height);
    border-bottom: 1px solid var(--hc-client-row-border);
    transition: background 0.14s;
}

.hc-col-client .hc-product-row:last-child {
    border-bottom: none;
}

.hc-col-client .hc-product-row:hover {
    background: var(--hc-client-row-hover);
}

.hc-product-type {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 400;
    color: var(--hc-text-secondary);
    text-align: left;
}

.hc-product-name {
    font-family: 'Sora', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: var(--hc-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hc-rate-val {
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    color: var(--hc-text-secondary);
}

.hc-rate-empty {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    text-align: center;
    /* Centered */
    color: var(--hc-text-muted);
    opacity: 0.4;
}

.hc-rank-val {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    color: var(--hc-text-secondary);
    background: rgba(0, 0, 0, 0.03);
    border-radius: 4px;
    padding: 2px 0;
    margin: 0 4px;
}

.hc-change-val {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 400;
}

/* Semantic change colors */
.hc-change-val.hc-up {
    color: var(--hc-up);
}

.hc-change-val.hc-down {
    color: var(--hc-down);
}

.hc-change-val.hc-flat {
    color: var(--hc-neutral);
}

/* ═══════════════════════════════════════════
   SCROLLABLE COMPETITORS (White)
═══════════════════════════════════════════ */
.hc-cols-scroll {
    display: flex;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--hc-border) transparent;
    background: var(--hc-comp-bg);
}

.hc-cols-scroll::-webkit-scrollbar {
    height: 4px;
}

.hc-cols-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.hc-cols-scroll::-webkit-scrollbar-thumb {
    background: var(--hc-border);
    border-radius: 2px;
}

/* — Each competitor column — */
.hc-col-comp {
    flex-shrink: 0;
    width: var(--hc-comp-width);
    border-right: 1px solid var(--hc-comp-row-border);
    display: flex;
    flex-direction: column;
    background: var(--hc-comp-bg);
}

.hc-col-comp:last-child {
    border-right: none;
}

/* — Bank header — */
.hc-col-comp .hc-bank-header {
    height: 110px;
    /* Match client header */
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 6px;
    border-bottom: 1px solid var(--hc-comp-row-border);
    background: var(--hc-comp-header-bg);
}

.hc-col-comp .hc-bank-name {
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: var(--hc-text-primary);
    min-height: 48px;
    /* Fixed height for name area (approx 2-3 lines) */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hc-col-comp .hc-rank-badge {
    font-size: 10px;
    color: var(--hc-text-secondary);
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid #E0E0E0;
    padding: 2px 6px;
    border-radius: 4px;
}

/* — Sub-header: Rate% | Rank — */
.hc-col-comp .hc-sub-header {
    height: 36px;
    display: grid;
    grid-template-columns: 1fr;
    /* Added 50px for Rank -> Removed */
    align-items: center;
    padding: 0 18px;
    border-bottom: 1px solid var(--hc-comp-row-border);
    background: rgba(0, 0, 0, 0.01);
}

.hc-col-comp .hc-sub-header span {
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--hc-text-muted);
    text-align: center;
}

/* — Product rows (Rate | Rank) — */
.hc-col-comp .hc-product-row {
    display: grid;
    grid-template-columns: 1fr;
    /* Match header */
    align-items: center;
    justify-items: center;
    padding: 0 18px;
    height: var(--hc-row-height);
    border-bottom: 1px solid var(--hc-comp-row-border);
    transition: background 0.14s;
}

.hc-col-comp .hc-product-row:last-child {
    border-bottom: none;
}

.hc-col-comp .hc-product-row:hover {
    background: var(--hc-comp-row-hover);
}

.hc-col-comp .hc-rate-val {
    font-size: 13px;
    color: var(--hc-text-secondary);
}

/* Best rate — no visual distinction */
.hc-best {
    font-weight: 500;
}

/* ── Scroll hint ─────────────────────────── */
.hc-scroll-hint {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--hc-text-muted);
    font-family: 'DM Mono', monospace;
    letter-spacing: 0.06em;
}

.hc-scroll-hint svg {
    opacity: 0.4;
    flex-shrink: 0;
}

/* ── No data state ───────────────────────── */
.hc-no-data {
    padding: 48px 24px;
    text-align: center;
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    color: var(--hc-text-muted);
    background: var(--hc-surface);
    border-radius: var(--hc-radius);
    border: 1px solid var(--hc-border);
}