/* The glance screen (glance.html). Same colors as the main page (styles.css). */
:root {
  --page: #050608;
  --bg: #0b0e13;
  --surface: #11151c;
  --surface-2: #161b23;
  --surface-3: #1d232d;
  --border: #1f252e;
  --border-strong: #2a313c;
  --text: #e8eaee;
  --muted: #8b919c;
  --faint: #4b515c;
  --primary: #5b5ef6;
  --primary-text: #9a9cff;
  --green: #0ecb81;
  --green-bg: rgba(14, 203, 129, .12);
  --green-line: rgba(14, 203, 129, .35);
  --red: #f34955;
  --red-bg: rgba(243, 73, 85, .12);
  --red-line: rgba(243, 73, 85, .35);
  --yellow: #f0b429;
  --yellow-bg: rgba(240, 180, 41, .13);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #121628 0%, var(--page) 60%) fixed, var(--page);
  color: var(--text);
  font: 14px/1.5 Inter, 'IBM Plex Sans Arabic', system-ui, -apple-system, sans-serif;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
a { color: inherit; }
.pos { color: var(--green); }
.neg { color: var(--red); }
.flat { color: var(--muted); }

.gl { max-width: 1120px; margin: 0 auto; padding: 22px 24px 40px; }

/* ---------- top */
.gl-top { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.gl-logo { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: none; border: 1px solid var(--border-strong); background: #000; }
.gl-logo img { width: 100%; height: 100%; display: block; }
.gl-title { min-width: 0; }
.gl-title h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.01em; }
.gl-state { margin: 2px 0 0; display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); }
.gl-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.gl-state.live { color: var(--green); }
.gl-state.live i { background: var(--green); box-shadow: 0 0 0 0 rgba(14, 203, 129, .6); animation: ping 1.8s infinite; }
.gl-state.warn { color: var(--yellow); }
.gl-state.warn i { background: var(--yellow); }
@keyframes ping { 70% { box-shadow: 0 0 0 7px rgba(14, 203, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(14, 203, 129, 0); } }
.gl-clock { margin-inline-start: auto; display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
[dir="rtl"] .gl-clock { align-items: flex-start; }
.gl-clock b { font-size: 18px; font-weight: 600; }
.gl-clock small { font-size: 12px; color: var(--muted); }
.gl-full { display: inline-flex; align-items: center; gap: 4px; padding: 8px 12px 8px 10px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); text-decoration: none; font-size: 13px; font-weight: 500; }
.gl-full:hover { color: var(--text); border-color: #3a4250; }
.gl-full svg { width: 16px; height: 16px; }
.gl-theme { padding: 8px; }
.gl-theme svg { width: 18px; height: 18px; stroke-width: 2; }

/* who is signed in */
.gl-who { display: flex; align-items: center; gap: 8px; }
.gl-user { display: flex; flex-direction: column; line-height: 1.25; text-align: start; }
.gl-user b { font-size: 13.5px; }
.gl-user small { font-size: 11.5px; color: var(--muted); }
.gl-out, .gl-admin { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 11px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; }
.gl-out:hover, .gl-admin:hover { color: var(--text); }
.gl-out svg, .gl-admin svg { width: 16px; height: 16px; stroke-width: 2; }

/* ---------- sections */
.gl-sec { margin-top: 26px; }
.sec-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 12px; }
.sec-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.sec-head small { color: var(--muted); font-size: 12.5px; }

.agree { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; padding: 11px 16px; border-radius: 14px; margin-bottom: 12px; font-size: 14px; border: 1px solid; }
.agree svg { width: 18px; height: 18px; }
.agree span { color: var(--muted); font-size: 13px; }
.agree.bull { background: var(--green-bg); border-color: var(--green-line); color: var(--green); }
.agree.bear { background: var(--red-bg); border-color: var(--red-line); color: var(--red); }
.agree.split { background: var(--yellow-bg); border-color: rgba(240, 180, 41, .35); color: var(--yellow); }

/* ---------- index tiles */
.ix-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ix-off, .wv-empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 18px; }
.ix {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, var(--surface-2), var(--surface) 55%);
  border: 1px solid var(--border); border-radius: 20px; padding: 18px 18px 16px;
  --c: var(--muted); --c-bg: var(--surface-3); --c-line: var(--border-strong);
}
.ix.bull { --c: var(--green); --c-bg: var(--green-bg); --c-line: var(--green-line); }
.ix.bear { --c: var(--red); --c-bg: var(--red-bg); --c-line: var(--red-line); }
.ix::before { content: ''; position: absolute; inset: 0 0 auto; height: 3px; background: var(--c); opacity: .9; }
.ix::after { content: ''; position: absolute; width: 260px; height: 260px; top: -150px; inset-inline-end: -110px; border-radius: 50%; background: var(--c); opacity: .07; filter: blur(30px); pointer-events: none; }
.ix-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ix-name b { display: block; font-size: 17px; font-weight: 700; letter-spacing: .01em; }
.ix-name span { font-size: 12.5px; color: var(--muted); }
.dir-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--c-bg); color: var(--c); border: 1px solid var(--c-line); font-weight: 700; font-size: 14px; white-space: nowrap; }
.dir-pill small { font-weight: 600; opacity: .8; }
.ix-price { display: flex; align-items: baseline; gap: 12px; margin-top: 14px; }
.ix-price bdi { font-size: 38px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; font-family: Inter, sans-serif; }
.chg { font-size: 15px; font-weight: 600; padding: 2px 8px; border-radius: 8px; background: var(--surface-3); }
.chg.pos { background: var(--green-bg); }
.chg.neg { background: var(--red-bg); }
.ix-sub { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.ix-none { color: var(--muted); margin: 18px 0 4px; }

.lean { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.lean-bar { display: flex; gap: 3px; flex: 1; max-width: 220px; }
.lean-bar i { flex: 1; height: 8px; border-radius: 3px; background: var(--surface-3); }
.lean-bar i.mid { flex: none; width: 2px; background: var(--border-strong); height: 14px; margin-top: -3px; }
.lean-bar i.on-neg { background: var(--red); }
.lean-bar i.on-pos { background: var(--green); }
.lean b { font-size: 13px; }

.lv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.lv { background: rgba(0, 0, 0, .22); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.lv-k { font-size: 12px; color: var(--muted); font-weight: 500; }
.lv-name { font-size: 12.5px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-num { font-size: 20px; font-weight: 700; margin-top: 2px; text-align: end; font-family: Inter, sans-serif; }
[dir="rtl"] .lv-num, [dir="rtl"] .lv-d { text-align: right; }
.lv-d { font-size: 13px; font-weight: 600; color: var(--text); display: flex; gap: 8px; align-items: baseline; justify-content: flex-end; }
.lv-d small { color: var(--muted); font-weight: 500; font-size: 12px; }
.lv.target .lv-num { color: var(--c); }
.lv.invalid .lv-num { color: var(--text); }
.lv-raw { font-size: 12.5px; margin-top: 4px; }
.ix-after { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }

.tl { margin-top: 14px; }
.tl-k { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tl-bar { position: relative; height: 12px; border-radius: 6px; background-color: var(--surface-3) !important; overflow: hidden; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); box-shadow: 0 0 6px rgba(255, 255, 255, .6); }
.tl-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--faint); margin-top: 4px; }

/* ---------- waves */
.wv-sum { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.sum-cell { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 1px; }
.sum-cell small { color: var(--muted); font-size: 12px; }
.sum-cell b { font-size: 24px; font-weight: 700; line-height: 1.2; }
.sum-cell span { font-size: 12px; color: var(--muted); }
.sum-cell.bull b { color: var(--green); }
.sum-cell.bear b { color: var(--red); }
[dir="rtl"] .sum-cell b[dir="ltr"], [dir="rtl"] .sum-cell span[dir="ltr"] { text-align: right; }

.run { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px; margin-bottom: 14px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px 16px; --c: var(--muted); }
.run.bull { --c: var(--green); }
.run.bear { --c: var(--red); }
.run.on { border-color: var(--c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.run-k { font-size: 12px; color: var(--muted); }
.run-main { display: flex; align-items: center; gap: 8px; color: var(--c); min-width: 0; }
.run-main svg { width: 18px; height: 18px; }
.run-main time { color: var(--muted); font-size: 12.5px; }
.run.none b { color: var(--muted); font-weight: 500; }
.run-dots { display: flex; gap: 5px; }
.run-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--border-strong); }
.run-dots i.on { background: var(--c); border-color: var(--c); }
.run.on .run-dots i.on { animation: glow 1.6s ease-in-out infinite; }
@keyframes glow { 50% { opacity: .55; } }

.wv-list { display: grid; gap: 10px; }
.wv {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 14px 16px;
  position: relative; overflow: hidden; --c: var(--muted); --c-bg: var(--surface-3);
}
.wv.bull { --c: var(--green); --c-bg: var(--green-bg); }
.wv.bear { --c: var(--red); --c-bg: var(--red-bg); }
.wv::before { content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px; background: var(--c); }
.wv-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--c-bg); color: var(--c); }
.wv-icon svg { width: 22px; height: 22px; stroke-width: 2.6; }
.wv-main { min-width: 0; }
.wv-title { display: flex; align-items: baseline; gap: 10px; }
.wv-title b { font-size: 15px; color: var(--c); }
.wv-title time { font-size: 12.5px; color: var(--muted); }
.wv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); border: 1px solid var(--border-strong); }
.tag.with { background: var(--primary-bg, rgba(91, 94, 246, .16)); color: var(--primary-text); border-color: rgba(91, 94, 246, .45); }
.tag.against { color: #c9a0a4; }
.tag.one { background: var(--yellow-bg); color: var(--yellow); border-color: rgba(240, 180, 41, .35); }
.wv-syms { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; justify-content: flex-end; }
.sym { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px 2px 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.sym i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 8.5px; font-weight: 700; background: #333; color: #fff; }
.wv-stats { display: grid; grid-template-columns: repeat(5, minmax(64px, auto)); gap: 4px; margin: 0; }
.wv-stats div { text-align: center; padding: 6px 8px; border-radius: 10px; background: rgba(0, 0, 0, .2); }
.wv-stats dt { font-size: 11px; color: var(--muted); white-space: nowrap; }
.wv-stats dd { margin: 0; font-size: 14px; font-weight: 700; }
.wv-stats .now { background: var(--surface-3); }

.gl-note { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------- narrow screens */
@media (max-width: 860px) {
  .wv { grid-template-columns: auto 1fr; }
  .wv-stats { grid-column: 1 / -1; grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 680px) {
  .gl { padding: 16px 16px 32px; }
  .gl-top { flex-wrap: wrap; gap: 10px 12px; margin-bottom: 14px; }
  .gl-logo { width: 40px; height: 40px; }
  .gl-title h1 { font-size: 18px; }
  .gl-clock { order: 3; margin-inline-start: 0; flex-direction: row; align-items: baseline; gap: 8px; }
  .gl-full { margin-inline-start: auto; }
  .gl-full.gl-theme { margin-inline-start: 0; }
  .gl-who { order: 4; width: 100%; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--border); }
  .ix-grid { grid-template-columns: 1fr; }
  .ix-price bdi { font-size: 32px; }
  .wv-sum { grid-template-columns: 1fr 1fr; }
  .wv-sum .sum-cell:first-child { grid-column: 1 / -1; }
  .run { grid-template-columns: 1fr; }
  .wv { padding: 12px; gap: 10px 12px; }
  .wv-icon { width: 38px; height: 38px; border-radius: 12px; }
  .wv-stats div { padding: 5px 2px; }
  .wv-stats dd { font-size: 13px; }
}
