html, body, .mud-typography, .mud-button-root, .mud-input {
    font-family: "Open Sans", "Segoe UI", sans-serif;
}

h1:focus {
    outline: none;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 10000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

/* ---- app styling ---- */
.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--mud-palette-success); }
.neg { color: var(--mud-palette-error); }
.muted { color: var(--mud-palette-text-secondary); }

.kpi-value { font-size: 1.5rem; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mud-palette-text-secondary); }

.apex-host { width: 100%; }
.apex-host .apexcharts-tooltip { box-shadow: 0 4px 16px rgba(0,0,0,.3); }

/* Headline tiles on the overview */
.price-tile {
    display: block;
    height: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-left: 4px solid var(--mud-palette-primary);
    background: var(--mud-palette-surface);
    color: inherit;
    text-decoration: none;
    transition: transform .08s ease, box-shadow .08s ease;
}
.price-tile:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.price-tile.Spot { border-left-color: #2196C8; }
.price-tile.Future { border-left-color: #F5A623; }
.price-tile.Retail { border-left-color: #1e9e6a; }
.price-tile.Storage, .price-tile.Inventory { border-left-color: #8e5ad7; }
.price-tile .tile-name { font-size: .82rem; font-weight: 600; line-height: 1.25; min-height: 2.05em; }
.price-tile .tile-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.price-tile .tile-units { font-size: .75rem; color: var(--mud-palette-text-secondary); }
.price-tile .tile-sub { font-size: .78rem; font-variant-numeric: tabular-nums; }

.price-tile .tile-desc { font-size: .72rem; color: var(--mud-palette-text-secondary); line-height: 1.25; margin: -2px 0 4px; }

/* Industry picker cards */
.industry-card {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    height: 100%;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--mud-palette-lines-default);
    border-top: 4px solid var(--mud-palette-primary);
    background: var(--mud-palette-surface);
    color: inherit;
    text-decoration: none;
    transition: transform .08s ease, box-shadow .08s ease;
}
.industry-card:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.industry-icon { color: var(--mud-palette-primary); flex: 0 0 auto; }
.industry-name { font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.industry-tagline { font-size: .85rem; margin: 2px 0 6px; }
.industry-count { font-size: .75rem; }

.clickable-row { cursor: pointer; }
.cell-name { font-weight: 600; }
.cell-desc { font-size: .75rem; color: var(--mud-palette-text-secondary); }

.seasonal-note { margin-top: 8px; font-size: .85rem; }
.seasonal-note-compact { color: var(--mud-palette-text-secondary); }

.mover-line { display: flex; justify-content: space-between; gap: 12px; padding: 4px 6px; border-radius: 4px; cursor: pointer; }
.mover-line:hover { background: var(--mud-palette-action-default-hover); }
.mover-line .cell-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A thin bar with a marker for where the latest value sits between its 52-week low and high. */
.range-bar { position: relative; width: 110px; height: 6px; border-radius: 3px; background: var(--mud-palette-lines-default); }
.range-bar span { position: absolute; top: -3px; width: 4px; height: 12px; margin-left: -2px; border-radius: 2px; background: var(--mud-palette-primary); }

/* SiteAnalyst shell */
.sa-shell { min-height: 100vh; display: flex; flex-direction: column; background: #f8f9fa; color: #333; }
.sa-topbar {
    background: #333;
    color: #ccc;
    font-size: 13px;
    padding: 8px 16px;
    text-align: center;
}
.sa-topbar a { color: #ccc; text-decoration: none; margin: 0 12px; }
.sa-topbar a:hover { color: #F5A623; }
.sa-divider { color: #666; }
.sa-topbar { position: relative; }
.sa-auth { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 10px; }
.sa-auth form { margin: 0; }
.sa-user { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ccc; }
.sa-topbar a.sa-login, .sa-login {
    display: inline-block;
    margin: 0;
    padding: 3px 14px;
    border: 1px solid #F5A623;
    border-radius: 4px;
    background: transparent;
    color: #F5A623;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}
.sa-topbar a.sa-login:hover, .sa-login:hover { background: #F5A623; color: #fff; }
@media (max-width: 1000px) {
    .sa-auth { position: static; transform: none; justify-content: center; margin-top: 6px; }
}
.sa-login-card { max-width: 520px; margin: 32px auto; }
.sa-nav {
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    box-shadow: 0 1px 6px rgba(0,0,0,.06);
    padding: 10px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 1100;
}
.sa-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: 0 0 auto; }
.sa-brand img { height: 42px; width: auto; }
.sa-brand span { font-size: 20px; font-weight: 700; color: #2196C8; letter-spacing: -0.3px; }
.sa-badge {
    background: #F5A623;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 50px;
}
.sa-nav-main { display: flex; align-items: center; gap: 18px; margin-left: auto; min-width: 0; }
.sa-links { display: flex; align-items: center; gap: 22px; }
.sa-links a {
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 0;
    white-space: nowrap;
}
.sa-links a:hover, .sa-links a.active { color: #2196C8; }
.sa-links a.active { box-shadow: inset 0 -2px 0 #2196C8; }
.sa-tools { display: flex; align-items: center; gap: 4px; }
.sa-burger {
    display: none;
    margin-left: auto;
    width: 40px;
    height: 36px;
    border: 1px solid #d7e6f0;
    border-radius: 6px;
    background: #fff;
    padding: 8px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}
.sa-burger span { display: block; height: 2px; background: #2196C8; border-radius: 1px; }
.sa-main { flex: 1 0 auto; }
.sa-family { background: #f8f9fa; text-align: center; padding: 56px 24px 48px; border-top: 1px solid #eee; }
.sa-family h2 { font-size: 28px; font-weight: 800; color: #333; margin: 0 0 36px; }
.sa-family-grid { display: flex; justify-content: center; gap: 56px; flex-wrap: wrap; }
.sa-family-item { text-decoration: none; color: inherit; width: 180px; }
.sa-family-item:hover { transform: translateY(-4px); }
.sa-family-item img { height: 88px; width: auto; max-width: 160px; object-fit: contain; }
.sa-family-item h4 { margin: 12px 0 4px; color: #2196C8; font-size: 16px; font-weight: 700; }
.sa-family-item p { margin: 0; color: #333; font-size: 14px; font-weight: 600; }
.sa-footer { background: #2a2a2a; color: #bbb; padding: 40px 24px 24px; }
.sa-footer-mark { max-width: 1000px; margin: 0 auto 28px; }
.sa-footer-mark img { height: 46px; width: auto; }
.sa-footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 36px;
}
.sa-footer h5 { color: #fff; font-size: 15px; font-weight: 700; margin: 0 0 16px; }
.sa-footer a { display: block; color: #bbb; text-decoration: none; font-size: 13px; margin-bottom: 8px; }
.sa-footer a:hover { color: #F5A623; }
.sa-footer-bottom {
    max-width: 1000px;
    margin: 28px auto 0;
    padding-top: 20px;
    border-top: 1px solid #444;
    text-align: center;
    font-size: 12px;
    color: #888;
}
.sa-source-note { max-width: 1000px; margin: 12px auto 0; font-size: 12px; color: #888; text-align: center; }
@media (max-width: 1100px) {
    .sa-burger { display: flex; }
    .sa-nav-main { display: none; width: 100%; flex-direction: column; align-items: stretch; margin-left: 0; }
    .sa-nav.open { flex-wrap: wrap; }
    .sa-nav.open .sa-nav-main { display: flex; }
    .sa-links { flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 8px; }
    .sa-tools { justify-content: flex-start; flex-wrap: wrap; }
    .sa-footer-inner { grid-template-columns: repeat(2, 1fr); }
}

/* ---- SiteAnalyst Macro ---- */
.disclaimer-strip { display: flex; align-items: center; margin-top: 10px; padding: 6px 10px; border-radius: 6px; font-size: .78rem; color: var(--mud-palette-text-secondary); background: var(--mud-palette-background-gray); }
.disclaimer-strip a { display: inline; color: var(--mud-palette-primary); }
.big-move { font-weight: 700; }

.cat-chip { display: inline-block; padding: 1px 9px; border-radius: 50px; font-size: .72rem; font-weight: 700; color: #fff; background: #6c7a89; white-space: nowrap; }
.cat-inflation { background: #d6403f; }
.cat-jobs { background: #1e9e6a; }
.cat-growth { background: #2196C8; }
.cat-rates-and-fed { background: #8e5ad7; }
.cat-housing { background: #c26b1a; }
.cat-consumer { background: #00a3a3; }
.cat-manufacturing { background: #6d8b2f; }
.cat-markets { background: #4a5568; }

/* Calendar */
.cal-week { margin-bottom: 18px; }
.cal-week h3 { font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; color: var(--mud-palette-text-secondary); margin: 0 0 6px; }
.cal-row { display: grid; grid-template-columns: 110px 1fr auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--mud-palette-lines-default); color: inherit; text-decoration: none; }
.cal-row:last-child { border-bottom: none; }
.cal-row:hover { background: var(--mud-palette-action-default-hover); }
.cal-row.past { opacity: .72; }
.cal-row.today { box-shadow: inset 4px 0 0 var(--mud-palette-secondary); background: var(--mud-palette-action-default-hover); }
.cal-date { font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.cal-date small { display: block; font-weight: 400; color: var(--mud-palette-text-secondary); }
.cal-name { font-weight: 600; }
.cal-measures { font-size: .78rem; color: var(--mud-palette-text-secondary); }
.cal-tags { display: flex; gap: 8px; align-items: center; }
.mover { color: var(--mud-palette-secondary); }
@media (max-width: 700px) { .cal-row { grid-template-columns: 80px 1fr; } .cal-tags { grid-column: 2; } }

/* "Next up" cards */
.next-card { display: block; height: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--mud-palette-lines-default); border-left: 4px solid var(--mud-palette-secondary); background: var(--mud-palette-surface); color: inherit; text-decoration: none; transition: transform .08s ease, box-shadow .08s ease; }
.next-card:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.next-card .next-when { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mud-palette-text-secondary); }
.next-card .next-name { font-weight: 700; line-height: 1.25; margin: 2px 0 4px; }
.next-card .next-in { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Indicator tiles */
.series-tile { display: block; height: 100%; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--mud-palette-lines-default); border-left: 4px solid var(--mud-palette-primary); background: var(--mud-palette-surface); color: inherit; text-decoration: none; transition: transform .08s ease, box-shadow .08s ease; }
.series-tile:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.series-tile .tile-name { font-size: .82rem; font-weight: 600; line-height: 1.25; min-height: 2.05em; }
.series-tile .tile-value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.series-tile .tile-sub { font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--mud-palette-text-secondary); }

.table-scroll { overflow-x: auto; }
.reaction-table th, .reaction-table td { white-space: nowrap; }
.reaction-table td.market-group { border-left: 1px solid var(--mud-palette-lines-default); }
.heat { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 4px; }
