:root {
  --bg: #05070e;
  --panel: rgba(13, 18, 32, 0.74);
  --panel-solid: #0b1120;
  --line: rgba(34, 211, 238, 0.18);
  --cyan: #22d3ee;
  --pink: #ec4899;
  --purple: #a855f7;
  --up: #00f29b;
  --down: #ff2a55;
  --wait: #f59e0b;
  --text: #e6f1ff;
  --muted: #8b9cb8;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(34, 211, 238, 0.12), transparent 60%),
    radial-gradient(700px 460px at 90% 8%, rgba(236, 72, 153, 0.10), transparent 62%),
    radial-gradient(700px 500px at 50% 110%, rgba(168, 85, 247, 0.10), transparent 60%);
  pointer-events: none;
  z-index: -2;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 20%, #000 35%, transparent 82%);
  -webkit-mask-image: radial-gradient(circle at 50% 20%, #000 35%, transparent 82%);
}

.glow { position: fixed; border-radius: 50%; filter: blur(90px); pointer-events: none; z-index: -1; }
.glow--cyan { width: 300px; height: 300px; background: rgba(34, 211, 238, 0.16); top: -90px; left: -80px; }
.glow--pink { width: 320px; height: 320px; background: rgba(236, 72, 153, 0.14); bottom: -120px; right: -100px; }

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.22);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.86em;
}

/* ---------- GATE ---------- */
.gate {
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 18px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
}

.brand { text-align: center; }

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  object-fit: cover;
  border: 1px solid rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 34px rgba(34, 211, 238, 0.28);
  background: #05070e;
}

.eyebrow {
  margin: 14px 0 4px;
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--cyan);
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.wordmark {
  margin: 2px 0 6px;
  font-size: clamp(34px, 10vw, 46px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.wordmark span:last-child { color: #fff; }
.wordmark em {
  font-style: normal;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(236, 72, 153, 0.35);
}

.tagline {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.orb-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 6px 0 0;
}
.orb-stage canvas { width: min(340px, 86vw); height: auto; display: block; }
.orb-stage--gate canvas { width: min(300px, 78vw); }

.orb-caption {
  margin: -6px 0 0;
  font-size: 10px;
  letter-spacing: 0.26em;
  color: rgba(139, 156, 184, 0.9);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: center;
  min-height: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 16px;
}

.card--gate { display: flex; flex-direction: column; gap: 10px; }

.field-label {
  font-size: 10px;
  letter-spacing: 0.3em;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.input {
  width: 100%;
  padding: 14px 14px;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: rgba(2, 6, 16, 0.85);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 0.06em;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input::placeholder { color: #4b5b75; }
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 13px 16px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  font-family: inherit;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn--block { width: 100%; }

.btn--primary {
  background: linear-gradient(135deg, #0ea5b7 0%, #22d3ee 42%, #a855f7 100%);
  color: #041016;
  box-shadow: 0 10px 30px rgba(34, 211, 238, 0.28), 0 0 0 1px rgba(34, 211, 238, 0.25) inset;
}
.btn--primary:hover { box-shadow: 0 14px 40px rgba(34, 211, 238, 0.36); }

.btn--wa {
  background: linear-gradient(135deg, #0f7a4d, #25d366);
  color: #04120b;
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.22);
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.12);
  font-size: 13px;
  padding: 11px 14px;
}

.btn--mic {
  flex: 1;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.22), rgba(168, 85, 247, 0.22));
  border-color: rgba(236, 72, 153, 0.45);
}
.btn--mic.is-live {
  background: linear-gradient(135deg, #db2777, #a855f7);
  color: #fff;
  animation: pulseMic 1.1s ease-in-out infinite;
}

@keyframes pulseMic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(236, 72, 153, 0.45); }
  50% { box-shadow: 0 0 0 12px rgba(236, 72, 153, 0); }
}

.msg {
  margin: 0;
  min-height: 18px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.msg.is-error { color: #ff8fa8; }
.msg.is-ok { color: var(--up); }

.card--steps summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #b9cbe6;
}
.card--steps ol { margin: 12px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.card--steps li { margin-bottom: 4px; }

.risk-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: #63748f;
  text-align: center;
  padding: 0 8px;
}

/* ---------- APP ---------- */
.app { min-height: 100dvh; max-width: 560px; margin: 0 auto; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(5, 7, 14, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(34, 211, 238, 0.14);
}

.topbar-brand { display: flex; align-items: center; gap: 9px; }
.topbar-brand img { border-radius: 10px; border: 1px solid rgba(34, 211, 238, 0.3); }
.topbar-name { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.topbar-name em {
  font-style: normal;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.18em;
  color: #7dffc8;
  border: 1px solid rgba(0, 242, 155, 0.28);
  background: rgba(0, 242, 155, 0.08);
  padding: 5px 8px;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--up);
  box-shadow: 0 0 10px var(--up);
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 10px;
  width: 36px; height: 36px;
  font-size: 15px;
  cursor: pointer;
  color: var(--text);
}
.icon-btn.is-off { opacity: 0.45; }

.screens { padding: 14px 14px 104px; display: flex; flex-direction: column; gap: 14px; }

.screen { display: flex; flex-direction: column; gap: 14px; animation: fadeUp 0.28s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.section-title {
  margin: 4px 0 0;
  font-size: 10px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.card--hero { display: flex; flex-direction: column; gap: 10px; }
.broker-row { display: flex; align-items: center; gap: 12px; }
.broker-badge {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-weight: 900;
  font-size: 20px;
  color: #041016;
  background: linear-gradient(135deg, #22d3ee, #a855f7);
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.35);
  flex: 0 0 auto;
}
.broker-meta { flex: 1; }
.broker-meta .eyebrow { margin: 0 0 2px; }
.broker-meta h2 { margin: 0; font-size: 18px; }

.pill {
  font-size: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.06em;
}
.pill--ok { color: #7dffc8; background: rgba(0, 242, 155, 0.10); border: 1px solid rgba(0, 242, 155, 0.3); }

.muted { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.65; }

.card--warn { border-color: rgba(245, 158, 11, 0.32); background: rgba(245, 158, 11, 0.07); }
.card--warn b { color: #ffcf70; font-size: 13px; }
.card--note { border-color: rgba(34, 211, 238, 0.25); }

.seg {
  display: grid;
  grid-auto-flow: column;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(10, 16, 28, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.seg-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 10px 8px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
}
.seg-btn.is-active {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(168, 85, 247, 0.22));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.25) inset;
}
.seg--sm { padding: 3px; flex: 0 0 auto; }
.seg--sm button { padding: 8px 10px; font-size: 11px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; cursor: pointer; font-weight: 700; }
.seg--sm button.is-active { background: rgba(34, 211, 238, 0.18); color: #fff; }

.asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.asset {
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 17, 32, 0.7);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.12s;
  font-family: inherit;
}
.asset:hover { border-color: rgba(34, 211, 238, 0.35); }
.asset:active { transform: scale(0.99); }
.asset.is-active {
  border-color: rgba(34, 211, 238, 0.65);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(168, 85, 247, 0.12));
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.22) inset;
}
.asset-name { display: block; font-weight: 700; font-size: 13.5px; letter-spacing: 0.01em; }
.asset-tag {
  display: inline-block;
  margin-top: 6px;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7f91ad;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.asset-tag.is-otc { color: #ffcf70; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(11, 17, 32, 0.7);
  color: var(--muted);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  transition: all 0.18s;
}
.chip.is-active {
  color: #041016;
  background: linear-gradient(135deg, #22d3ee, #a855f7);
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.3);
}

.micro { margin: 0; text-align: center; font-size: 10.5px; color: #5c6c86; }

/* ---------- RESULT ---------- */
.result {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  padding: 16px;
  background: rgba(11, 17, 32, 0.8);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: fadeUp 0.3s ease both;
}
.result--up { border-color: rgba(0, 242, 155, 0.45); background: linear-gradient(160deg, rgba(0, 242, 155, 0.13), rgba(11, 17, 32, 0.85) 60%); }
.result--down { border-color: rgba(255, 42, 85, 0.45); background: linear-gradient(160deg, rgba(255, 42, 85, 0.13), rgba(11, 17, 32, 0.85) 60%); }
.result--wait { border-color: rgba(245, 158, 11, 0.42); background: linear-gradient(160deg, rgba(245, 158, 11, 0.11), rgba(11, 17, 32, 0.85) 60%); }

.result-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.result-asset { font-weight: 800; font-size: 15px; }
.result-tf { font-size: 10px; letter-spacing: 0.16em; color: var(--muted); font-family: ui-monospace, monospace; }
.result-dir {
  font-size: clamp(34px, 11vw, 46px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.result--up .result-dir { color: var(--up); text-shadow: 0 0 30px rgba(0, 242, 155, 0.45); }
.result--down .result-dir { color: var(--down); text-shadow: 0 0 30px rgba(255, 42, 85, 0.45); }
.result--wait .result-dir { color: var(--wait); text-shadow: 0 0 30px rgba(245, 158, 11, 0.4); }

.result-sub { font-size: 12.5px; color: #b7c7dd; line-height: 1.6; }
.confluence { display: flex; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 10.5px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--muted);
  font-family: ui-monospace, monospace;
}
.tag--bull { color: #8dffd3; border-color: rgba(0, 242, 155, 0.3); background: rgba(0, 242, 155, 0.07); }
.tag--bear { color: #ff9db2; border-color: rgba(255, 42, 85, 0.3); background: rgba(255, 42, 85, 0.07); }
.tag--neutral { color: #ffd789; border-color: rgba(245, 158, 11, 0.28); background: rgba(245, 158, 11, 0.06); }

.price-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-top: 1px dashed rgba(255, 255, 255, 0.10); padding-top: 10px; }
.price-line span { font-size: 11px; color: var(--muted); }
.price-line b { font-size: 18px; font-family: ui-monospace, monospace; }

/* indicator table */
.ind-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.ind-list { display: flex; flex-direction: column; gap: 7px; }
.ind-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 10px;
  align-items: center;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.055);
}
.ind-name { font-size: 12.5px; font-weight: 600; }
.ind-val { font-size: 11.5px; color: #a9bad2; font-family: ui-monospace, monospace; text-align: right; }
.ind-vote { grid-column: 1 / -1; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-family: ui-monospace, monospace; }
.ind-vote.bull { color: var(--up); }
.ind-vote.bear { color: var(--down); }
.ind-vote.neutral { color: var(--wait); }

.bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
  display: flex;
}
.bar i { display: block; height: 100%; }
.bar .b { background: var(--up); }
.bar .r { background: var(--down); }
.bar .n { background: var(--wait); }

.backtest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 17, 32, 0.7);
  padding: 11px;
  text-align: center;
}
.stat b { display: block; font-size: 19px; font-family: ui-monospace, monospace; }
.stat span { font-size: 9px; letter-spacing: 0.14em; color: var(--muted); text-transform: uppercase; }

.row-actions { display: flex; gap: 8px; }
.row-actions > * { flex: 1; }

/* ---------- VOICE ---------- */
.orb-stage--voice canvas { width: min(300px, 76vw); }
.card--chat { padding: 12px; }
.chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  animation: fadeUp 0.2s ease both;
}
.bubble--bot { align-self: flex-start; background: rgba(34, 211, 238, 0.09); border: 1px solid rgba(34, 211, 238, 0.2); }
.bubble--me { align-self: flex-end; background: rgba(236, 72, 153, 0.12); border: 1px solid rgba(236, 72, 153, 0.24); }

.quick-chips { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.quick-chips::-webkit-scrollbar { display: none; }
.quick-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(11, 17, 32, 0.8);
  color: #b9cbe6;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- PROFILE ---------- */
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.08); font-size: 12.5px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.kv b { font-family: ui-monospace, monospace; font-weight: 600; text-align: right; word-break: break-all; }

.hist { display: flex; flex-direction: column; gap: 7px; }
.hist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}
.hist-row b { font-family: ui-monospace, monospace; }
.hist-row .up { color: var(--up); }
.hist-row .down { color: var(--down); }
.hist-row .wait { color: var(--wait); }
.hist-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 12px; border: 1px dashed rgba(255, 255, 255, 0.10); border-radius: 12px; }

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 30;
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: rgba(5, 7, 14, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(34, 211, 238, 0.14);
}
.nav-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  padding: 9px 4px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.03em;
  transition: color 0.2s, background 0.2s;
}
.nav-btn.is-active { color: #fff; background: linear-gradient(135deg, rgba(34, 211, 238, 0.16), rgba(168, 85, 247, 0.14)); }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(8, 14, 26, 0.96);
  border: 1px solid rgba(34, 211, 238, 0.35);
  color: var(--text);
  font-size: 12.5px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.2s ease both;
}

.spinner {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(4, 16, 22, 0.3);
  border-top-color: #041016;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- V2: catalog, quality, model ---------- */
.asset-tools {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input--search {
  width: 100%;
  padding: 11px 13px;
  font-size: 12.5px;
}
.asset-tools .micro { text-align: left; }
.chips--groups { margin-top: 2px; }
.chips--groups .chip {
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 600;
}
.chip:disabled {
  opacity: 0.34;
  cursor: not-allowed;
  filter: grayscale(1);
}
.chip:disabled:hover { box-shadow: none; }

.dir-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.quality {
  font-size: 9.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: ui-monospace, monospace;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  white-space: nowrap;
}
.quality--ok { color: #8dffd3; border-color: rgba(0, 242, 155, 0.4); background: rgba(0, 242, 155, 0.08); }
.quality--thin { color: #ffd789; border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.quality--low { color: #ff9db2; border-color: rgba(255, 42, 85, 0.35); background: rgba(255, 42, 85, 0.08); }

.proxy-banner {
  border: 1px solid rgba(255, 207, 112, 0.35);
  background: rgba(255, 207, 112, 0.07);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 11.5px;
  line-height: 1.55;
  color: #f3dca6;
}
.proxy-banner b { color: #ffcf70; letter-spacing: 0.1em; font-size: 10px; }

.mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.mini-stat {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.025);
  padding: 8px 6px;
  text-align: center;
}
.mini-stat b { display: block; font-size: 14px; font-family: ui-monospace, monospace; }
.mini-stat span { font-size: 8.5px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }

.ind-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ind-weight {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  color: #7f91ad;
  font-family: ui-monospace, monospace;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 1px 4px;
  vertical-align: middle;
}
.ind-note { font-size: 10px; color: #7f91ad; }

.bt-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bt-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 7px;
  font-size: 11px;
  color: var(--muted);
}
.bt-row b { font-family: ui-monospace, monospace; color: #c8d8ee; font-weight: 600; text-align: right; }

.hist-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.hist-right .quality { font-size: 8px; padding: 3px 6px; }

@media (min-width: 480px) {
  .asset-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}


/* ---------- RISK / JOURNAL / LEARN ---------- */
.nav-btn { font-size: 10px; letter-spacing: 0.01em; padding: 9px 2px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.field span { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.input--plain { letter-spacing: 0; font-size: 14px; padding: 12px; }
.stat-big { font-family: ui-monospace, monospace; font-size: 26px; font-weight: 700; color: var(--cyan); margin: 4px 0 2px; }
.risk-warn { border-color: rgba(255, 42, 85, 0.4); background: rgba(255, 42, 85, 0.07); }
.risk-warn b { color: #ff8aa1; }
.risk-warn p { margin: 6px 0 0; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.mini-table th, .mini-table td { text-align: right; padding: 6px 4px; border-bottom: 1px dashed rgba(255, 255, 255, 0.08); }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; }
.mini-table th { color: var(--muted); font-weight: 600; }
.mini-table .bad { color: var(--down); font-weight: 700; }
.hist-item { display: flex; flex-direction: column; gap: 6px; }
.marks { display: flex; gap: 6px; padding: 0 2px 8px; }
.mark-btn {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  padding: 7px 4px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
}
.mark-btn.is-win { color: #04110b; background: var(--up); border-color: var(--up); }
.mark-btn.is-loss { color: #fff; background: var(--down); border-color: var(--down); }
.mark-btn.is-skip { color: #1a1204; background: var(--wait); border-color: var(--wait); }
.lesson { margin-bottom: 10px; }
.lesson svg { display: block; margin: 12px auto 4px; background: rgba(2, 6, 16, 0.6); border-radius: 10px; }
.lesson h4 { margin: 12px 0 2px; font-size: 12px; color: var(--cyan); letter-spacing: 0.04em; }
.lesson p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }

/* ---------- COUNTDOWN / TUTORIAL ---------- */
.countdown {
  align-self: flex-start;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}
.countdown.is-expired { color: var(--wait); border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.08); }
.tutorial {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(2, 4, 10, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.tutorial[hidden] { display: none; }
.tutorial-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--panel-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.tutorial-card h3 { margin: 0; font-size: 18px; }
.tutorial-dots { display: flex; gap: 6px; justify-content: center; margin: 6px 0; }
.tutorial-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.tutorial-dots i.is-on { background: var(--cyan); }

.range { width: 100%; accent-color: var(--cyan); }
.field span b { color: var(--cyan); font-family: ui-monospace, monospace; }
.weekend-banner[hidden] { display: none; }
.row-actions { flex-wrap: wrap; }
.row-actions > * { min-width: 96px; }

/* ---------- PRIVACY / POLISH ---------- */
html { -webkit-tap-highlight-color: transparent; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn, .chip, .asset, .mark-btn, .nav-btn { transition: transform 0.12s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease; }
.btn:active, .chip:active, .mark-btn:active, .nav-btn:active { transform: scale(0.97); }
.chip { min-height: 36px; }
.selected-asset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.12), rgba(168, 85, 247, 0.1));
}
.selected-asset .sel-label { font-size: 10px; letter-spacing: 0.14em; color: var(--muted); font-family: ui-monospace, monospace; }
.selected-asset .sel-name { font-size: 18px; font-weight: 800; margin-top: 2px; }
.selected-asset .sel-tf { font-family: ui-monospace, monospace; font-size: 13px; font-weight: 700; color: var(--cyan); }
.voice-line {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(34, 211, 238, 0.07);
  border: 1px solid rgba(34, 211, 238, 0.22);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}
.search-hint { text-align: center; padding: 14px 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* ---------- ANALYZE LAYOUT / CHART / RADAR ---------- */
.analyze-bar {
  position: sticky;
  top: var(--topbar-h, 56px);
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  background: rgba(5, 7, 14, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.analyze-bar .btn { flex: 0 0 auto; padding: 10px 16px; }
.analyze-bar .tz-clock { margin-left: auto; }
.orb-stage--analyze canvas { width: min(120px, 32vw); }
.tz-clock { font-family: ui-monospace, monospace; font-size: 11px; font-weight: 700; color: var(--cyan); letter-spacing: 0.04em; white-space: nowrap; }
.radar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.radar-head .eyebrow { margin: 0; }
.radar .btn { margin-top: 10px; }
.radar-title { margin: 10px 0 4px; font-weight: 800; font-size: 15px; }
.radar p { margin: 6px 0 0; font-size: 13px; line-height: 1.65; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.scan-block { margin-top: 12px; }
.scan-block h4 { margin: 0 0 4px; font-size: 12px; letter-spacing: 0.06em; color: var(--cyan); }
.scan-row {
  width: 100%;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 9px 6px;
  border: 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.scan-row:active { background: rgba(34, 211, 238, 0.08); }
.scan-row .rank { color: var(--muted); font-family: ui-monospace, monospace; }
.scan-row .val { font-family: ui-monospace, monospace; font-weight: 700; text-align: right; }
.scan-row .val small { display: block; color: var(--muted); font-weight: 500; font-size: 10.5px; }
.pos { color: var(--up); }
.neg { color: var(--down); }
.chart-card { padding: 12px; }
.chart-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-size: 13px; }
.chart-ohlc { font-family: ui-monospace, monospace; font-size: 11px; color: #9aa4b8; min-height: 16px; }
.chart-canvas { display: block; width: 100%; height: 280px; border-radius: 10px; background: #131722; touch-action: pan-y; }

.candle-call { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; font-weight: 800; font-size: 14px; line-height: 1.5; border: 1px solid transparent; }
.candle-call.is-up { color: #8dffd3; background: rgba(0, 242, 155, 0.08); border-color: rgba(0, 242, 155, 0.3); }
.candle-call.is-down { color: #ff9db2; background: rgba(255, 42, 85, 0.08); border-color: rgba(255, 42, 85, 0.3); }
.candle-call.is-wait { color: #ffd789; background: rgba(245, 158, 11, 0.07); border-color: rgba(245, 158, 11, 0.28); }

/* ---------- NEWS BOARD ---------- */
.news-board .eyebrow { margin: 0; }
.news-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.news-status { margin-top: 10px; padding: 16px; border-radius: 16px; border: 1px solid transparent; font-size: 18px; font-weight: 800; line-height: 1.5; }
.news-status small { display: block; margin-top: 6px; font-size: 13px; font-weight: 500; opacity: 0.9; }
.news-status.is-green { color: #8dffd3; background: rgba(0, 242, 155, 0.09); border-color: rgba(0, 242, 155, 0.35); }
.news-status.is-yellow { color: #ffd789; background: rgba(245, 158, 11, 0.1); border-color: rgba(245, 158, 11, 0.4); }
.news-status.is-red { color: #ff9db2; background: rgba(255, 42, 85, 0.1); border-color: rgba(255, 42, 85, 0.45); }
.news-status.is-grey { color: #c3cde0; background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.15); }
.news-note { margin-top: 10px; padding: 12px; border-radius: 12px; background: rgba(168, 85, 247, 0.1); border: 1px solid rgba(168, 85, 247, 0.35); font-size: 13.5px; line-height: 1.6; }
.news-day { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 14px; font-weight: 700; }
.news-pill { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.news-pill.is-low { color: #8dffd3; background: rgba(0, 242, 155, 0.12); }
.news-pill.is-mid { color: #ffd789; background: rgba(245, 158, 11, 0.14); }
.news-pill.is-high { color: #ff9db2; background: rgba(255, 42, 85, 0.14); }
.news-block h4 { margin: 14px 0 4px; font-size: 12px; letter-spacing: 0.06em; color: var(--cyan); }
.news-ev { padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, 0.1); font-size: 13px; line-height: 1.55; }
.news-ev b { font-family: ui-monospace, monospace; }
.news-ev .why { display: block; color: var(--muted); font-size: 12px; }
.chip.is-safe { border-color: rgba(0, 242, 155, 0.4); color: #8dffd3; }
.chip.is-caution { border-color: rgba(245, 158, 11, 0.45); color: #ffd789; }

.adv-stats { margin-top: 10px; }
.adv-stats summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--cyan); padding: 6px 0; }

/* ---------- RX AGENT (floating) ---------- */
.agent-fab {
  position: fixed;
  right: max(14px, calc((100vw - 560px) / 2 + 14px));
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 40;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background:
    radial-gradient(circle at 32% 28%, rgba(34, 211, 238, 0.28), transparent 62%),
    radial-gradient(circle at 70% 76%, rgba(168, 85, 247, 0.26), transparent 66%),
    rgba(9, 14, 26, 0.94);
  color: var(--text);
  font-family: ui-monospace, monospace;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 20px rgba(34, 211, 238, 0.12);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.agent-fab:active { transform: scale(0.95); }
.agent-fab::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(168, 85, 247, 0.22);
  pointer-events: none;
}
.agent-fab.is-on { border-color: rgba(0, 242, 155, 0.6); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45), 0 0 24px rgba(0, 242, 155, 0.22); }
.agent-fab.is-on::before { border-color: rgba(0, 242, 155, 0.4); animation: agentPulse 2.4s ease-out infinite; }
.agent-glyph { position: relative; z-index: 1; }
@keyframes agentPulse {
  0% { transform: scale(1); opacity: 0.75; }
  70% { transform: scale(1.38); opacity: 0; }
  100% { transform: scale(1.38); opacity: 0; }
}
.agent-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--down);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 1px solid rgba(5, 7, 14, 0.9);
}

.agent-panel {
  position: fixed;
  right: max(10px, calc((100vw - 560px) / 2 + 10px));
  bottom: calc(140px + env(safe-area-inset-bottom));
  z-index: 41;
  width: min(352px, calc(100vw - 20px));
  max-height: min(62vh, calc(100dvh - 152px));
  overflow-y: auto;
  padding: 13px;
  border-radius: 18px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: rgba(8, 13, 24, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  animation: agentIn 0.18s ease both;
}
@keyframes agentIn {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.agent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.agent-title { display: flex; align-items: center; gap: 9px; font-size: 13px; letter-spacing: 0.04em; }
.agent-title small { display: block; color: var(--muted); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em; }
.agent-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 3px rgba(139, 156, 184, 0.12); }
.agent-dot.is-on { background: var(--up); box-shadow: 0 0 0 3px rgba(0, 242, 155, 0.15), 0 0 10px rgba(0, 242, 155, 0.5); }
.agent-dot.is-work { background: var(--purple); box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.16), 0 0 10px rgba(168, 85, 247, 0.5); }
.agent-switch { position: relative; width: 42px; height: 23px; flex: 0 0 auto; cursor: pointer; }
.agent-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.agent-switch span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255, 255, 255, 0.14); transition: background 0.2s; }
.agent-switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #c3cde0; transition: transform 0.2s, background 0.2s; }
.agent-switch input:checked + span { background: rgba(0, 242, 155, 0.25); border-color: rgba(0, 242, 155, 0.55); }
.agent-switch input:checked + span::after { transform: translateX(19px); background: var(--up); }

.agent-status { margin: 9px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.agent-status.is-on { color: #9ff5d2; }
.agent-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 9px; }
.agent-stats .st { padding: 7px 6px; border-radius: 10px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.07); text-align: center; }
.agent-stats .st b { display: block; font-family: ui-monospace, monospace; font-size: 13px; }
.agent-stats .st span { display: block; margin-top: 2px; font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.agent-stats .st.is-good b { color: var(--up); }
.agent-stats .st.is-bad b { color: var(--down); }

.agent-block { margin-top: 11px; }
.agent-block .eyebrow { margin: 0 0 6px; font-size: 9.5px; letter-spacing: 0.16em; }
.agent-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.agent-chip { padding: 5px 9px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.03); color: var(--muted); font-size: 10.5px; font-weight: 700; }
.agent-chip.is-active { color: #04110b; background: rgba(0, 242, 155, 0.8); border-color: rgba(0, 242, 155, 0.8); }
.agent-mode { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 10.5px; color: var(--muted); cursor: pointer; }
.agent-mode input { accent-color: #22d3ee; }

.agent-log { max-height: 148px; overflow-y: auto; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.07); background: rgba(0, 0, 0, 0.18); }
.agent-row { display: grid; grid-template-columns: 40px 1fr; gap: 7px; padding: 6px 8px; border-bottom: 1px dashed rgba(255, 255, 255, 0.06); font-size: 11px; line-height: 1.45; cursor: default; }
.agent-row:last-child { border-bottom: 0; }
.agent-row time { font-family: ui-monospace, monospace; color: rgba(139, 156, 184, 0.8); font-size: 10px; padding-top: 1px; }
.agent-row.is-signal { background: rgba(0, 242, 155, 0.07); }
.agent-row.is-signal b { color: var(--up); }
.agent-row.is-learn { background: rgba(168, 85, 247, 0.07); }
.agent-row.is-learn b { color: #d8b4fe; }
.agent-row.is-error b { color: #ff9db2; }
.agent-row.is-scan b { color: var(--muted); }
.agent-row b { color: var(--text); font-weight: 700; }
.agent-row.is-clickable { cursor: pointer; }
.agent-row.is-clickable:hover { background: rgba(34, 211, 238, 0.08); }
.agent-empty { padding: 12px 10px; font-size: 11px; color: var(--muted); text-align: center; line-height: 1.6; }

.agent-learn { display: flex; flex-direction: column; gap: 5px; }
.agent-learn p { margin: 0; font-size: 10.8px; line-height: 1.55; color: var(--muted); }
.agent-learn p.is-good { color: #8dffd3; }
.agent-learn p.is-warn { color: #ffd789; }
.agent-learn p.is-bad { color: #ff9db2; }

.agent-foot { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.agent-foot .btn { flex: 1 1 0; padding: 8px 6px; font-size: 10px; letter-spacing: 0.02em; }
.agent-foot .btn.is-on { border-color: rgba(0, 242, 155, 0.5); color: #8dffd3; }
.agent-note { margin-top: 10px; font-size: 9.5px; }

@media (max-height: 640px) {
  .agent-log { max-height: 110px; }
}
.agent-row.is-monitor { background: rgba(245, 158, 11, 0.07); }
.agent-row.is-monitor b { color: #ffd789; }
