/*
 * TOE Energy Dashboard — public styles
 * All values use theme CSS variables where possible.
 * Fonts (Manrope, Orbitron) are enqueued by the Spiel theme; do not re-declare.
 *
 * Grid markup uses wp-block-post-template / is-layout-grid / columns-N classes so
 * WordPress's own layout CSS applies. Plugin CSS here is the authoritative fallback
 * and for plugin-specific overrides only.
 */

/* ── Dashboard wrapper ───────────────────────────────────────── */

.toe-energy-dashboard {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    margin-inline: auto;
    padding-inline: var(--wp--preset--spacing--60);
    padding-block: var(--wp--preset--spacing--60);
    font-family: Manrope, sans-serif;
    font-weight: 500;
    font-size: var(--wp--preset--font-size--medium);
    letter-spacing: -0.005em;
    line-height: 1.4;
    color: var(--wp--preset--color--contrast);
}

/* ── Header ─────────────────────────────────────────────────── */

.toe-energy-dashboard__header {
    margin-block-end: var(--wp--preset--spacing--40);
}

.toe-energy-dashboard__greeting {
    font-family: Orbitron, sans-serif;
    font-size: var(--wp--preset--font-size--x-large);
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

/* ── Sections container ──────────────────────────────────────── */

.toe-energy-dashboard__sections {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Sections vertical scroller ─────────────────────────────── */

/* Viewport is a plain wrapper — no height/overflow constraints.
   JS auto-scrolls the page to bring sections under the sticky ticker. */

/* ── Section (category group) ────────────────────────────────── */

.toe-energy-dashboard__section {
    display: flex;
    flex-direction: column;
}

.toe-energy-dashboard__section-header {
    border-bottom: 3px solid var(--wp--preset--color--contrast);
    margin-block-end: var(--wp--preset--spacing--30);
    padding-block-end: var(--wp--preset--spacing--20);
}

.toe-energy-dashboard__section-label {
    font-family: Manrope, sans-serif;
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
    margin: 0 !important;
}

/* Override theme heading margins — WP generates high-specificity rules
   from theme.json core/post-content elements.heading */
.toe-energy-dashboard h2,
.toe-energy-dashboard h3,
.toe-energy-dashboard h4,
.toe-energy-dashboard :where(h2),
.toe-energy-dashboard :where(h3),
.toe-energy-dashboard :where(h4),
.entry-content .toe-energy-dashboard h2,
.entry-content .toe-energy-dashboard h3,
.entry-content .toe-energy-dashboard h4,
.wp-block-post-content .toe-energy-dashboard h2,
.wp-block-post-content .toe-energy-dashboard h3,
.wp-block-post-content .toe-energy-dashboard h4 {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
}

/* ── 4-column post grid ──────────────────────────────────────── */

.toe-energy-dashboard__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
    gap: var(--wp--preset--spacing--30);
    align-items: stretch;
}

@media (max-width: 1024px) {
    .toe-energy-dashboard__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .toe-energy-dashboard__grid {
        grid-template-columns: 1fr;
    }
}

/* ── Card (list item) ────────────────────────────────────────── */

.toe-energy-dashboard__card {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--20);
    border: 1px solid var(--wp--preset--color--secondary);
    padding: 0.4rem 1rem 0.5rem !important;
    word-break: normal;
    overflow-wrap: anywhere;
    height: 100%;
    min-height: 0;
    min-width: 0;
    box-sizing: border-box;
}

/* Reset any inherited margins/padding on card children */
.toe-energy-dashboard__card > * {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    min-width: 0;
}

.toe-energy-dashboard__card--span-2 {
    grid-column: span 2;
}

.toe-energy-dashboard__card--span-4 {
    grid-column: 1 / -1;
}

.toe-energy-dashboard__card--error {
    border-style: dashed;
}

.toe-energy-dashboard__card-source {
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--wp--preset--color--primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toe-energy-dashboard__card-title {
    font-family: Manrope, sans-serif;
    font-size: var(--wp--preset--font-size--medium);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 !important;
    flex-grow: 1;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
    max-width: 100%;
}

.toe-energy-dashboard__card-title a {
    color: var(--wp--preset--color--contrast);
    text-decoration: none;
}

.toe-energy-dashboard__card-title a:hover,
.toe-energy-dashboard__card-title a:focus-visible {
    color: var(--wp--preset--color--primary);
}

.toe-energy-dashboard__card-byline {
    font-size: var(--wp--preset--font-size--x-small);
    color: var(--wp--preset--color--tertiary);
    margin: 0;
    margin-block-start: auto;
}

/* ── Meta / muted text ──────────────────────────────────────── */

.toe-energy-dashboard__meta {
    font-size: var(--wp--preset--font-size--x-small);
    color: var(--wp--preset--color--tertiary);
    margin: 0;
}

/* ── Buttons ────────────────────────────────────────────────── */

.toe-energy-dashboard__btn {
    display: inline-block;
    background-color: var(--wp--preset--color--contrast);
    color: var(--wp--preset--color--base);
    font-family: Manrope, sans-serif;
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 1.0625rem 2.125rem;
    cursor: pointer;
    border: none;
    transition: background-color 0.15s ease;
}

.toe-energy-dashboard__btn:hover,
.toe-energy-dashboard__btn:focus-visible {
    background-color: var(--wp--preset--color--primary);
    outline: 1px dotted var(--wp--preset--color--primary);
    outline-offset: 2px;
}

/* ── Live Ticker ───────────────────────────────────────────── */

.toe-energy-dashboard__ticker-section {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--wp--preset--color--base, #ffffff);
    margin-block-end: 0;
    padding-block-end: 0.5rem;
}

.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__ticker-section {
    background: #111318;
}

@media (prefers-color-scheme: dark) {
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__ticker-section {
        background: #111318;
    }
}

.toe-energy-dashboard__ticker {
    background: #0a0e17;
    border: 1px solid #1e2330;
    border-radius: 2px;
    margin-block-start: var(--wp--preset--spacing--30);
    font-family: Manrope, sans-serif;
    max-width: 100%;
}

.toe-energy-dashboard__ticker--error {
    padding: 0.625rem 1rem;
}

/* Each layer is a horizontal row: pinned label + scrolling track */
.toe-energy-dashboard__ticker-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #1e2330;
}

.toe-energy-dashboard__ticker-row:last-child {
    border-bottom: none;
}

/* Pinned category label on the left */
.toe-energy-dashboard__ticker-label {
    flex-shrink: 0;
    width: 9rem;
    padding: 0.15rem 0.5rem;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    background: #0d1119;
    border-right: 1px solid #1e2330;
    text-align: center;
    line-height: 1.3;
}

.toe-energy-dashboard__ticker-header {
    display: flex;
    align-items: baseline;
    gap: var(--wp--preset--spacing--40);
}

.toe-energy-dashboard__ticker-attr {
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 500;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--wp--preset--color--tertiary, #757575);
    margin-left: auto;
}

/* Scrolling area — overflow hidden with fade edges */
.toe-energy-dashboard__ticker-scroll {
    flex: 1;
    overflow: hidden !important;
    position: relative;
    padding-block: 0.15rem;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.toe-energy-dashboard__ticker-scroll::before,
.toe-energy-dashboard__ticker-scroll::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3rem;
    z-index: 2;
    pointer-events: none;
}
.toe-energy-dashboard__ticker-scroll::before {
    left: 0;
    background: linear-gradient(to right, #0a0e17, transparent);
}
.toe-energy-dashboard__ticker-scroll::after {
    right: 0;
    background: linear-gradient(to left, #0a0e17, transparent);
}

.toe-energy-dashboard__ticker-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 2.5rem;
    white-space: nowrap;
    -webkit-animation: toe-ticker-scroll 60s linear infinite;
    animation: toe-ticker-scroll 60s linear infinite;
    width: max-content;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    will-change: transform;
}

.toe-energy-dashboard__ticker:hover .toe-energy-dashboard__ticker-track {
    -webkit-animation-play-state: paused;
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .toe-energy-dashboard__ticker-track {
        animation: none;
        overflow-x: auto;
    }
}

@-webkit-keyframes toe-ticker-scroll {
    0%   { -webkit-transform: translateX(0); transform: translateX(0); }
    100% { -webkit-transform: translateX(-50%); transform: translateX(-50%); }
}
@keyframes toe-ticker-scroll {
    0%   { -webkit-transform: translateX(0); transform: translateX(0); }
    100% { -webkit-transform: translateX(-50%); transform: translateX(-50%); }
}

.toe-energy-dashboard__ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    font-size: var(--wp--preset--font-size--medium);
    line-height: 1;
}

.toe-energy-dashboard__ticker-name {
    color: #f0a500;
    font-weight: 700;
    text-transform: uppercase;
    font-size: var(--wp--preset--font-size--small);
    letter-spacing: 0.04em;
}

.toe-energy-dashboard__ticker-price {
    color: #e2e8f0;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.toe-energy-dashboard__ticker-change {
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.toe-energy-dashboard__ticker-change--up {
    color: #00c853;
}

.toe-energy-dashboard__ticker-change--down {
    color: #ff1744;
}

.toe-energy-dashboard__ticker-change--flat {
    color: #6b7280;
}

/* Responsive: stack label above track on narrow screens */
@media (max-width: 600px) {
    .toe-energy-dashboard__ticker-row {
        flex-direction: column;
        align-items: stretch;
    }
    .toe-energy-dashboard__ticker-label {
        width: auto;
        border-right: none;
        border-bottom: 1px solid #1e2330;
        text-align: left;
        padding: 0.4rem 0.75rem;
    }
}



/* ── Oil Prices ─────────────────────────────────────────────── */

.toe-oil-prices__card .toe-energy-dashboard__card-title {
    flex-grow: 0;
}

.toe-oil-prices__value {
    font-family: Orbitron, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--wp--preset--color--contrast);
    letter-spacing: -0.02em;
    margin: var(--wp--preset--spacing--20) 0;
}

.toe-oil-prices__currency {
    font-size: 1rem;
    font-weight: 600;
    vertical-align: super;
    margin-inline-end: 0.1em;
    color: var(--wp--preset--color--primary);
}

.toe-energy-dashboard__card-excerpt {
    font-size: var(--wp--preset--font-size--x-small);
    margin: 0;
}

/* ── Spot Prices ───────────────────────────────────────────── */

.toe-spot-prices__card .toe-energy-dashboard__card-title {
    flex-grow: 0;
}

.toe-spot-prices__change {
    font-family: Manrope, sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    margin: 0;
    line-height: 1;
}

.toe-spot-prices__change--up {
    color: #00c853;
}

.toe-spot-prices__change--down {
    color: #ff1744;
}

.toe-spot-prices__change--flat {
    color: var(--wp--preset--color--tertiary);
}

.toe-spot-prices__sparkline,
.toe-oil-prices__sparkline {
    margin: var(--wp--preset--spacing--20) 0;
    line-height: 0;
}

.toe-sparkline {
    display: block;
    width: 100%;
    height: 32px;
}

/* ── Futures Curve ──────────────────────────────────────────── */

.toe-futures__header {
    display: flex;
    align-items: baseline;
    gap: var(--wp--preset--spacing--40);
}

.toe-futures__attr {
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--wp--preset--color--tertiary, #757575);
    margin-left: auto;
}

.toe-futures__rows {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.toe-futures__row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--wp--preset--color--secondary, #2e2e2e);
}

.toe-futures__row:last-child {
    border-bottom: none;
}

.toe-futures__commodity-label {
    flex-shrink: 0;
    width: 11rem;
    padding: 0.6rem 0.75rem;
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
}

.toe-futures__scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Right fade edge to signal more content */
.toe-futures__row::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 3rem;
    pointer-events: none;
    z-index: 1;
}

.toe-futures__row {
    position: relative;
}

.toe-futures__contracts {
    display: flex;
    gap: 0;
    padding: 0.4rem 0;
    width: max-content;
}

.toe-futures__cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.3rem 0.75rem;
    min-width: 4.5rem;
    opacity: 0.7;
    border-left: 2px solid transparent;
}

.toe-futures__cell--front {
    opacity: 1;
}

.toe-futures__month {
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.toe-futures__change {
    font-size: 0.65rem;
    margin-left: 0.15em;
}

.toe-futures__change--up {
    color: #00c853;
}

.toe-futures__change--down {
    color: #ff1744;
}

.toe-futures__change--flat {
    color: var(--wp--preset--color--tertiary);
}

.toe-futures__price {
    font-family: Orbitron, sans-serif;
    font-size: var(--wp--preset--font-size--small);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.toe-futures__unit {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--wp--preset--color--tertiary, #757575);
}

.toe-futures__through {
    display: flex;
    align-items: center;
    padding: 0.3rem 0.75rem;
    font-size: var(--wp--preset--font-size--x-small);
    color: var(--wp--preset--color--tertiary, #757575);
    white-space: nowrap;
    font-style: italic;
}

/* Mobile: narrower label, show front + 2 initially */
@media (max-width: 600px) {
    .toe-futures__commodity-label {
        width: 6rem;
        font-size: 0.7rem;
        padding: 0.4rem 0.5rem;
    }
    .toe-futures__cell {
        min-width: 4rem;
        padding: 0.3rem 0.5rem;
    }
}

/* ── US Energy Map ─────────────────────────────────────────── */

.toe-map__header {
    display: flex;
    align-items: baseline;
    gap: var(--wp--preset--spacing--40);
}

.toe-map__attr {
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--wp--preset--color--tertiary, #757575);
    margin-left: auto;
}

.toe-map__container {
    display: flex;
    flex-direction: column;
    gap: var(--wp--preset--spacing--30);
}

.toe-map__canvas {
    width: 100%;
    height: 840px;
    border-radius: 4px;
    z-index: 1;
}

.toe-map__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--40);
    font-size: var(--wp--preset--font-size--x-small);
    color: var(--wp--preset--color--tertiary, #757575);
}

.toe-map__legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}

.toe-map__legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Leaflet tooltip override */
.toe-map__tooltip {
    font-family: Manrope, sans-serif;
    font-size: var(--wp--preset--font-size--x-small);
    font-weight: 600;
    background: #1a1d24;
    color: #e2e8f0;
    border: 1px solid #2a2d34;
    border-radius: 4px;
    padding: 0.35rem 0.6rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.toe-map__tooltip strong {
    color: #f0a500;
}

/* Override Leaflet default tooltip arrow */
.leaflet-tooltip.toe-map__tooltip::before {
    border-top-color: #1a1d24;
}

/* Leaflet popup override — dark theme */
.toe-map__popup .leaflet-popup-content-wrapper {
    background: #1a1d24;
    color: #e0e0e0;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
    font-family: Manrope, sans-serif;
    font-size: var(--wp--preset--font-size--x-small);
}

.toe-map__popup .leaflet-popup-tip {
    background: #1a1d24;
}

.toe-map__popup .leaflet-popup-close-button {
    color: #888;
    font-size: 16px;
}

.toe-map__popup .leaflet-popup-close-button:hover {
    color: #fff;
}

.toe-map__popup-content {
    line-height: 1.5;
}

.toe-map__popup-title {
    display: block;
    color: #f0a500;
    font-weight: 700;
    margin-bottom: 4px;
    font-size: var(--wp--preset--font-size--small);
}

.toe-map__popup-row {
    margin-bottom: 1px;
}

.toe-map__popup-label {
    color: #888;
}

.toe-map__popup-value {
    color: #e0e0e0;
}

/* Override Leaflet layer control for dark theme */
.toe-map__canvas .leaflet-control-layers {
    background: #1a1d24;
    border: 1px solid #2a2d34;
    border-radius: 4px;
    color: #e2e8f0;
    font-family: Manrope, sans-serif;
    font-size: var(--wp--preset--font-size--x-small);
}

.toe-map__canvas .leaflet-control-layers-separator {
    border-top-color: #2a2d34;
}

.toe-map__canvas .leaflet-control-layers label {
    color: #e2e8f0;
}

/* Override Leaflet zoom control for dark theme */
.toe-map__canvas .leaflet-control-zoom a {
    background: #1a1d24;
    color: #e2e8f0;
    border-color: #2a2d34;
}

.toe-map__canvas .leaflet-control-zoom a:hover {
    background: #2a2d34;
}

/* Override Leaflet attribution for dark theme */
.toe-map__canvas .leaflet-control-attribution {
    font-size: 0.6rem;
    background: rgba(10, 14, 23, 0.75);
    color: #6b7280;
}

.toe-map__canvas .leaflet-control-attribution a {
    color: #6b7280;
}

/* Pop-out fullscreen button */
.toe-map-popout__btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 30px !important;
    height: 30px !important;
    background: #1a1d24 !important;
    color: #e2e8f0 !important;
    border-color: #2a2d34 !important;
    line-height: 30px !important;
    text-decoration: none !important;
}

.toe-map-popout__btn:hover {
    background: #2a2d34 !important;
    color: #f0a500 !important;
}

/* Export layer data control */
.toe-map-export__btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 30px !important;
    height: 30px !important;
    background: #1a1d24 !important;
    color: #e2e8f0 !important;
    border-color: #2a2d34 !important;
    line-height: 30px !important;
    text-decoration: none !important;
    cursor: pointer;
}

.toe-map-export__btn:hover {
    background: #2a2d34 !important;
    color: #f0a500 !important;
}

.toe-map-export__menu {
    position: absolute;
    top: 0;
    left: 36px;
    background: #0d1017;
    border: 1px solid #3a3f4b;
    border-radius: 6px;
    min-width: 240px;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
    padding: 4px 0;
}

.toe-map-export__menu::before {
    content: 'Export CSV';
    display: block;
    padding: 6px 12px 4px;
    color: #f0a500;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #2a2d34;
    margin-bottom: 2px;
}

.toe-map-export__item,
.toe-map-export__item:link,
.toe-map-export__item:visited,
.toe-map-export__item:active {
    display: block;
    padding: 7px 12px;
    color: #e2e8f0 !important;
    text-decoration: none !important;
    font-family: Manrope, sans-serif;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.4;
    background: transparent;
}

.toe-map-export__item:hover {
    background: #1a1d24 !important;
    color: #f0a500 !important;
}

@media (max-width: 600px) {
    .toe-map__canvas {
        height: 560px;
    }
    .toe-map__legend {
        gap: var(--wp--preset--spacing--20) var(--wp--preset--spacing--30);
    }
}

/* ── Market Indicators ──────────────────────────────────────── */

.toe-market-indicators__card .toe-energy-dashboard__card-title {
    flex-grow: 0;
}

.toe-market-indicators__value {
    font-family: Orbitron, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--wp--preset--color--contrast);
    letter-spacing: -0.02em;
    margin: var(--wp--preset--spacing--20) 0;
}

.toe-market-indicators__units {
    font-family: Manrope, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-inline-start: 0.25em;
    vertical-align: middle;
    color: var(--wp--preset--color--tertiary);
}

/* ── Drilling Intelligence ─────────────────────────────────── */

.toe-drilling__card .toe-energy-dashboard__card-title {
    flex-grow: 0;
}

.toe-drilling__value {
    font-family: Orbitron, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--wp--preset--color--contrast);
    letter-spacing: -0.02em;
    margin: var(--wp--preset--spacing--20) 0;
}

.toe-drilling__units {
    font-family: Manrope, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-inline-start: 0.25em;
    vertical-align: middle;
    color: var(--wp--preset--color--tertiary);
}

/* ── Storage ──────────────────────────────────────────────── */

.toe-storage__card .toe-energy-dashboard__card-title {
    flex-grow: 0;
}

.toe-storage__value {
    font-family: Orbitron, sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--wp--preset--color--contrast);
    letter-spacing: -0.02em;
    margin: var(--wp--preset--spacing--20) 0;
}

.toe-storage__units {
    font-family: Manrope, sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    margin-inline-start: 0.25em;
    vertical-align: middle;
    color: var(--wp--preset--color--tertiary);
}

/* ── News Feed ──────────────────────────────────────────────── */

.toe-news-feed__card .toe-energy-dashboard__card-byline {
    margin-top: auto !important;
}

.toe-news-feed__headline {
    color: inherit;
    text-decoration: none;
    display: inline;
    margin: 0 !important;
    padding: 0 !important;
}

.toe-news-feed__headline:hover,
.toe-news-feed__headline:focus-visible {
    color: var(--wp--preset--color--primary);
}

/* ── Dark theme (Bloomberg terminal) ────────────────────────── */

.toe-energy-dashboard[data-scheme="dark"] {
    background: #111318;
    color: #e2e8f0;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__section-header {
    border-bottom: 2px solid #f0a500;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__section-label {
    color: #ffffff;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__card {
    background: #1a1d24;
    border: 1px solid #2a2d34;
    box-shadow: 0 2px 12px rgba(0,0,0,0.5);
    border-radius: 4px;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-oil-prices__card {
    border-top: 2px solid #f0a500;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-spot-prices__card {
    border-top: 2px solid #00b4d8;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-spot-prices__card .toe-energy-dashboard__card-title {
    color: #ffffff;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-spot-prices__card .toe-oil-prices__currency {
    color: #f0a500;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-spot-prices__card .toe-oil-prices__value {
    color: #f0a500;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-news-feed__card {
    border-top: 2px solid #00b4d8;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__card-source {
    color: #00b4d8;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-oil-prices__card .toe-energy-dashboard__card-title {
    color: #ffffff;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-news-feed__card .toe-energy-dashboard__card-title {
    color: #e2e8f0;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__card-title a {
    color: #e2e8f0;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__card-title a:hover,
.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__card-title a:focus-visible {
    color: #00b4d8;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__card-byline,
.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__meta,
.toe-energy-dashboard[data-scheme="dark"] .toe-energy-dashboard__card-excerpt {
    color: #6b7280;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-oil-prices__value {
    color: #f0a500;
    font-size: 1.5rem;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-oil-prices__currency {
    color: #f0a500;
    font-size: 1rem;
}
/* Futures — dark */
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__commodity-label {
    color: #f0a500;
    background: #0d1119;
    border-right: 1px solid #1e2330;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__row {
    border-bottom-color: #1e2330;
    background: #1a1d24;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__cell--front {
    border-left-color: #f0a500;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__month {
    color: #e2e8f0;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__price {
    color: #e2e8f0;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__cell--front .toe-futures__price {
    color: #f0a500;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__unit {
    color: #6b7280;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__through {
    color: #6b7280;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__attr {
    color: #6b7280;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__row::after {
    background: linear-gradient(to left, #1a1d24, transparent);
}
.toe-energy-dashboard[data-scheme="dark"] .toe-futures__scroll {
    scrollbar-color: #2a2d34 transparent;
}

/* Map — dark */
.toe-energy-dashboard[data-scheme="dark"] .toe-map__canvas {
    border: 1px solid #2a2d34;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-map__attr {
    color: #6b7280;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-map__legend {
    color: #6b7280;
}

.toe-energy-dashboard[data-scheme="dark"] .toe-market-indicators__card {
    border-top: 2px solid #34d399;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-market-indicators__card .toe-energy-dashboard__card-title {
    color: #ffffff;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-market-indicators__value {
    color: #34d399;
    font-size: 1.5rem;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-market-indicators__value--up {
    color: #34d399;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-market-indicators__value--down {
    color: #f87171;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-market-indicators__units {
    color: #6b7280;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-drilling__card {
    border-top: 2px solid #fb923c;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-drilling__card .toe-energy-dashboard__card-title {
    color: #ffffff;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-drilling__value {
    color: #fb923c;
    font-size: 1.5rem;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-drilling__units {
    color: #6b7280;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-storage__card {
    border-top: 2px solid #60a5fa;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-storage__card .toe-energy-dashboard__card-title {
    color: #ffffff;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-storage__value {
    color: #60a5fa;
    font-size: 1.5rem;
}
.toe-energy-dashboard[data-scheme="dark"] .toe-storage__units {
    color: #6b7280;
}

/* ── Auto scheme — dark overrides follow OS preference ───────── */

@media (prefers-color-scheme: dark) {
    .toe-energy-dashboard[data-scheme="auto"] { background: #111318; color: #e2e8f0; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__section-header { border-bottom: 2px solid #f0a500; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__section-label { color: #ffffff; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__card { background: #1a1d24; border: 1px solid #2a2d34; box-shadow: 0 2px 12px rgba(0,0,0,0.5); border-radius: 4px; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-oil-prices__card { border-top: 2px solid #f0a500; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-market-indicators__card { border-top: 2px solid #34d399; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-spot-prices__card { border-top: 2px solid #00b4d8; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-spot-prices__card .toe-energy-dashboard__card-title { color: #ffffff; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-spot-prices__card .toe-oil-prices__currency { color: #f0a500; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-spot-prices__card .toe-oil-prices__value { color: #f0a500; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-news-feed__card { border-top: 2px solid #00b4d8; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__card-source { color: #00b4d8; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-oil-prices__card .toe-energy-dashboard__card-title { color: #ffffff; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-market-indicators__card .toe-energy-dashboard__card-title { color: #ffffff; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-news-feed__card .toe-energy-dashboard__card-title { color: #e2e8f0; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__card-title a { color: #e2e8f0; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__card-title a:hover,
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__card-title a:focus-visible { color: #00b4d8; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__card-byline,
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__meta,
    .toe-energy-dashboard[data-scheme="auto"] .toe-energy-dashboard__card-excerpt { color: #6b7280; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-oil-prices__value { color: #f0a500; font-size: 1.5rem; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-oil-prices__currency { color: #f0a500; font-size: 1rem; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-market-indicators__value { color: #34d399; font-size: 1.5rem; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-market-indicators__value--up { color: #34d399; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-market-indicators__value--down { color: #f87171; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-market-indicators__units { color: #6b7280; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-drilling__card { border-top: 2px solid #fb923c; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-drilling__card .toe-energy-dashboard__card-title { color: #ffffff; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-drilling__value { color: #fb923c; font-size: 1.5rem; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-drilling__units { color: #6b7280; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-storage__card { border-top: 2px solid #60a5fa; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-storage__card .toe-energy-dashboard__card-title { color: #ffffff; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-storage__value { color: #60a5fa; font-size: 1.5rem; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-storage__units { color: #6b7280; }
    /* Map — auto dark */
    .toe-energy-dashboard[data-scheme="auto"] .toe-map__canvas { border: 1px solid #2a2d34; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-map__attr { color: #6b7280; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-map__legend { color: #6b7280; }
    /* Futures — auto dark */
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__commodity-label { color: #f0a500; background: #0d1119; border-right: 1px solid #1e2330; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__row { border-bottom-color: #1e2330; background: #1a1d24; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__cell--front { border-left-color: #f0a500; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__month { color: #e2e8f0; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__price { color: #e2e8f0; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__cell--front .toe-futures__price { color: #f0a500; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__unit { color: #6b7280; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__through { color: #6b7280; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__attr { color: #6b7280; }
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__row::after { background: linear-gradient(to left, #1a1d24, transparent); }
    .toe-energy-dashboard[data-scheme="auto"] .toe-futures__scroll { scrollbar-color: #2a2d34 transparent; }
}
