html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

:root {
    --energy-black: #020617;
    --energy-surface: #0B1220;
    --energy-surface-2: #111827;
    --energy-green: #22C55E;
    --energy-green-bright: #4ADE80;
    --energy-gold: #C9A227;
    --energy-text: #E5E7EB;
    --energy-text-muted: #9CA3AF;
    --energy-border: #1F2937;
    --energy-bg-0: #0B0F10;
    --energy-bg-1: #0F1A1C;
    --energy-bg-2: #102426;
    --energy-panel: #0C1420;
    --energy-panel-2: #0A1220;
    --energy-grid: rgba(255,255,255,0.08);
    --energy-grid-soft: rgba(255,255,255,0.05);
    --energy-text-soft: rgba(255,255,255,0.72);
    --energy-text-muted-2: rgba(255,255,255,0.58);
}

body {
    background: var(--energy-black);
    color: var(--energy-text);
}

a,
.mud-link,
.btn-link {
    color: var(--energy-green-bright);
}

a:hover,
.mud-link:hover,
.btn-link:hover {
    color: #86EFAC;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxL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2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

.window-selector {
    transition: box-shadow 200ms ease, transform 200ms ease;
}

.window-selector.pulse {
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.18);
    transform: translateY(-1px);
}

.history-link {
    display: inline-flex !important;
    align-items: center;
    font-weight: 500;
    transition: transform 150ms ease, opacity 150ms ease;
}

.history-link:hover {
    transform: translateX(4px);
    opacity: 0.85;
}

/* Reserve space so charts don't cause layout shift while loading */
.chart-frame {
    min-height: 260px;
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(255,255,255,0.015) 0%, rgba(255,255,255,0) 100%), linear-gradient(135deg, #09111A 0%, #07101D 100%);
    border: 1px dashed rgba(255,255,255,0.08);
}

.chart-container {
    max-width: 100%;
}

.index-main-layout {
    display: block;
}

@media (min-width: 960px) {
    .index-main-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 170px;
        column-gap: 8px;
        align-items: start;
    }

    .index-charts-column {
        min-width: 0;
    }

    .index-rail-column {
        width: 170px;
        justify-self: end;
    }
}

/* --------------------------------------------------
   Global shell
-------------------------------------------------- */

.mud-main-content {
    background: var(--energy-black);
}

.mud-paper {
    border-color: var(--energy-border);
}

/* --------------------------------------------------
   Buttons
-------------------------------------------------- */

.mud-button-root {
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-transform: none;
    transition: all 0.18s ease;
}

.mud-button-filled.mud-button-filled-primary {
    background: linear-gradient(180deg, var(--energy-green-bright) 0%, var(--energy-green) 100%) !important;
    color: #04130A !important;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.28);
}

.mud-button-filled.mud-button-filled-primary:hover {
    filter: brightness(1.04);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.36);
}

.mud-button-text {
    color: var(--energy-text);
}

.mud-button-text:hover {
    background-color: rgba(74, 222, 128, 0.08);
}

.mud-button-outlined {
    border-color: rgba(74, 222, 128, 0.35) !important;
    color: var(--energy-green-bright) !important;
    background: rgba(255,255,255,0.01);
}

.mud-button-outlined:hover {
    border-color: rgba(74, 222, 128, 0.55) !important;
    background: rgba(74, 222, 128, 0.08) !important;
}

/* --------------------------------------------------
   Chips
-------------------------------------------------- */

.mud-chip {
    border-radius: 999px !important;
    font-weight: 500;
    transition: all 0.18s ease;
}

.mud-chip.mud-chip-outlined {
    border-color: rgba(74, 222, 128, 0.25) !important;
    background-color: rgba(255,255,255,0.02) !important;
    color: var(--energy-text) !important;
}

.mud-chip.mud-chip-outlined:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    border-color: rgba(74, 222, 128, 0.45) !important;
    background-color: rgba(74, 222, 128, 0.07) !important;
}

.mud-chip.mud-chip-color-primary {
    background: linear-gradient(180deg, rgba(74,222,128,0.18) 0%, rgba(34,197,94,0.12) 100%) !important;
    color: var(--energy-green-bright) !important;
    border: 1px solid rgba(74, 222, 128, 0.35) !important;
}

.mud-chip.mud-chip-color-tertiary {
    background: rgba(201, 162, 39, 0.10) !important;
    color: #E7C96A !important;
    border: 1px solid rgba(201, 162, 39, 0.35) !important;
}

.mud-chip .mud-link {
    color: inherit !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
}

.mud-chip:hover .mud-link,
.mud-chip:focus-within .mud-link {
    text-decoration: underline !important;
}

.energy-price-chip {
    border-width: 1px !important;
    cursor: pointer;
}

/* --------------------------------------------------
   Tabs
-------------------------------------------------- */

.mud-tabs {
    background: transparent;
}

.mud-tabs-toolbar {
    gap: 0.25rem;
}

.mud-tab {
    min-height: 42px;
    border-radius: 10px 10px 0 0;
    color: var(--energy-text-muted) !important;
    font-weight: 600;
    text-transform: none;
    transition: all 0.18s ease;
}

.mud-tab:hover {
    color: var(--energy-text) !important;
    background: rgba(255,255,255,0.03);
}

.mud-tab.mud-tab-active {
    color: var(--energy-green-bright) !important;
    background: rgba(74, 222, 128, 0.07) !important;
}

.mud-tabs-slider {
    height: 3px !important;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--energy-green) 0%, var(--energy-green-bright) 100%) !important;
}

/* --------------------------------------------------
   Menus / dropdowns
-------------------------------------------------- */

.mud-popover .mud-paper {
    background: var(--energy-surface) !important;
    color: var(--energy-text) !important;
    border: 1px solid var(--energy-border);
    box-shadow: 0 14px 34px rgba(0,0,0,0.35);
}

.mud-list-item {
    border-radius: 8px;
}

.mud-list-item:hover {
    background: rgba(74, 222, 128, 0.08) !important;
}

/* --------------------------------------------------
   Inputs / selects
-------------------------------------------------- */

.mud-input-control .mud-input-outlined-border {
    border-color: rgba(255,255,255,0.12) !important;
}

.mud-input-control:hover .mud-input-outlined-border {
    border-color: rgba(74, 222, 128, 0.30) !important;
}

.mud-input.mud-input-outlined {
    background: rgba(255,255,255,0.015);
}

/* --------------------------------------------------
   Section cards / panels
-------------------------------------------------- */

.energy-panel,
.mud-paper.energy-panel {
    background: linear-gradient(180deg, rgba(17,24,39,0.92) 0%, rgba(11,18,32,0.96) 100%);
    border: 1px solid var(--energy-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    border-radius: 12px !important;
}

.energy-panel .mud-divider {
    border-color: rgba(255,255,255,0.08) !important;
}

.energy-panel .mud-text-secondary {
    color: var(--energy-text-muted) !important;
}

.energy-live-card {
    position: relative;
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.00) 100%), linear-gradient(135deg, var(--energy-panel) 0%, var(--energy-panel-2) 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 8px 24px rgba(0,0,0,0.25);
    border: 1px solid var(--energy-border);
}

.energy-live-card .mud-typography-h4 {
    font-weight: 700;
    letter-spacing: -0.01em;
}

.energy-live-card .apexcharts-canvas {
    max-width: 100%;
}

.energy-filter-box {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    min-height: 32px;
}

.mud-typography-h5 {
    font-weight: 600;
}

.mud-chip-set {
    gap: 6px;
}

.index-charts-column .mud-paper {
    transition: transform 0.15s ease;
}

.index-charts-column .mud-paper:hover {
    transform: translateY(-1px);
}

.live-hero-panel {
    background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.00));
}

.live-price-text {
    letter-spacing: -0.02em;
    line-height: 1.05;
}

.stat-card {
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}

.mud-button-root.back-button {
    transition: transform 0.2s ease;
}

.mud-button-root.back-button:hover {
    transform: translateX(-2px);
}

.section-title {
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: -0.01em;
}

.category-section-title {
    color: rgba(255, 255, 255, 0.94);
    font-weight: 600;
    line-height: 1.2;
}

/* --------------------------------------------------
   Footer
-------------------------------------------------- */

.footer-title {
    color: rgba(255, 255, 255, 0.92);
    font-weight: 600;
}

.footer-subtext {
    color: rgba(255, 255, 255, 0.72);
}

.footer-chip-link {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
}

.footer-legal-link {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal-link:hover {
    color: rgba(255, 255, 255, 1);
}

/* --------------------------------------------------
   App bar
-------------------------------------------------- */

.appbar-energy {
    background: linear-gradient(180deg, rgba(8,18,32,0.98), rgba(10,22,38,0.96));
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(6px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}

.appbar-brand {
    color: rgba(255,255,255,0.94);
}

.appbar-logo {
    display: block;
    margin-right: 10px;
    mix-blend-mode: lighten;
}

.appbar-menu {
    color: rgba(255,255,255,0.88);
}

.appbar-menu:hover {
    color: rgba(255,255,255,1);
}

.appbar-energy .mud-button-root,
.appbar-energy .mud-icon-root,
.appbar-energy .mud-button-label {
    color: rgba(255,255,255,0.88);
}

.appbar-energy .mud-button-root:hover,
.appbar-energy .mud-button-root:hover .mud-icon-root,
.appbar-energy .mud-button-root:hover .mud-button-label {
    color: rgba(255,255,255,1);
}

.appbar-menu-active .mud-button-root,
.appbar-menu-active .mud-button-label,
.appbar-menu-active .mud-icon-root {
    color: rgba(255, 255, 255, 1) !important;
    font-weight: 600;
}

.appbar-menu-active {
    position: relative;
}

.appbar-menu-active::after {
    content: "";
    position: absolute;
    bottom: -6px;
    left: 8px;
    right: 8px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #ff9800, #ff5722);
    opacity: 0.9;
}

.appbar-menu-item-active {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

    .appbar-menu-item-active .mud-list-item-text {
        color: rgba(255, 255, 255, 1) !important;
        font-weight: 600;
    }

/* --------------------------------------------------
   Commodity tiles
-------------------------------------------------- */

.commodity-tile {
    background: linear-gradient(180deg, rgba(20, 28, 44, 0.96), rgba(14, 21, 36, 0.96)) !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.commodity-tile:hover {
    background: linear-gradient(180deg, rgba(28, 38, 58, 0.98), rgba(18, 27, 44, 0.98)) !important;
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
    border-color: rgba(255, 255, 255, 0.14);
    border-left-width: 5px; /* 👈 subtle increase */
}

.commodity-tile__link {
    display: block;
    height: 100%;
    width: 100%;
    color: inherit;
    text-decoration: none;
}

.commodity-tile__link:hover {
    color: inherit;
    text-decoration: none;
}

.commodity-tile__title {
    font-weight: 700;
    line-height: 1.2;
}

.commodity-tile__subtitle {
    color: rgba(255, 255, 255, 0.72);
}

.commodity-tile__chip {
    color: rgba(255, 255, 255, 0.88);
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.03);
    align-self: center;
    margin-top: 0;
}

.commodity-tile__price {
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.05;
    margin-top: 0.25rem;
}

.commodity-tile__sparkline-wrap {
    height: 28px;
    margin-top: 0.2rem;
    margin-bottom: 0.15rem;
}

.commodity-tile__sparkline {
    width: 100%;
    height: 28px;
    display: block;
    opacity: 0.95;
}

.commodity-tile .mud-typography-caption,
.commodity-tile .mud-typography-body2 {
    color: rgba(255, 255, 255, 0.72) !important;
}

.commodity-tile__header-row {
    min-height: 44px;
}

.about-section-title {
    color: rgba(255, 255, 255, 0.94);
    font-weight: 600;
}

.about-section-text {
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.55;
}

.commodity-tile__title-block {
    min-width: 0;
}

.commodity-tile__change {
    font-weight: 600;
    margin-top: 0.15rem;
    line-height: 1.2;
}

.commodity-tile__change--positive {
    color: #4ADE80;
}

.commodity-tile__change--negative {
    color: #F87171;
}

.commodity-tile__change--neutral {
    color: rgba(255, 255, 255, 0.72);
}

.today-live-column {
    width: 100%;
}

.today-right-rail {
    width: 200px;
    max-width: 200px;
}

.today-rail-ad {
    width: 200px;
    height: 600px;
}

@media (max-width: 1279.98px) {
    .today-right-rail {
        width: 100%;
        max-width: none;
    }

    .today-rail-ad {
        width: 100%;
        height: 180px;
    }
}

.today-live-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 24px;
    align-items: start;
}

.today-live-column {
    min-width: 0;
    width: 100%;
}

.today-right-rail-wrap {
    width: 200px;
    justify-self: end;
}

.today-right-rail {
    width: 200px;
    max-width: 200px;
}

.today-rail-ad {
    width: 200px;
    height: 600px;
}

@media (max-width: 1279.98px) {
    .today-live-layout {
        grid-template-columns: 1fr;
    }

    .today-right-rail-wrap,
    .today-right-rail {
        width: 100%;
        max-width: none;
    }

    .today-rail-ad {
        width: 100%;
        height: 180px;
    }
}

.energy-text-primary {
    color: rgba(255,255,255,0.92);
}

.energy-text-secondary {
    color: rgba(255,255,255,0.82);
    line-height: 1.6;
}

.energy-text-link {
    color: #86EFAC;
}

.energy-panel .mud-typography-h6.energy-text-primary,
.energy-panel .mud-typography-body2.energy-text-secondary {
    text-shadow: 0 1px 0 rgba(0,0,0,0.18);
}

.in-content-ad-slot {
    width: 100%;
    min-height: 110px;
    padding: 12px;
    border: 1px dashed rgba(255,255,255,0.10);
    background: linear-gradient(180deg, rgba(255,255,255,0.015) 0%, rgba(255,255,255,0.00) 100%);
}

@media (min-width: 960px) {
    .in-content-ad-slot {
        min-height: 120px;
    }
}

.history-controls-row {
    row-gap: 12px;
}

.history-tabs-compact {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    border-radius: 10px;
    overflow: hidden;
}

.history-tabs-compact .mud-tabs-toolbar {
    width: fit-content;
    max-width: 100%;
    min-height: 36px;
    height: 36px;
}

.history-currency-box {
    white-space: nowrap;
    margin-left: auto;
}

@media (max-width: 959.98px) {
    .history-controls-row {
        align-items: stretch;
    }

    .history-currency-box {
        margin-left: 0;
        width: fit-content;
    }
}

.history-controls-row {
    flex-wrap: wrap;
    gap: 12px;
}

.history-tabs-compact {
    width: auto;
    flex: 0 0 auto;
}

.history-tabs-compact .mud-tabs-toolbar {
    width: fit-content;
    min-height: 36px;
    height: 36px;
}

.history-currency-box {
    flex: 0 0 auto;
    white-space: nowrap;
    height: 36px; /* align with tabs */
    border-radius: 6px; /* subtle polish */
}

@media (max-width: 900px) {
    .history-controls-row {
        align-items: flex-start;
    }
}

.history-tabs-compact .mud-tab {
    min-height: 36px;
    height: 36px;
    padding-top: 0;
    padding-bottom: 0;
}

.history-tabs-compact .mud-tab .mud-tab-label {
    line-height: 36px;
}

.mud-popover-open,
.mud-popover-open .mud-popover-content,
.mud-popover-open .mud-paper,
.mud-popover-open .mud-list {
    max-height: calc(100vh - 100px) !important;
}

.mud-popover-open .mud-popover-content,
.mud-popover-open .mud-list {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}