:root {
  --bg: #0C1016; --card: #121A22; --deep: #0F151C; --line: #26323E; --grid: #18212B; --chip: #1C2631;
  --teal: #34D6BE; --teal-ink: #08201C; --red: #F05460; --red-soft: #F57A84; --red-fill: #D9404C;
  --orange: #E87028; --gold: #FFC85A; --text: #ECF2F6; --sub: #C3CED8; --muted: #8FA0B0;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: 'Exo 2', system-ui, sans-serif; }
body {
  min-height: 100vh;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 30px 30px; background-attachment: fixed;
}
a { color: var(--teal); text-decoration: none; }
button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
#view { max-width: 560px; margin: 0 auto; padding: 18px 16px calc(96px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }

/* типографика */
.brand { font-size: 30px; font-weight: 800; color: var(--teal); letter-spacing: .5px; line-height: 1; }
.kicker { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; }
.h2 { font-size: 22px; font-weight: 800; }
.h3 { font-size: 16px; font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 1.45; }
.mono { font-family: var(--mono); }
.teal { color: var(--teal); } .red { color: var(--red-soft); } .orange { color: var(--orange); } .gold { color: var(--gold); }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

/* блоки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.card.big { border-radius: 18px; padding: 16px; gap: 12px; }
.card.row { flex-direction: row; align-items: center; }
.card.warn { border-color: var(--orange); background: #1E1510; }
.card.owner { border-color: var(--orange); background: #1A140F; }
.cell { background: var(--deep); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.cell .lbl { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.cell .val { font-family: var(--mono); font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat .lbl { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 1px; }
.stat .val { font-size: 20px; font-weight: 800; }
.bar { height: 6px; border-radius: 3px; background: var(--chip); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: var(--teal); }

/* чипы и кнопки */
.pill { font-size: 12px; font-weight: 800; border-radius: 6px; padding: 4px 8px; white-space: nowrap; }
.pill.long { background: var(--teal); color: var(--teal-ink); }
.pill.short { background: var(--red-fill); color: #fff; }
.pill.score { background: var(--orange); color: #fff; font-size: 14px; border-radius: 8px; padding: 5px 9px; margin-left: auto; }
.pill.tradfi { color: var(--gold); border: 1px solid #5A4A26; background: transparent; }
.tag { font-size: 12px; font-weight: 600; color: var(--sub); background: var(--chip); border-radius: 8px; padding: 4px 8px; }
.tag.rr { color: var(--text); background: transparent; border: 1px solid var(--teal); font-weight: 700; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border-radius: 18px; font-size: 13px; font-weight: 700; border: 1px solid var(--line); background: var(--card); color: var(--sub); }
.chip.on { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.seg button { height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--sub); font-weight: 800; font-size: 13px; }
.seg button.on { background: var(--teal); color: var(--teal-ink); }
.btn { height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--deep); color: var(--text); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 12px; width: 100%; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--teal-ink); font-weight: 800; }
.btn.accent { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 800; }
.btn.on { background: #10302B; border-color: var(--teal); color: var(--teal); }
.btn[disabled] { opacity: .55; }
.btn svg, .tabs svg, .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.back { height: 44px; display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; color: var(--muted); background: none; border: 0; padding: 0; }
.search { display: flex; gap: 8px; }
.search input { flex: 1; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); padding: 0 14px; font-size: 16px; text-transform: uppercase; }
.search input::placeholder { text-transform: none; color: var(--muted); }
.search .btn { width: auto; padding: 0 16px; }
input[type=number] { height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--deep); padding: 0 14px; font-size: 16px; width: 100%; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-top: 1px solid var(--chip); }
.switch:first-of-type { border-top: 0; }
.switch input { width: 22px; height: 22px; accent-color: var(--teal); flex-shrink: 0; }
.switch label { font-size: 14px; font-weight: 700; }

/* списки */
.setup { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.setup .sym { font-size: 22px; font-weight: 800; letter-spacing: .3px; }
.rsirow { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--text); min-height: 52px; }
.event { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--deep); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.check svg { width: 18px; height: 18px; stroke: var(--teal); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; margin-top: 1px; }
.check.bad svg { stroke: var(--orange); } .check.bad { color: #F2A65A; }
.para { font-size: 14px; line-height: 1.5; color: #D5DEE6; white-space: pre-line; }
.dot { width: 12px; height: 12px; border-radius: 6px; flex-shrink: 0; }
details.block { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
details.block summary { list-style: none; min-height: 56px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; }
details.block summary::-webkit-details-marker { display: none; }
details.block summary .plus { margin-left: auto; color: var(--muted); font-size: 20px; }
details.block[open] summary .plus { transform: rotate(45deg); }
details.block .para { padding: 0 16px 16px; }

/* графики */
.chart { height: 330px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--deep); }
.chart.rsi { height: 110px; margin-top: -8px; }
.tfbar { display: flex; gap: 6px; }

/* табы */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line); background: #0E141Bf2; backdrop-filter: blur(8px); padding: 8px 8px calc(10px + env(safe-area-inset-bottom)); z-index: 10; }
.tabs a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.tabs a svg { width: 22px; height: 22px; }
.tabs a.on { color: var(--teal); font-weight: 700; }
.tabs.hidden { display: none; }

/* состояния */
.skeleton { background: linear-gradient(90deg, var(--card) 0%, #17212B 50%, var(--card) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 16px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; background: var(--card); border: 1px dashed var(--line); border-radius: 16px; }
.toast { position: fixed; left: 16px; right: 16px; bottom: calc(90px + env(safe-area-inset-bottom)); margin: 0 auto; max-width: 520px; background: #1C2631; border: 1px solid var(--line);
  color: var(--text); border-radius: 12px; padding: 12px 14px; font-size: 14px; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.footer-note { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.45; }
