/* Layout: phone-first app shell, one column with a fixed bottom tab bar; on wide screens a top bar and two-column grids. */
:root {
  --bg: #0A0D12;
  --surface: #121822;
  --surface-2: #18202C;
  --line: #263040;
  --fg: #EEF1F5;
  --muted: #A3ADBB;
  --gold: #E7B54A;
  --gold-hi: #F4CD74;
  --gold-ink: #16110A;
  --gold-soft: #251E10;
  --gold-line: #5C4A1F;
  --up: #3FD08F;
  --up-soft: #0F2A1D;
  --down: #FF8080;
  --down-soft: #2C1414;
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --radius: 14px;
  color-scheme: dark;
}
:root[data-brand="blue"] {
  --bg: #060A2A;
  --surface: #0D1446;
  --surface-2: #131B56;
  --line: #243081;
  --muted: #AEB7DA;
  --gold-soft: #1D1C2E;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, video { max-width: 100%; display: block; }
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; line-height: 1.12; }
h1 { font-size: clamp(30px, 7vw, 46px); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.num { white-space: nowrap; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.topbar-in {
  max-width: 1120px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand img { width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--gold-line); }
.brand b { display: block; white-space: nowrap; font-family: var(--display); font-size: 16px; letter-spacing: 0.01em; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.topnav { display: none; gap: 4px; }
.topnav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.topnav a[aria-current="page"] { color: var(--gold); background: var(--gold-soft); }
.top-actions { display: flex; gap: 8px; align-items: center; }
.lang { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.lang button { min-width: 40px; min-height: 42px; border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: 12.5px; letter-spacing: 0.04em; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; }

main {
  max-width: 1120px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 16px 120px;
}
.view { display: flex; flex-direction: column; gap: 26px; }
.section { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.section-head a { font-size: 13.5px; font-weight: 600; text-decoration: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.tabbar a { min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; }
.tabbar a[aria-current="page"] { color: var(--gold); }
.tabbar svg, .topnav svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  main { padding-block: 24px 64px; }
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* ---------- pieces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card.gold { background: var(--gold-soft); border-color: var(--gold-line); }
.card.up { background: var(--up-soft); border-color: color-mix(in srgb, var(--up) 35%, transparent); }
.card.down { background: var(--down-soft); border-color: color-mix(in srgb, var(--down) 35%, transparent); }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.grid-3 { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2s { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.btn {
  min-height: 50px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line);
  background: transparent; color: var(--fg); font-weight: 700; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; cursor: pointer;
}
.btn:hover { color: var(--fg); border-color: var(--muted); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.btn.primary:hover { background: var(--gold-hi); color: var(--gold-ink); }
.btn.sm { min-height: 40px; font-size: 13px; padding: 0 12px; border-radius: 10px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.chip[aria-pressed="true"], .chip.on { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.seg { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; overflow-x: auto; }
.seg button { flex: 1 0 auto; min-height: 42px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button[aria-selected="true"] { background: var(--gold); color: var(--gold-ink); }

.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; padding: 4px 9px; border-radius: 7px; white-space: nowrap; }
.badge.buy, .badge.open { background: var(--up); color: #062014; }
.badge.sell { background: var(--down); color: #2A0707; }
.badge.gold { background: var(--gold); color: var(--gold-ink); }
.badge.ghost { border: 1px solid var(--line); color: var(--muted); }
.badge.live { background: #E5484D; color: #fff; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #E5484D; box-shadow: 0 0 0 0 rgba(229,72,77,.6); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(229,72,77,0); } 100% { box-shadow: 0 0 0 0 rgba(229,72,77,0); } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } .ticker-track { animation: none !important; } }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.list li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #D6DBE3; }
.list li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 8px; border-radius: 2px; background: var(--gold); transform: rotate(45deg); }
.note { font-size: 12.5px; color: var(--muted); }
.warn { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--down-soft); border: 1px solid color-mix(in srgb, var(--down) 35%, transparent); color: #FFD2D2; font-size: 13.5px; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- ticker ---------- */
.ticker { margin-inline: calc(-1 * max(16px, env(safe-area-inset-left, 0px))); border-block: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.ticker .tv { min-height: 0; }
.ticker-fallback { overflow: hidden; }
.ticker-track { display: inline-flex; gap: 26px; padding: 12px 16px; white-space: nowrap; animation: slide 38s linear infinite; font-size: 13px; }
.ticker-track span b { color: var(--muted); font-weight: 600; margin-right: 6px; }
@keyframes slide { to { transform: translateX(-50%); } }

/* ---------- hero ---------- */
.hero { display: grid; gap: 18px; }
.hero-img { border-radius: 16px; border: 1px solid var(--gold-line); width: 100%; aspect-ratio: 1672 / 941; object-fit: cover; }
.hero-copy { display: flex; flex-direction: column; gap: 12px; }
.lead { font-size: 16px; color: #D2D8E0; max-width: 62ch; }
.fourfm { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--gold-line); border-radius: 12px; overflow: hidden; }
.fourfm div { padding: 10px 6px; text-align: center; font-weight: 700; font-size: 13px; border-left: 1px solid var(--gold-line); }
.fourfm div:first-child { border-left: 0; }
@media (min-width: 900px) { .hero { grid-template-columns: 1.1fr 1fr; align-items: center; } }

.tile { min-height: 92px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 10px 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--fg); text-decoration: none; font-size: 12.5px; font-weight: 700; text-align: center; }
.tile svg { width: 24px; height: 24px; color: var(--gold); }
.tile:hover { border-color: var(--gold-line); color: var(--fg); }
@media (min-width: 700px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; } }

/* ---------- signals & posts ---------- */
.signal { display: flex; flex-direction: column; gap: 10px; }
.signal .pair { font-family: var(--display); font-size: 18px; font-weight: 800; }
.signal .levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.signal .levels div { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.signal .levels span { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.signal .levels b { font-family: var(--mono); font-size: 14px; }
.post-img { border-radius: 10px; width: 100%; object-fit: cover; max-height: 360px; background: var(--bg); }
.by { font-size: 12.5px; color: var(--muted); }

/* ---------- slider ---------- */
.slider { border-radius: 16px; overflow: hidden; border: 1px solid var(--gold-line); background: #000; }
.slider video, .slider iframe { width: 100%; height: min(70vh, 520px); object-fit: contain; background: #000; border: 0; }
.slider-bar { background: var(--surface); border-top: 2px solid var(--gold); padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.thumbs button { height: 64px; padding: 0; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); cursor: pointer; opacity: 0.6; }
.thumbs button[aria-pressed="true"] { border: 2px solid var(--gold); opacity: 1; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; display: grid; place-items: center; cursor: pointer; flex: none; }
.round.primary { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }

/* ---------- plans ---------- */
.plan-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.plan-row:first-of-type { border-top: 0; }
.price { font-family: var(--mono); font-weight: 700; font-size: 17px; text-align: right; }
.price s { color: var(--muted); font-weight: 500; font-size: 13px; margin-right: 6px; }
.price small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
.off { color: var(--up); font-size: 12px; font-weight: 800; }

.photo-card { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--gold-line); aspect-ratio: 4 / 3.6; max-height: 420px; background: #0A1150; }
.photo-card img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.photo-card .cap { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(6, 10, 32, 0.88); border-top: 2px solid var(--gold); padding: 12px 16px; }
.photo-card .badge { position: absolute; left: 12px; top: 12px; }

/* ---------- forms ---------- */
form.stack { gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label, .field legend { font-size: 13px; font-weight: 700; color: #CBD2DC; }
.field input, .field select, .field textarea { min-height: 48px; width: 100%; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); padding: 10px 12px; font-size: 15px; }
.field textarea { min-height: 90px; resize: vertical; }
.field input[type="file"] { border-style: dashed; border-color: var(--gold-line); padding: 12px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; font-weight: 600; cursor: pointer; }
.checks input { accent-color: var(--gold); width: 16px; height: 16px; min-height: 0; }
.result { padding: 14px; border-radius: 12px; }
.code-box { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: 0.06em; color: var(--fg); }

/* ---------- calculators ---------- */
.calc-out { background: var(--bg); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.tp-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; font-family: var(--mono); font-size: 13px; }
.tp-list div { background: var(--surface); border-radius: 8px; padding: 6px 8px; display: flex; justify-content: space-between; gap: 6px; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; min-height: 50vh; }
.msg { max-width: 86%; padding: 11px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.5; white-space: pre-line; }
.msg.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.me { align-self: flex-end; background: var(--gold); color: var(--gold-ink); font-weight: 600; border-bottom-right-radius: 4px; }
.msg .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chat-input { position: sticky; bottom: 70px; display: flex; gap: 8px; padding-block: 10px; background: var(--bg); }
@media (min-width: 900px) { .chat-input { bottom: 0; } }
.chat-input input { flex: 1; min-height: 48px; border-radius: 24px; border: 1px solid var(--line); background: var(--surface); padding: 0 16px; min-width: 0; }
.sys { align-self: center; font-size: 12px; color: #9DE6C2; background: var(--up-soft); border: 1px solid color-mix(in srgb, var(--up) 30%, transparent); border-radius: 999px; padding: 6px 12px; }

/* ---------- payment ---------- */
.pay { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.pay:first-child { border-top: 0; }
.pay .val { font-family: var(--mono); font-size: 12.5px; color: var(--muted); word-break: break-all; }

/* ---------- feedback ---------- */
.fb-slide { min-height: 300px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.fb-slide img { border-radius: 10px; max-height: 420px; width: 100%; object-fit: contain; background: var(--bg); }
.dots { display: flex; gap: 6px; justify-content: center; }
.dots span { width: 8px; height: 8px; border-radius: 4px; background: var(--line); }
.dots span.on { width: 22px; background: var(--gold); }
.stat { font-family: var(--display); font-weight: 800; font-size: 30px; line-height: 1; }

/* ---------- book ---------- */
.book-head { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; }
.book-head img { border-radius: 4px 8px 8px 4px; border: 1px solid var(--gold-line); }
.tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tagcloud span { font-size: 12.5px; padding: 5px 9px; border-radius: 7px; background: var(--bg); border: 1px solid var(--line); color: #CBD2DC; }

/* ---------- footer ---------- */
footer.site { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-weight: 700; font-size: 13.5px; z-index: 40; }
.tv-wrap { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); min-height: 420px; }
.yt { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: center; text-decoration: none; color: var(--fg); }
.yt img { border-radius: 8px; aspect-ratio: 16 / 9; object-fit: cover; background: var(--surface-2); }

@media (max-width: 420px) { .brand span { display: none; } .brand img { width: 38px; height: 38px; } .top-actions { gap: 6px; } #install-btn { padding: 0 10px; font-size: 12px; } }
