/* Market Monitor: read-only pages. No inline styles anywhere (CSP style-src 'self'). */
:root {
  --bg: #0a0e14; --panel: #10161f; --head: #16202c; --line: #1e2936; --soft: #172029;
  --txt: #c8d4e3; --hi: #eef4fb; --dim: #7d8ea3; --dimmer: #506172;
  --up: #2fd18b; --down: #ff5f6f; --accent: #4d9fff; --warn: #ffb545; --alert: #ff7a3d;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--txt); font-family: var(--mono); font-size: 13px; line-height: 1.45; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.top {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  padding: 10px 16px; background: linear-gradient(180deg, #131b25, #0d131b); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .14em; color: var(--hi); white-space: nowrap; }
.brand .dot { color: var(--accent); margin: 0 4px; }
.brand .sub { color: var(--dim); font-size: 10px; letter-spacing: .22em; }
.tabs, .subtabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs a, .subtabs a { color: var(--dim); font-size: 11px; padding: 3px 8px; border: 1px solid var(--line); border-radius: 3px; }
.tabs a:hover, .subtabs a:hover { color: var(--hi); border-color: var(--accent); text-decoration: none; }
.tabs a.on { color: var(--hi); border-color: var(--accent); background: #13202e; }
.stamp { margin-left: auto; color: var(--dim); font-size: 11px; }

main { max-width: 1500px; margin: 0 auto; padding: 14px 16px 24px; display: grid; gap: 18px; }
.tabpage { display: grid; gap: 18px; min-width: 0; }
h1.tabh { margin: 2px 0 0; font-size: 15px; letter-spacing: .16em; color: var(--hi); text-transform: uppercase; }
section.sec { scroll-margin-top: 80px; display: grid; gap: 10px; min-width: 0; }
h2 { margin: 4px 0 0; font-size: 13px; letter-spacing: .14em; color: var(--hi); text-transform: uppercase; }
h1 .h2s, h2 .h2s { color: var(--dim); font-size: 11px; letter-spacing: .02em; text-transform: none; margin-left: 10px; font-weight: 400; }
.grid2 { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.grid3 { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }
.tvrow { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 1250px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1050px) { .grid2, .grid3, .tvrow { grid-template-columns: minmax(0, 1fr); } }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; min-width: 0; }
.ph { display: flex; align-items: baseline; gap: 8px; padding: 7px 10px; background: var(--head); border-bottom: 1px solid var(--line); }
.ph-t { color: var(--hi); font-size: 12px; }
.ph-s { margin-left: auto; color: var(--dimmer); font-size: 10px; text-align: right; }
.pb { overflow-x: auto; }
.pad { padding: 8px 10px; }

table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: right; color: var(--dim); font-weight: 400; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
     padding: 5px 9px; border-bottom: 1px solid var(--soft); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
td { padding: 4px 9px; border-bottom: 1px solid rgba(30, 41, 54, .45); white-space: nowrap; vertical-align: top; }
td.num { text-align: right; }
td.wrap { white-space: normal; min-width: 140px; max-width: 320px; }
tbody tr:hover td { background: #141c27; }
tr.grp td { color: var(--dim); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; background: #0b1119; }

.b { color: var(--hi); font-weight: 600; }
.dim { color: var(--dim); }
.tiny { color: var(--dimmer); font-size: 10px; }
.up { color: var(--up); }
.down { color: var(--down); }
.warn { color: var(--warn); }
.alert { color: var(--alert); }
.tag { display: inline-block; font-size: 9px; letter-spacing: .08em; border: 1px solid var(--line); border-radius: 2px; padding: 0 4px; margin-left: 5px; vertical-align: 1px; }
.tag.live { color: var(--up); border-color: rgba(47, 209, 139, .4); }
.tag.est { color: var(--warn); border-color: rgba(255, 181, 69, .4); }
.tag.old { color: var(--down); border-color: rgba(255, 95, 111, .4); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 1px; background: var(--soft);
         border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.tile { background: #0c121a; padding: 9px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile .k { color: var(--dim); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.tile .v { color: var(--hi); font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { color: var(--dim); font-size: 11px; }
.tile.alert .v { color: var(--alert); }
.tile.up .v { color: var(--up); }

.fill { position: relative; height: 14px; min-width: 110px; background: #0a1017; border: 1px solid var(--soft); border-radius: 2px; overflow: hidden; }
.fill .bar { position: absolute; left: 0; top: 0; bottom: 0; opacity: .6; }
.fill .bar.hi { background: var(--up); }
.fill .bar.mid { background: var(--accent); }
.fill .bar.lo { background: var(--alert); }
.fill .mark { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--warn); }
.fill .mark.floor { background: var(--down); }
.fill .lbl { position: relative; font-size: 10px; padding-left: 4px; color: var(--hi); line-height: 13px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0; padding: 8px 10px; }
.kv dt { color: var(--dim); }
.kv dd { margin: 0; text-align: right; color: var(--hi); }
.note { color: var(--dim); padding: 8px 10px; font-size: 12px; white-space: normal; margin: 0; }
.def { color: var(--dimmer); font-size: 11px; padding: 6px 10px 10px; line-height: 1.55; margin: 0; }
.def b { color: var(--dim); }
.err { color: var(--down); padding: 10px; margin: 0; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 4px 10px 6px; color: var(--dim); font-size: 10px; }
.sw { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 5px; }
.sw.a { background: var(--accent); }
.sw.o { background: var(--alert); }
.sw.g { background: var(--dim); }
.sw.band { height: 8px; background: rgba(77, 159, 255, .28); }

svg.chart { display: block; width: 100%; height: auto; }
.chart .gl { stroke: var(--soft); stroke-width: 1; }
.chart .ax { stroke: var(--line); stroke-width: 1; }
.chart .l1 { fill: none; stroke: var(--accent); stroke-width: 1.7; }
.chart .l2 { fill: none; stroke: var(--alert); stroke-width: 1.7; }
.chart .l3 { fill: none; stroke: var(--dim); stroke-width: 1.3; stroke-dasharray: 3 3; }
.chart .band { fill: rgba(77, 159, 255, .13); stroke: none; }
.chart .cap { stroke: var(--warn); stroke-width: 1; stroke-dasharray: 4 3; }
.chart .flr { stroke: var(--down); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .dot1 { fill: var(--accent); }
.chart text { fill: var(--dim); font-size: 9px; font-family: var(--mono); }
.chart text.w { fill: var(--warn); }
.chart .bp { fill: rgba(47, 209, 139, .65); }
.chart .bn { fill: rgba(255, 95, 111, .65); }
.chart .bf { opacity: .4; }

/* Widgets are display-only: the wrapper is inert in the markup, and pointer-events is the fallback for browsers
   without inert support. Frame heights are set per widget from the script. */
.tv-frame { pointer-events: none; user-select: none; }
.tv iframe { display: block; width: 100%; border: 0; background: #131722; }
.tv-attr { padding: 3px 10px 6px; font-size: 10px; color: var(--dimmer); }

.ev { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 5px 10px; border-bottom: 1px solid rgba(30, 41, 54, .45); }
.ev .d { color: var(--dimmer); font-size: 11px; }
.src li { margin: 0 0 6px; }
.src { margin: 0; padding: 8px 10px 8px 28px; }

.foot { max-width: 1500px; margin: 0 auto; padding: 12px 16px 30px; color: var(--dimmer); font-size: 11px; border-top: 1px solid var(--line); }
.foot p { margin: 0; }
