html[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="light"] {
    color-scheme: light;
}

tv-ticker-tape {
    display: block;
    width: 100%;
    height: 40px;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
}

.home-section {
    padding: 1rem;
}

.home-refresh-status {
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(239, 89, 103, 0.35);
    border-radius: 8px;
    background: rgba(239, 89, 103, 0.09);
    color: #ef5967;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

.home-section .card-header {
    padding: 0 0 0.85rem;
}

.home-status-grid,
.home-sentiment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.85rem;
}

.home-sentiment-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.home-rwa-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.home-rwa-grid .home-status-item {
    min-width: 0;
}

.home-rwa-grid[hidden] {
    display: none;
}

.home-rwa-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.home-rwa-toggle {
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

.home-brief-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 0.85rem;
}

.home-status-item,
.home-sentiment-item,
.home-brief-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--control-radius);
}

.home-status-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.home-status-label,
.home-sentiment-label,
.home-brief-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

.home-status-price {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.home-status-change {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.home-status-asof {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.home-status-link {
    margin-top: 0.3rem;
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    width: fit-content;
}

.home-status-link:hover {
    text-decoration: underline;
}

.home-sentiment-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
}

.home-sentiment-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--border-color);
}

.home-sentiment-group-title {
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 750;
    letter-spacing: -0.01em;
}

.home-sentiment-block {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-top: 0.25rem;
}

.home-sentiment-block + .home-sentiment-block {
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--border-color);
}

.home-sentiment-date {
    font-size: 0.66rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.home-sentiment-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.home-sentiment-sub {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.home-fund-change {
    align-self: flex-end;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.home-fg-gauge-wrap {
    --home-gauge-track: #252527;
    --home-gauge-tick: #85858c;
    --home-gauge-ink: #f2f2f3;
    --home-gauge-hub: #1e1e21;
    --home-gauge-tint: 24%;
    width: 100%;
    max-width: 300px;
    margin: auto;
}

[data-theme="light"] .home-fg-gauge-wrap {
    --home-gauge-track: #b8b8be;
    --home-gauge-tick: #8c8c8c;
    --home-gauge-ink: #262626;
    --home-gauge-hub: #ffffff;
    --home-gauge-tint: 22%;
}

.home-fg-gauge {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    font-family: Inter, sans-serif;
}

.home-fg-sector {
    fill: var(--home-gauge-track);
    stroke: transparent;
    stroke-width: .8px;
    transition: fill .45s ease, stroke .45s ease;
}

.home-fg-sector.active {
    fill: color-mix(in srgb, var(--home-sector-color) var(--home-gauge-tint), var(--bg-secondary));
    stroke: var(--home-sector-color);
}

.home-fg-dot { fill: var(--home-gauge-tick); }

.home-fg-sector-label {
    fill: var(--home-gauge-ink);
    font-size: 10px;
    font-weight: 600;
    text-anchor: middle;
    pointer-events: none;
}

.home-fg-tick {
    fill: var(--home-gauge-tick);
    font-size: 10px;
    text-anchor: middle;
    dominant-baseline: central;
}

.home-fg-needle {
    transform-origin: 160px 166px;
    transform: rotate(-90deg);
    transition: transform 1.1s cubic-bezier(.22, 1, .36, 1);
}

.home-fg-needle path { fill: var(--home-gauge-ink); }
.home-fg-hub { fill: var(--home-gauge-hub); }

.home-fg-value {
    fill: var(--home-gauge-ink);
    font-size: 20px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    text-anchor: middle;
    dominant-baseline: central;
    letter-spacing: -.04em;
}

.home-fg-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .5rem;
    margin-top: auto;
}

.home-fg-footer .home-status-link {
    margin-top: 0;
    padding-top: .3rem;
}

.home-fg-status {
    color: var(--text-secondary);
    font-size: .68rem;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .home-fg-sector,
    .home-fg-needle { transition: none; }
}

.home-value-line {
    display: flex;
    align-items: baseline;
    gap: 0.25rem;
}

.home-value-unit {
    color: var(--text-muted);
    font-size: 0.64rem;
    font-weight: 600;
}

.home-investor-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
}

.home-investor-item {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
}

.home-investor-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.home-investor-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.home-sentiment-item > .home-status-link {
    margin-top: auto;
    padding-top: 0.3rem;
}

.home-summary-box {
    margin-top: 0.4rem;
    padding: 0.75rem 0.85rem;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border-color));
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-muted), transparent 70%);
}

.home-summary-heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.55rem;
}

.home-summary-heading h3 {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.home-summary-icon {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: var(--accent-muted);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 800;
}

.home-summary-list {
    display: grid;
    gap: 0.46rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.home-summary-list li {
    position: relative;
    padding-left: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.55;
}

.home-summary-list li::before {
    content: '';
    position: absolute;
    top: 0.55em;
    left: 0;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--accent);
}

#homeBriefSection > .home-status-link {
    display: block;
    margin: 0.5rem 1rem 1rem auto;
}

@media (max-width: 768px) {
    .home-rwa-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .home-status-item-head .badge {
        display: inline-flex;
        flex-shrink: 0;
    }
}

@media (max-width: 1000px) {
    .home-sentiment-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .home-sentiment-grid,
    .home-rwa-grid {
        grid-template-columns: 1fr;
    }
}
