/* ARGPT Order Flow. Doomsday dark, the same tokens as alrizqi.com and the ARGPT
   calendar. Green and red carry meaning (buyers / sellers); everything else stays
   neutral. Fonts are self-hosted (Geist, OFL) so the page loads nothing from outside. */

@font-face {
  font-family: 'Geist'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/Geist-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Geist Mono'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(fonts/GeistMono-latin.woff2) format('woff2');
}

:root {
  --ink: #070A08;
  --surface: #0E1411;
  --surface-2: #121A16;
  --deep: #0C1A12;
  --text: #EDF3EE;
  --text-dim: #A3B3A8;
  --text-faint: #7E8F84;
  --line: #1E2A23;
  --line-strong: #2A3A31;
  --accent: #39D98A;
  --accent-line: #39D98A66;
  --buy: #39D98A;
  --sell: #FF6B81;
  --gold: #E7B44A;
  --hvn: rgba(58, 82, 68, .55);
  --lvn: rgba(124, 82, 140, .45);
  --font: 'Geist', -apple-system, 'SF Pro Display', 'Helvetica Neue', system-ui, sans-serif;
  --mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { height: 100%; background: var(--ink); color: var(--text); }
body { font: 400 14px/1.5 var(--font); -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums; }
::selection { background: rgba(57, 217, 138, .28); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.buy { color: var(--buy); }
.sell { color: var(--sell); }

/* small uppercase labels, as on alrizqi.com */
.label { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-faint); }

.pulse { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-faint);
  flex: none; }
.pulse.live { background: var(--buy); animation: pulse 2.6s ease-in-out infinite; }
.pulse.stale { background: var(--gold); }
.pulse.error { background: var(--sell); }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .pulse.live { animation: none; } }

.cta { padding: 11px 18px; border-radius: 999px; border: 1px solid var(--accent-line);
  background: var(--deep); color: var(--accent); font-weight: 600; letter-spacing: -.005em;
  transition: border-color .2s, background .2s; }
.cta:hover { border-color: var(--accent); background: #0F2318; }
.cta:disabled { opacity: .6; }
.ghost { width: 100%; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--line);
  color: var(--text-dim); font-weight: 500; transition: color .2s, border-color .2s; }
.ghost:hover { color: var(--text); border-color: var(--line-strong); }
.ghost.danger { color: var(--sell); }

/* ------------------------------------------------------------ login */
body.login { display: grid; place-items: center; padding: 16px; min-height: 100dvh; }
.login-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px 22px; }
.eyebrow { display: flex; align-items: center; gap: 9px; }
.login-card h1 { font-size: 44px; font-weight: 700; line-height: 1.02; letter-spacing: -.045em;
  margin: 16px 0 12px; }
.login-card h1 em { font-style: normal; color: var(--text-faint); }
.lede { color: var(--text-dim); margin-bottom: 22px; }
.login-card form .label { display: block; margin-bottom: 8px; }
.login-card input { width: 100%; padding: 13px 16px; font: 16px var(--font); color: var(--text);
  background: var(--ink); border: 1px solid var(--line); border-radius: 14px; outline: none; }
.login-card input:focus { border-color: var(--accent-line); }
.login-card .cta { width: 100%; margin-top: 12px; }
.err { color: var(--sell); min-height: 1.5em; margin-top: 10px; font-size: 13px; }
.fine { color: var(--text-faint); font-size: 12px; margin-top: 14px; }

/* ------------------------------------------------------------ app layout */
body.app { display: flex; flex-direction: column; height: 100dvh; overflow: hidden;
  padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left); }

.topbar { display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(7, 10, 8, .86); -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px); border-bottom: 1px solid var(--line); }
.brand { font-size: 15px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.brand span { color: var(--text-faint); font-weight: 500; }
.meta { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint);
  white-space: nowrap; }
.meta span { overflow: hidden; text-overflow: ellipsis; }
.meta.stale { color: var(--gold); }
.trial-badge { flex: none; padding: 4px 9px; border: 1px solid rgba(231, 180, 74, .5); border-radius: 999px;
  color: var(--gold); font-size: 11px; font-weight: 600; white-space: nowrap; }
@media (max-width: 400px) { .topbar .brand span { display: none; } }
.icon { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 999px;
  border: 1px solid var(--line); color: var(--text-dim); transition: color .2s, border-color .2s; }
.icon:hover { color: var(--text); border-color: var(--line-strong); }
#btn-menus svg { transition: transform .28s ease; }
#btn-menus[aria-expanded="false"] svg { transform: rotate(180deg); }

/* Menus between the top bar and the chart: slide up to give the chart the room.
   grid-template-rows 1fr -> 0fr animates to the content's real height. */
.controls { display: grid; grid-template-rows: 1fr; flex: none; transition: grid-template-rows .28s ease; }
.controls-in { min-height: 0; overflow: hidden; transition: opacity .2s ease; }
.controls.is-collapsed { grid-template-rows: 0fr; }
.controls.is-collapsed .controls-in { opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s .28s; }
@media (prefers-reduced-motion: reduce) { .controls, .controls-in, #btn-menus svg { transition: none; } }

/* With the menus hidden, the top bar keeps the market, timeframe and price. */
.mini { flex: none; display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.mini[hidden] { display: none; }
.mini span { font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-faint); }
.mini b { font-size: 14px; font-weight: 600; letter-spacing: -.01em; }
@media (max-width: 480px) { body.menus-hidden #status-text { display: none; } }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 16px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px;
  min-width: 0; }
.stat .label { display: block; font-size: 10px; letter-spacing: .1em; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.stat b { display: block; margin-top: 2px; font: 600 15px/1.3 var(--font); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 460px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px 10px; }
.feeds { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); }
.feed { padding: 6px 13px; border-radius: 999px; border: 1px solid transparent; font-size: 13px; font-weight: 500;
  color: var(--text-dim); transition: color .18s, border-color .18s, background .18s; }
.feed:hover { color: var(--text); }
.feed.is-active { color: var(--text); border-color: var(--line-strong); background: var(--line); }
.tog-row { padding-top: 0; }
/* Four pills on one line at 375 px; a narrower phone scrolls them sideways. */
.tog-row .feeds { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tog-row .feeds::-webkit-scrollbar { display: none; }
.tog-row .feed { flex: none; padding: 6px 8px; font-size: 12px; }
.tog { display: inline-flex; align-items: center; gap: 5px; }
.tog::before { content: ''; width: 6px; height: 6px; border-radius: 50%; border: 1px solid var(--text-faint); }
.tog.is-active::before { background: var(--accent); border-color: var(--accent); }
.tog:disabled { opacity: .4; }
.price { text-align: right; min-width: 0; }
.price .label { display: block; font-size: 10px; letter-spacing: .1em; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.price b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }

.chart-wrap { position: relative; flex: 1 1 auto; min-height: 240px; border-top: 1px solid var(--line);
  background: var(--ink); }
#heat { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 0; }  /* under the chart */
#chart { position: absolute; inset: 0; z-index: 0; }
#overlay { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 1; }
.empty { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; text-align: center;
  padding: 24px; color: var(--text-dim); max-width: 46ch; margin: 0 auto; }

/* ------------------------------------------------------------ legend */
.legend-box { position: absolute; top: 8px; left: 8px; z-index: 3; width: 142px; padding: 6px 9px 7px;
  background: rgba(7, 10, 8, .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 12px; font-size: 11px; line-height: 1.35; color: var(--text-dim); }
.lg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.lg-head .label { font-size: 10px; }
.lg-x { width: 26px; height: 26px; margin: -4px -6px -4px 0; border-radius: 999px; font-size: 18px; line-height: 1;
  color: var(--text-faint); }
.lg-x:hover { color: var(--text); }
.legend-box ul { list-style: none; display: grid; gap: 1px; }
.legend-box li { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.lg-foot { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); font-size: 10.5px;
  color: var(--text-faint); }
.lg-chip { position: absolute; top: 8px; left: 8px; z-index: 3; padding: 5px 12px; border-radius: 999px;
  background: rgba(7, 10, 8, .82); border: 1px solid var(--line); font-size: 10px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); }

.fp-chip { left: auto; right: 68px; }            /* JS keeps it just left of the price axis */
.fp-chip[aria-pressed="true"] { color: var(--text); border-color: var(--line-strong); }

/* legend keys, also used in settings */
.k { display: inline-block; flex: none; width: 18px; height: 10px; font-style: normal; }
.k.line { height: 0; border-top: 2px solid var(--gold); }
.k.line.dash { border-top: 1px dashed var(--gold); }
.k.band.hvn { background: var(--hvn); }
.k.band.lvn { background: var(--lvn); }
.k.band.zbuy { background: rgba(57, 217, 138, .38); border-top: 1px solid rgba(57, 217, 138, .7); }
.k.band.zsell { background: rgba(255, 107, 129, .38); border-top: 1px solid rgba(255, 107, 129, .7); }
.k.tri { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; }
.k.tri.up { border-bottom: 9px solid var(--buy); }
.k.tri.down { border-top: 9px solid var(--sell); margin-left: -4px; }
.k.circ { width: 9px; height: 9px; border-radius: 50%; }
.k.circ.buy { background: var(--buy); }
.k.circ.sell { background: var(--sell); margin-left: -4px; }
.k.fp { height: 11px; border-left: 2px solid var(--buy);
  background: linear-gradient(180deg, rgba(255, 107, 129, .35) 0 33%, rgba(57, 217, 138, .5) 33% 66%,
  rgba(57, 217, 138, .2) 66%); }
.k.heat { background: linear-gradient(90deg, #240634, #440154 15%, #365C8D 40%, #1F9E89 65%, #A0DA39 88%, #FDE725); }
.k.magk { width: 14px; height: 14px; border: 2px solid var(--text-dim); border-radius: 50%; position: relative; }
.k.magk::after { content: ''; position: absolute; width: 6px; height: 2px; background: var(--text-dim);
  right: -6px; bottom: -3px; transform: rotate(45deg); }
.k.dcol { height: 11px; background: linear-gradient(180deg, rgba(57, 217, 138, .55) 0 50%, rgba(255, 107, 129, .55) 50%); }
.k.txt { width: auto; height: auto; font: 500 10.5px var(--mono); color: var(--buy); }
.k.bars { height: 10px; background: linear-gradient(90deg, var(--buy) 0 22%, transparent 22% 39%,
  var(--sell) 39% 61%, transparent 61% 78%, var(--buy) 78%); }

/* ------------------------------------------------------------ magnify window */
.mag { position: absolute; z-index: 4; width: 256px; padding: 8px 6px 6px; border-radius: 12px;
  background: rgba(9, 13, 11, .95); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.mag-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.mag-head b { font-size: 12.5px; font-weight: 600; }
.mag-sub { padding: 2px 4px 0; font: 500 10px var(--mono); color: var(--text-faint); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.mag-tot { padding: 2px 4px 6px; font: 600 11px var(--mono); }
.mag-tot.buy { color: var(--buy); }
.mag-tot.sell { color: var(--sell); }
#mag-cv { display: block; margin: 0 auto; }
.mag-note { padding: 4px 4px 0; font-size: 10px; color: var(--text-faint); }
.mag-note:empty { display: none; }

/* ------------------------------------------------------------ tap details */
.tip { position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 5;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 14px; padding: 11px 14px;
  font-size: 13px; color: var(--text-dim); box-shadow: 0 12px 36px rgba(0, 0, 0, .55); }
.tip b { display: block; color: var(--text); font-weight: 600; margin-bottom: 2px; }

/* ------------------------------------------------------------ settings */
dialog.sheet { width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); overflow: auto;
  margin: auto; background: var(--surface); color: var(--text); border: 1px solid var(--line);
  border-radius: 20px; padding: 18px 18px 20px; }
dialog.sheet::backdrop { background: rgba(3, 5, 4, .7); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet h2 { font-size: 22px; font-weight: 700; letter-spacing: -.03em; }
.sheet h3 { margin: 20px 0 8px; font-size: 10.5px; }
.desc { display: block; color: var(--text-dim); font-size: 13px; line-height: 1.45; }
.desc.small { font-size: 12px; color: var(--text-faint); min-height: 1.2em; margin: 6px 0; }
.row { display: flex; gap: 8px; margin-top: 10px; }
.row input { flex: 1; min-width: 0; padding: 11px 14px; font: 16px var(--font); color: var(--text);
  background: var(--ink); border: 1px solid var(--line); border-radius: 999px; outline: none; }
.row input:focus { border-color: var(--accent-line); }
.opt { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.kbox { flex: none; width: 22px; height: 20px; display: flex; align-items: center; justify-content: flex-start; }
.opt-txt { flex: 1; min-width: 0; }
.opt-txt b { display: block; font-weight: 600; font-size: 14px; margin-bottom: 1px; }
.note { margin: 16px 0 12px; padding: 11px 13px; border: 1px solid rgba(231, 180, 74, .28); border-radius: 14px;
  color: var(--text-dim); font-size: 12.5px; }

/* on/off switch */
.switch { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 40px; height: 24px;
  margin-top: 2px; border-radius: 999px; background: var(--line); border: 1px solid var(--line-strong);
  cursor: pointer; transition: background .2s, border-color .2s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-faint); transition: transform .2s, background .2s; }
.switch:checked { background: var(--deep); border-color: var(--accent-line); }
.switch:checked::after { transform: translateX(16px); background: var(--accent); }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }

/* market tabs above the stats */
.sym-row { padding-bottom: 0; }
.sym-row .feeds { flex-wrap: wrap; }
/* Bybit / All exchanges: beside the markets, onto its own line when the phone is narrow. */
.sym-row { flex-wrap: wrap; row-gap: 8px; }
.srcs .feed { padding: 6px 11px; }
