
:root {
  --bg: #EEF1F4; --surface: #FFFFFF; --sunken: #E4E8ED; --ink: #101828; --muted: #667085;
  --line: #DDE2E8; --accent: #3D3BF3; --accent-soft: #E7E7FE; --on-accent: #FFFFFF;
  --gain: #0E9F6E; --gain-soft: #DDF5EC; --loss: #E5484D; --loss-soft: #FDE7E8;
  --sell: #E58A00; --warn: #B76E00; --warn-soft: #FFF1D6;
  --r-xl: 24px; --r-l: 18px; --r-m: 12px;
  --font: "Onest", -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0E1117; --surface: #171B23; --sunken: #1F2430; --ink: #EDF0F5; --muted: #8C94A3;
  --line: #272D39; --accent: #8483FF; --accent-soft: #24244A; --on-accent: #0E1117;
  --gain: #2BD38E; --gain-soft: #123528; --loss: #FF6B70; --loss-soft: #3A1A1D;
  --sell: #FFAA33; --warn: #F2B544; --warn-soft: #33270F;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1117; --surface: #171B23; --sunken: #1F2430; --ink: #EDF0F5; --muted: #8C94A3;
    --line: #272D39; --accent: #8483FF; --accent-soft: #24244A; --on-accent: #0E1117;
    --gain: #2BD38E; --gain-soft: #123528; --loss: #FF6B70; --loss-soft: #3A1A1D;
    --sell: #FFAA33; --warn: #F2B544; --warn-soft: #33270F;
    color-scheme: dark;
  }
}
/* тема «am» (Армения): без зелёного в интерфейсе — прибыль синяя, акцент абрикосовый; зелёные только растущие свечи */
:root[data-brand="am"] {
  --bg: #F5F2ED; --surface: #FFFFFF; --sunken: #ECE7E0; --ink: #1B1A2E; --muted: #6E6A7C;
  --line: #E3DDD4; --accent: #E8590C; --accent-soft: #FDE8D9; --on-accent: #FFFFFF;
  --gain: #2563EB; --gain-soft: #E1EAFE; --loss: #D92D20; --loss-soft: #FDE6E4;
  --sell: #7C3AED; --warn: #B54708; --warn-soft: #FEF0C7;
  --candle-up: #16A34A; --candle-down: #DC2626;
}
:root[data-brand="am"][data-theme="dark"] {
  --bg: #121320; --surface: #1B1C2B; --sunken: #25263A; --ink: #F1EEF7; --muted: #9895AB;
  --line: #2E2F45; --accent: #FF8A3D; --accent-soft: #3A2416; --on-accent: #1B1308;
  --gain: #6EA8FF; --gain-soft: #172A4D; --loss: #FF6B6B; --loss-soft: #3D1A1D;
  --sell: #B794FF; --warn: #F5B547; --warn-soft: #3A2C12;
  --candle-up: #22C55E; --candle-down: #EF4444;
}
:root[data-brand="am"] .chart-cta { background: linear-gradient(135deg, var(--accent), #C2410C); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 400 15px/1.45 var(--font); font-variant-numeric: tabular-nums; min-height: 100vh;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#app { max-width: 560px; margin: 0 auto; padding: 12px 16px 120px; }
.screen { animation: enter .28s cubic-bezier(.2,.8,.2,1); }
.screen.back { animation-name: enter-back; }
@keyframes enter { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes enter-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }

h1 { font-size: 28px; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; margin: 8px 0 6px; }
h2 { font-size: 20px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; margin: 28px 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.gain { color: var(--gain); } .loss { color: var(--loss); }

.panel { background: var(--surface); border-radius: var(--r-xl); padding: 20px; }
.row { display: flex; align-items: center; gap: 12px; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 10px; }

/* шапка главной */
.account { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 4px 0 18px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: var(--gain); box-shadow: 0 0 0 4px var(--gain-soft); }
.dot.paused { background: var(--warn); }
.big-number { font-size: 44px; font-weight: 750; letter-spacing: -.03em; line-height: 1.05; }
.big-label { color: var(--muted); font-size: 14px; margin-bottom: 2px; }

/* последовательность шагов клиента */
.journey { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: j; }
.journey li { counter-increment: j; display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.journey li:first-child { border-top: 0; }
.journey li::before { content: counter(j); flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; background: var(--sunken); color: var(--muted); }
.journey li.now::before { background: var(--accent); color: var(--on-accent); }
.journey li.done::before { content: "✓"; background: var(--gain-soft); color: var(--gain); }
.journey b { display: block; font-weight: 600; }
.journey span { color: var(--muted); font-size: 13px; }

/* список ботов */
.bot-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 14px 0;
  border-top: 1px solid var(--line); }
.bot-row:first-child { border-top: 0; }
.ticker { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800; font-size: 12px; letter-spacing: -.01em; flex: none; }
.bot-row .t { font-weight: 600; }
.bot-row .s { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.bot-row .v { text-align: right; font-weight: 650; }
.bot-row .v small { display: block; font-weight: 500; font-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; background: var(--sunken); color: var(--muted); }
.badge.wait { background: var(--warn-soft); color: var(--warn); }

.link { color: var(--accent); font-weight: 600; padding: 12px 0; display: inline-block; }
.link.loss { color: var(--loss); }
.links { display: flex; flex-direction: column; align-items: flex-start; margin-top: 6px; }
.links .link { padding: 10px 0; }

/* стратегии */
.strategy { display: flex; gap: 16px; width: 100%; text-align: left; background: var(--surface);
  border-radius: var(--r-l); padding: 16px; margin-bottom: 10px; transition: transform .12s; }
.strategy:active { transform: scale(.98); }
.strategy[disabled] { opacity: .55; }
.glyph { width: 64px; height: 64px; flex: none; border-radius: 16px; background: var(--sunken); display: grid; place-items: center; }
.glyph svg { width: 44px; height: 44px; }
.strategy .t { font-weight: 650; font-size: 17px; }
.strategy .d { color: var(--muted); font-size: 14px; margin: 2px 0 8px; }
.facts { display: flex; gap: 6px; flex-wrap: wrap; }
.fact { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.risk { display: inline-flex; gap: 3px; align-items: center; }
.risk i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); display: inline-block; }
.risk[data-l="1"] i:nth-child(-n+1), .risk[data-l="2"] i:nth-child(-n+2), .risk[data-l="3"] i:nth-child(-n+3) { background: currentColor; }
.risk[data-l="1"] { color: var(--gain); } .risk[data-l="2"] { color: var(--warn); } .risk[data-l="3"] { color: var(--loss); }

/* график */
.chart-wrap { background: var(--surface); border-radius: var(--r-xl); padding: 18px 16px 12px; position: relative; }
.chart-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.chart-value { font-size: 34px; font-weight: 750; letter-spacing: -.03em; line-height: 1; }
.chart-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
canvas.chart { width: 100%; height: 250px; display: block; margin-top: 14px; }
.replay { width: 36px; height: 36px; border-radius: 50%; background: var(--sunken); display: grid; place-items: center; flex: none; }
.replay svg { width: 18px; height: 18px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend i.line { width: 14px; height: 0; border-radius: 0; border-top: 2px dashed var(--muted); }
.demo-note { font-size: 12px; color: var(--muted); margin-top: 10px; }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--r-l); overflow: hidden; margin-top: 12px; }
.metrics div { background: var(--surface); padding: 14px 16px; }
.metrics b { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.metrics span { font-size: 13px; color: var(--muted); }

.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 12px 0; border-top: 1px solid var(--line); }
.plain li:first-child { border-top: 0; }
.panel.plain, .panel.journey, .panel.list { padding: 4px 20px; }
.quote { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; color: var(--ink); margin: 14px 0; }

/* мастер */
.progress { display: flex; gap: 4px; margin: 6px 0 14px; }
.progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); transition: background .3s; }
.progress i.done { background: var(--accent); }
.progress i.now { background: linear-gradient(90deg, var(--accent) 50%, var(--line) 50%); background-size: 200% 100%;
  animation: fill .5s ease-out forwards; }
@keyframes fill { from { background-position: 100% 0; } to { background-position: 0 0; } }
.step-count { font-size: 13px; color: var(--muted); }
.question { font-size: 24px; line-height: 1.2; font-weight: 700; letter-spacing: -.015em; margin: 6px 0 18px; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; background: var(--surface); color: var(--ink); }
.option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 68px; text-align: left; padding: 14px 18px;
  background: var(--surface); border-radius: var(--r-l); margin-bottom: 10px; border: 2px solid transparent;
  transition: transform .12s, border-color .15s, background .15s; }
.option:active { transform: scale(.98); }
.option .l { font-size: 17px; font-weight: 600; }
.option .h { font-size: 13px; color: var(--muted); margin-top: 2px; }
.option.rec { border-color: var(--accent-soft); }
.option .tag { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 2px; }
.option .tick { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); flex: none; margin-left: auto;
  display: grid; place-items: center; transition: all .18s; }
.option.picked { border-color: var(--accent); }
.option.picked .tick { background: var(--accent); border-color: var(--accent); }
.option.picked .tick::after { content: ""; width: 10px; height: 6px; border-left: 2.5px solid var(--on-accent); border-bottom: 2.5px solid var(--on-accent);
  transform: rotate(-45deg) translate(1px,-1px); animation: pop .25s; }
@keyframes pop { from { transform: rotate(-45deg) scale(0); } to { transform: rotate(-45deg) scale(1); } }
.option.loading { color: var(--muted); }
.shimmer { background: linear-gradient(90deg, var(--surface) 0%, var(--sunken) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sh 1.2s infinite linear; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.custom { background: var(--surface); border-radius: var(--r-l); padding: 14px 18px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field input { width: 100%; padding: 15px 16px; border-radius: var(--r-m); border: 1.5px solid var(--line); background: var(--bg);
  font-size: 16px; outline: none; transition: border-color .15s; }
.field input:focus { border-color: var(--accent); }
.field .err { color: var(--loss); font-size: 13px; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px;
  border-radius: var(--r-m); font-weight: 650; font-size: 16px; background: var(--sunken); transition: transform .1s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.danger { background: var(--loss-soft); color: var(--loss); }
.btn.wide { width: 100%; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* соглашение */
.points li { display: flex; gap: 14px; align-items: flex-start; }
.points svg { width: 22px; height: 22px; flex: none; color: var(--accent); margin-top: 1px; }
.doc { white-space: pre-wrap; font-size: 13px; line-height: 1.55; background: var(--surface); border-radius: var(--r-l);
  padding: 16px; max-height: 50vh; overflow: auto; margin-top: 10px; color: var(--muted); }
.check { display: flex; gap: 14px; align-items: center; background: var(--surface); border-radius: var(--r-l); padding: 16px 18px;
  margin-top: 14px; width: 100%; text-align: left; border: 2px solid transparent; }
.check .box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); flex: none; display: grid; place-items: center; transition: all .15s; }
.check.on { border-color: var(--accent); }
.check.on .box { background: var(--accent); border-color: var(--accent); }
.check.on .box::after { content: ""; width: 11px; height: 6px; border-left: 2.5px solid var(--on-accent); border-bottom: 2.5px solid var(--on-accent); transform: rotate(-45deg) translate(1px,-1px); }
.hash { font-size: 12px; color: var(--muted); margin-top: 10px; overflow-wrap: anywhere; }

/* готово */
.finish { text-align: center; padding-top: 40px; }
.finish svg.ring { width: 112px; height: 112px; }
.ring circle { stroke: var(--gain); stroke-width: 6; fill: none; stroke-dasharray: 302; stroke-dashoffset: 302; animation: draw .7s .1s ease-out forwards; }
.ring path { stroke: var(--gain); stroke-width: 7; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .4s .7s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* бот */
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stats div span { display: block; font-size: 12px; color: var(--muted); }
.stats div b { font-weight: 650; }
.notice { border-radius: var(--r-l); padding: 16px; margin-top: 12px; background: var(--warn-soft); color: var(--ink); }
.notice b { display: block; margin-bottom: 4px; }
.event { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.event:first-child { border-top: 0; }
.event time { color: var(--muted); flex: none; width: 46px; font-size: 13px; }

/* нижняя шторка и тост */
.sheet-bg { position: fixed; inset: 0; background: rgba(5,8,15,.45); z-index: 40; animation: fade .2s; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: var(--surface); border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; animation: up .28s cubic-bezier(.2,.8,.2,1); }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet h3 { font-size: 20px; margin: 0 0 6px; }
.sheet { max-height: 90vh; overflow-y: auto; }
.sheet .option { background: var(--bg); }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast { position: fixed; left: 16px; right: 16px; top: 12px; z-index: 60; max-width: 528px; margin: 0 auto; padding: 14px 16px;
  border-radius: var(--r-m); background: var(--ink); color: var(--bg); font-weight: 500; animation: drop .25s ease-out; }
.toast.error { background: var(--loss); color: #fff; }
@keyframes drop { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.skeleton { height: 18px; border-radius: 8px; margin: 10px 0; }
.loader-steps { list-style: none; padding: 0; margin: 24px 0; }
.loader-steps li { padding: 10px 0; color: var(--muted); display: flex; gap: 12px; align-items: center; transition: color .2s; }
.loader-steps li.on { color: var(--ink); font-weight: 600; }
.loader-steps li i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.loader-steps li.on i { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.loader-steps li.ok i { background: var(--gain); border-color: var(--gain); }
@keyframes spin { to { transform: rotate(360deg); } }


/* готовые стратегии */
.seg { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; background: var(--sunken); border-radius: 12px; padding: 3px; margin: 8px 0 16px; }
.seg button { min-height: 38px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.featured { display: block; width: 100%; text-align: left; background: var(--surface); border-radius: var(--r-xl); padding: 18px; margin-bottom: 12px; transition: transform .12s; }
.featured:active { transform: scale(.985); }
.featured .by { font-size: 13px; color: var(--muted); }
.featured .t { font-size: 21px; font-weight: 750; letter-spacing: -.015em; margin: 2px 0 4px; }
.featured .d { color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.tick-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tkr { font-size: 13px; font-weight: 700; padding: 6px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.alloc { display: grid; gap: 7px; }
.alloc .r { display: grid; grid-template-columns: 52px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.alloc .r b { font-weight: 700; }
.alloc .r span:last-child { text-align: right; color: var(--muted); }
.cells { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.cells i { height: 14px; border-radius: 4px; background: var(--accent-soft); }
.cells.mini i { height: 8px; border-radius: 2px; }
.alloc.live .cells i.on { background: var(--accent); }
.tabs { display: flex; gap: 6px; margin: 14px 0 0; }
.tabs button { flex: 1; min-height: 36px; border-radius: 10px; font-weight: 700; font-size: 13px; background: var(--sunken); color: var(--muted); }
.tabs button.on { background: var(--ink); color: var(--bg); }
.asset { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.asset:first-child { border-top: 0; }
.asset .n { font-weight: 600; }
.asset .w { font-size: 13px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--r-l); overflow: hidden; }
.kv div { background: var(--surface); padding: 12px 14px; }
.kv span { display: block; font-size: 12px; color: var(--muted); }
.kv b { font-weight: 600; font-size: 14px; }
.risks { background: var(--loss-soft); border-radius: var(--r-l); padding: 6px 16px; }
.risks li { padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--loss) 18%, transparent); font-size: 14px; }
.risks li:first-child { border-top: 0; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.steps li:first-child { border-top: 0; }
.steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: 13px; background: var(--accent-soft); color: var(--accent); }
.steps b { display: block; font-weight: 600; margin-bottom: 2px; }
.steps span { color: var(--muted); font-size: 14px; }
.rangebar { position: relative; height: 8px; border-radius: 4px; background: var(--accent-soft); margin: 10px 0 4px; }
.rangebar i { position: absolute; top: -4px; width: 2px; height: 16px; background: var(--accent); border-radius: 1px; }
.rangebar b { position: absolute; top: -3px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); border: 2px solid var(--surface); }
.rangebar-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.leg { padding: 14px 0; border-top: 1px solid var(--line); }
.leg:first-child { border-top: 0; }


/* доходность по отрезкам */
.perf { background: var(--surface); border-radius: var(--r-xl); padding: 18px 16px 14px; }
.periods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; background: var(--sunken); border-radius: 12px; padding: 3px; }
.periods button { min-height: 34px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.periods button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.periods button[disabled] { opacity: .4; }
.perf-value { font-size: 40px; font-weight: 750; letter-spacing: -.03em; line-height: 1; margin-top: 16px; }
.perf-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.perf svg { width: 100%; height: 86px; display: block; margin-top: 12px; overflow: visible; }
.perf svg path.eq { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.perf svg path.eq.draw { animation: drawline .7s ease-out; }
@keyframes drawline { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
.perf-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 12px; }
.perf-row span { display: block; font-size: 12px; color: var(--muted); }
.perf-row b { font-weight: 650; }
.perf-note { font-size: 12px; color: var(--muted); margin-top: 12px; }
.mini-perf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 2px 0 14px; }
.mini-perf div { background: var(--bg); border-radius: 10px; padding: 8px 8px 7px; }
.mini-perf span { display: block; font-size: 11px; color: var(--muted); }
.mini-perf b { font-size: 15px; font-weight: 700; }


/* конструктор v13 */
.legend-mini { display: flex; gap: 14px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.legend-mini i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; }
.legend-mini i.dash { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); }
.risk-pass .rp { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.risk-pass .rp:first-child { border-top: 0; }
.risk-pass .rp span { color: var(--muted); }
.risk-pass .rp b { text-align: right; }
.tune-btn { width: 100%; margin-bottom: 12px; background: var(--accent-soft); color: var(--accent); }
.heat { display: grid; gap: 4px; align-items: center; margin-top: 6px; }
.heat .hx, .heat .hy { font-size: 11px; color: var(--muted); text-align: center; }
.heat .hy { text-align: left; }
.hc { min-height: 36px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--ink); position: relative; }
.hc.na { background: var(--sunken); color: var(--muted); }
.hc.on { box-shadow: 0 0 0 2.5px var(--ink); }
.hc.best::after { content: "★"; position: absolute; top: -6px; right: -3px; font-size: 12px; color: #F59E0B; }
.presets { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.preset { flex: none; width: 168px; text-align: left; background: var(--surface); border-radius: 14px; padding: 12px 14px; }
.preset b { display: block; font-size: 14px; }
.preset span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.pf-row { display: grid; grid-template-columns: 76px 1fr 46px 28px; gap: 8px; align-items: center; padding: 6px 0; }
.pf-t, .r-tk, .r-n, .r-num { width: 100%; padding: 9px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); font: inherit; font-size: 15px; font-weight: 600; }
.pf-w { width: 100%; accent-color: var(--accent); }
.pf-v { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.pf-x { width: 28px; height: 28px; border-radius: 50%; background: var(--sunken); color: var(--muted); font-size: 16px; line-height: 1; }
.pf-sum { font-size: 13px; font-weight: 600; margin-top: 6px; }
.pf-sum.warn { color: var(--warn); }
.pf-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin-top: 10px; background: var(--sunken); }
.pf-bar i { display: block; height: 100%; }
.r-ai textarea { width: 100%; margin: 8px 0; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font: inherit; font-size: 15px; resize: vertical; color: inherit; }
.r-card { margin-top: 10px; }
.r-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.r-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.r-op { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sel { padding: 9px 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg); font: inherit; font-size: 14px; color: inherit; }
.r-tk { width: 78px; } .r-n { width: 58px; } .r-num { width: 74px; }
.r-then { font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
.r-hold { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.r-h { display: inline-flex; gap: 4px; align-items: center; background: var(--sunken); border-radius: 12px; padding: 4px 6px; }

/* интерактивный график */
.ce-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 4px; }
.ce-title { font-size: 22px; letter-spacing: -.01em; }
.ce-title b { font-weight: 750; }
.tfs { display: flex; background: var(--sunken); border-radius: 10px; padding: 2px; }
.tfs button { min-width: 38px; min-height: 32px; border-radius: 8px; font-weight: 700; font-size: 13px; color: var(--muted); }
.tfs button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.ind-row { display: flex; gap: 6px; overflow-x: auto; margin: 12px -16px 10px; padding: 0 16px; scrollbar-width: none; }
.ind-row::-webkit-scrollbar { display: none; }
.ichip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; background: var(--sunken);
  font-size: 13px; font-weight: 600; color: var(--muted); transition: background .15s, color .15s; }
.ichip i { width: 10px; height: 3px; border-radius: 2px; opacity: .45; }
.ichip.on { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.ichip.on i { opacity: 1; }
.ce-wrap { position: relative; margin: 0 -16px; }
.ce-canvas { display: block; width: 100%; height: min(58vh, 470px); touch-action: none; background: var(--surface); }
.ce-wrap.small { margin: 0; border-radius: var(--r-l); overflow: hidden; }
.ce-wrap.small .ce-canvas { height: 300px; }
.ce-canvas.adding { cursor: crosshair; }
.ce-hint { position: absolute; left: 50%; top: 10px; transform: translate(-50%, -6px); background: var(--ink); color: var(--bg); font-size: 13px;
  font-weight: 600; padding: 6px 12px; border-radius: 999px; opacity: 0; transition: opacity .15s, transform .15s; pointer-events: none; white-space: nowrap; }
.ce-hint.on { opacity: .92; transform: translate(-50%, 0); }
.ce-load { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; background: var(--surface); }
.tools { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.tools .seg { flex: 1; margin: 0; }
.tool { min-height: 40px; padding: 0 14px; border-radius: 12px; background: var(--sunken); font-weight: 600; font-size: 14px; }
.tool:active { transform: scale(.96); }
#undo { font-size: 20px; width: 44px; padding: 0; }
.ce-set { margin-top: 12px; }
.ce-set .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 15px; }
.ce-set input[type=range] { width: 100%; margin-top: 10px; accent-color: var(--accent); }
.seg.mini { margin: 0; width: auto; }
.seg.mini button { min-height: 32px; padding: 0 10px; font-size: 13px; }
.ce-stats { margin-top: 12px; }
.ce-stats .kv { margin-bottom: 10px; }
.ce-sim { padding: 14px 16px; }
.ce-simrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px; }
.ce-simrow div { display: flex; flex-direction: column; }
.ce-simrow b { font-size: 17px; font-variant-numeric: tabular-nums; }
.ce-simrow span { font-size: 11px; color: var(--muted); }
.mults { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.mults .option { min-height: 56px; margin: 0; }
.chart-cta { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; background: linear-gradient(135deg, var(--accent), #6D5BFF);
  color: var(--on-accent); border-radius: var(--r-xl); padding: 16px 18px; margin-bottom: 12px; transition: transform .12s; }
.chart-cta:active { transform: scale(.985); }
.chart-cta .ic { font-size: 26px; }
.chart-cta b { display: block; font-size: 16px; }
.chart-cta span span { display: block; font-size: 13px; opacity: .85; }

/* сообщество */
.field textarea { width: 100%; min-height: 220px; padding: 14px 16px; border-radius: var(--r-m); border: 1.5px solid var(--line);
  background: var(--bg); font: inherit; font-size: 16px; color: inherit; resize: vertical; line-height: 1.45; }
.field textarea:focus { border-color: var(--accent); outline: none; }
.counter { font-size: 12px; color: var(--muted); text-align: right; margin-top: 4px; }
.counter.ok { color: var(--gain); }
.idea { white-space: pre-wrap; line-height: 1.5; font-size: 15px; }
.cta-panel { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; background: var(--accent-soft);
  border-radius: var(--r-xl); padding: 16px 18px; margin: 16px 0 6px; transition: transform .12s; }
.cta-panel:active { transform: scale(.985); }
.cta-panel .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--accent); color: var(--on-accent); display: grid;
  place-items: center; font-size: 24px; font-weight: 700; flex: none; }
.cta-panel b { display: block; font-size: 16px; color: var(--ink); }
.cta-panel > span > span { display: block; color: var(--muted); font-size: 13px; }
.status-chip { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.status-chip.published { background: var(--gain-soft); color: var(--gain); }
.status-chip.pending { background: var(--warn-soft); color: var(--warn); }
.status-chip.blocked { background: var(--loss-soft); color: var(--loss); }
.amounts { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 14px; }
.amounts button { padding: 9px 14px; border-radius: 999px; background: var(--sunken); font-weight: 600; font-size: 14px; }
.amounts button.on { background: var(--accent); color: var(--on-accent); }

.win-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; margin-top: 12px;
  text-align: left; font: inherit; color: inherit; cursor: pointer; }
.win-row b { color: var(--accent); font-weight: 600; white-space: nowrap; }
/* автоследование */
.wbar { display: grid; grid-template-columns: 64px 1fr 52px; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.wbar:first-child { border-top: 0; }
.wbar b { font-weight: 700; }
.wbar .track { height: 8px; border-radius: 4px; background: var(--sunken); overflow: hidden; }
.wbar .track i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transform-origin: left; animation: grow .6s ease-out; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.wbar span:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.wbar small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chg { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.chg:first-child { border-top: 0; }
.chg .k { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; flex: none; }
.chg .k.new { background: var(--gain-soft); color: var(--gain); }
.chg .k.up { background: var(--accent-soft); color: var(--accent); }
.chg .k.down { background: var(--warn-soft); color: var(--warn); }
.chg .k.sold { background: var(--loss-soft); color: var(--loss); }
.alloc-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.alloc-row:first-child { border-top: 0; }
.alloc-row .m { color: var(--muted); font-size: 12px; }
.alloc-row .zero { color: var(--muted); }

/* инвестпрофиль */
.pf-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 12px; }
.pf-src { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; min-width: 0; }
.pf-switch { flex: none; font-size: 13px; font-weight: 700; padding: 8px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); transition: transform .12s; }
.pf-switch:active { transform: scale(.95); }
.pf-foot { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.pf-hero { background: var(--surface); border-radius: var(--r-xl); padding: 20px; }
.an-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.an-row:first-child { border-top: 0; }
.an-row .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lv { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.lv.l1 { background: var(--gain-soft); color: var(--gain); }
.lv.l2 { background: var(--warn-soft); color: var(--warn); }
.lv.l3 { background: var(--loss-soft); color: var(--loss); }
.pf-why { font-size: 14px; font-weight: 600; color: var(--accent); margin: 0 0 6px; }
.pf-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 6px 0 4px; }
.pf-money { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.pf-money div { background: var(--bg); border-radius: 14px; padding: 10px 12px; }
.pf-money span { display: block; font-size: 12px; color: var(--muted); }
.pf-money b { font-size: 17px; font-weight: 750; letter-spacing: -.01em; }
.pf-money .hl { background: var(--accent); color: var(--on-accent); }
.pf-money .hl span { color: inherit; opacity: .8; }
.pf-cmp { display: grid; grid-template-columns: 52px 1fr 76px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.pf-cmp:first-child { border-top: 0; }
.pf-cmp .bars { display: grid; gap: 3px; }
.pf-cmp .bars i { display: block; height: 7px; border-radius: 4px; transform-origin: left; animation: grow .6s ease-out; }
.pf-cmp .bars i.now { background: var(--muted); opacity: .45; }
.pf-cmp .bars i.tg { background: var(--accent); }
.pf-cmp span:last-child { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.buy-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.buy-row:first-child { border-top: 0; }
.buy-row .m { font-size: 12px; color: var(--muted); }
.buy-row .q { text-align: right; font-weight: 650; }
.buy-row.skip { opacity: .55; }

/* кнопка внизу вне Telegram (в Telegram — нативная MainButton) */
#mainbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); z-index: 30; display: none; }
#mainbar button { width: 100%; max-width: 528px; margin: 0 auto; display: block; min-height: 54px; border-radius: 14px;
  background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 17px; }
#mainbar button[disabled] { opacity: .45; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
