/* TickerHall branding on top of Ubold: ink navy primary, brass accent, navy sidenav.
   Green/red stay reserved for bullish/bearish. */
:root, [data-bs-theme=light] {
    --theme-primary: #09253B;
    --theme-primary-rgb: 27, 58, 87;
    --bs-primary: #09253B;
    --bs-primary-rgb: 27, 58, 87;
    --bs-link-color: #09253B;
    --bs-link-color-rgb: 27, 58, 87;
    --th-brass: #D49A35;
    --theme-link-color: #09253B;
    --theme-link-color-rgb: 27, 58, 87;
    --theme-link-hover-color: #2d5a85;
    --theme-link-hover-color-rgb: 45, 90, 133;
    --theme-primary-bg-subtle: #e3e9ef;
    --theme-primary-text-emphasis: #09253B;
    --theme-primary-border-subtle: #b9c7d4;
}
[data-bs-theme=dark] {
    --theme-link-color: #8fb3d6; --theme-link-color-rgb: 143, 179, 214;
    --theme-link-hover-color: #b5cde6; --theme-link-hover-color-rgb: 181, 205, 230;
    --theme-primary-bg-subtle: rgba(143, 179, 214, .15); --theme-primary-text-emphasis: #b5cde6;
}
[data-bs-theme=dark] { --bs-link-color: #8fb3d6; --bs-link-color-rgb: 143, 179, 214; }
html[data-menu-color=dark] { --theme-sidenav-bg: #071e31; --theme-sidenav-item-color: #b8c4d0; --theme-sidenav-item-hover-color: #fff; --theme-sidenav-item-active-color: #fff; }
[data-bs-theme=light] .btn-primary { --bs-btn-bg: #09253B; --bs-btn-border-color: #09253B; --bs-btn-hover-bg: #0d2f4a; --bs-btn-hover-border-color: #0d2f4a; --bs-btn-active-bg: #061a2a; }
[data-bs-theme=light] .btn-outline-primary { --bs-btn-color: #09253B; --bs-btn-border-color: #09253B; --bs-btn-hover-bg: #09253B; --bs-btn-hover-border-color: #09253B; }
.text-brass { color: var(--th-brass) !important; }
.th-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.th-post { white-space: pre-wrap; word-break: break-word; }
.th-post.removed { opacity: .6; text-decoration: line-through; }
.th-table td, .th-table th { vertical-align: middle; }
.th-row-link { cursor: pointer; }
.th-row-link:hover td { background: rgba(var(--bs-primary-rgb), .04); }
.th-kv dt { font-weight: 500; color: var(--bs-secondary-color); font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; }
.th-kv dd { margin-bottom: .6rem; }
.th-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #071e31; }
.th-auth .card { width: 100%; max-width: 440px; }
.side-nav-link .badge { font-size: .7rem; }
.sentiment-bullish { color: #1a7f4b; } .sentiment-bearish { color: #c0392b; }
/* Machine suggestions are brass (not info-cyan); severity is one navy scale (no traffic lights,
   which would nudge decisions and clash with green/red being reserved for sentiment). */
.th-suggestion { border-left: 3px solid var(--th-brass); }
.th-brass-badge { background: rgba(200,147,49,.15); color: #7a5716; }
.th-sev-1 { background: #c9d3dd; color: #09253B; } .th-sev-2 { background: #8fa5bb; color: #fff; }
.th-sev-3 { background: #4d6f90; color: #fff; } .th-sev-4 { background: #09253B; color: #fff; }

/* ---- Dark theme (design review 28 Sep): navy family, lit-navy actions, readable controls ---- */
html[data-bs-theme=dark] {
    --bs-primary: #2f5f94; --bs-primary-rgb: 47, 95, 148;
    --theme-primary: #2f5f94; --theme-primary-rgb: 47, 95, 148;
    --th-brass: #F0B64A;
    --bs-body-bg: #0f1722; --bs-secondary-bg: #16202d; --bs-tertiary-bg: #1b2735; --bs-border-color: #263445;
    --theme-card-bg: #16202d; --bs-card-bg: #16202d; --bs-body-color: #dbe3ec; --bs-secondary-color: #9aa8b8;
    --theme-body-bg: #0f1722; --theme-topbar-bg: #16202d;
}
html[data-bs-theme=dark][data-menu-color=dark], html[data-bs-theme=dark][data-menu-color=light] { --theme-sidenav-bg: #0b1520; --theme-sidenav-item-color: #9fb4c9; }
[data-bs-theme=dark] .text-primary { color: #8fb3d6 !important; }
[data-bs-theme=dark] .btn-primary { --bs-btn-bg: #2f5f94; --bs-btn-border-color: #2f5f94; --bs-btn-hover-bg: #3a6fa8; --bs-btn-hover-border-color: #3a6fa8; --bs-btn-active-bg: #3a6fa8; --bs-btn-color: #fff; --bs-btn-disabled-bg: #2f5f94; }
[data-bs-theme=dark] .btn-outline-primary { --bs-btn-color: #8fb3d6; --bs-btn-border-color: #4d78a6; --bs-btn-hover-bg: #2f5f94; --bs-btn-hover-border-color: #2f5f94; --bs-btn-hover-color: #fff; --bs-btn-active-bg: #2f5f94; --bs-btn-active-border-color: #2f5f94; --bs-btn-active-color: #fff; --bs-btn-disabled-color: #8fb3d6; --bs-btn-disabled-border-color: #4d78a6; }
[data-bs-theme=dark] .btn-check:checked + .btn-outline-primary { background: #2f5f94; border-color: #2f5f94; color: #fff; }
[data-bs-theme=dark] .bg-primary-subtle { background-color: rgba(143,179,214,.14) !important; }
[data-bs-theme=dark] svg path[stroke], [data-bs-theme=dark] svg polyline[stroke] { stroke: #8fb3d6; }
[data-bs-theme=dark] .th-sev-1 { background: #263445; color: #9fb4c9; } [data-bs-theme=dark] .th-sev-2 { background: #34506e; color: #dbe3ec; }
[data-bs-theme=dark] .th-sev-3 { background: #3f6d9c; color: #fff; } [data-bs-theme=dark] .th-sev-4 { background: #8fb3d6; color: #0f1722; }
.side-nav-link .badge { background: #D49A35 !important; color: #0f1722 !important; }
[data-bs-theme=dark] .sentiment-bullish { color: #4cc98a; } [data-bs-theme=dark] .sentiment-bearish { color: #f07878; }
:where(a, button, .btn, .form-control, .form-select, .form-check-input, .dropdown-item):focus-visible { outline: 2px solid #09253B; outline-offset: 2px; }
[data-bs-theme=dark] :where(a, button, .btn, .form-control, .form-select, .form-check-input, .dropdown-item):focus-visible { outline-color: #8fb3d6; }

/* Dashboard charts: one navy series from the theme token (dark mode uses its own fill step). */
.th-chart .th-chart-bar { fill: var(--bs-primary); }
.th-chart .th-chart-bar:hover { fill: var(--th-brass); }
.th-chart .th-chart-axis { stroke: var(--bs-border-color); stroke-width: 1; }
.th-chart .th-chart-label { font-size: 11px; fill: var(--bs-secondary-color); }
.th-hbar { display: block; height: 8px; border-radius: 0 4px 4px 0; background: var(--bs-primary); min-width: 2px; }
.th-stat { font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.th-stat-label { font-size: 12px; color: var(--bs-secondary-color); text-transform: uppercase; letter-spacing: .03em; }
/* Condensed and scrollable layouts position the sidenav absolutely; anchor it to the whole page so it runs to the bottom of long pages. */
.wrapper { position: relative; min-height: 100vh; }
.text-uppercase::placeholder { text-transform: none; }

/* Live dashboard */
.th-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #1a7f4b; display: inline-block; box-shadow: 0 0 0 0 rgba(26,127,75,.6); animation: th-pulse 2s infinite; }
@keyframes th-pulse { 0% { box-shadow: 0 0 0 0 rgba(26,127,75,.55); } 70% { box-shadow: 0 0 0 9px rgba(26,127,75,0); } 100% { box-shadow: 0 0 0 0 rgba(26,127,75,0); } }
@media (prefers-reduced-motion: reduce) { .th-live-dot { animation: none; } }
.th-legend { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; border: 1px solid #fff; }
.th-health { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; margin-top: 5px; }
.th-health-ok { background: #1a7f4b; } .th-health-off { background: #9aa5b1; } .th-health-warn { background: #D49A35; } .th-health-fail { background: #c0392b; }
#live-map .jvm-zoom-btn { background: var(--bs-secondary-bg); color: var(--bs-body-color); }

/* Simple menu: advanced pages show after "Show all pages". */
html:not(.th-nav-all) .th-nav-adv { display: none; }

/* Reported images: blurred until a moderator chooses to look; full-size viewer. */
.th-staff-img { position: relative; width: 120px; height: 120px; border-radius: .5rem; overflow: hidden; border: 1px solid var(--bs-border-color); background: var(--bs-tertiary-bg); }
.th-staff-img img { width: 100%; height: 100%; object-fit: cover; filter: blur(14px) saturate(.6); transform: scale(1.1); transition: filter .15s; }
.th-staff-img.is-shown img { filter: none; transform: none; }
.th-staff-img-reveal { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.th-staff-img-open { position: absolute; inset: 0; border: 0; background: transparent; cursor: zoom-in; }
.th-staff-img-open:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: -2px; }
.th-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(5, 15, 25, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; padding: 1.5rem; outline: none; }
.th-lightbox img { max-width: 100%; max-height: calc(100vh - 7rem); object-fit: contain; border-radius: .25rem; }
.th-lightbox-bar { display: flex; gap: .5rem; align-items: center; color: #fff; font-size: .85rem; }

/* Page intros are instructions the owner needs to read: full secondary contrast (was ~2.3:1). */
[data-bs-theme=light] .page-title-head .text-muted { color: #5b6776 !important; }

/* Ubold buttons read --theme-btn-* (not --bs-btn-*): mirror the dark-mode button colours so outline buttons aren't 2.5:1. */
[data-bs-theme=dark] .btn-primary { --theme-btn-bg: #2f5f94; --theme-btn-border-color: #2f5f94; --theme-btn-hover-bg: #3a6fa8; --theme-btn-hover-border-color: #3a6fa8; --theme-btn-active-bg: #3a6fa8; --theme-btn-color: #fff; --theme-btn-disabled-bg: #2f5f94; }
[data-bs-theme=dark] .btn-outline-primary { --theme-btn-color: #8fb3d6; --theme-btn-border-color: #4d78a6; --theme-btn-hover-bg: #2f5f94; --theme-btn-hover-border-color: #2f5f94; --theme-btn-hover-color: #fff; --theme-btn-active-bg: #2f5f94; --theme-btn-active-border-color: #2f5f94; --theme-btn-active-color: #fff; --theme-btn-disabled-color: #8fb3d6; --theme-btn-disabled-border-color: #4d78a6; }
/* Muted text: the template's #9ba6b7 is 2.5:1 on white. */
html:not([data-bs-theme=dark]) { --theme-secondary-color: #5b6776; --theme-secondary-color-rgb: 91, 103, 118; --bs-secondary-color: #5b6776; }
.text-muted a, .form-text a { text-decoration: underline; }
