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;
    color: #333;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 0.75rem; top: 0.5rem; }

.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred."; }


/* ---- shared bits ---- */
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--mud-palette-text-secondary); }
.small { font-size: .8rem; }
.apex-host { width: 100%; }
.apex-host .apexcharts-tooltip { box-shadow: 0 4px 16px rgba(0,0,0,.3); }
.clickable { cursor: pointer; }
.nowrap { white-space: nowrap; }
.rw-section { font-size: 1.05rem; font-weight: 700; margin: 0 0 2px; }
.rw-sub { font-size: .8rem; color: var(--mud-palette-text-secondary); margin: 0 0 8px; }
.rw-table td, .rw-table th { white-space: nowrap; }
.rw-table td.wrap { white-space: normal; min-width: 220px; }
.rw-kv { display: grid; grid-template-columns: minmax(130px, 40%) 1fr; gap: 5px 14px; margin: 0; }
.rw-kv dt { color: var(--mud-palette-text-secondary); font-size: .85rem; }
.rw-kv dd { margin: 0; font-weight: 600; word-break: break-word; }

/* ---- the disclaimer strip under the header: on every page ---- */
.rw-disclaimer { background: #fff4e0; color: #5a3b00; border-bottom: 1px solid #f0d49b; font-size: 12.5px; line-height: 1.4; padding: 7px 24px; text-align: center; }
.rw-disclaimer b { color: #8a4b00; }
.rw-disclaimer a { color: inherit; text-decoration: underline; }
.mud-theme-dark .rw-disclaimer, .rw-dark .rw-disclaimer { background: #3a2b10; color: #f4dcae; border-bottom-color: #5a4220; }
.rw-fineprint { font-size: .78rem; line-height: 1.45; color: var(--mud-palette-text-secondary); }

/* ---- search ---- */
.rw-search { max-width: 760px; margin: 0 auto; }
.rw-hero { text-align: center; padding: 28px 12px 18px; }
.rw-hero h1 { font-size: 2.1rem; font-weight: 800; margin: 0 0 6px; letter-spacing: -.5px; }
.rw-hero h1 span { color: #F5A623; }
.rw-hero p { margin: 0 auto 18px; max-width: 760px; color: var(--mud-palette-text-secondary); }
.rw-hit { display: flex; flex-direction: column; line-height: 1.25; }
.rw-hit .detail { font-size: .75rem; color: var(--mud-palette-text-secondary); }

/* ---- SiteAnalyst shell ---- */
.sa-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--mud-palette-background); color: var(--mud-palette-text-primary); }
.sa-topbar { background: #333; color: #ccc; font-size: 13px; padding: 8px 16px; text-align: center; position: relative; }
.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-nav {
    background: var(--mud-palette-appbar-background);
    color: var(--mud-palette-appbar-text);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    box-shadow: 0 1px 6px rgba(0,0,0,.12);
    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: 20px; }
.sa-links a { text-decoration: none; color: inherit; 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: transparent; 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: var(--mud-palette-background); text-align: center; padding: 56px 24px 48px; border-top: 1px solid var(--mud-palette-lines-default); }
.sa-family h2 { font-size: 28px; font-weight: 800; 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; 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; }
.sa-source-note a { display: inline; }

@media (max-width: 1250px) {
    .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); }
    .impact .dom { flex-basis: 110px; }
}

/* ---- KPI tiles ---- */
.rw-kpi { display: block; height: 100%; padding: 10px 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; }
.rw-kpi .label { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--mud-palette-text-secondary); }
.rw-kpi .value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.rw-kpi .unit { font-size: .8rem; font-weight: 400; color: var(--mud-palette-text-secondary); margin-left: 3px; }
.rw-kpi .note { font-size: .75rem; color: var(--mud-palette-text-secondary); line-height: 1.3; }
.rw-kpi.warn { border-left-color: #F5A623; }
.rw-kpi.alarm { border-left-color: #d6403f; }
.rw-kpi.good { border-left-color: #1e9e6a; }


/* ---- chips, bars and tables ---- */
.rw-chip { display: inline-block; font-size: .72rem; font-weight: 700; padding: 1px 9px; border-radius: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rw-pointbar { height: 9px; border-radius: 5px; background: rgba(128,128,128,.2); overflow: hidden; min-width: 70px; }
.rw-pointbar .fill { height: 100%; border-radius: 5px; }
.rw-chance { display: flex; align-items: center; gap: 8px; }
.rw-chance .pct { min-width: 44px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rw-chance .rw-pointbar { flex: 1 1 auto; }
.rw-leg { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; font-size: .75rem; }
.rw-leg .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 4px; }

/* ---- gauge hero ---- */
.rw-now { display: flex; align-items: stretch; gap: 18px; flex-wrap: wrap; }
.rw-level { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 200px; padding: 16px 22px; border-radius: 12px; }
.rw-level .value { font-size: 3.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.rw-level .unit { font-size: 1.1rem; font-weight: 700; margin-left: 4px; }
.rw-level .cat { font-size: 1.1rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; margin-top: 6px; text-align: center; }
.rw-level .sub { font-size: .78rem; opacity: .9; margin-top: 2px; }
.rw-now-body { flex: 1 1 320px; min-width: 0; }

.rw-risk { border-radius: 10px; border: 1px solid var(--mud-palette-lines-default); border-left: 6px solid var(--risk, #8b95a5); background: var(--mud-palette-surface); padding: 12px 16px; }
.rw-risk .headline { font-size: 1.05rem; font-weight: 700; line-height: 1.35; margin: 4px 0 8px; }
.rw-risk p { margin: 0 0 8px; line-height: 1.5; font-size: .92rem; }

/* flood-stage ladder: the gauge's official levels as a stack, with the river's level marked */
.rw-ladder { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--mud-palette-lines-default); }
.rw-ladder .step { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 12px; font-size: .85rem; font-weight: 700; }
.rw-ladder .step .at { font-weight: 600; font-variant-numeric: tabular-nums; opacity: .95; }
.rw-ladder .step.here { box-shadow: inset 5px 0 0 rgba(0,0,0,.65); }
.rw-ladder .step .mark { font-size: .7rem; font-weight: 800; background: rgba(0,0,0,.28); color: #fff; padding: 0 7px; border-radius: 8px; margin-left: 6px; }

/* what the water does at each level */
.rw-impact { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--mud-palette-lines-default); }
.rw-impact:last-child { border-bottom: none; }
.rw-impact .at { flex: 0 0 120px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rw-impact .at small { display: block; font-weight: 400; opacity: .75; }
.rw-impact .txt { flex: 1 1 auto; font-size: .88rem; line-height: 1.45; }
.rw-impact.reached .at { color: #d6403f; }
.rw-impact.reached { background: rgba(214,64,63,.07); }

/* ---- outlook table / drivers ---- */
.rw-factor { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--mud-palette-lines-default); font-size: .85rem; line-height: 1.4; }
.rw-factor:last-child { border-bottom: none; }
.rw-factor .name { flex: 0 0 150px; font-weight: 700; }
.rw-factor .arrow { flex: 0 0 22px; font-weight: 800; }
.rw-factor .arrow.up { color: #d6403f; }
.rw-factor .arrow.down { color: #2e9e5b; }
.rw-factor .arrow.neutral, .rw-factor .arrow.info { color: var(--mud-palette-text-secondary); }

.rw-nearby a { text-decoration: none; }

/* ---- map ---- */
.rw-map { width: 100%; height: calc(100vh - 330px); min-height: 440px; border-radius: 10px; border: 1px solid var(--mud-palette-lines-default); z-index: 0; background: #cfd8e3; }
.rw-map-mini { height: 300px; min-height: 300px; }
.leaflet-container { font-family: "Open Sans", "Segoe UI", sans-serif; }
.rw-map-tip b { font-size: .9rem; }
.rw-map-ctl { background: var(--mud-palette-surface); color: var(--mud-palette-text-primary); padding: 6px 10px; border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,.35); font-size: .75rem; line-height: 1.6; }
.rw-map-ctl .sw { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border-radius: 50%; border: 1px solid #222; }
.rw-map-ctl .sw.ring { background: #fff; border: 3px solid #f07d1a; width: 10px; height: 10px; }

/* ---- watch list on the home page ---- */
.rw-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--mud-palette-lines-default); color: inherit; text-decoration: none; }
.rw-row:hover { background: rgba(128,128,128,.08); }
.rw-row:last-child { border-bottom: none; }
.rw-row .nm { flex: 1 1 auto; min-width: 0; font-size: .88rem; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; }
.rw-row .nm small { display: block; font-weight: 400; color: var(--mud-palette-text-secondary); font-size: .74rem; }
.rw-row .val { flex: 0 0 auto; text-align: right; font-size: .82rem; font-variant-numeric: tabular-nums; }

@media (max-width: 700px) {
    .rw-hero h1 { font-size: 1.6rem; }
    .rw-level .value { font-size: 2.6rem; }
    .rw-impact { flex-direction: column; gap: 2px; }
    .rw-impact .at { flex-basis: auto; }
    .rw-factor { flex-wrap: wrap; }
    .rw-factor .name { flex-basis: 100%; }
    .rw-map { height: 60vh; }
}
.table-responsive { overflow-x: auto; }
ul.rw-about, ol.rw-about { padding-left: 20px; margin: 0; line-height: 1.6; } .rw-about li { margin-bottom: 6px; }
