/* ============================================================================
   EarnSmart — Equities Homepage
   ----------------------------------------------------------------------------
   Three-column, prediction-first layout.
   - Reuses --es-* design tokens from earnsmart.css
   - Adds a few prediction-flavored tokens below
   ============================================================================ */

:root {
    --es-eq-pred-up:    #15803d;
    --es-eq-pred-down:  #b91c1c;
    --es-eq-pred-band:  rgba(13, 110, 253, 0.10);
    --es-eq-pred-line:  #0d6efd;
    --es-eq-history:    #1a1a2e;
    --es-eq-grid-line:  #eef0f4;
    --es-eq-tile-bg:    #fff;
    --es-eq-tile-hover: #f5f8ff;
    --es-eq-active-bg:  #eef4ff;
    --es-eq-active-bd:  #0d6efd;
}

/* ---------- Recently visited strip ---------- */
.es-eq-recent-bar {
    height: 42px;
    border-bottom: 1px solid var(--es-border-light);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.es-eq-recent-label {
    color: var(--es-text-primary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.es-eq-recent-label .bi {
    color: #475569;
    font-size: 0.78rem;
}

.es-eq-recent-scroll {
    min-width: 0;
    gap: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.es-eq-recent-scroll::-webkit-scrollbar {
    display: none;
}

.es-eq-recent-item {
    min-width: max-content;
    height: 30px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    border: 0;
    background: transparent;
    color: var(--es-text-primary);
    padding: 0 18px;
    font-size: 0.76rem;
    line-height: 1;
    text-decoration: none;
}

.es-eq-recent-item:first-child {
    padding-left: 0;
}

.es-eq-recent-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0;
    top: 9px;
    width: 1px;
    height: 12px;
    background: var(--es-border-light);
}

.es-eq-recent-item:hover {
    color: #0d6efd;
}

.es-eq-recent-ticker {
    font-weight: 800;
    letter-spacing: 0.01em;
}

.es-eq-recent-pred {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.es-eq-recent-pred.up {
    color: var(--es-eq-pred-up);
}

.es-eq-recent-pred.down {
    color: var(--es-eq-pred-down);
}

.es-eq-recent-pred.es-eq-recent-tag {
    color: #0f4c81;
    font-weight: 700;
    font-size: 0.66rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.es-eq-recent-empty {
    color: var(--es-text-secondary);
    font-size: 0.74rem;
    white-space: nowrap;
}

/* ---------- Top-level shell (Bootstrap row/col in template) ---------- */
.es-eq-home {
    font-family: var(--es-font-sans);
    color: var(--es-text-primary);
}

.es-eq-home > .row > main {
    background: var(--es-bg-page);
    border: 1px solid var(--es-border-light);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

@media (min-width: 992px) {
    .es-eq-home > .row > aside {
        background: var(--es-bg-page);
        border: 1px solid var(--es-border-light);
        border-radius: 10px;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    }
}

/* ============================================================================
   LEFT COLUMN — Equity Navigator
   ============================================================================ */
.es-eq-left {
    padding: 0;
    overflow: visible;
}

@media (min-width: 992px) {
    .es-eq-left {
        padding: 12px 10px;
    }
}

/* Mobile navigator control — shown below lg via Bootstrap utilities */
.es-eq-nav-open {
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--es-border-medium);
    border-radius: 999px;
    background: #fff;
    color: var(--es-text-primary);
    font-size: 0.86rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    align-self: flex-start;
}

.es-eq-nav-open:hover {
    border-color: #c5cdd8;
    color: var(--es-accent-blue);
}

.es-eq-nav-open .bi {
    font-size: 1.05rem;
    line-height: 1;
}

.es-eq-nav-drawer {
    --bs-offcanvas-width: min(320px, 88vw);
}

.es-eq-nav-drawer .offcanvas-header {
    border-bottom: 1px solid var(--es-border-light);
    padding: 14px 16px;
}

.es-eq-nav-drawer .offcanvas-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.es-eq-nav-drawer-body {
    padding: 10px 8px 18px;
}

@media (min-width: 992px) {
    .es-eq-nav-drawer.offcanvas-lg .offcanvas-body.es-eq-nav-drawer-body {
        flex-direction: column;
        padding: 0;
    }
}

.es-eq-search {
    position: relative;
    margin-bottom: 10px;
}

.es-eq-search i {
    position: absolute;
    left: 10px; top: 50%;
    transform: translateY(-50%);
    color: var(--es-text-secondary);
    font-size: 0.78rem;
    pointer-events: none;
}

.es-eq-search input {
    width: 100%;
    padding: 7px 10px 7px 28px;
    font-size: 0.82rem;
    color: var(--es-text-primary);
    background: var(--es-bg-muted);
    border: 1px solid var(--es-border-medium);
    border-radius: 8px;
    transition: all 0.15s ease;
}
.es-eq-search input:focus {
    outline: none;
    background: #fff;
    border-color: var(--es-accent-blue);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.10);
}

/* ----- Section header (Watchlist / Sectors) ----- */
.es-eq-nav-section {
    margin-bottom: 14px;
}

.es-eq-nav-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 6px 6px 4px;
    border-bottom: 1px solid var(--es-border-light);
    margin-bottom: 4px;
}

.es-eq-nav-header h6 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--es-text-primary);
    text-transform: uppercase;
    margin: 0;
}

.es-eq-nav-meta {
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--es-text-secondary);
    text-transform: uppercase;
}

.es-eq-watchlist-header {
    align-items: center;
    min-height: 38px;
    padding: 2px 6px 8px;
    margin-bottom: 8px;
}

.es-eq-watchlist-header h6 {
    display: flex;
    align-items: center;
    min-height: 28px;
    line-height: 1;
}

.es-eq-watchlist-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
}

.es-eq-watchlist-icon,
.es-eq-watchlist-delete,
.es-eq-watchlist-done {
    border: 0;
    background: transparent;
    padding: 0;
    line-height: 1;
    transition: color 0.12s ease, background-color 0.12s ease;
}

.es-eq-watchlist-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #64748b;
    font-size: 0.86rem;
}

.es-eq-watchlist-icon[data-action="watchlist-add"] {
    color: #0d6efd;
}

.es-eq-watchlist-icon:hover,
.es-eq-watchlist-delete:hover {
    background-color: var(--es-eq-tile-hover);
    color: #111827;
}

.es-eq-watchlist-icon[data-action="watchlist-add"]:hover {
    color: #084298;
}

.es-eq-watchlist-done {
    display: none;
    align-items: center;
    min-height: 28px;
    color: #0b5ed7;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}

.es-eq-watchlist-delete {
    display: none;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    color: #64748b;
    font-size: 1rem;
}

.es-eq-watchlist-delete:hover {
    color: #b91c1c;
    background-color: rgba(185, 28, 28, 0.08);
}

.es-eq-watchlist.is-editing .es-eq-watchlist-count,
.es-eq-watchlist.is-editing .es-eq-watchlist-icon,
.es-eq-watchlist.is-editing .es-eq-item-pred {
    display: none;
}

.es-eq-watchlist.is-editing .es-eq-watchlist-done {
    display: inline-flex;
}

.es-eq-watchlist.is-editing .es-eq-watchlist-delete {
    display: inline-flex;
}

.es-eq-watchlist.is-editing .es-eq-item {
    border-radius: 0;
    border-left-color: transparent;
    border-bottom: 1px solid var(--es-border);
}

.es-eq-watchlist-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 22px 14px 18px;
    color: var(--es-text-secondary);
    text-align: center;
}

.es-eq-empty-orbit {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #0d6efd;
    background: rgba(13, 110, 253, 0.08);
    animation: es-eq-empty-float 2.8s ease-in-out infinite;
}

.es-eq-watchlist-empty p {
    margin: 4px 0 0;
    color: var(--es-text-primary);
    font-size: 0.82rem;
    font-weight: 700;
}

.es-eq-watchlist-empty span {
    max-width: 190px;
    font-size: 0.72rem;
    line-height: 1.35;
}

@keyframes es-eq-empty-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* ----- Watchlist list ----- */
.es-eq-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.es-eq-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.1s ease;
    font-size: 0.82rem;
    border-left: 2px solid transparent;
}

.es-eq-item:hover {
    background-color: var(--es-eq-tile-hover);
}

.es-eq-item.active {
    background-color: var(--es-eq-active-bg);
    border-left-color: var(--es-eq-active-bd);
}

.es-eq-item-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
}

.es-eq-ticker {
    font-weight: 700;
    font-size: 0.84rem;
    color: var(--es-text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.es-eq-name {
    font-size: 0.72rem;
    color: var(--es-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.es-eq-item-pred {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    flex-shrink: 0;
    text-decoration: none;
}

.es-eq-pred-pct {
    font-weight: 700;
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
}
.es-eq-pred-pct.up,
.es-eq-item-pred.up .es-eq-pred-pct { color: var(--es-eq-pred-up); }
.es-eq-pred-pct.down,
.es-eq-item-pred.down .es-eq-pred-pct { color: var(--es-eq-pred-down); }

.es-eq-pred-conf {
    font-size: 0.65rem;
    color: var(--es-text-secondary);
    font-variant-numeric: tabular-nums;
}

/* ----- Sectors ----- */
.es-eq-sectors {
    list-style: none;
    margin: 0;
    padding: 0;
}

.es-eq-sector {
    margin-bottom: 2px;
}

.es-eq-sector-btn {
    width: 100%;
    background: none;
    border: 0;
    padding: 8px 8px;
    border-radius: 6px;
    display: grid;
    grid-template-columns: 1fr 60px 12px;
    gap: 8px;
    align-items: center;
    cursor: pointer;
    font-size: 0.81rem;
    color: var(--es-text-primary);
    text-align: left;
    transition: background-color 0.1s ease;
}

.es-eq-sector-btn:hover {
    background-color: var(--es-eq-tile-hover);
}

.es-eq-sector-name {
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* heat bar: -100..+100 → red..green using CSS var --heat */
.es-eq-sector-heat {
    height: 6px;
    background: var(--es-bg-muted);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.es-eq-sector-heat-bar {
    position: absolute;
    top: 0; bottom: 0;
    left: 50%;
    /* Width proportional to abs(heat); positioned to one side of center */
    width: calc(abs(var(--heat)) * 0.5%);
    background: var(--es-eq-pred-up);
    border-radius: 0 4px 4px 0;
}

.es-eq-sector[data-heat^="-"] .es-eq-sector-heat-bar {
    background: var(--es-eq-pred-down);
    transform: translateX(-100%);
    border-radius: 4px 0 0 4px;
}

.es-eq-sector-chev {
    color: var(--es-text-secondary);
    font-size: 0.65rem;
    transition: transform 0.15s ease;
}

.es-eq-sector.open .es-eq-sector-chev {
    transform: rotate(180deg);
}

.es-eq-sector-children {
    list-style: none;
    margin: 0;
    padding: 4px 0 8px 12px;
    display: none;
    border-left: 2px solid var(--es-border-light);
    margin-left: 14px;
}

.es-eq-sector.open .es-eq-sector-children {
    display: block;
}

.es-eq-sector-children .es-eq-item {
    padding: 5px 6px;
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 8px;
    border-left: 0;
}

.es-eq-sector-children .es-eq-name {
    font-size: 0.74rem;
}

/* ============================================================================
   MIDDLE COLUMN — Indices + Detail
   ============================================================================ */
.es-eq-middle {
    padding: 14px 16px 18px;
    min-width: 0;
}

/* ----- Landing insights ----- */
.es-eq-landing-header h1 {
    margin: 0 0 4px;
    color: var(--es-text-primary);
    font-size: 1.25rem;
    font-weight: 760;
    line-height: 1.2;
}

.es-eq-landing-header p {
    margin: 0;
    color: var(--es-text-secondary);
    font-size: 0.9rem;
}

.es-eq-landing-card {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    background: var(--es-bg-page);
    border: 1px solid var(--es-border-light);
    border-radius: 8px;
}

.es-eq-landing-card-growth h3 {
    color: var(--es-eq-pred-up);
}

.es-eq-landing-card-price h3 {
    color: var(--es-eq-pred-line);
}

.es-eq-landing-card-risk h3 {
    color: var(--es-eq-pred-down);
}

.es-eq-landing-card-value h3 {
    color: #b45309;
}

.es-eq-landing-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.es-eq-landing-card-head h3 {
    margin: 0 0 5px;
    font-size: 0.98rem;
    font-weight: 760;
}

.es-eq-landing-card-head p {
    margin: 0;
    color: var(--es-text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
}

.es-eq-landing-chip {
    flex: 0 0 auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: #eef4ff;
    color: var(--es-eq-pred-line);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.es-eq-landing-chip.risk {
    background: #fef2f2;
    color: var(--es-eq-pred-down);
}

.es-eq-landing-chip.value {
    background: #fff7ed;
    color: #b45309;
}

.es-eq-leader-list {
    flex: 1 1 auto;
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.es-eq-leader-list li {
    min-height: 42px;
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 7px 8px;
    border-bottom: 1px solid var(--es-border-light);
    border-radius: 6px;
    transition: background-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.es-eq-leader-list li:not(.es-eq-view-all-row):hover {
    background: #f8fbff;
    box-shadow: 0 0 0 1px rgba(13, 110, 253, 0.10), 0 6px 18px rgba(13, 110, 253, 0.10);
    transform: translateY(-1px);
}

.es-eq-leader-list li:last-child {
    border-bottom: 0;
}

.es-eq-landing-card-risk .es-eq-leader-list li {
    grid-template-columns: 24px minmax(0, 1fr) 70px auto;
}

.es-eq-leader-list .es-eq-view-all-row,
.es-eq-landing-card-risk .es-eq-leader-list .es-eq-view-all-row {
    min-height: 34px;
    grid-template-columns: 1fr;
    margin-top: auto;
    padding-top: 10px;
    border-bottom: 0;
}

.es-eq-view-all-row a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    color: var(--es-eq-pred-line);
    font-size: 0.82rem;
    font-weight: 750;
    text-decoration: none;
}

.es-eq-view-all-row a:hover {
    color: #0a58ca;
}

.es-eq-rank {
    color: var(--es-text-secondary);
    font-size: 0.78rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.es-eq-leader-main {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--es-text-primary);
    text-decoration: none;
}

.es-eq-leader-main:hover {
    color: var(--es-eq-pred-line);
}

.es-eq-leader-main strong {
    flex: 0 0 auto;
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.es-eq-leader-main span {
    min-width: 0;
    overflow: hidden;
    color: var(--es-text-secondary);
    font-size: 0.78rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.es-eq-leader-metric {
    color: var(--es-text-primary);
    font-size: 0.84rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.es-eq-leader-metric.up,
.es-eq-leader-dual .up {
    color: var(--es-eq-pred-up);
}

.es-eq-leader-metric.down {
    color: var(--es-eq-pred-down);
}

.es-eq-leader-metric.value {
    color: #b45309;
}

.es-eq-leader-dual {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-variant-numeric: tabular-nums;
}

.es-eq-leader-dual strong {
    font-size: 0.84rem;
    font-weight: 800;
}

.es-eq-leader-dual small {
    color: var(--es-text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
}

.es-eq-risk-meter {
    width: 70px;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #fee2e2;
}

.es-eq-risk-meter > span {
    display: block;
    width: calc(var(--risk) * 1%);
    height: 100%;
    border-radius: inherit;
    background: var(--es-eq-pred-down);
}

/* ----- Indices strip ----- */
.es-eq-indices {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

@media (max-width: 1400px) {
    .es-eq-indices { grid-template-columns: repeat(2, 1fr); }
}

.es-eq-index-card {
    position: relative;
    padding: 10px 12px 30px;
    background: var(--es-eq-tile-bg);
    border: 1px solid var(--es-border-light);
    border-radius: 8px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.15s ease;
}

.es-eq-index-card:hover {
    border-color: var(--es-text-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.es-eq-index-card.active {
    border-color: var(--es-eq-active-bd);
    background: var(--es-eq-active-bg);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.08);
}

.es-eq-index-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.es-eq-index-name {
    font-weight: 700;
    font-size: 0.84rem;
    color: var(--es-text-primary);
}

.es-eq-index-symbol {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--es-text-secondary);
    letter-spacing: 0.04em;
}

.es-eq-index-card-body {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.es-eq-index-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--es-text-primary);
    font-variant-numeric: tabular-nums;
}

.es-eq-index-change {
    font-size: 0.78rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.es-eq-index-change.up { color: var(--es-eq-pred-up); }
.es-eq-index-change.down { color: var(--es-eq-pred-down); }

.es-eq-index-card-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-top: 6px;
    border-top: 1px dashed var(--es-border-light);
    font-size: 0.72rem;
}

.es-eq-pred-label {
    color: var(--es-text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.04em;
    font-size: 0.65rem;
}

.es-eq-pred-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.es-eq-pred-value.up { color: var(--es-eq-pred-up); }
.es-eq-pred-value.down { color: var(--es-eq-pred-down); }

.es-eq-pred-conf-chip {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--es-text-secondary);
    letter-spacing: 0.03em;
    background: var(--es-bg-muted);
    padding: 2px 6px;
    border-radius: 999px;
}

.es-eq-spark {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 22px;
    background: linear-gradient(180deg, transparent 0%, rgba(13,110,253,0.08) 100%);
    pointer-events: none;
}

/* Decorative spark trend line indicators */
.es-eq-spark[data-spark="up"]::before,
.es-eq-spark[data-spark="flat"]::before,
.es-eq-spark[data-spark="down"]::before {
    content: '';
    position: absolute;
    left: 8px; right: 8px;
    bottom: 6px;
    height: 1.5px;
    background: var(--es-eq-pred-up);
    border-radius: 2px;
    transform-origin: left center;
}
.es-eq-spark[data-spark="up"]::before { transform: rotate(-3deg); }
.es-eq-spark[data-spark="flat"]::before { transform: rotate(0deg); background: var(--es-text-secondary); }
.es-eq-spark[data-spark="down"]::before { transform: rotate(3deg); background: var(--es-eq-pred-down); }

/* ----- Shared empty-state hint (detail middle) ----- */
.es-eq-empty-hint {
    font-size: 0.82rem;
    color: var(--es-text-secondary);
    font-style: italic;
    padding: 12px 0 0;
    margin: 0;
    border-top: 1px dashed var(--es-border-light);
}

/* ============================================================================
   RIGHT COLUMN — AI Research Panel
   ============================================================================ */
.es-eq-right {
    padding: 14px 14px 18px;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
}

.es-eq-research-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.es-eq-research-header h6 {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--es-text-primary);
    text-transform: uppercase;
}

.es-eq-research-pill {
    background: linear-gradient(135deg, #5b8def, #0d6efd);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    letter-spacing: 0.06em;
}

/* Ask form */
.es-eq-research-greeting {
    display: block;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--es-text-primary);
    margin-bottom: 10px;
    line-height: 1.3;
}

.es-eq-ask-form {
    display: flex;
    gap: 6px;
    background: var(--es-bg-muted);
    border: 1px solid var(--es-border-medium);
    border-radius: 10px;
    padding: 4px 4px 4px 10px;
    transition: all 0.15s ease;
}

.es-eq-ask-form:focus-within {
    background: #fff;
    border-color: var(--es-eq-pred-line);
    box-shadow: 0 0 0 3px rgba(13,110,253,0.10);
}

.es-eq-ask-form input {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 7px 0;
    font-size: 0.84rem;
    color: var(--es-text-primary);
}

.es-eq-ask-form input:focus { outline: none; }

.es-eq-ask-form button {
    border: 0;
    background: var(--es-eq-pred-line);
    color: #fff;
    width: 30px; height: 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
    font-size: 0.78rem;
}

.es-eq-ask-form button:hover {
    background: #0a58ca;
}

/* Suggestions */
.es-eq-research-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.es-eq-suggestion {
    background: #fff;
    border: 1px solid var(--es-border-medium);
    color: var(--es-text-primary);
    text-align: left;
    padding: 8px 12px;
    font-size: 0.82rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.es-eq-suggestion:hover {
    border-color: var(--es-eq-pred-line);
    background: var(--es-eq-tile-hover);
    color: var(--es-eq-pred-line);
}

/* Quick actions */
.es-eq-research-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.es-eq-research-action {
    flex: 1;
    background: var(--es-bg-muted);
    border: 1px solid var(--es-border-medium);
    color: var(--es-text-primary);
    padding: 8px 10px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.es-eq-research-action:hover {
    background: #fff;
    border-color: var(--es-eq-pred-line);
    color: var(--es-eq-pred-line);
}

/* Insight feed */
.es-eq-research-feed {
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid var(--es-border-light);
    padding-top: 12px;
}

.es-eq-insight {
    background: var(--es-bg-page);
    border: 1px solid var(--es-border-light);
    border-radius: 10px;
    padding: 12px 14px;
    transition: all 0.15s ease;
}

.es-eq-insight.user {
    background: var(--es-eq-active-bg);
    border-color: rgba(13, 110, 253, 0.20);
}

.es-eq-insight:hover {
    border-color: var(--es-text-secondary);
}

.es-eq-insight header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.es-eq-insight-tag {
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--es-eq-pred-line);
    background: rgba(13, 110, 253, 0.10);
    padding: 2px 8px;
    border-radius: 999px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.es-eq-insight-time {
    font-size: 0.7rem;
    color: var(--es-text-secondary);
}

.es-eq-insight-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--es-text-primary);
    margin: 0 0 6px 0;
    line-height: 1.35;
}

.es-eq-insight-body {
    font-size: 0.82rem;
    color: var(--es-text-body);
    line-height: 1.5;
    margin: 0;
}

.es-eq-insight-body .up { color: var(--es-eq-pred-up); font-weight: 600; }
.es-eq-insight-body .down { color: var(--es-eq-pred-down); font-weight: 600; }

.es-eq-insight footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--es-border-light);
    font-size: 0.7rem;
    color: var(--es-text-secondary);
}

/* Loading state for AI replies */
.es-eq-insight.loading .es-eq-insight-body::after {
    content: '·  ·  ·';
    animation: es-eq-dots 1.5s infinite;
    letter-spacing: 0.2em;
    color: var(--es-eq-pred-line);
}

@keyframes es-eq-dots {
    0%   { opacity: 0.2; }
    50%  { opacity: 1; }
    100% { opacity: 0.2; }
}

/* =====================================================================
   Single-equity detail (middle column) — polished research layout
   ===================================================================== */

.es-eq-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
    --es-eq-glow: 0 0 0 1px rgba(13, 110, 253, 0.12),
                  0 4px 18px rgba(13, 110, 253, 0.12),
                  0 10px 28px rgba(15, 23, 42, 0.06);
    --es-eq-glow-good: 0 0 0 1px rgba(21, 128, 61, 0.14),
                       0 4px 18px rgba(21, 128, 61, 0.14),
                       0 10px 28px rgba(15, 23, 42, 0.05);
    --es-eq-glow-watch: 0 0 0 1px rgba(180, 120, 10, 0.16),
                        0 4px 18px rgba(202, 138, 4, 0.14),
                        0 10px 28px rgba(15, 23, 42, 0.05);
    --es-eq-glow-bad: 0 0 0 1px rgba(185, 28, 28, 0.14),
                      0 4px 18px rgba(185, 28, 28, 0.12),
                      0 10px 28px rgba(15, 23, 42, 0.05);
}

.es-eq-detail-error {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(185, 28, 28, 0.25);
    background: rgba(185, 28, 28, 0.06);
    color: var(--es-eq-pred-down);
    font-size: 0.84rem;
    font-weight: 600;
}

/* ----- Company header ----- */
.es-eq-co-header {
    background: var(--es-bg-page);
    border: 1px solid var(--es-border-light);
    border-radius: 10px;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.es-eq-co-header:hover {
    border-color: rgba(13, 110, 253, 0.28);
    box-shadow: var(--es-eq-glow);
    transform: translateY(-1px);
}

.es-eq-co-heading {
    min-width: 0;
}

.es-eq-co-ticker {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--es-text-secondary);
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.es-eq-co-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--es-text-primary);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.es-eq-co-meta {
    font-size: 0.74rem;
    color: var(--es-text-secondary);
    font-weight: 600;
}

.es-eq-co-meta i {
    font-size: 0.72rem;
    opacity: 0.8;
}

.es-eq-co-asof {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--es-text-secondary);
    white-space: nowrap;
}

.es-eq-wl-btn {
    border: 1px solid var(--es-border-medium);
    background: #fff;
    color: var(--es-text-primary);
    border-radius: 8px;
    padding: 6px 11px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.es-eq-wl-btn:hover {
    border-color: rgba(13, 110, 253, 0.35);
    background: #f8fbff;
    box-shadow: 0 1px 3px rgba(13, 110, 253, 0.08);
}

.es-eq-wl-btn.is-active {
    border-color: rgba(202, 138, 4, 0.45);
    background: #fffbeb;
    color: #92400e;
}

.es-eq-wl-btn.is-active i { color: #ca8a04; }

.es-eq-wl-btn:disabled {
    opacity: 0.65;
    cursor: wait;
}

/* ----- KPI summary cards ----- */
.es-eq-kpi-card {
    background: var(--es-bg-page);
    border: 1px solid var(--es-border-light);
    border-radius: 10px;
    padding: 14px 16px;
    min-width: 0;
    min-height: 100%;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.es-eq-kpi-card:hover {
    border-color: rgba(13, 110, 253, 0.28);
    box-shadow: var(--es-eq-glow);
    transform: translateY(-2px);
}

.es-eq-kpi-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(13, 110, 253, 0.08);
    color: var(--es-eq-pred-line);
    flex-shrink: 0;
    font-size: 0.95rem;
}

.es-eq-kpi-icon-price {
    background: rgba(21, 128, 61, 0.08);
    color: var(--es-eq-pred-up);
}

.es-eq-kpi-kicker {
    margin: 0;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--es-text-secondary);
}

.es-eq-kpi-period {
    margin: 2px 0 0;
    font-size: 0.76rem;
    color: var(--es-text-secondary);
    font-weight: 500;
}

.es-eq-kpi-value {
    font-size: 1.7rem;
    font-weight: 750;
    color: var(--es-text-primary);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.es-eq-kpi-badge {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    background: var(--es-bg-muted);
    color: var(--es-text-secondary);
    border: 1px solid var(--es-border-light);
}

.es-eq-kpi-badge.up {
    color: var(--es-eq-pred-up);
    background: rgba(21, 128, 61, 0.07);
    border-color: rgba(21, 128, 61, 0.22);
}

.es-eq-kpi-badge.down {
    color: var(--es-eq-pred-down);
    background: rgba(185, 28, 28, 0.06);
    border-color: rgba(185, 28, 28, 0.2);
}

.es-eq-kpi-foot {
    border-top: 1px solid var(--es-border-light);
}

.es-eq-kpi-foot-item {
    min-width: 0;
}

.es-eq-kpi-foot-label {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--es-text-secondary);
}

.es-eq-kpi-foot-sub {
    font-size: 0.72rem;
    color: var(--es-text-secondary);
}

.es-eq-kpi-foot-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--es-text-primary);
    font-variant-numeric: tabular-nums;
}

/* ----- Panels ----- */
.es-eq-panel {
    background: var(--es-bg-page);
    border: 1px solid var(--es-border-light);
    border-radius: 10px;
    padding: 14px 16px 16px;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

.es-eq-panel:hover {
    border-color: rgba(13, 110, 253, 0.26);
    box-shadow: var(--es-eq-glow);
    transform: translateY(-1px);
}

.es-eq-panel-head {
    border-bottom: 1px solid var(--es-border-light);
}

.es-eq-panel-title {
    margin: 0;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--es-text-primary);
}

.es-eq-panel-desc {
    margin: 4px 0 0;
    font-size: 0.78rem;
    color: var(--es-text-secondary);
    line-height: 1.4;
    max-width: 52rem;
}

.es-eq-metric-group-title {
    margin: 4px 0 0;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--es-text-primary);
}

/* ----- Gauges ----- */
.es-eq-gauge-card {
    border: 1px solid var(--es-border-light);
    border-radius: 10px;
    background: #fafbfc;
    padding: 10px 10px 12px;
    min-width: 0;
    min-height: 210px;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.es-eq-gauge-card:hover {
    background: #fff;
    border-color: rgba(13, 110, 253, 0.28);
    box-shadow: var(--es-eq-glow);
    transform: translateY(-2px);
}

.es-eq-gauge-card[data-tone="good"] { border-color: rgba(21, 128, 61, 0.24); }
.es-eq-gauge-card[data-tone="watch"] { border-color: rgba(180, 120, 10, 0.28); }
.es-eq-gauge-card[data-tone="bad"] { border-color: rgba(185, 28, 28, 0.24); }

.es-eq-gauge-card[data-tone="good"]:hover {
    border-color: rgba(21, 128, 61, 0.35);
    box-shadow: var(--es-eq-glow-good);
}

.es-eq-gauge-card[data-tone="watch"]:hover {
    border-color: rgba(180, 120, 10, 0.4);
    box-shadow: var(--es-eq-glow-watch);
}

.es-eq-gauge-card[data-tone="bad"]:hover {
    border-color: rgba(185, 28, 28, 0.35);
    box-shadow: var(--es-eq-glow-bad);
}

.es-eq-gauge-head {
    min-height: 2.6em;
}

.es-eq-gauge-name {
    margin: 0;
    flex: 1;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--es-text-secondary);
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.es-eq-gauge-info {
    border: 0;
    background: transparent;
    color: #94a3b8;
    padding: 0;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
}

.es-eq-gauge-info:hover { color: var(--es-eq-pred-line); }

.es-eq-gauge-chart {
    width: 100%;
    height: 108px;
}

.es-eq-gauge-value {
    font-size: 0.95rem;
    font-weight: 750;
    color: var(--es-text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.es-eq-gauge-status {
    font-size: 0.72rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.es-eq-gauge-status.tone-good { color: var(--es-eq-pred-up); }
.es-eq-gauge-status.tone-watch { color: #b45309; }
.es-eq-gauge-status.tone-bad { color: var(--es-eq-pred-down); }
.es-eq-gauge-status.tone-neutral { color: var(--es-text-secondary); }

.es-eq-gauge-date {
    font-size: 0.66rem;
    color: var(--es-text-secondary);
    font-weight: 600;
}

/* ----- Timeseries ----- */
.es-eq-ts-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--es-text-secondary);
}

.es-eq-ts-legend li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.es-eq-leg-line {
    width: 18px;
    height: 0;
    border-top: 2px solid #334155;
    display: inline-block;
}

.es-eq-leg-line.dashed {
    border-top-style: dashed;
    border-color: #64748b;
}

.es-eq-leg-price {
    border-color: #0f4c81;
}

.es-eq-leg-price-pred {
    border-color: #5b8db8;
}

.es-eq-leg-band {
    width: 16px;
    height: 10px;
    border-radius: 2px;
    background: rgba(13, 110, 253, 0.16);
    display: inline-block;
}

.es-eq-ts-chart {
    width: 100%;
    height: 520px;
    min-height: 360px;
}

/* ----- Price history ----- */
.es-eq-price-head {
    align-items: flex-end;
}

.es-eq-price-summary {
    text-align: right;
    min-width: 9rem;
}

.es-eq-price-summary-main {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 8px;
}

.es-eq-price-last {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--es-text-primary);
    font-variant-numeric: tabular-nums;
}

.es-eq-price-change {
    font-size: 0.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.es-eq-price-change.up { color: var(--es-eq-pred-up); }
.es-eq-price-change.down { color: var(--es-eq-pred-down); }

.es-eq-price-summary-sub {
    margin-top: 2px;
    font-size: 0.7rem;
    color: var(--es-text-secondary);
    font-weight: 600;
}

.es-eq-price-control-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--es-text-secondary);
}

.es-eq-seg {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--es-border-light);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.es-eq-seg-btn {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--es-text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 6px 11px;
    cursor: pointer;
    line-height: 1.2;
    border-right: 1px solid var(--es-border-light);
    transition: background 0.15s ease, color 0.15s ease;
}

.es-eq-seg-btn:last-child {
    border-right: 0;
}

.es-eq-seg-btn:hover {
    background: #f8fafc;
    color: var(--es-text-primary);
}

.es-eq-seg-btn.is-active {
    background: #0f172a;
    color: #fff;
}

.es-eq-seg-btn:focus-visible {
    outline: 2px solid #0f4c81;
    outline-offset: -2px;
    z-index: 1;
}

.es-eq-price-chart {
    height: 380px;
    min-height: 300px;
}

/* ----- Shared model plot tiles (price + evidence) ----- */
.es-eq-model-plots {
    border-top: 1px solid var(--es-border-light);
}

.es-eq-model-plots-title {
    margin: 0;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--es-text-primary);
}

.es-eq-model-plots-desc {
    margin: 4px 0 0;
    font-size: 0.76rem;
    color: var(--es-text-secondary);
    line-height: 1.4;
}

.es-eq-model-plot-card {
    border: 1px solid var(--es-border-light);
    border-radius: 10px;
    background: #fafbfc;
    padding: 12px;
    min-width: 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.es-eq-model-plot-card:hover {
    background: #fff;
    border-color: rgba(15, 76, 129, 0.28);
    box-shadow: 0 8px 24px rgba(15, 76, 129, 0.10);
    transform: translateY(-1px);
}

.es-eq-model-plot-name {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--es-text-primary);
    line-height: 1.3;
    min-width: 0;
    width: 100%;
}

.es-eq-model-plot-predicted {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--es-text-secondary);
    line-height: 1.3;
}

.es-eq-model-plot-media {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid var(--es-border-light);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    cursor: zoom-in;
    text-decoration: none;
    color: inherit;
}

.es-eq-model-plot-media img {
    display: block;
    width: 100%;
    height: auto;
    min-height: 220px;
    max-height: 420px;
    object-fit: contain;
    background: #fff;
}

.es-eq-model-plots-grid.is-single .es-eq-model-plot-media img {
    min-height: 320px;
    max-height: 560px;
}

.es-eq-model-plot-expand {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.82);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
}

.es-eq-model-plot-media:hover .es-eq-model-plot-expand,
.es-eq-model-plot-media:focus-visible .es-eq-model-plot-expand,
.es-eq-model-plot-card:hover .es-eq-model-plot-expand {
    opacity: 1;
    transform: translateY(0);
}

.es-eq-model-plot-media:focus-visible {
    outline: 2px solid #0f4c81;
    outline-offset: 2px;
}

@media (max-width: 991.98px) {
    .es-eq-kpi-value { font-size: 1.45rem; }
    .es-eq-ts-chart { height: 460px; }
    .es-eq-price-chart { height: 320px; }
    .es-eq-seg-btn {
        padding: 6px 8px;
        font-size: 0.68rem;
    }
}

@media (max-width: 575.98px) {
    .es-eq-gauge-chart { height: 96px; }
    .es-eq-gauge-card { min-height: 190px; }
    .es-eq-ts-chart { height: 380px; }
    .es-eq-nav-open { width: 100%; justify-content: center; }
}

/* ----- News ----- */
.es-eq-news-list {
    border-top: 1px solid var(--es-border-light);
}

.es-eq-news-item {
    padding: 14px 2px 14px 14px;
    border-bottom: 1px solid var(--es-border-light);
    border-left: 2px solid transparent;
    transition: background 0.15s ease, border-left-color 0.15s ease;
}

.es-eq-news-item:hover {
    background: rgba(15, 23, 42, 0.02);
    border-left-color: #334155;
}

.es-eq-news-item:last-child {
    border-bottom: 0;
}

.es-eq-news-date {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--es-text-secondary);
}

.es-eq-news-category {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 2px 7px;
}

.es-eq-news-sentiment {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid transparent;
}

.es-eq-news-sentiment-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.es-eq-news-sentiment.is-positive {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.es-eq-news-sentiment.is-negative {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.es-eq-news-sentiment.is-neutral {
    color: #475569;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.es-eq-news-text {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--es-text-primary);
}

.es-eq-news-list.is-collapsed .es-eq-news-extra {
    display: none;
}

.es-eq-news-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 6px;
    margin-top: 2px;
    padding: 8px 14px;
    border: 1px solid var(--es-border-light);
    border-radius: 8px;
    background: #fff;
    color: var(--es-text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.es-eq-news-more:hover {
    color: var(--es-text-primary);
    border-color: rgba(13, 110, 253, 0.35);
    background: #f8fbff;
}

.es-eq-news-more .bi {
    font-size: 0.9rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

.es-eq-news-more[aria-expanded="true"] .bi {
    transform: rotate(180deg);
}

/* ----- About ----- */
.es-eq-about-desc {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--es-text-primary);
}

.es-eq-about-grid > div {
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid var(--es-border-light);
    border-radius: 8px;
    background: #fafbfc;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.es-eq-about-grid > div:hover {
    background: #fff;
    border-color: rgba(13, 110, 253, 0.28);
    box-shadow: var(--es-eq-glow);
    transform: translateY(-1px);
}

.es-eq-about-grid dt {
    margin: 0;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--es-text-secondary);
}

.es-eq-about-grid dd {
    margin: 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--es-text-primary);
    overflow-wrap: anywhere;
}

.es-eq-about-grid a {
    color: var(--es-eq-pred-line);
    text-decoration: none;
    font-weight: 600;
}

.es-eq-about-grid a:hover {
    text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
    .es-eq-co-header,
    .es-eq-kpi-card,
    .es-eq-panel,
    .es-eq-gauge-card,
    .es-eq-model-plot-card,
    .es-eq-about-grid > div {
        transition: none;
    }
    .es-eq-co-header:hover,
    .es-eq-kpi-card:hover,
    .es-eq-panel:hover,
    .es-eq-gauge-card:hover,
    .es-eq-model-plot-card:hover,
    .es-eq-about-grid > div:hover {
        transform: none;
    }
}

/* ----- Hybrid async loading states ----- */
.es-eq-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--es-text-secondary);
}

/* !important beats Bootstrap .d-flex utilities if still present */
.es-eq-async-body[data-state="ready"] .es-eq-loading,
.es-eq-async-body[data-state="empty"] .es-eq-loading,
.es-eq-async-body[data-state="error"] .es-eq-loading,
.es-eq-loading[hidden] {
    display: none !important;
}

.es-eq-loading-spinner {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(13, 110, 253, 0.2);
    border-top-color: var(--es-eq-pred-line);
    animation: es-eq-spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes es-eq-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .es-eq-loading-spinner { animation: none; }
}

/* ============================================================================
   Single Index detail (middle section)
   ============================================================================ */

/* Index type badge in the header */
.es-idx-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f4c81;
    background: rgba(15, 76, 129, 0.10);
    border: 1px solid rgba(15, 76, 129, 0.18);
}

/* KPI value colour when it carries a change class */
.es-idx-kpi-card .es-eq-kpi-value.up { color: var(--es-eq-pred-up); }
.es-idx-kpi-card .es-eq-kpi-value.down { color: var(--es-eq-pred-down); }

/* Narrow 4-up KPI grid: keep the value + change badge inside the card.
   The value stays on one line; the badge wraps to its own line when tight. */
.es-idx-kpi-card .es-eq-kpi-value {
    font-size: 1.4rem;
    white-space: nowrap;
}

.es-idx-kpi-main {
    column-gap: 8px;
    row-gap: 4px;
}

.es-idx-kpi-main .es-eq-kpi-badge {
    flex-shrink: 0;
    padding: 3px 7px;
    font-size: 0.7rem;
}

/* Tighten the kicker so single long words (e.g. CONSTITUENTS) stay in-card */
.es-idx-kpi-card .es-eq-kpi-kicker {
    font-size: 0.64rem;
    letter-spacing: 0.03em;
}

.es-idx-kpi-card .es-eq-kpi-top > div {
    min-width: 0;
}

/* ---------- Sector allocation ---------- */
.es-idx-sector-chart {
    width: 100%;
    height: 260px;
    min-height: 220px;
}

.es-idx-sector-legend {
    margin: 0;
    padding: 0;
    list-style: none;
}

.es-idx-sector-row {
    font-size: 0.82rem;
    color: var(--es-text-primary);
}

.es-idx-sector-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    background: #334155;
}

.es-idx-sector-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.es-idx-sector-bar {
    width: 84px;
    height: 6px;
    border-radius: 999px;
    background: var(--es-eq-grid-line);
    overflow: hidden;
    flex-shrink: 0;
}

.es-idx-sector-bar-fill {
    display: block;
    height: 100%;
    width: var(--w, 0%);
    border-radius: 999px;
    background: linear-gradient(90deg, #0f4c81, #5b8db8);
}

.es-idx-sector-pct {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    min-width: 52px;
    text-align: right;
    flex-shrink: 0;
}

/* ---------- Constituents table ---------- */
.es-idx-members-wrap {
    margin: 0;
}

.es-idx-members-table {
    border-collapse: collapse;
    font-size: 0.82rem;
}

.es-idx-members-table thead th {
    position: sticky;
    top: 0;
    background: #f8fafc;
    color: var(--es-text-secondary);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 8px 12px;
    border-bottom: 1px solid var(--es-border-light);
    white-space: nowrap;
}

.es-idx-members-table tbody td {
    padding: 9px 12px;
    border-bottom: 1px solid var(--es-eq-grid-line);
    vertical-align: middle;
}

.es-idx-members-table tbody tr:hover {
    background: var(--es-eq-tile-hover);
}

.es-idx-col-code { width: 84px; }
.es-idx-col-weight { width: 132px; }

.es-idx-member-link {
    font-weight: 800;
    color: #0f4c81;
    text-decoration: none;
}

.es-idx-member-link:hover {
    text-decoration: underline;
}

.es-idx-member-name {
    color: var(--es-text-primary);
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.es-idx-member-sector,
.es-idx-member-industry {
    color: var(--es-text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.es-idx-col-weight {
    white-space: nowrap;
}

.es-idx-weight-value {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.es-idx-weight-bar {
    display: inline-block;
    vertical-align: middle;
    width: 56px;
    height: 6px;
    margin-left: 8px;
    border-radius: 999px;
    background: var(--es-eq-grid-line);
    overflow: hidden;
}

.es-idx-weight-bar-fill {
    display: block;
    height: 100%;
    width: var(--w, 0%);
    border-radius: 999px;
    background: linear-gradient(90deg, #2f855a, #68b389);
}
