:root {
  --bg: #0A0A0C;
  --surface: #141418;
  --surface-2: #1E1E24;
  --line: #24242A;
  --line-2: #2A2A31;
  --text: #F2EFE8;
  --muted: #9A968C;
  --faint: #8A867D;
  --gold: #D4B06A;
  --gold-2: #E8C98A;
  --gold-ink: #1A1408;
  --gold-line: #3A3220;
  --green: #7FE0C2;
  --green-bg: #173A31;
  --red: #F4A08A;
  --red-bg: #3B1E18;
  --amber-bg: #2E2817;
  --radius: 18px;
  --nav-h: 72px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
body { min-height: 100dvh; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--gold); }
a:hover { color: var(--gold-2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.small { font-size: 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.gold { color: var(--gold); }
.green { color: var(--green); }
.red { color: var(--red); }
.hidden { display: none !important; }

.boot { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.brand-mark { font-family: var(--serif); font-weight: 600; letter-spacing: 6px; font-size: 34px; color: var(--gold); }

/* ---------- layout ---------- */
.shell { max-width: 520px; margin: 0 auto; min-height: 100dvh; position: relative; }
.page {
  padding: calc(16px + env(safe-area-inset-top)) 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px;
}
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; padding-top: 6px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.title { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.05; }
.section-title { margin: 0; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); font-weight: 600; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.premium { background: #16161B; border-color: var(--gold-line); border-radius: 22px; padding: 18px; }
.tile { background: var(--surface-2); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile .label { font-size: 11px; color: var(--muted); }
.tile .value { font-family: var(--mono); font-size: 15px; overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* ---------- buttons & inputs ---------- */
.btn { min-height: 46px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-weight: 600; font-size: 14px; padding: 0 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.primary { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); font-weight: 700; }
.btn.ghost-gold { color: var(--gold); border-color: var(--gold-line); }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; font-size: 12px; padding: 0 12px; border-radius: 10px; }
.btn:disabled { opacity: .5; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.input { height: 48px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); padding: 0 14px; font-size: 16px; width: 100%; min-width: 0; }
.input.mono { font-family: var(--mono); }

.seg { display: grid; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.seg button { min-height: 40px; border-radius: 10px; border: none; background: transparent; color: #C9C5BB; font-weight: 600; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--gold); color: var(--gold-ink); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.pill.buy { background: var(--green-bg); color: var(--green); }
.pill.sell { background: var(--red-bg); color: var(--red); }
.pill.neutral { background: var(--amber-bg); color: var(--gold-2); }
.pill.strong { background: var(--gold); color: var(--gold-ink); }
.pill.tp { background: linear-gradient(135deg, #FF7A00, #FFB23F); color: #1F1000; box-shadow: 0 0 14px rgba(255, 140, 0, .45); }

/* TP reached: bright orange tile that stands out from the rest of the card */
.tile.tp-hit {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, #FF7A00 0%, #FF9A1F 55%, #FFC15A 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 220, 160, .7), 0 6px 22px rgba(255, 122, 0, .38);
  animation: tpglow 2.4s ease-in-out infinite;
}
.tile.tp-hit .label { color: #2B1600; font-weight: 800; letter-spacing: .5px; display: flex; align-items: center; gap: 6px; }
.tile.tp-hit .value { color: #1F1000; font-weight: 700; }
.tile.tp-hit .hit-badge { background: #1F1000; color: #FFB23F; font-size: 9px; font-weight: 800; letter-spacing: 1.5px; padding: 2px 6px; border-radius: 999px; }
.tile.tp-hit .hit-pips { font-family: var(--mono); font-size: 11px; font-weight: 700; color: #3A1E00; }
.tile.tp-hit::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  animation: tpshine 3.2s ease-in-out infinite;
}
@keyframes tpglow { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(255,220,160,.7), 0 6px 22px rgba(255,122,0,.30); } 50% { box-shadow: inset 0 0 0 1px rgba(255,220,160,.9), 0 6px 30px rgba(255,122,0,.60); } }
@keyframes tpshine { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) { .tile.tp-hit, .tile.tp-hit::after { animation: none; } .tile.tp-hit::after { display: none; } }

.zone-pips { font-family: var(--sans); font-size: 11px; font-weight: 700; color: var(--gold-2); background: var(--amber-bg); border: 1px solid var(--gold-line); border-radius: 999px; padding: 2px 8px; margin-left: 6px; white-space: nowrap; vertical-align: middle; }

/* Released news impact */
.impact { display: flex; flex-direction: column; align-items: stretch; gap: 4px; flex-shrink: 0; }
.imp { font-size: 11px; font-weight: 800; letter-spacing: .5px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; text-align: center; }
.imp.up { background: var(--green-bg); color: var(--green); }
.imp.down { background: var(--red-bg); color: var(--red); }
.imp.flat { background: var(--surface-2); color: #C9C5BB; }
.imp.exp { background: transparent; border: 1px dashed #5A5A63; color: #B9B5AB; padding: 2px 7px; }

/* Admin support (Telegram) */
.card.support { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); }
.card.support:hover { border-color: #2AABEE; color: var(--text); }
.tg-mark { width: 42px; height: 42px; border-radius: 50%; background: #2AABEE; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Open MT5 button */
.btn.mt5 {
  min-height: 40px; gap: 7px; padding: 0 12px 0 6px; border-radius: 999px; flex-shrink: 0; font-size: 13px;
  background: linear-gradient(135deg, #1E3A8A, #2563EB); border-color: #3B82F6; color: #fff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, .35);
}
.btn.mt5:hover { filter: brightness(1.08); }
.mt5-mark { font-family: var(--mono); font-weight: 700; font-size: 10px; background: #fff; color: #1E3A8A; border-radius: 999px; padding: 6px 7px; letter-spacing: .5px; }

.bar { height: 6px; border-radius: 3px; background: #26262D; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 3px; }

/* ---------- signal ---------- */
.side-badge { padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; letter-spacing: 1px; }
.reason { display: flex; gap: 8px; font-size: 13px; line-height: 1.4; }
.reason .mark { font-family: var(--mono); font-size: 12px; min-width: 26px; }
.reason .pts { margin-left: auto; font-family: var(--mono); color: var(--muted); white-space: nowrap; }

.news-row { display: flex; gap: 14px; padding: 14px 16px; border-bottom: 1px solid #222228; align-items: flex-start; }
.news-row:last-child { border-bottom: none; }

/* ---------- history ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 72px; }
.bars .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.bars .col span.b { width: 100%; max-width: 28px; border-radius: 4px; }
.bars .col span.l { font-size: 10px; color: var(--faint); white-space: nowrap; }
.hist-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: #C9C5BB; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--gold); background: var(--amber-bg); color: var(--gold-2); }

/* ---------- sessions ---------- */
.timeline { position: relative; display: flex; flex-direction: column; gap: 10px; }
.tl-row { display: flex; align-items: center; gap: 10px; }
.tl-row .name { width: 70px; font-size: 12px; color: #C9C5BB; }
.tl-track { flex: 1; height: 14px; border-radius: 7px; background: var(--surface-2); position: relative; overflow: hidden; }
.tl-track span { position: absolute; top: 0; bottom: 0; border-radius: 7px; }
.tl-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--text); }

/* ---------- nav ---------- */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: rgba(15, 15, 18, .96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.nav-inner { max-width: 520px; margin: 0 auto; display: flex; justify-content: space-around; }
.nav button { background: none; border: none; color: var(--faint); display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 60px; min-height: 52px; padding: 6px 0; font-size: 11px; font-weight: 600; cursor: pointer; }
.nav button[aria-current="page"] { color: var(--gold); }
.nav svg { width: 22px; height: 22px; }

/* ---------- auth ---------- */
.auth { max-width: 420px; margin: 0 auto; min-height: 100dvh; padding: 32px 20px; display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.notice { border-radius: 14px; padding: 12px 14px; font-size: 13px; line-height: 1.5; background: var(--surface); border: 1px solid var(--line); }
.notice.error { border-color: #5A2A22; color: var(--red); }
.notice.ok { border-color: #1F4A3E; color: var(--green); }
.disclaimer { font-size: 11px; line-height: 1.5; color: var(--faint); }

/* ---------- admin ---------- */
.member { display: flex; flex-direction: column; gap: 10px; padding: 14px 0; border-bottom: 1px solid #222228; }
.member:last-child { border-bottom: none; }
.member .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.token { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: #26262D; color: var(--text); padding: 10px 16px; border-radius: 12px; font-size: 13px; z-index: 50; box-shadow: 0 8px 24px rgba(0,0,0,.4); max-width: calc(100% - 32px); }
