:root {
  --bg: #0b0f14;
  --panel: #121820;
  --line: #1f2731;
  --txt: #e6ebf2;
  --dim: #7d8896;
  --gold: #f5a524;
  --up: #22c39a;
  --down: #f0525a;
  --va: #3b82f6;
  --poc: #facc15;
  --r: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--txt); }
body {
  font: 15px/1.5 "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  padding-bottom: calc(76px + var(--safe-b));
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.num, .price, .levels, .chips, .alerts .p { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }

/* header */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px 10px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.brand { font: 700 18px/1 "JetBrains Mono", monospace; letter-spacing: .5px; direction: ltr; }
.brand span { color: var(--gold); }
.session { flex: 1; color: var(--dim); font-size: 12px; }
.lang { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--dim); }

main { padding: 0 12px; }

/* asset chips */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line);
  font-size: 13px; font-weight: 700; color: var(--dim);
}
.chip i { font-style: normal; font-size: 11px; }
.chip.up i { color: var(--up); }
.chip.down i { color: var(--down); }
.chip.on { color: var(--txt); border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }

/* plan card */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.asset { font: 700 22px/1.1 "JetBrains Mono", monospace; direction: ltr; text-align: start; }
.price { color: var(--dim); font-size: 13px; margin-top: 4px; text-align: start; }
.bias {
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; white-space: nowrap;
  background: color-mix(in srgb, var(--c, var(--gold)) 16%, transparent); color: var(--c, var(--gold));
}
.bias.up { --c: var(--up); }
.bias.down { --c: var(--down); }

.chart { margin: 12px -6px 6px; height: 300px; }
.chart svg { width: 100%; height: 100%; display: block; }

.lines { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.lines li { position: relative; padding-inline-start: 16px; font-size: 15px; }
.lines li::before { content: ""; position: absolute; inset-inline-start: 0; top: .62em; width: 6px; height: 6px; border-radius: 2px; background: var(--gold); }
.lines li:first-child { font-weight: 700; }
.lines .num { color: var(--gold); direction: ltr; unicode-bidi: isolate; }

.levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
.lv { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; text-align: left; }
.lv b { display: block; font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; font-size: 10px; color: var(--dim); font-weight: 500; letter-spacing: .5px; }
.lv span { font-size: 13px; font-weight: 700; }
.lv.key { border-color: var(--gold); }
.lv.tg span { color: var(--gold); }
.lv.inv span { color: var(--down); }
.lv:active { transform: scale(.97); }

/* alerts */
.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alerts li {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px;
}
.alerts .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 20%, transparent); }
.alerts .dot.invalid { background: var(--down); box-shadow: 0 0 0 4px color-mix(in srgb, var(--down) 20%, transparent); }
.alerts .dot.tg { background: var(--up); box-shadow: 0 0 0 4px color-mix(in srgb, var(--up) 20%, transparent); }
.alerts .a { font-weight: 700; }
.alerts .a small { color: var(--dim); font-weight: 400; margin-inline-start: 6px; }
.alerts .p { direction: ltr; text-align: end; font-size: 13px; }
.alerts .p small { display: block; color: var(--dim); font-size: 11px; }

/* me + admin */
.me h2, .admin h2 { margin: 0 0 4px; font-size: 18px; }
.me .big { font: 700 44px/1 "JetBrains Mono", monospace; color: var(--gold); margin: 12px 0 2px; }
.me .row { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); color: var(--dim); }
.me .row span:last-child { color: var(--txt); }
.cta {
  display: block; width: 100%; margin-top: 14px; padding: 13px; border-radius: 12px; text-align: center;
  background: var(--gold); color: #111; font-weight: 700; text-decoration: none;
}
.admin form { display: grid; grid-template-columns: 1fr 80px auto; gap: 8px; margin: 10px 0; }
.admin input { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; color: var(--txt); padding: 10px; font: inherit; direction: ltr; }
.admin button { background: var(--gold); color: #111; border-radius: 10px; padding: 0 14px; font-weight: 700; }
.admin ul { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.admin li { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.admin li .paid { color: var(--up); }
.admin li .off { color: var(--down); }

/* states */
.state { text-align: center; color: var(--dim); padding: 48px 20px; }
.state h3 { color: var(--txt); margin: 10px 0 6px; }
.state .ico { font-size: 34px; }
.locked .chart, .locked .levels, .locked .lines { filter: blur(7px); pointer-events: none; user-select: none; }
.skeleton { background: linear-gradient(90deg, var(--panel), #18202a, var(--panel)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* tabs */
.tabs {
  position: fixed; inset: auto 0 0 0; z-index: 6;
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 8px 10px calc(8px + var(--safe-b));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tabs button { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px; color: var(--dim); font-size: 12px; }
.tabs i { font-style: normal; font-size: 18px; line-height: 1; }
.tabs .on { color: var(--gold); }
.tabs b { position: absolute; top: 2px; inset-inline-end: 28%; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--down); color: #fff; font-size: 11px; line-height: 18px; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%);
  background: #000c; color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 13px; z-index: 9;
}
