:root {
  --bg: #0c0914; --panel: #151020; --panel-2: #1d162b; --line: #3b2a50;
  --muted: #a99bb9; --text: #fff8ff; --red: #ff6f9f; --red-2: #ff9bba;
  --amber: #ffd47e; --green: #75e6c1; --cyan: #80dff4;
  --lavender: #b99cff; --pink-soft: #ffd4e5;
  --shadow: 0 18px 55px rgba(5, 2, 12, .42);
}
html { background: var(--bg); }
body, body.telegram-mini-app {
  background: radial-gradient(circle at 12% 0%, rgba(185,156,255,.18), transparent 30%), radial-gradient(circle at 92% 10%, rgba(255,111,159,.17), transparent 28%), linear-gradient(180deg,#110c1b 0%,#0b0912 48%,#100b18 100%);
  min-height: 100vh;
}
body::before, body::after { content:""; position:fixed; z-index:-1; pointer-events:none; border-radius:50%; }
body::before { width:190px; height:190px; left:-80px; top:32%; background:rgba(128,223,244,.055); box-shadow:0 0 90px rgba(128,223,244,.12); }
body::after { width:240px; height:240px; right:-120px; bottom:6%; background:rgba(255,111,159,.06); box-shadow:0 0 100px rgba(255,111,159,.14); }
::selection { color:#1c0c1c; background:var(--pink-soft); }
.noise { opacity:.012; mix-blend-mode:soft-light; }
.shell { padding-bottom:24px; }
.topbar { height:82px; border-bottom:0; position:relative; }
.topbar::after { content:""; position:absolute; left:0; right:0; bottom:0; height:1px; background:linear-gradient(90deg,transparent,rgba(185,156,255,.55),rgba(255,111,159,.55),transparent); }
.brand { gap:11px; letter-spacing:.04em; }
.brand::after { content:"â™¡"; color:var(--red-2); font-size:14px; transform:translateY(-7px); text-shadow:0 0 14px rgba(255,111,159,.7); }
.brand b { color:var(--red-2); }
.brand-mark { width:38px; height:38px; border-radius:13px; align-items:end; justify-content:center; background:linear-gradient(145deg,#ff8db3,#af75f5); transform:none; box-shadow:0 7px 24px rgba(255,111,159,.3),inset 0 1px rgba(255,255,255,.35); }
.brand-mark i { border-radius:5px 5px 2px 2px; background:#fff8ff; }
.live-cluster { gap:12px; }
.mode-badge,.telegram-user { border:1px solid rgba(185,156,255,.28); border-radius:999px; padding:8px 12px; background:rgba(185,156,255,.08); color:#d8caff; }
.sync { border-radius:999px; padding:8px 11px; background:rgba(117,230,193,.07); }
.sync i { width:8px; height:8px; box-shadow:0 0 0 4px rgba(117,230,193,.10),0 0 15px var(--green); }
.icon-button { border:1px solid rgba(185,156,255,.26); border-radius:12px; background:linear-gradient(145deg,rgba(185,156,255,.12),rgba(255,111,159,.08)); }
.icon-button:hover { border-color:var(--red-2); color:var(--pink-soft); box-shadow:0 0 22px rgba(255,111,159,.18); }
.hero { min-height:390px; border-bottom:0; position:relative; }
.hero::before { content:"âœ¦"; position:absolute; right:24%; top:16%; color:rgba(255,212,229,.55); font-size:24px; text-shadow:40px 50px 0 rgba(128,223,244,.22),-85px 80px 0 rgba(185,156,255,.22); }
.eyebrow { color:var(--red-2); }
.hero h1 { letter-spacing:-.055em; text-shadow:0 14px 40px rgba(4,2,10,.55); }
.hero h1 span { color:#d8c8f4; -webkit-text-stroke:0; opacity:.78; }
.hero-copy { color:#bcb0ca; }
.clock-card { border:1px solid rgba(185,156,255,.20); border-radius:24px; padding:22px; background:linear-gradient(145deg,rgba(185,156,255,.12),rgba(255,111,159,.08)); box-shadow:var(--shadow); }
.clock-card strong { color:var(--pink-soft); }

.summary-grid { gap:12px; border:0; padding:6px 0 18px; }
.summary-card { min-height:124px; border:1px solid rgba(185,156,255,.18); border-radius:22px; background:linear-gradient(145deg,rgba(29,22,43,.94),rgba(20,15,31,.94)); box-shadow:0 12px 36px rgba(4,2,10,.18),inset 0 1px rgba(255,255,255,.025); }
.summary-card:last-child { border-right:1px solid rgba(185,156,255,.18); }
.summary-card.accent { border-color:rgba(255,111,159,.32); background:linear-gradient(145deg,rgba(63,27,52,.92),rgba(28,18,40,.95)); }
.summary-card.accent strong { color:#ff9bbb; }
.board-head { padding-top:58px; }
.board-head h2,.method-section h2 { color:#fff8ff; }
.legend { padding:10px 14px; border:1px solid rgba(185,156,255,.16); border-radius:999px; background:rgba(22,16,33,.72); }
.error-banner { border:1px solid rgba(255,111,159,.38); border-radius:16px; background:rgba(73,24,49,.55); color:var(--pink-soft); }
.candidate-grid { gap:18px; }
.candidate-card { border:1px solid rgba(185,156,255,.20); border-radius:26px; background:radial-gradient(circle at 92% 3%,rgba(255,111,159,.12),transparent 25%),linear-gradient(150deg,rgba(29,22,43,.97),rgba(15,12,24,.98)); box-shadow:var(--shadow),inset 0 1px rgba(255,255,255,.035); transition:border-color .25s,transform .25s,box-shadow .25s; }
.candidate-card:hover { border-color:rgba(255,155,187,.55); transform:translateY(-4px); box-shadow:0 24px 65px rgba(4,2,10,.55),0 0 35px rgba(255,111,159,.08); }
.candidate-card:nth-child(1) { border-color:rgba(255,111,159,.46); }
.card-rank { top:-24px; color:var(--pink-soft); opacity:.045; }
.coin-logo { width:43px; height:43px; border:1px solid rgba(255,212,229,.28); background:radial-gradient(circle at 30% 25%,#ffb6cf,#a26cdb 48%,#332040 72%); color:#fff; box-shadow:0 8px 22px rgba(185,156,255,.18); }
.status-pill { border-radius:999px; padding:7px 10px; background:rgba(185,156,255,.09); }
.status-pill.danger { border-color:rgba(255,111,159,.52); color:#ffc0d4; background:rgba(255,111,159,.13); }
.status-pill.warning { border-color:rgba(255,212,126,.45); background:rgba(255,212,126,.08); }
.score-ring { background:conic-gradient(#ff78a6 var(--score),rgba(185,156,255,.14) 0); box-shadow:0 0 28px rgba(255,111,159,.13); }
.score-ring::after { background:#171120; }
.spark polyline { stroke:#ff86ad; filter:drop-shadow(0 0 5px rgba(255,111,159,.32)); }
.score-bars { border-color:rgba(185,156,255,.14); }
.score-bars i { height:5px; border-radius:999px; background:rgba(185,156,255,.12); overflow:hidden; }
.score-bars u { border-radius:inherit; background:linear-gradient(90deg,#b879fa,#ff719f); }
.score-bars .trigger-bar { background:linear-gradient(90deg,#80dff4,#75e6c1); }
.mini-orb,.agent-orb { position:relative; background:radial-gradient(circle at 35% 25%,#ffd7e6,#ff75a4 37%,#9f5dde 67%,#2b163c 100%); box-shadow:0 0 28px rgba(255,111,159,.28),inset -5px -7px 12px rgba(75,31,102,.24); }
.mini-orb::after,.agent-orb::after { content:"â€¢á´—â€¢"; position:absolute; inset:0; display:grid; place-items:center; color:rgba(65,24,75,.86); font-weight:900; letter-spacing:-1px; }
.mini-orb::after { font-size:7px; }
.agent-orb::after { font-size:13px; }
.agent-callout { align-items:flex-start; }
.agent-callout p { color:#c7bbd3; }
.levels { border-color:rgba(185,156,255,.18); border-radius:16px; overflow:hidden; background:rgba(11,8,18,.26); }
.levels>div { border-color:rgba(185,156,255,.16); }
.card-actions button,.quick-questions button { border-color:rgba(185,156,255,.22); border-radius:12px; background:rgba(185,156,255,.055); transition:.2s ease; }
.card-actions button:hover,.quick-questions button:hover { border-color:rgba(255,155,187,.65); background:rgba(255,111,159,.10); color:var(--pink-soft); }
.agent-button { border:0!important; background:linear-gradient(135deg,#ff729f,#a976f1)!important; box-shadow:0 9px 25px rgba(255,111,159,.22); }
.metric { border-color:rgba(185,156,255,.17); border-radius:13px; background:rgba(185,156,255,.045); }
.method-section { border:1px solid rgba(185,156,255,.16); border-radius:28px; padding:42px; background:linear-gradient(145deg,rgba(29,22,43,.78),rgba(17,12,26,.8)); box-shadow:var(--shadow); }
.flow-step>b { color:#6d5686; }
.flow-step.final b,.flow-step.final strong { color:var(--red-2); }
.flow-line { background:linear-gradient(90deg,rgba(128,223,244,.4),rgba(185,156,255,.55),rgba(255,111,159,.55)); }

.drawer-backdrop { background:rgba(8,4,14,.72); backdrop-filter:blur(10px); }
.agent-drawer { border-left:1px solid rgba(255,155,187,.24); background:radial-gradient(circle at 100% 0%,rgba(185,156,255,.17),transparent 34%),linear-gradient(180deg,#171020 0%,#0d0a14 100%); box-shadow:-24px 0 70px rgba(3,1,8,.5); }
.drawer-close { width:38px; height:38px; right:18px; top:15px; border:1px solid rgba(185,156,255,.18); border-radius:50%; background:rgba(185,156,255,.07); font-size:23px; }
.agent-head { border-color:rgba(185,156,255,.17); }
.agent-head p { color:var(--red-2); }
.agent-snapshot { gap:7px; padding:12px 0; border:0; }
.agent-snapshot div { border:1px solid rgba(185,156,255,.14); border-radius:13px; padding:12px 9px; background:rgba(185,156,255,.045); }
.agent-snapshot div:last-child { border:1px solid rgba(185,156,255,.14); }
.agent-messages { scrollbar-width:thin; scrollbar-color:rgba(255,111,159,.35) transparent; }
.message { border-radius:18px; box-shadow:0 8px 24px rgba(3,1,8,.16); }
.message.agent { border-left:0; border-bottom-left-radius:5px; background:linear-gradient(145deg,rgba(48,35,66,.95),rgba(28,21,41,.98)); color:#f8efff; }
.message.user { border-bottom-right-radius:5px; background:linear-gradient(135deg,#a86fe2,#e96899); color:#fff; }
.agent-form { gap:7px; border:0; }
.agent-form input { height:50px; border:1px solid rgba(185,156,255,.22); border-radius:15px; background:rgba(25,18,36,.95); }
.agent-form input:focus { border-color:rgba(255,155,187,.64); box-shadow:0 0 0 4px rgba(255,111,159,.07); }
.agent-form button { width:50px; height:50px; border-radius:15px; background:linear-gradient(135deg,#ff719f,#a976f1); box-shadow:0 8px 24px rgba(255,111,159,.25); }
.agent-disclaimer { color:#796d88; }
footer { padding-inline:6px; }

@media(max-width:700px) {
  body.telegram-mini-app .shell { width:min(100% - 18px,1450px); }
  .topbar,body.telegram-mini-app .topbar { height:64px; }
  body.telegram-mini-app .brand-mark { width:31px; height:31px; border-radius:10px; }
  .brand::after { display:none; }
  .hero,body.telegram-mini-app .hero { padding:34px 6px 30px; min-height:330px; }
  body.telegram-mini-app .hero h1 { font-size:clamp(34px,10vw,44px); line-height:.96; }
  .hero::before { right:8%; top:9%; }
  .summary-grid { gap:9px; }
  .summary-card,body.telegram-mini-app .summary-card { min-height:98px; padding:15px 13px; border-radius:17px; }
  .summary-card:last-child { border-right:1px solid rgba(185,156,255,.18); }
  .board-head { padding-top:42px; }
  .candidate-card,body.telegram-mini-app .candidate-card { padding:18px; border-radius:22px; }
  .method-section { border-radius:22px; padding:26px 20px; }
  .agent-drawer,body.telegram-mini-app .agent-drawer { padding:22px 18px calc(18px + var(--tg-content-safe-area-inset-bottom,0px)); }
  .agent-head { padding:4px 46px 18px 0; }
  .agent-orb { width:54px; height:54px; }
  .agent-snapshot { padding:10px 0; }
  .agent-messages { padding:16px 0; }
  .message { max-width:92%; padding:13px 14px; font-size:12px; }
  .quick-questions { flex-wrap:nowrap; overflow-x:auto; padding-bottom:3px; scrollbar-width:none; }
  .quick-questions::-webkit-scrollbar { display:none; }
  .quick-questions button { white-space:nowrap; flex:0 0 auto; }
}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; transition-duration:.01ms!important; }
}

.candidate-card[role="button"] { cursor:pointer; }
.candidate-card[role="button"]:focus-visible { outline:2px solid var(--pink-soft); outline-offset:3px; }
.chart-drawer { position:fixed; right:0; top:0; bottom:0; z-index:23; width:min(590px,100%); padding:32px; display:flex; flex-direction:column; background:radial-gradient(circle at 100% 0%,rgba(185,156,255,.2),transparent 34%),linear-gradient(180deg,#171020,#0d0a14); border-left:1px solid rgba(255,155,187,.24); box-shadow:-24px 0 70px rgba(3,1,8,.55); transform:translateX(102%); transition:transform .28s; }
.chart-drawer.open { transform:translateX(0); }
#chartBackdrop { z-index:22; }
.chart-head { display:flex; align-items:center; gap:14px; padding:5px 48px 18px 0; border-bottom:1px solid rgba(185,156,255,.17); }
.chart-logo { width:48px; height:48px; }
.chart-head p { color:var(--red-2); font-size:8px; letter-spacing:.18em; margin:0 0 5px; }
.chart-head h2 { margin:0; font-size:26px; }
.chart-head small { color:var(--muted); font-size:10px; }
.timeframe-tabs { display:flex; gap:7px; padding:16px 0 12px; }
.timeframe-tabs button { min-width:48px; padding:9px 8px; border:1px solid rgba(185,156,255,.2); border-radius:10px; background:rgba(185,156,255,.05); color:var(--muted); font-size:11px; font-weight:800; cursor:pointer; }
.timeframe-tabs button.active { border-color:rgba(255,155,187,.65); color:#fff; background:linear-gradient(135deg,#ff719f,#a976f1); box-shadow:0 8px 20px rgba(255,111,159,.18); }
.chart-tools { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:-3px 0 10px; color:var(--muted); font-size:8px; letter-spacing:.03em; }
.chart-tools>div { display:flex; gap:5px; }.chart-tools button { min-height:28px; border:1px solid rgba(185,156,255,.22); border-radius:8px; background:rgba(185,156,255,.06); color:#eee4f7; padding:4px 9px; font-size:11px; cursor:pointer; }
.chart-tools button:hover { border-color:rgba(255,155,187,.6); background:rgba(255,111,159,.11); }
.chart-loading { min-height:22px; color:var(--muted); font-size:11px; }
.chart-canvas { min-height:260px; margin-top:7px; padding:12px 0 6px; border-top:1px solid rgba(185,156,255,.12); border-bottom:1px solid rgba(185,156,255,.12); touch-action:none; user-select:none; }
.chart-canvas svg { width:100%; height:250px; overflow:visible; cursor:crosshair; }
.chart-grid-line { stroke:rgba(185,156,255,.15); stroke-width:1; vector-effect:non-scaling-stroke; }
.chart-axis-label { fill:#9f91ae; font-size:7px; font-family:var(--font); }
.chart-wick { stroke-width:1; vector-effect:non-scaling-stroke; }
.chart-wick.up { stroke:var(--green); }.chart-wick.down { stroke:var(--red-2); }
.chart-body.up { fill:var(--green); }.chart-body.down { fill:var(--red-2); }
.chart-crosshair { stroke:rgba(255,227,240,.72); stroke-width:1; stroke-dasharray:3 3; vector-effect:non-scaling-stroke; }.chart-crosshair-dot { fill:var(--pink-soft); stroke:#28162f; stroke-width:1.5; }
.chart-selected { min-height:19px; padding-top:8px; color:#dbcfe9; font-size:10px; }
.chart-ohlc { display:grid; grid-template-columns:repeat(4,1fr); gap:7px; padding:13px 0; }
.chart-ohlc div { min-width:0; padding:9px 8px; border:1px solid rgba(185,156,255,.15); border-radius:11px; background:rgba(185,156,255,.045); }
.chart-ohlc span { display:block; color:var(--muted); font-size:7px; letter-spacing:.1em; }
.chart-ohlc strong { display:block; margin-top:5px; color:#fff7ff; font-size:10px; overflow:hidden; text-overflow:ellipsis; }
.chart-note { margin:6px 0 0; color:#8d819b; font-size:9px; line-height:1.5; }

/* Read-only market viewer */
.chart-drawer { width:min(780px,100%); overflow-y:auto; display:block; overscroll-behavior:contain; scrollbar-color:#ad4f83 transparent; }
.chart-actionbar { position:absolute; z-index:3; top:20px; right:22px; display:flex; gap:7px; }
.chart-actionbar button { width:ïNµ¶‰žËkºwµçign-items:flex-start}.flow-line{margin-top:22px}.hero{grid-template-columns:1fr 150px}.clock-card{width:150px;padding-left:22px}}
@media(max-width:700px){.shell{width:min(100% - 28px,1450px)}.topbar{height:72px}.mode-badge{display:none}.sync span{display:none}.hero{grid-template-columns:1fr;min-height:420px;padding:55px 0}.clock-card{display:none}.hero h1{font-size:47px}.summary-grid{grid-template-columns:1fr 1fr}.summary-card{padding:18px 14px;min-height:110px}.summary-card strong{font-size:28px}.candidate-card,.candidate-card:nth-child(1),.candidate-card:nth-child(2){grid-column:1/-1}.board-head{align-items:flex-start;gap:20px}.legend{display:none}.method-flow{flex-direction:column;gap:15px}.flow-line{height:28px;width:1px;margin:0 0 0 17px}.flow-step{min-width:0}.method-section{margin-top:60px}.levels strong{font-size:8px}footer{flex-direction:column;align-items:flex-start;justify-content:center;padding:28px 0}.agent-drawer{padding:25px 18px}.metric-panel{grid-template-columns:1fr}.live-cluster{gap:8px}}
