:root {
  --bg: #f6f7f9; --card: #ffffff; --text: #15181f; --muted: #6b7180; --line: #e2e5ea;
  --up: #12996f; --down: #d64545; --liq: #b7791f; --prof: #6a5fd0; --accent: #2962ff; --pro-bg: #eeedfe; --pro-text: #3c3489;
  --grid: #eceef2; --err: #c62828;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141c; --card: #191d27; --text: #e6e8ee; --muted: #8b92a3; --line: #2a2f3b;
    --up: #26a69a; --down: #ef5350; --liq: #e0a63a; --prof: #9b93f0; --accent: #5b8cff; --pro-bg: #26215c; --pro-text: #cecbf6;
    --grid: #1f2430; --err: #ff6b6b;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
main { max-width: 640px; margin: 0 auto; padding: 12px 14px 24px; }
[hidden] { display: none !important; }
h1 { font-size: 20px; font-weight: 600; margin: 8px 0 4px; }
h2 { font-size: 15px; font-weight: 600; margin: 18px 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.err { color: var(--err); font-size: 13px; min-height: 1em; }
.center { text-align: center; padding-top: 18vh; }
.center button { width: 100%; max-width: 320px; margin: 22px auto 6px; display: block; }
button, select, input { font: inherit; color: var(--text); }
button { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button:active { transform: scale(0.98); }
select, input:not([type]) { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; }
.logo { display: inline-flex; gap: 6px; align-items: flex-end; height: 44px; }
.logo span { width: 10px; border-radius: 2px; background: var(--up); }
.logo span:nth-child(1) { height: 26px; } .logo span:nth-child(2) { height: 40px; background: var(--down); } .logo span:nth-child(3) { height: 32px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.top select { font-weight: 600; padding: 6px 8px; margin-right: 6px; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { color: var(--up); border-color: var(--up); }
.pill.warn { color: var(--liq); border-color: var(--liq); }
.pill.bad { color: var(--err); border-color: var(--err); }
.price-row { display: flex; align-items: baseline; gap: 10px; margin: 8px 0 4px; }
.px { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; touch-action: pan-y; }
.chart svg { display: block; width: 100%; }
.chart text { font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.c-up { fill: var(--up); stroke: var(--up); } .c-down { fill: var(--down); stroke: var(--down); }
.c-cur { opacity: 0.55; }
.g-line { stroke: var(--grid); stroke-width: 1; }
.l-odpor { stroke: var(--down); } .l-podpora { stroke: var(--up); } .l-likvidita { stroke: var(--liq); } .l-profil { stroke: var(--prof); }
.t-odpor { fill: var(--down) !important; } .t-podpora { fill: var(--up) !important; } .t-likvidita { fill: var(--liq) !important; } .t-profil { fill: var(--prof) !important; }
.lv-line { stroke-width: 1; stroke-dasharray: 4 3; }
.vwap-line { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: 0.9; }
.t-vwap { fill: var(--accent) !important; font-weight: 600; }
.lv .n.vwap { color: var(--accent); font-weight: 600; }
.px-line { stroke: var(--text); stroke-width: 0.6; stroke-dasharray: 2 2; }
.px-tag { fill: var(--text); } .px-tag-t { fill: var(--bg) !important; font-weight: 600; }
.m-sig { fill: var(--pro-text); }
.s-entry { stroke: var(--pro-text); stroke-width: 1.2; } .s-sl { stroke: var(--down); stroke-width: 1.2; } .s-tp { stroke: var(--up); stroke-width: 1.2; }
.sig { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--pro-bg); color: var(--pro-text); font-size: 13.5px; }
.sig b { font-weight: 600; }
.sig .why { margin-top: 3px; }
.sig.old { background: var(--card); color: var(--muted); border: 1px solid var(--line); }
.levels { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; font-variant-numeric: tabular-nums; }
.lv { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: baseline; }
.lv:last-child { border-bottom: 0; }
.lv .n.odpor { color: var(--down); } .lv .n.podpora { color: var(--up); } .lv .n.likvidita { color: var(--liq); } .lv .n.profil { color: var(--prof); }
.lv .d { color: var(--muted); min-width: 64px; text-align: right; }
.lv .p { min-width: 38px; text-align: right; font-weight: 600; }
.lv.now { grid-template-columns: 1fr; text-align: center; color: var(--text); font-weight: 600; background: var(--bg); margin: 0 -12px; padding: 6px 12px; }
.smt { margin-top: 12px; font-size: 13.5px; }
.m-abs { stroke: var(--pro-text); stroke-width: 1.4; fill: none; }
.m-abs.silne { fill: var(--pro-text); }
.m-abs.slabe { opacity: 0.4; }
.events { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px; }
.ev { display: grid; grid-template-columns: 44px 1fr; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.ev:last-child { border-bottom: 0; }
.ev .up { color: var(--up); } .ev .down { color: var(--down); }
.ev .abs { color: var(--pro-text); } .ev .abs.silne { font-weight: 600; } .ev .abs.slabe { color: var(--muted); }
.prefs label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 6px 0; }
.prefs .row { margin-top: 8px; }
.smt .hot { color: var(--err); font-weight: 600; }
.bottom { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.row { display: flex; gap: 8px; align-items: center; }
.row input { flex: 1; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.link { word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.list .it { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.list .it:last-child { border-bottom: 0; }
.list .it button { padding: 6px 10px; font-size: 13px; }
.lang { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 6px; }
.lang button { padding: 3px 9px; font-size: 12px; border-radius: 8px; color: var(--muted); }
.lang button.on { color: var(--text); border-color: var(--accent); font-weight: 600; }
.z-tp { fill: var(--up); opacity: 0.16; } .z-sl { fill: var(--down); opacity: 0.16; }
.z-tp.act, .z-sl.act { opacity: 0.24; }
.z-tp.gone, .z-sl.gone { opacity: 0.06; }
.s-entry { stroke: var(--pro-text); stroke-width: 1.2; } .s-entry.gone { opacity: 0.4; stroke-dasharray: 3 3; }
.s-slm { stroke: var(--down); stroke-width: 1; stroke-dasharray: 3 2; }
.m-sig.gone { opacity: 0.35; }
.res { font-weight: 600; }
.m-absz { fill: #7f77dd; opacity: 0.45; stroke: #7f77dd; stroke-width: 1; }
.m-abst { fill: var(--pro-text) !important; font-weight: 700; font-size: 10px; }
.ev .abs.big { font-weight: 600; color: var(--pro-text); }
.ev .abs .small { font-weight: 400; color: var(--muted); }
.chart-wrap { position: relative; }
.robot { margin: 0 0 6px; color: var(--muted); }
.robot.block { color: var(--liq); }
.variants { display: flex; gap: 6px; margin: 4px 0 6px; }
.variants button { flex: 1; padding: 6px 8px; font-size: 13px; }
.variants button.on, .chips button.on { border-color: var(--accent); color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chips button { padding: 4px 10px; font-size: 12.5px; border-radius: 999px; color: var(--muted); }
.chart-live { position: absolute; right: 84px; top: 8px; padding: 3px 9px; font-size: 12px; }
body.chart-big .chart-live { position: fixed; z-index: 51; top: calc(env(safe-area-inset-top) + 6px); right: calc(env(safe-area-inset-right) + 110px); }
.pz-tp { fill: var(--up); fill-opacity: 0.07; stroke: var(--up); stroke-dasharray: 4 3; stroke-width: 1; }
.pz-sl { fill: var(--down); fill-opacity: 0.07; stroke: var(--down); stroke-dasharray: 4 3; stroke-width: 1; }
.pz-e { stroke: var(--pro-text); stroke-dasharray: 2 2; stroke-width: 1; }
.plab { font-size: 10px; font-weight: 600; }
.dl-box { fill: none; stroke-width: 1.4; } .dl-up { stroke: var(--up); } .dl-dn { stroke: var(--down); }
.dl-t { font-size: 9.5px; font-weight: 600; }
.imb-b { fill: #2f6bff; opacity: 0.85; } .imb-s { fill: #ef3b3b; opacity: 0.85; }
.imb-bx { fill: #2f6bff; opacity: 0.32; } .imb-sx { fill: #ef3b3b; opacity: 0.32; }
.bt-b { fill: #2f6bff; fill-opacity: 0.45; stroke: #2f6bff; } .bt-s { fill: #ef3b3b; fill-opacity: 0.45; stroke: #ef3b3b; }
.bt-t { font-size: 9px; fill: var(--text) !important; }
.stats table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.stats th, .stats td { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.stats th:first-child, .stats td:first-child { text-align: left; }
.stats .pos { color: var(--up); font-weight: 600; } .stats .neg { color: var(--down); font-weight: 600; }
.stats { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 4px 10px; }
.ev .res-p { color: var(--up); font-weight: 600; } .ev .res-n { color: var(--down); font-weight: 600; }
.chart { cursor: zoom-in; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart-close { display: none; }
body.chart-big { overflow: hidden; }
body.chart-big .chart { position: fixed; inset: 0; z-index: 50; border-radius: 0; border: 0; cursor: zoom-out;
  padding: calc(env(safe-area-inset-top) + 44px) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); background: var(--card); }
body.chart-big .chart-close { display: block; position: fixed; z-index: 51; top: calc(env(safe-area-inset-top) + 6px); right: calc(env(safe-area-inset-right) + 10px); }
