* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #1b1b1f; color: #eee;
  font: 13px/1.4 system-ui, 'Segoe UI', Tahoma, 'Noto Naskh Arabic', 'Noto Sans Arabic', -apple-system, "Segoe UI", Roboto, sans-serif; overflow: hidden; }
#bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 6px 12px;
  background: #26262c; border-bottom: 1px solid #3a3a42; height: 44px; }
.cell { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.cell.right { margin-right: auto; color: #9a9aa5; }
.lbl { color: #9a9aa5; }
#sky { font-size: 18px; }
b { font-weight: 600; font-variant-numeric: tabular-nums; }
button, select { background: #35353d; color: #eee; border: 1px solid #4a4a54; border-radius: 4px;
  padding: 3px 8px; font: inherit; cursor: pointer; }
button:hover, select:hover { background: #42424c; }
button.on { background: #c9a227; color: #1b1b1f; border-color: #c9a227; }
.speed { gap: 3px; }
.filters { gap: 6px; }
label { display: flex; align-items: center; gap: 3px; color: #cfcfd6; }
main { position: absolute; top: 44px; left: 0; right: 0; bottom: 0; }
canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
canvas.drag { cursor: grabbing; }
#zoom { position: absolute; left: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 4px; }
#zoom button { width: 32px; height: 32px; font-size: 18px; padding: 0; }
#legend { position: absolute; right: 12px; bottom: 12px; background: rgba(30,30,36,.88);
  border: 1px solid #3a3a42; border-radius: 6px; padding: 8px 10px; max-width: 230px; }
#legend h4 { margin: 0 0 4px; font-size: 12px; color: #9a9aa5; font-weight: 600; }
#legend .row { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
#legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
#legend .ring { border: 2px solid #fff; background: transparent; width: 10px; height: 10px; border-radius: 50%; }
#legend .small { width: 6px; height: 6px; margin: 0 2px; }
#legend hr { border: 0; border-top: 1px solid #3a3a42; margin: 6px 0; }

#searchbox { position: absolute; top: 10px; right: 12px; z-index: 6; }
body.pn #zoom { left: 352px; }
#search { background: #35353d; color: #eee; border: 1px solid #4a4a54; border-radius: 4px; padding: 3px 8px; font: inherit; width: 190px; }
#results { position: absolute; top: 30px; right: 0; width: 260px; background: #2c2c33; border: 1px solid #4a4a54;
  border-radius: 4px; z-index: 20; display: none; }
#results div { padding: 4px 8px; cursor: pointer; }
#results div:hover { background: #42424c; }
#panel { position: absolute; top: 0; left: 0; bottom: 0; width: 340px; overflow-y: auto; background: rgba(32,32,38,.97);
  border-right: 1px solid #3a3a42; padding: 10px 12px 16px; z-index: 10; }
#panel[hidden] { display: none; }
#panel h3 { margin: 0 0 2px; font-size: 16px; }
#panel h5 { margin: 12px 0 4px; font-size: 11px;  color: #9a9aa5; font-weight: 600; }
#panel .sub { color: #b5b5c0; }
#panel .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
#panel .now { background: #2d2d36; border-radius: 6px; padding: 7px 9px; }
#panel .why { color: #e8c86a; margin-top: 3px; }
.ar { direction: rtl; unicode-bidi: isolate; text-align: right; font-size: 14px; }
.bar { display: flex; align-items: center; gap: 6px; margin: 2px 0; }
.bar span.n { width: 66px; color: #b5b5c0; }
.bar .track { flex: 1; height: 8px; background: #3a3a42; border-radius: 4px; overflow: hidden; }
.bar .fill { height: 100%; }
.bar span.v { width: 28px; text-align: left; font-variant-numeric: tabular-nums; color: #cfcfd6; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 1px 10px; }
.kv span:nth-child(odd) { color: #9a9aa5; }
.strip { display: flex; gap: 1px; position: relative; }
.strip i { flex: 1; height: 16px; display: block; border-radius: 2px; }
.strip i.cur { outline: 2px solid #fff; outline-offset: 1px; }
.hours { display: flex; justify-content: space-between; color: #7c7c88; font-size: 10px; margin-top: 2px; }
.links a { color: #7db7ff; cursor: pointer; margin-left: 8px; display: inline-block; }
.links a:hover { text-decoration: underline; }
#hist { max-height: 220px; overflow-y: auto; font-size: 12px; color: #cfcfd6; border-top: 1px solid #3a3a42; }
#hist div { padding: 2px 0; border-bottom: 1px solid #2d2d36; }
#panel .tag { display: inline-block; background: #4a2f2f; color: #ffb4b4; border-radius: 3px; padding: 0 5px; margin-right: 4px; font-size: 11px; }
#panel .tag.ok { background: #2c3f55; color: #b4d4ff; }
button.on { background: #c9a227; color: #1b1b1f; }
#legend { z-index: 5; }

#searchbox { display: flex; gap: 6px; align-items: flex-start; }
#results { top: 30px; }
#ticker { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); max-width: 46%; background: rgba(30,30,36,.9);
  border: 1px solid #3a3a42; border-radius: 14px; padding: 3px 12px; z-index: 6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#ticker.hot { border-color: #e05a5a; color: #ffd0d0; }
#dash { position: absolute; left: 0; right: 0; bottom: 0; height: 47%; background: rgba(28,28,34,.98); border-top: 1px solid #4a4a54; z-index: 8; display: flex; flex-direction: column; }
body.pn #dash { left: 340px; }
#dash[hidden] { display: none; }
#tabs { display: flex; gap: 6px; padding: 6px 10px; border-bottom: 1px solid #3a3a42; align-items: center; }
#tabs #dash-note { margin-right: auto; color: #9a9aa5; }
#dash-body { flex: 1; overflow: auto; padding: 8px 12px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 10px; }
.chart { background: #23232a; border-radius: 6px; padding: 4px 6px 2px; }
.chart h6 { margin: 0 0 2px; font-size: 12px; color: #b5b5c0; font-weight: 600; }
.chart canvas { width: 100%; height: 150px; display: block; }
.legendrow { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11px; color: #b5b5c0; margin: 2px 0 4px; }
.legendrow i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-left: 3px; }
table.t { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
table.t th { text-align: left; color: #9a9aa5; font-weight: 600; padding: 2px 8px; position: sticky; top: 0; background: #28282f; }
table.t td { text-align: left; padding: 2px 8px; border-bottom: 1px solid #2d2d36; }
table.t th:first-child, table.t td:first-child { text-align: right; }
table.t tbody tr { cursor: pointer; }
table.t tbody tr:hover { background: #2f2f38; }
table.t tr.sel { background: #35354a; }
table.t tr.low td { color: #ffb4b4; background: #3a2626; }
.up { color: #ff9c8a; } .down { color: #8ad6a0; }
.summary { font-family: ui-monospace, Menlo, monospace; font-size: 12px; color: #cfcfd6; margin-bottom: 8px; word-break: break-word; }
.split { display: grid; grid-template-columns: minmax(380px, 1.1fr) 1fr; gap: 12px; }
.evrow { padding: 2px 0; border-bottom: 1px solid #2d2d36; }
.evrow .k { display: inline-block; min-width: 76px; color: #9a9aa5; }
.evrow.hot { color: #ffb4b4; }
.chart canvas, #view { direction: ltr; }
.evrow .k { margin-left: 8px; }
