.top-asset-card {
    flex: 0 0 auto;
    width: 180px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 12px 14px 0 14px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 80px; /* Ensure enough height for content + chart bleed */
}

.top-asset-card:hover {
    background: #fdfdfd;
    border-color: #dcdcdc;
}

.asset-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.asset-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.asset-value {
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-brand);
    color: var(--text-primary);
    margin-bottom: 0px;
    line-height: 1.2;
}

.asset-change {
    font-size: 11px;
    font-weight: 600;
}

.asset-change.positive { color: #10B981; }
.asset-change.negative { color: #EF4444; }
.asset-change.neutral {
    color: var(--text-secondary);
    font-weight: 500;
}

.top-asset-card-footnote {
    margin-top: auto;
    margin-left: -14px;
    margin-right: -14px;
    width: calc(100% + 28px);
    padding: 8px 10px 10px;
    font-size: 10px;
    line-height: 1.35;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-light);
    text-align: center;
    font-weight: 500;
}

.finance-inline-cta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--border-light);
    background: rgba(var(--bg-light-rgb, 255, 255, 255), 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-top: 10px;
    margin-bottom: 18px;
}

.finance-inline-cta-row__left {
    min-width: 0;
}

.finance-inline-cta-row__title {
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.finance-inline-cta-row__subtitle {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.86;
    line-height: 1.25;
}

.finance-inline-cta-row__right {
    display: inline-flex;
    gap: 8px;
    flex-shrink: 0;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

a.finance-inline-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.01em;
    transition: all 0.18s ease;
    white-space: nowrap;
    border: 1px solid transparent;
}

.finance-inline-cta__arrow {
    font-weight: 900;
    opacity: 0.9;
}

a.finance-inline-cta--primary {
    color: #064e3b;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.26);
}

a.finance-inline-cta--primary:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.38);
    transform: translateY(-1px);
}

a.finance-inline-cta--ghost {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

a.finance-inline-cta--ghost:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.10);
    transform: translateY(-1px);
}

a.finance-inline-cta--fedha {
    color: #0c4a6e;
    background: rgba(14, 165, 233, 0.14);
    border-color: rgba(14, 165, 233, 0.32);
    box-shadow: 0 0 0 1px rgba(14, 165, 233, 0.06);
}

a.finance-inline-cta--fedha:hover {
    background: rgba(14, 165, 233, 0.22);
    border-color: rgba(14, 165, 233, 0.45);
    transform: translateY(-1px);
}

.finance-analysis-agents {
    margin-top: 28px;
    margin-bottom: 12px;
    padding-top: 22px;
    border-top: 1px solid var(--border-light);
}

.finance-analysis-agents-intro {
    margin-bottom: 20px;
}

.finance-analysis-agents-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.finance-analysis-agents-context {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.35;
}

.finance-analysis-agents-context--signup-hint {
    margin-top: 6px;
}

/* One horizontal row of sections; scroll sideways to see Analyst Agents, Research Agents, … */
.finance-analysis-agents-strip {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 2px 26px;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 4px 12px;
    -webkit-overflow-scrolling: touch;
}

.finance-analysis-agents-strip::-webkit-scrollbar {
    height: 6px;
}

.finance-analysis-agents-strip::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 99px;
}

.finance-analysis-cluster {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    box-sizing: border-box;
    width: max-content;
    max-width: none;
    scroll-snap-align: start;
    padding-right: 22px;
    margin-right: 10px;
    border-right: 1px solid var(--border-light);
}

.finance-analysis-cluster:last-child {
    border-right: none;
    padding-right: 2px;
    margin-right: 0;
}

.finance-analysis-cluster__title {
    margin: 0;
    padding: 0 4px 0 0;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    line-height: 1.3;
}

.finance-analysis-cluster__cards {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    width: max-content;
    min-width: 0;
}

.finance-analysis-card {
    flex: 0 0 auto;
    width: 176px;
    min-width: 176px;
    min-height: 112px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    background: rgba(var(--bg-light-rgb, 255, 255, 255), 0.85);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.finance-analysis-card__name {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.finance-analysis-card__name .finance-section-anchor {
    display: block;
}

.finance-analysis-card__count-link {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0;
    text-decoration: none;
}

.finance-analysis-card__count-link:hover .finance-analysis-card__count-num,
.finance-analysis-card__count-link:hover .finance-analysis-card__count-label {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.finance-analysis-card__count {
    font-size: 12px;
    font-weight: 800;
    color: var(--finance-primary, #00b894);
    letter-spacing: -0.02em;
}

.finance-analysis-card__count-num {
    font-variant-numeric: tabular-nums;
}

.finance-analysis-card__count-label {
    font-weight: 700;
    color: var(--text-secondary);
}

.finance-analysis-card--empty .finance-analysis-card__count {
    color: var(--text-secondary);
    opacity: 0.85;
}

.finance-analysis-card--loading .finance-analysis-card__count-num {
    animation: finance-analysis-pulse 1s ease-in-out infinite;
}

@keyframes finance-analysis-pulse {
    50% { opacity: 0.35; }
}

.finance-analysis-card:not(.finance-analysis-card--empty) {
    cursor: pointer;
}

.finance-analysis-card--empty {
    cursor: default;
}

button.finance-analysis-card__btn {
    margin-top: auto;
    align-self: flex-start;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(16, 185, 129, 0.35);
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

button.finance-analysis-card__btn:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.18);
    transform: translateY(-1px);
}

button.finance-analysis-card__btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-secondary);
}

.finance-analysis-card--selected {
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.06);
}

.finance-analysis-report-panel {
    margin-top: 16px;
    padding: 8px 0 0;
    background: transparent;
    border: none;
    box-shadow: none;
}

.finance-analysis-report-panel[hidden] {
    display: none !important;
}

.finance-analysis-report-panel__title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.finance-analysis-report-panel__chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 12px;
    margin: 0 0 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

button.finance-analysis-chip {
    flex: 0 0 auto;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-light);
    background: rgba(0, 0, 0, 0.04);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button.finance-analysis-chip:hover {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.35);
}

button.finance-analysis-chip--active {
    background: rgba(16, 185, 129, 0.22);
    border-color: rgba(16, 185, 129, 0.45);
    color: #065f46;
}

.finance-analysis-report-panel__body {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-primary);
}

.finance-analysis-md-error {
    margin: 0;
    font-size: 13px;
    color: #b91c1c;
}

/* Report body: skeleton while fetching Markdown */
.finance-analysis-report-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px 0 12px;
}

.finance-analysis-report-skeleton__bar,
.finance-analysis-report-skeleton__block {
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.06);
    position: relative;
    overflow: hidden;
}

.finance-analysis-report-skeleton__bar::after,
.finance-analysis-report-skeleton__block::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    animation: finance-analysis-report-shimmer 1.35s ease-in-out infinite;
}

@keyframes finance-analysis-report-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .finance-analysis-report-skeleton__bar::after,
    .finance-analysis-report-skeleton__block::after {
        animation: none;
    }
}

.finance-analysis-report-skeleton__bar--title {
    height: 22px;
    width: 72%;
}

.finance-analysis-report-skeleton__bar--meta {
    height: 12px;
    width: 38%;
}

.finance-analysis-report-skeleton__block {
    height: 72px;
    width: 100%;
    margin: 4px 0 2px;
}

.finance-analysis-report-skeleton__bar {
    height: 12px;
    width: 100%;
}

.finance-analysis-report-skeleton__bar--short {
    width: 55%;
}

.finance-analysis-report-skeleton__bar--medium {
    width: 82%;
}

.finance-agent-report-md {
    font-size: 13px;
    line-height: 1.6;
}

.finance-agent-report-md h1,
.finance-agent-report-md h2,
.finance-agent-report-md h3,
.finance-agent-report-md h4 {
    margin: 1.1em 0 0.45em;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.finance-agent-report-md h1 { font-size: 1.25rem; }
.finance-agent-report-md h2 { font-size: 1.12rem; }
.finance-agent-report-md h3 { font-size: 1.05rem; }
.finance-agent-report-md h4 { font-size: 0.98rem; }

.finance-agent-report-md p {
    margin: 0.55em 0;
}

.finance-agent-report-md ul,
.finance-agent-report-md ol {
    margin: 0.5em 0 0.6em 1.25em;
    padding: 0;
}

.finance-agent-report-md li {
    margin: 0.25em 0;
}

.finance-agent-report-md strong {
    font-weight: 800;
}

.finance-agent-report-md code {
    font-size: 0.92em;
    padding: 0.1em 0.35em;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.06);
}

.finance-agent-report-md pre {
    margin: 0.75em 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.06);
    overflow-x: auto;
    font-size: 12px;
}

.finance-agent-report-md pre code {
    padding: 0;
    background: none;
}

.finance-agent-report-md blockquote {
    margin: 0.65em 0;
    padding: 0.35em 0 0.35em 12px;
    border-left: 3px solid rgba(16, 185, 129, 0.45);
    color: var(--text-secondary);
}

.finance-agent-report-md table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75em 0;
    font-size: 12px;
}

.finance-agent-report-md th,
.finance-agent-report-md td {
    border: 1px solid var(--border-light);
    padding: 6px 8px;
    text-align: left;
}

.finance-agent-report-md th {
    font-weight: 800;
    background: rgba(0, 0, 0, 0.03);
}

.finance-agent-report-md a {
    color: var(--finance-primary, #00b894);
    font-weight: 700;
}

.finance-brokers-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.finance-brokers-title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.finance-brokers-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.finance-brokers-hint {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
}

.finance-brokers-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 6px 2px 12px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.finance-brokers-scroll::-webkit-scrollbar {
    display: none;
}

a.finance-broker-card {
    flex: 0 0 auto;
    width: 320px;
    max-width: min(320px, 100%); /* 100vw was wider than the main column beside the app sidebar */
    border-radius: 18px;
    border: 1px solid var(--border-light);
    background: rgba(var(--bg-light-rgb, 255, 255, 255), 0.8);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    padding: 14px 14px 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

a.finance-broker-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.10), transparent 55%);
    opacity: 0.9;
    pointer-events: none;
}

a.finance-broker-card:hover {
    transform: translateY(-2px);
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.10);
    background: rgba(255, 255, 255, 0.92);
}

a.finance-broker-card--disabled {
    opacity: 0.75;
    cursor: not-allowed;
}

a.finance-broker-card--disabled:hover {
    transform: none;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    border-color: var(--border-light);
}

.finance-broker-card__top,
.finance-broker-card__meta,
.finance-broker-card__addr,
.finance-broker-card__foot {
    position: relative;
    z-index: 1;
}

.finance-broker-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.finance-broker-card__name {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.finance-broker-card__badge {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.finance-broker-card__meta {
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
}

.finance-broker-card__line {
    display: flex;
    gap: 10px;
    align-items: baseline;
    min-width: 0;
}

.finance-broker-card__k {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    flex: 0 0 auto;
}

.finance-broker-card__v {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    opacity: 0.92;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finance-broker-card__addr {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    line-height: 1.35;
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.finance-broker-card__foot {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: flex-end;
}

.finance-broker-card__link {
    font-size: 12px;
    font-weight: 900;
    color: #065f46;
    background: rgba(16, 185, 129, 0.10);
    border: 1px solid rgba(16, 185, 129, 0.20);
    padding: 6px 10px;
    border-radius: 12px;
}

.finance-broker-card__link--muted {
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.06);
}

.finance-broker-card__linkArrow {
    margin-left: 6px;
}

@media (max-width: 768px) {
    .finance-inline-cta-row {
        flex-direction: column;
        align-items: stretch;
    }

    .finance-inline-cta-row__right {
        justify-content: flex-start;
    }
}

.top-asset-card--bond {
    min-height: 0;
}

.asset-chart-placeholder {
    height: 50px;
    width: calc(100% + 32px);
    margin-left: -16px;
    margin-right: -16px;
    margin-top: auto; /* Push to absolute bottom */
    margin-bottom: 0; /* Extreme bleed to hide any internal ApexCharts padding */
}

/* Asset Detail Header */
.asset-detail-header {
    position: relative;
    overflow: hidden;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 20px 22px 22px;
    animation: fadeIn var(--transition);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.chart-loading {
    opacity: 0.6;
}

.asset-detail-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.asset-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.asset-title-block__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.asset-detail-provider-badge {
    font-size: 11px;
    background: var(--finance-primary, #00b894);
    color: #fff;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    font-family: var(--font-ui);
    letter-spacing: 0.04em;
}

.asset-price-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.asset-price-block > .asset-detail-change:not(.asset-detail-change--fund-meta) {
    margin-top: 6px;
}

.asset-detail-change--fund-meta {
    font-size: 13px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.asset-detail-header__accent {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, var(--finance-primary-alpha, rgba(0, 184, 148, 0.06)) 0%, transparent 70%);
    pointer-events: none;
}

.asset-detail-name {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-ui);
    letter-spacing: -0.02em;
}

.asset-detail-ticker {
    color: var(--text-secondary);
    font-weight: 500;
    font-family: var(--font-ui);
    font-size: 13px;
    background: var(--bg-hover);
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
}

.asset-detail-price {
    font-size: 24px;
    font-weight: 700;
    text-align: right;
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--text-primary);
}

.asset-detail-change {
    font-size: 16px;
    font-weight: 600;
    text-align: right;
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
}

.asset-detail-change.positive {
    color: var(--success-color, #10b981);
}

.asset-detail-change.negative {
    color: var(--error-color, #ef4444);
}

.asset-detail-change.neutral {
    color: var(--text-secondary);
    font-weight: 500;
}

.asset-detail-change__inner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.asset-detail-change__pct {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.92;
}

.asset-detail-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
    gap: 24px;
    min-width: 0;
    max-width: 100%;
    margin-top: 16px;
    position: relative;
    z-index: 1;
}

.asset-large-chart {
    min-width: 0;
    max-width: 100%;
}

.finance-section--asset-post-chart {
    margin-top: 20px;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

#asset-trend-chart {
    min-height: 350px;
    position: relative;
    border-radius: 12px;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.015);
    border: 1px solid rgba(0, 0, 0, 0.04);
    padding: 4px 2px 0;
}

/* ── Asset Metrics Refinements ────────────────────────────────────────────── */
.asset-metrics-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    background: rgba(var(--bg-light-rgb, 255, 255, 255), 0.5);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    height: fit-content;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    min-width: 0;
    max-width: 100%;
}

.asset-metrics-grid--beside-chart {
    align-self: start;
}

.asset-metrics-grid__heading {
    font-weight: 700;
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.asset-metrics-grid__footnote {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    font-size: 11px;
    color: var(--text-secondary);
    font-style: italic;
    opacity: 0.75;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    gap: 12px;
}

.metric-item:has(+ .asset-metrics-grid__footnote) {
    border-bottom: none;
    padding-bottom: 0;
}

.metric-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.metric-value {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    font-family: var(--font-ui);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.metric-value.positive { color: #10B981; }
.metric-value.negative { color: #EF4444; }

@media (max-width: 768px) {
    .asset-detail-main {
        grid-template-columns: 1fr;
    }
    .asset-detail-top {
        flex-direction: column;
        gap: 12px;
    }
    .asset-price-block {
        align-items: flex-start;
        width: 100%;
    }
    .asset-detail-price, .asset-detail-change {
        text-align: left;
    }
}


/* Sentiment Widget Styles */
.sentiment-widget {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0; /* Tightened */
    min-width: 180px;
}

.sentiment-main {
    display: flex;
    align-items: center;
    gap: 8px; /* Tighter gap */
}

.sentiment-bars {
    display: flex;
    gap: 2px;
}

.sentiment-widget.neutral .sentiment-label {
    color: #f59e0b; /* Amber for Neutral */
}

.sentiment-widget.neutral .sentiment-bars .bar.active {
    background: #f59e0b;
    opacity: 1;
}

.sentiment-bars .bar {
    width: 3px; /* Slightly slimmer */
    height: 12px; /* Slightly shorter */
    background: rgba(0, 0, 0, 0.08);
    border-radius: 1px;
}

.sentiment-label {
    font-size: 13px; /* Slightly smaller */
    font-weight: 600;
    color: #ff4d4d;
}

.sentiment-meta {
    font-size: 10px; /* Slightly smaller */
    color: var(--text-tertiary);
    font-weight: 500;
    margin-top: -2px; /* Pull up */
}

/* Compact "What's Happening" for Finance */
.finance-view .whats-happening-section {
    margin-bottom: 32px;
}

/* Vertical rhythm: analysts / brokers / news / ETF heatmap on /finance main column */
.finance-view .finance-main-col > .finance-section + .finance-section {
    margin-top: 48px;
}

.finance-view .finance-main-col > .asset-detail-header + .finance-section {
    margin-top: 40px;
}

.finance-view .finance-main-col > .finance-section + .whats-happening-section {
    margin-top: 48px;
}

.finance-view .finance-main-col > .etf-heatmap-container {
    margin-top: 48px;
}

.finance-view .happening-card {
    padding: 12px 14px;
    min-width: 260px;
    max-width: 260px;
}

.finance-view .happening-title {
    font-size: 14px;
    margin-bottom: 4px;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.finance-view .happening-excerpt {
    font-size: 12px;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.finance-view .happening-card-header {
    margin-bottom: 8px;
}

.finance-view .source-icon {
    width: 18px;
    height: 18px;
    font-size: 9px;
}

/* ── Chart Range Selector Toolbar ─────────────────────────────────────────── */
.chart-range-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 10px;
    padding: 4px;
    width: fit-content;
    max-width: 100%;
    background: var(--bg-hover);
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

.chart-range-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 5px 10px;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.chart-range-btn:hover {
    background: var(--bg-hover);
    border-color: var(--finance-primary, #00b894);
    color: var(--text-primary);
}

.chart-range-btn.active {
    background: var(--finance-primary, #00b894);
    border-color: var(--finance-primary, #00b894);
    color: #fff;
}

/* Loading overlay inside the chart container */
#asset-trend-chart.chart-loading {
    position: relative;
    min-height: 320px;
}

#asset-trend-chart.chart-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(var(--bg-light-rgb, 255,255,255), 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    z-index: 10;
}

/* ── Custom Chart Tooltip (Support for JS inline styles) ──────────────────── */
.custom-chart-tooltip {
    pointer-events: none;
    z-index: 100;
}

/* ── Portfolio Connect Modal ─────────────────────────────────────────────── */
.portfolio-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 24px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.portfolio-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.portfolio-modal {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: 
        0 0 0 1px rgba(0, 0, 0, 0.05),
        0 20px 50px -12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    transform: scale(0.95) translateY(10px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.portfolio-modal-overlay.active .portfolio-modal {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 40px 32px 24px;
    text-align: center;
    background: linear-gradient(to bottom, rgba(0, 184, 148, 0.03), transparent);
}

/* Override topics.css .modal-header (flex row + space-between) so title and copy stack */
.portfolio-modal .modal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    border-bottom: none;
    z-index: auto;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    z-index: 10;
    font-size: 20px;
    line-height: 1;
}

.modal-close-btn:hover {
    background: #fff;
    color: var(--text-primary);
    transform: rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.modal-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.2;
}

.modal-header p {
    margin: 12px 0 0;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.6;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.broker-list {
    padding: 0 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.broker-item {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.broker-item:hover {
    border-color: var(--finance-primary, #00b894);
    box-shadow: 0 8px 25px -5px rgba(0, 184, 148, 0.1);
    transform: translateY(-2px);
}

.broker-icon {
    width: 48px;
    height: 48px;
    background: rgba(0, 184, 148, 0.05);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--finance-primary, #00b894);
    flex-shrink: 0;
}

.broker-info {
    flex-grow: 1;
}

.broker-info h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.broker-info p {
    margin: 3px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.coming-soon-badge {
    background: rgba(15, 23, 42, 0.05);
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.modal-footer {
    padding: 24px 32px;
    background: rgba(15, 23, 42, 0.02);
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.modal-footer p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.modal-footer p strong {
    color: var(--finance-primary, #00b894);
    font-weight: 700;
}

/* Mobile: make the connect modal a true full-screen sheet */
@media (max-width: 768px) {
    .portfolio-modal-overlay {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }

    .portfolio-modal {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-width: none;
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .portfolio-modal .modal-header {
        padding: calc(24px + env(safe-area-inset-top)) 20px 16px;
    }

    .portfolio-modal .modal-header h2 {
        font-size: 22px;
    }

    .portfolio-modal .modal-header p {
        font-size: 14px;
        max-width: 100%;
    }

    .portfolio-modal .modal-close-btn {
        top: calc(14px + env(safe-area-inset-top));
        right: 14px;
    }

    .broker-list {
        padding: 0 16px 16px;
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .modal-footer {
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
        flex-shrink: 0;
    }
}

/* ── Portfolio Widget Inline Upgrade ───────────────────────────────────────── */
.portfolio-block {
    background: linear-gradient(135deg, #fff 0%, rgba(0, 184, 148, 0.02) 100%) !important;
}

.pb-content {
    margin-bottom: 20px;
}

.pb-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.pb-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.pb-signup-hint {
    margin: 10px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--finance-primary, #00b894);
    line-height: 1.45;
}

.pb-features {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pb-features--modal {
    margin: 0 0 16px;
}

.pb-features__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.pb-features__item strong {
    color: var(--text-primary);
    font-weight: 700;
}

.pb-features__icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(0, 184, 148, 0.08);
    color: var(--finance-primary, #00b894);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.portfolio-block .pb-action {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.portfolio-register-btn {
    background: var(--finance-primary, #00b894);
    border: none;
    color: #fff;
    height: 48px;
    font-weight: 700;
    border-radius: 14px;
}

.portfolio-register-btn:hover {
    filter: brightness(0.95);
}

.portfolio-connect-preview-btn {
    font-size: 13px;
    font-weight: 600;
}

.portfolio-modal-register {
    padding: 0 24px 8px;
}

.portfolio-modal-register-lead {
    max-width: 100% !important;
}

.portfolio-modal-register-note {
    margin: 12px 0 0;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.45;
}

.portfolio-modal-secure {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #10b981;
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portfolio-modal-footer-hint {
    margin: 10px 0 0 !important;
    font-size: 12px;
}

.broker-list--locked .broker-item {
    opacity: 0.72;
    cursor: default;
    pointer-events: none;
}

.broker-list--locked .broker-item:hover {
    transform: none;
    border-color: var(--border-light);
    box-shadow: none;
}

.pb-action .btn-outline {
    background: #fff;
    border: 1px solid var(--border-light);
    height: 48px;
    font-weight: 700;
    border-radius: 14px;
    transition: all 0.2s ease;
}

.pb-action .btn-outline:hover {
    border-color: var(--finance-primary, #00b894);
    background: rgba(0, 184, 148, 0.02);
    color: var(--finance-primary, #00b894);
}


/* ── Finance Detail Pages (Commodities/Currencies/Forex) ─────────────────── */

.finance-detail-container {
    padding: 0;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.finance-detail-content {
    padding: 0 40px 60px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.finance-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.finance-main-col {
    min-width: 0;
    max-width: 100%;
}

.finance-sidebar-col {
    min-width: 0;
    max-width: 100%;
}

#finance-top-assets-container {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

@media (max-width: 992px) {
    .finance-columns {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.finance-detail-header {
    background: var(--bg-main);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 24px;
}

/* In-page anchors (/finance#...) clear sticky finance header + mobile bar */
.finance-in-page-target {
    scroll-margin-top: clamp(100px, 18vh, 160px);
}

a.finance-section-anchor {
    color: inherit;
    text-decoration: none;
    font: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}

a.finance-section-anchor:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

a.finance-section-anchor:focus-visible {
    outline: 2px solid var(--finance-primary, #00b894);
    outline-offset: 3px;
    border-radius: 3px;
}

.finance-detail-header-inner {
    padding: 32px 40px 24px;
}

.finance-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

/* Page titles: same typography as /finance (Masoko) hub — category-header + description */
.category-view.finance-view .category-header.finance-theme h1,
.finance-detail-header .finance-title-row > .finance-title-group h1 {
    font-family: var(--font-brand);
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0 0 8px 0;
    line-height: 1.15;
}

.finance-detail-header .finance-title-row > .finance-title-group h1 .finance-h1-bank {
    font-weight: 600;
    font-size: 0.78em;
    color: var(--text-secondary);
    letter-spacing: 0;
}

.category-view.finance-view .category-header.finance-theme .category-description,
.finance-detail-header .finance-title-row > .finance-title-group p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ── Modern Inline Sub-Navigation (Texts not Chips) ─────────────────────── */
.finance-nav-container {
    min-width: 0;
    max-width: 100%;
}

.finance-nav-layout {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    margin-top: 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.finance-nav {
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: nowrap;
}

.finance-nav.desktop-nav {
    min-width: 0;
    flex: 1 1 auto;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 2px;
}

.finance-nav.desktop-nav::-webkit-scrollbar {
    height: 4px;
}

.finance-nav.desktop-nav::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

.finance-nav-item {
    padding: 6px 0;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    border-bottom: 2px solid transparent;
}

.finance-nav-item:hover {
    color: var(--text-primary);
}

.finance-nav-item.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
}

.finance-mobile-nav {
    display: none;
}

.header-status-group {
    display: flex;
    flex-direction: column; /* Stack vertically but tight */
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.market-status-simple {
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1;
}

.market-status-simple .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.market-status-simple.open .status-dot { background: #10b981; box-shadow: 0 0 8px rgba(16, 185, 129, 0.4); }
.market-status-simple.closed .status-dot { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }

.market-status-simple .status-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.market-status-simple .status-market {
    font-size: 10px;
    color: var(--text-tertiary);
    font-weight: 500;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .finance-nav-layout {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        margin-top: 5px;
    }

    .finance-nav.desktop-nav {
        display: none !important;
    }

    .finance-mobile-nav {
        display: block !important;
        flex: 1 1 auto;
        min-width: 0;
    }

    .header-status-group {
        flex: 0 0 auto;
        gap: 12px;
    }

    .market-status-simple {
        display: none !important; /* Hide market status on mobile as requested */
    }

    .sentiment-widget {
        min-width: unset;
        align-items: flex-end;
    }

    .sentiment-bars, 
    .sentiment-meta {
        display: none !important; /* Hide bars and date on mobile for clean look */
    }

    .sentiment-label {
        font-size: 12px;
        white-space: nowrap;
    }
}


/* ── Glass Data Cards ────────────────────────────────────────────────────── */
/* Sticky right column on /finance/assets/<symbol> when asset resolves (DSE movers + Forex widgets stay visible) */
.finance-columns.finance-columns-sticky-sidebar {
    align-items: start;
}

.finance-columns.finance-columns-sticky-sidebar .finance-sidebar-col {
    position: sticky;
    top: 100px;
    align-self: start;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    z-index: 5;
}

@media (max-width: 992px) {
    .finance-columns.finance-columns-sticky-sidebar .finance-sidebar-col {
        position: static;
        max-height: none;
        overflow-y: visible;
    }
}

.glass-data-card {
    background: rgba(var(--bg-light-rgb, 255, 255, 255), 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: 28px;
    box-shadow: 
        0 1px 3px rgba(0,0,0,0.05),
        0 10px 40px -10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    margin-bottom: 30px;
}

.card-header-premium {
    padding: 24px 24px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title-premium {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Commodities page: header controls (date + search) */
.commodities-controls {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.commodities-control {
    width: 100%;
}

.commodities-control--date {
    flex: 0 0 220px;
    max-width: 220px;
}

.commodities-control--search {
    flex: 0 1 350px;
    max-width: 350px;
}

/* ── Refined Input Styling (Magic Bar Look) ────────────────────────────── */
.premium-search-container {
    padding: 16px 24px 24px;
}

.premium-search-input-wrapper {
    position: relative;
    max-width: 100%;
}

.premium-search-input {
    width: 100%;
    height: 54px;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.premium-search-input:focus {
    outline: none;
    border-color: var(--finance-primary, #00b894);
    box-shadow: 0 0 0 4px rgba(0, 184, 148, 0.1), 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ── Refined Table Styling ────────────────────────────────────────────────── */
.premium-table-wrapper {
    position: relative;
    padding-top: 5px;
}

.glass-data-card .premium-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Fix for loading overlap */
.loading-indicator {
    position: absolute;
    top: 60px; /* Below the search bar area */
    left: 0;
    width: 100%;
    z-index: 5;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    display: none; /* Controlled by JS */
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-bottom: 1px solid var(--border-light);
}

.loading-indicator p {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--finance-primary, #00b894);
}

.commodity-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.commodity-table thead th {
    background: rgba(var(--bg-light-rgb, 255, 255, 255), 0.9);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
    text-align: left;
    padding: 16px 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-light);
}

.commodity-table tbody td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14.5px;
    color: var(--text-primary);
    vertical-align: middle;
}

.commodity-row:hover {
    background: rgba(var(--bg-light-rgb, 255, 255, 255), 1);
    box-shadow: inset 0 0 20px rgba(0,0,0,0.02);
}

.commodity-row.selected {
    background: rgba(var(--finance-primary-alpha, 0, 184, 148, 0.05));
}

.commodity-row:last-child td {
    border-bottom: none;
}

/* Sparklines cell refinement */
.col-trend {
    min-width: 140px;
}

.sparkline-container {
    height: 44px;
    width: 100%;
}

/* ── Specific Overrides for Currencies ─────────────────────────────────── */
.bank-col { text-align: center !important; }
.bank-sub { font-size: 10px !important; opacity: 0.7; }
.rate-cell { font-family: var(--font-brand); font-weight: 700; color: var(--text-primary); }

/* Keep the currency ("Fedha") column pinned while scrolling bank rates horizontally */
.premium-table-wrapper .currencies-table {
    border-collapse: separate;
    border-spacing: 0;
}

.premium-table-wrapper .currencies-table thead th.col-name,
.premium-table-wrapper .currencies-table tbody td.col-name {
    position: sticky;
    left: 0;
    z-index: 6;
    background: rgba(var(--bg-light-rgb, 255, 255, 255), 0.98);
    box-shadow: 12px 0 14px -16px rgba(0, 0, 0, 0.22);
}

.premium-table-wrapper .currencies-table thead th.col-name {
    z-index: 14;
}

.premium-table-wrapper .currencies-table thead th.col-name::after,
.premium-table-wrapper .currencies-table tbody td.col-name::after {
    content: '';
    position: absolute;
    top: 0;
    right: -1px;
    width: 1px;
    height: 100%;
    background: var(--border-light);
}

@media (max-width: 768px) {
    .finance-detail-header-inner { padding: 24px 20px 16px; }
    .finance-detail-content { padding: 0 16px 40px; }
    .category-view.finance-view .category-header.finance-theme h1,
    .finance-detail-header .finance-title-row > .finance-title-group h1 {
        font-size: 24px;
    }
    .category-view.finance-view .category-header.finance-theme .category-description,
    .finance-detail-header .finance-title-row > .finance-title-group p {
        font-size: 14px;
    }

    .card-header-premium {
        padding: 18px 16px 12px;
        gap: 12px;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .premium-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .premium-table-wrapper table {
        min-width: 640px;
    }

    .commodity-table thead th,
    .commodity-table tbody td {
        padding-left: 14px;
        padding-right: 14px;
    }

    .commodities-controls {
        width: 100%;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .commodities-control--date {
        flex: 1 1 180px;
        max-width: none;
    }

    .commodities-control--search {
        flex: 2 1 260px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .finance-detail-content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .finance-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .finance-nav::-webkit-scrollbar {
        display: none;
    }

    .table-date-selector {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .premium-table-wrapper table {
        min-width: 700px;
    }

    .commodities-controls {
        flex-direction: column;
        gap: 10px;
    }

    .commodities-control--date,
    .commodities-control--search {
        flex: 0 0 auto;
        max-width: none;
        width: 100%;
    }
}
