:root {
  --bg: #0b0e14;
  --panel: #121722;
  --panel-2: #171d2a;
  --line: #242c3b;
  --text: #eef2f7;
  --muted: #9aa5b5;
  --faint: #6b7686;
  --go: #22c55e;
  --go-bg: #0f2a1b;
  --ready: #f5b83d;
  --ready-bg: #2b2210;
  --trade: #4ea1ff;
  --trade-bg: #0f2036;
  --stop: #ff6b6b;
  --stop-bg: #2e1416;
  --gray: #8a95a6;
  --gray-bg: #1a202b;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.5; }
a { color: inherit; }
b { font-weight: 700; }

/* Top bar */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; border-bottom: 1px solid var(--line); background: #0d1119; position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800;
  background: linear-gradient(135deg, #f5b83d, #d98a1c); color: #1a1205; font-size: 20px; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: .02em; }
.brand-sub { font-size: 12px; color: var(--muted); }
.bar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.live-dot.ok { background: var(--go); box-shadow: 0 0 0 4px rgba(34,197,94,.15); }
.live-dot.bad { background: var(--stop); }
.live-text { font-size: 13px; color: var(--muted); margin-right: 6px; }
.clock { font-size: 13px; color: var(--muted); margin-right: 6px; font-variant-numeric: tabular-nums; }

.btn { font: inherit; font-size: 14px; font-weight: 600; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: #3a4558; }
.btn.icon { width: 38px; padding: 8px 0; text-align: center; }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.primary { background: var(--go); color: #06200f; border-color: transparent; }
.btn.on { border-color: rgba(34,197,94,.5); color: #b6f3cb; }
.btn.arm { border-color: rgba(245,184,61,.6); color: #ffd98a; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(245,184,61,.18); } }

main { max-width: 1200px; margin: 0 auto; padding: 20px 24px 40px; }

/* Today strip */
.today { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile-label { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile strong { display: block; font-size: 20px; margin: 2px 0; }
.tile small { color: var(--muted); font-size: 13px; }

/* Market cards */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
  border-top: 6px solid var(--gray); display: flex; flex-direction: column; gap: 14px; min-height: 360px; }
.card.loading { color: var(--muted); align-items: center; justify-content: center; grid-column: 1 / -1; min-height: 200px; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.market { font-size: 22px; font-weight: 800; }
.market small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.price { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }

.pill { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .08em; padding: 5px 12px; border-radius: 999px;
  background: var(--gray-bg); color: var(--gray); }
.headline { font-size: 28px; font-weight: 800; line-height: 1.2; margin: 6px 0 0; }
.explain { color: #cfd6e0; margin: 0; font-size: 16px; }

.s-GO { background: var(--go-bg); color: var(--go); }
.s-GET_READY { background: var(--ready-bg); color: var(--ready); }
.s-IN_TRADE { background: var(--trade-bg); color: var(--trade); }
.s-NO_DATA { background: var(--stop-bg); color: var(--stop); }
.card.c-GO { border-top-color: var(--go); box-shadow: 0 0 0 1px rgba(34,197,94,.35), 0 10px 40px rgba(34,197,94,.12); }
.card.c-GET_READY { border-top-color: var(--ready); }
.card.c-IN_TRADE { border-top-color: var(--trade); }
.card.c-NO_DATA { border-top-color: var(--stop); }
.card.c-GO .headline { color: var(--go); }

/* Trade numbers */
.numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.num { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.num span { display: block; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.num strong { display: block; font-size: 22px; font-variant-numeric: tabular-nums; }
.num em { font-style: normal; font-size: 13px; color: var(--muted); }
.num.stop strong { color: var(--stop); }
.num.target strong { color: var(--go); }
.timer { font-size: 14px; color: var(--ready); font-weight: 600; }

.steps-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.steps { margin: 4px 0 0; padding-left: 22px; display: grid; gap: 6px; }
.steps li { padding-left: 4px; }

.trend { margin-top: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.trend-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-weight: 600; }
.arrow-up { color: var(--go); } .arrow-down { color: var(--stop); } .arrow-side { color: var(--ready); }
.trend p { margin: 4px 0 0; color: var(--muted); }

details.why summary { cursor: pointer; color: var(--muted); font-size: 14px; }
details.why ul { margin: 6px 0 0; padding-left: 20px; color: #cfd6e0; font-size: 14px; }

.footnote { color: var(--faint); font-size: 13px; text-align: center; margin-top: 22px; }
.go-word { color: var(--go); }

/* Drawers */
.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 20; display: flex; justify-content: flex-end; }
.drawer[hidden] { display: none; }
.drawer-inner { width: min(520px, 100%); height: 100%; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--line); padding: 20px 22px 40px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.drawer h2 { margin: 0; font-size: 22px; }
.drawer h3 { margin: 22px 0 8px; font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.howto { padding-left: 22px; display: grid; gap: 8px; }
.legend { list-style: none; padding: 0; display: grid; gap: 8px; }
.legend .pill { min-width: 150px; text-align: center; margin-right: 8px; }
.glossary dt { font-weight: 700; margin-top: 10px; }
.glossary dd { margin: 2px 0 0; color: #cfd6e0; }
.field { display: grid; gap: 6px; margin: 16px 0; font-size: 14px; color: var(--muted); }
.field input { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.muted { color: var(--faint); font-size: 13px; }

@media (max-width: 860px) {
  .cards { grid-template-columns: 1fr; }
  .today { grid-template-columns: 1fr; }
  .bar { padding: 12px 16px; }
  main { padding: 16px 16px 32px; }
  .headline { font-size: 24px; }
  .numbers { grid-template-columns: 1fr 1fr 1fr; }
  .num strong { font-size: 18px; }
}

/* Three timeframes: 4H direction, 1H confirm, 5m entry */
.tfs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tf { display: grid; gap: 1px; }
.tf-label { font-weight: 700; color: var(--text); }
.tf-role { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.tf-word { font-weight: 600; font-size: 14px; }
@media (max-width: 860px) { .tfs { grid-template-columns: 1fr; } }
.against { color: var(--gray); }

/* Testing in the background */
.testing { margin-top: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.testing summary { cursor: pointer; font-weight: 700; }
.test-row { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.test-title { font-weight: 700; }
.test-line { font-variant-numeric: tabular-nums; }
.learned-list { margin: 8px 0; padding-left: 20px; display: grid; gap: 4px; }
