:root{--bg:#edf2f6;--panel:#fff;--ink:#243347;--muted:#738095;--line:#d5e0e9;--head:#e2ebf3;--green:#117956;--soft-green:#edf8f2;--red:#c83d52;--blue:#2c65b4}
*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:70px}body{margin:0;background:var(--bg);color:var(--ink);font-family:"Times New Roman",Times,serif;font-size:15px;padding:18px 22px}button,input,select{font:inherit;color:inherit}button,a,input,select{touch-action:manipulation}button{background:#f7fafd;border:1px solid #c5d5e3;border-radius:5px;padding:6px 11px;cursor:pointer;white-space:nowrap}button:hover{border-color:var(--green);background:var(--soft-green)}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--green);color:#fff;border-color:var(--green);font-weight:bold}input,select{height:30px;border:1px solid #c7d6e5;border-radius:4px;background:white;padding:4px 7px;min-width:0}input:focus,select:focus,button:focus-visible,a:focus-visible{outline:2px solid #71acda;outline-offset:1px}input[type=checkbox]{width:15px;height:15px;accent-color:var(--green);vertical-align:middle;margin:0 6px 0 0}a{color:var(--green);text-decoration:none}a:hover{text-decoration:underline}[hidden]{display:none!important}.shell{max-width:1900px;margin:auto}.topbar{position:sticky;top:0;z-index:5;background:var(--panel);display:flex;align-items:center;gap:26px;border:1px solid var(--line);border-top:3px solid var(--green);border-radius:9px 9px 0 0;padding:13px 17px;box-shadow:0 3px 12px #273b4e08}.brand{font-size:25px;font-weight:bold;letter-spacing:-.6px;color:#1e5b49}.brand span{font-weight:normal;color:var(--ink)}nav{display:flex;gap:5px}nav a{padding:6px 13px;border-radius:5px;font-weight:bold;color:var(--muted)}nav a:hover,nav a.selected{background:var(--soft-green);color:var(--green);text-decoration:none}.retention{margin-left:auto;font-size:13px;color:var(--muted)}.statusbar{display:flex;align-items:center;gap:18px;background:#f6faf8;border:1px solid var(--line);border-top:0;min-height:34px;padding:6px 16px;font-size:13px}.right{margin-left:auto}.badge{display:inline-block;border-radius:4px;padding:3px 7px;background:#eff3f7;color:var(--muted);font-size:12px}.badge.live{background:#e7f5ee;color:var(--green)}.badge.pending{background:#fff5df;color:#966c17}.badge.error{background:#ffedf0;color:var(--red)}section{background:white;border:1px solid var(--line);margin-top:14px;border-radius:6px;overflow:hidden;scroll-margin-top:75px}.section-title{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line);gap:15px}.section-title h1,.section-title h2{font-size:19px;display:inline;margin:0 13px 0 0}.section-title span{font-size:13px;color:var(--muted)}.filters{display:flex;align-items:flex-end;gap:12px;padding:10px 14px;background:#fafcfe;flex-wrap:wrap;border-bottom:1px solid var(--line)}label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:#5c6d83;font-weight:bold}label input,label select{font-size:14px;font-weight:normal}label.check{flex-direction:row;align-items:center;min-height:30px;color:var(--ink);font-size:13px;white-space:nowrap}.filters input[type=number]{width:115px}.search{flex:1;min-width:180px;max-width:300px}.table-scroll{overflow:auto}table{border-collapse:collapse;width:100%;table-layout:auto;font-variant-numeric:tabular-nums}th{background:var(--head);border-right:1px solid #cbd9e6;border-bottom:1px solid #bccfe0;text-align:center;padding:10px 8px;font-size:13px;white-space:nowrap;color:#425a72}th[data-sort]{cursor:pointer;user-select:none}th[data-sort]:hover{background:#d2e1ee}td{padding:7px 10px;border-right:1px solid #e4eaf0;border-bottom:1px solid #e0e7ee;text-align:center;white-space:nowrap;height:35px}th:last-child,td:last-child{border-right:0}tbody tr:nth-child(even){background:#fafcfe}tbody tr:hover{background:#f0f6fa}.symbol-cell{display:flex;align-items:center;justify-content:space-between;gap:10px;min-width:160px}.coin-name{font-size:17px;font-weight:bold;color:#253d54}.coin-actions{display:flex;gap:4px}.icon-btn{padding:0 4px;border:0;background:transparent;color:#adbac7;font-size:18px}.icon-btn.active-star{color:#b8891a}.icon-btn.active-black{color:var(--red)}.positive{color:var(--green);font-weight:bold}.negative{color:var(--red);font-weight:bold}.range-number{font-weight:bold;color:var(--blue)}.muted{color:var(--muted)}.empty{text-align:center;padding:32px;color:var(--muted)}.market-table th:nth-child(1){width:210px}.market-table td:nth-child(2){font-weight:bold}.tiny-links{display:flex;gap:10px;justify-content:center;font-size:12px}.pager{display:flex;align-items:center;justify-content:flex-end;gap:8px;padding:8px 13px;color:var(--muted);font-size:12px}.pager>span{margin-right:auto}.pager label{flex-direction:row;align-items:center;margin-left:8px}.pager select{height:27px}.pager button{font-size:12px;padding:4px 10px}.journal-scroll{max-height:420px}.journal-scroll thead{position:sticky;top:0;z-index:1}.journal-filters{gap:14px}.journal-filters input{width:150px}.journal-filters input[type=number]{width:95px}.rules-table td{padding:7px 8px}.rules-table input,.rules-table select{width:100%;text-align:center}.rules-table input[type=checkbox]{width:16px}.rules-table td:nth-child(2) input{text-align:left}.rules-table th:first-child{width:50px}.rules-table th:nth-child(2){width:25%}.rules-table th:nth-child(4),.rules-table th:nth-child(5),.rules-table th:nth-child(6),.rules-table th:nth-child(8){width:100px}.rules-table tr.on{background:#f3faf6}.footnote{font-size:12px;color:var(--muted);padding:9px 14px;line-height:1.5;border-top:1px solid var(--line)}.actions{display:flex;gap:8px;align-items:center}.telegram-form{display:flex;align-items:flex-end;gap:12px;padding:15px;flex-wrap:wrap}.telegram-form label:first-child{flex:1;min-width:220px}.telegram-form label:nth-child(2){width:170px}.save-state{font-size:12px;max-width:330px;white-space:normal}.save-state.saving{color:var(--blue)}.save-state.success{color:var(--green);font-weight:bold}.save-state.error{color:var(--red);font-weight:bold}#chat-results{padding:0 14px 12px}#chat-results:empty{display:none}#notice{position:fixed;top:12px;right:28px;z-index:80;padding:12px 20px;border:1px solid #a4cdb6;background:#f1fff7;color:var(--green);border-radius:6px;box-shadow:0 6px 28px #26364224;max-width:550px}#notice.error{background:#fff4f5;border-color:#e3b1b9;color:var(--red)}#chart{display:block;width:100%;height:250px;padding:0 10px}details{margin-top:14px;background:#fff;border:1px solid var(--line);padding:10px 14px;border-radius:6px;color:var(--muted);font-size:13px}summary{cursor:pointer}pre{white-space:pre-wrap;word-break:break-word;font:12px monospace;max-height:240px;overflow:auto}footer{display:flex;justify-content:space-between;gap:15px;padding:17px 2px;color:var(--muted);font-size:12px}footer>span{text-align:right}button.subtle{background:transparent;color:var(--muted)}.black-row{opacity:.65}
.login-body{min-height:100vh;display:grid;place-items:center}.login-card{width:100%;max-width:420px;background:white;border:1px solid var(--line);border-top:3px solid var(--green);border-radius:8px;padding:28px;box-shadow:0 8px 30px #24334712}.login-card h1{margin:0}.login-card p{line-height:1.45;color:var(--muted)}.login-card form{display:grid;gap:15px}.login-card label{font-size:14px}.login-card input:not([type=checkbox]){height:40px;font-size:16px}.login-card button{min-height:40px}.login-card #login-status{margin:0;min-height:42px;font-size:14px}.login-card #login-status.negative{color:var(--red)}
.market-table th{padding:7px 6px}.market-table td{height:30px;padding:4px 7px}.market-table .number-col{width:38px;min-width:38px}.market-table .row-number{width:38px;padding-left:4px;padding-right:4px;color:var(--muted);font-size:12px}.market-table th.impulse-head{background:#e7f2ec;color:#23664f;min-width:72px}.market-table td.impulse-number{padding-left:6px;padding-right:6px;font-weight:bold;color:#315f50;background:#f7fbf9}.market-table .symbol-cell{min-width:140px}.market-table .coin-name{font-size:16px}.impulse-filters{display:flex;align-items:flex-end;gap:5px;padding:5px 7px;border:1px solid #d5e0e9;border-radius:5px;background:#f2f8f5}.impulse-filters>span{align-self:center;margin-right:3px;color:#52697d;font-size:12px;font-weight:bold;white-space:nowrap}.impulse-filters label{gap:2px;text-align:center;color:#23664f;font-size:11px}.filters .impulse-filters input{width:46px;height:25px;padding:2px 4px;text-align:center;font-size:12px}.quick-impulses{display:flex;align-items:center;gap:3px;padding:4px 6px;border:1px solid #b9dcc9;border-radius:5px;background:#edf8f2}.quick-impulses>span{margin-right:2px;color:#23664f;font-size:12px;font-weight:bold;white-space:nowrap}.quick-impulse{min-height:24px!important;padding:0 5px;color:#23664f!important}.quick-impulse input{margin-right:3px}#markets{margin-top:0}
@media(max-width:1000px){body{padding:8px}.topbar{gap:12px;flex-wrap:wrap}.retention{display:none}.brand{font-size:22px}.section-title>div>span{display:block;margin-top:5px}.statusbar{gap:10px;flex-wrap:wrap}.rules-table{min-width:1000px}.market-table{min-width:900px}footer{display:block}footer>span{display:block;text-align:left;margin-top:7px}}

/* Компактная рабочая панель: рынок слева, журнал справа */
body{padding:10px 12px}.shell{max-width:none}.dashboard-grid{--market-pane:60%;display:grid;grid-template-columns:minmax(720px,var(--market-pane)) 12px minmax(480px,1fr);gap:0;align-items:start}.dashboard-grid>section{margin-top:0}#markets{grid-column:1;grid-row:1}#journal{grid-column:3;grid-row:1;position:sticky;top:10px;align-self:start}#graph{grid-column:1/-1;grid-row:2}.dashboard-divider{grid-column:2;grid-row:1;align-self:stretch;position:relative;min-height:100%;cursor:col-resize;background:linear-gradient(90deg,transparent 3px,#b9c8d5 3px,#b9c8d5 9px,transparent 9px);touch-action:none;outline:0}.dashboard-divider span{position:sticky;top:48vh;display:flex;align-items:center;justify-content:center;width:12px;height:44px;border:1px solid #9fb4c5;border-radius:5px;background:#f7fafc;color:#5f7487;font-size:18px;line-height:1;box-shadow:0 2px 7px #26394d20}.dashboard-divider:hover,.dashboard-divider:focus-visible{background:linear-gradient(90deg,transparent 2px,#208060 2px,#208060 10px,transparent 10px)}.dashboard-divider:hover span,.dashboard-divider:focus-visible span{border-color:var(--green);color:var(--green);background:#eef8f3}.resizing-dashboard{cursor:col-resize!important;user-select:none}.market-title-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;white-space:nowrap}.market-title-actions .primary{padding:6px 13px}.market-table{table-layout:fixed;min-width:0}.market-table th:nth-child(1){width:36px}.market-table th:nth-child(2){width:190px}.market-table th:nth-child(n+3):nth-child(-n+7){width:74px}.market-table th:nth-child(8){width:118px}.market-table .symbol-cell{justify-content:center;min-width:0;gap:7px}.market-table .coin-actions{flex:0 0 auto}.freshness{display:inline-flex;align-items:center;justify-content:center;gap:5px;max-width:112px;color:var(--green);font-size:12px;white-space:nowrap}.freshness i{display:block;width:7px;height:7px;flex:0 0 7px;border-radius:50%;background:currentColor;box-shadow:0 0 0 2px #dff1e9}.freshness.online,.freshness.waiting{color:#587b70}.freshness.offline,.freshness.stopped{color:var(--red)}.freshness.offline i,.freshness.stopped i{box-shadow:0 0 0 2px #fae0e5}.journal-scroll{height:calc(100vh - 240px);min-height:430px;max-height:none}.journal-filters{gap:6px;padding:7px 8px}.journal-filters label{gap:2px}.journal-filters input,.journal-filters select{height:27px;font-size:12px}.journal-filters input{width:112px}.journal-filters button{padding:4px 7px;font-size:12px}#journal .section-title{padding:9px 10px}#journal th{padding:7px 5px;font-size:12px}#journal td{height:29px;padding:5px 6px;font-size:12px}#journal .pager{padding:6px 9px}.journal-title-actions{gap:5px}.journal-title-actions button{padding:5px 7px;font-size:12px}.sync-button.active{border-color:var(--green);background:var(--soft-green);color:var(--green);font-weight:bold}.modal{position:fixed;inset:0;z-index:40;display:grid;place-items:center;padding:3vh 2vw;background:#26394d99;backdrop-filter:blur(2px)}.modal-card{width:min(1320px,96vw);max-height:94vh;overflow:auto;background:var(--bg);border:1px solid #aebdca;border-radius:9px;box-shadow:0 16px 55px #15283c55}.modal-title{position:sticky;top:0;z-index:4;display:flex;align-items:center;justify-content:space-between;padding:12px 15px;background:white;border-bottom:1px solid var(--line)}.modal-title h2{display:inline;margin:0 12px 0 0;font-size:21px}.modal-title span{color:var(--muted);font-size:13px}.modal-card section{margin:10px}.modal-open{overflow:hidden}
.dashboard-grid.journal-hidden{grid-template-columns:minmax(0,1fr)}.dashboard-grid.journal-hidden #markets{grid-column:1/-1}.dashboard-grid.journal-hidden #journal,.dashboard-grid.journal-hidden .dashboard-divider{display:none}.journal-toggle-hidden{border-color:var(--green);background:var(--soft-green);color:var(--green);font-weight:bold}
.blacklist-button{border-color:#d7abb2;color:#a63649;background:#fff8f9}.blacklist-button:hover{border-color:var(--red);color:var(--red);background:#fff0f2}.blacklist-card{width:min(1050px,94vw);background:white}.blacklist-note{padding:10px 15px;border-bottom:1px solid var(--line);background:#fff9f9;color:#76525a;font-size:13px}.blacklist-table{table-layout:fixed}.blacklist-table th:first-child{width:185px}.blacklist-table th:nth-child(n+2):nth-child(-n+6){width:82px;background:#e7f2ec;color:#23664f}.blacklist-table th:nth-child(7){width:135px}.blacklist-table th:last-child{width:135px}.blacklist-table td{height:34px;padding:5px 8px}.blacklist-table td.impulse-number{font-weight:bold;color:#315f50;background:#f7fbf9}.remove-blacklist{padding:4px 8px;color:var(--red);border-color:#e1b7be;background:#fff8f9;font-size:12px}
@media(max-width:1250px){.dashboard-grid{display:block}.dashboard-grid>section{margin-top:10px}.dashboard-divider{display:none}#markets{margin-top:0}#journal{position:static}.journal-scroll{height:auto;min-height:360px;max-height:520px}.market-table{min-width:760px}}

/* Экраны: только совмещённые графики DEX + LBank */
body.screens-view #diagnostics,body.screens-view #footer{display:none}
#screens{margin-top:0;min-height:calc(100vh - 20px);background:#f4f7fa}
.screens-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:62px;padding:9px 12px;border-bottom:1px solid var(--line);background:#fff}
.screens-title{display:flex;align-items:baseline;gap:13px}.screens-title h1{margin:0;font-size:23px}.screens-title>span{color:var(--muted);font-size:13px;font-weight:bold}
.legend-dot{display:inline-block;width:9px;height:9px;margin:0 3px;border-radius:50%}.dex-dot{background:#13855e}.lbank-dot{background:#2c65b4}
.screens-controls{display:flex;align-items:flex-end;gap:8px}.screens-controls>label{gap:2px}.screens-controls select{height:29px}
.screen-count-control{display:flex;align-items:center;gap:3px;padding:3px;border:1px solid #c8d6e3;border-radius:5px;background:#f7fafc}.screen-count-control>span{padding:0 6px;color:var(--muted);font-size:12px;font-weight:bold}.screen-count-control button{min-width:34px;padding:4px 8px;border:0;background:transparent}.screen-count-control button.active{background:var(--green);color:#fff;font-weight:bold}
.screens-grid{display:grid;gap:8px;padding:8px}.screens-grid.count-2{grid-template-columns:repeat(2,minmax(0,1fr))}.screens-grid.count-4{grid-template-columns:repeat(2,minmax(0,1fr))}.screens-grid.count-6{grid-template-columns:repeat(3,minmax(0,1fr))}
.screen-card{display:flex;min-width:0;flex-direction:column;overflow:hidden;border:1px solid #c9d7e4;border-radius:6px;background:#fff;box-shadow:0 2px 8px #23384e0a}.count-2 .screen-card{height:calc(100vh - 100px)}.count-4 .screen-card,.count-6 .screen-card{height:calc((100vh - 108px)/2)}
.screen-card-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:37px;padding:4px 7px 4px 11px;border-bottom:1px solid #dce5ed;background:#fbfcfe}.screen-coin-tools{display:flex;align-items:center;gap:2px}.screen-coin-copy{padding:3px 4px;border:0;background:transparent;color:#26394d;font-family:inherit;font-size:16px;font-weight:bold}.screen-coin-copy:hover{color:var(--green);text-decoration:underline}.screen-coin-copy span{font-size:12px}.screen-coin{width:31px;min-width:31px;height:27px;padding:0;border:1px solid transparent;background-color:transparent;color:transparent;font-size:0}.screen-coin:hover,.screen-coin:focus{border-color:#bdd0df;background-color:#fff}.screen-coin option{color:#26394d;font-size:14px}.screen-legend{display:flex;align-items:center;gap:9px;color:var(--muted);font-size:11px;font-weight:bold}.screen-legend span{display:flex;align-items:center;gap:4px}.screen-legend i{display:block;width:14px;height:3px;border-radius:2px}.screen-legend .dex-line{background:#13855e}.screen-legend .lbank-line{background:#2c65b4}
.screen-canvas-wrap{position:relative;min-height:0;flex:1}.screen-chart{display:block;width:100%;height:100%}.screen-empty{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);font-size:14px;pointer-events:none}.screens-loading{grid-column:1/-1;display:grid;min-height:60vh;place-items:center;color:var(--muted);font-size:17px}
.screen-empty[hidden]{display:none}
.coin-copy{padding:0;border:0;background:transparent;font-family:inherit}.coin-copy:hover{border:0;background:transparent;color:var(--green);text-decoration:underline}.coin-copy span{font-size:11px}
.dex-chart-button{display:inline-flex;align-items:center;padding:2px 4px;border:1px solid #afd3c1;border-radius:4px;background:#edf8f2;color:var(--green);font-size:10px;font-weight:bold;line-height:1.2}.dex-chart-button:hover{border-color:var(--green);background:#def1e7;text-decoration:none}
.close-journal{border-color:#dab4bb;background:#fff8f9;color:#a83a4d}.close-journal:hover{border-color:var(--red);background:#fff0f2;color:var(--red)}

/* Интерактивный последовательный график LBank Last */
.last-chart-title{min-height:48px;background:#fff}.last-chart-actions{align-items:center;flex-wrap:wrap}.chart-range-group{display:inline-flex;overflow:hidden;border:1px solid #c5d5e3;border-radius:5px}.chart-range-group button{min-width:39px;border:0;border-right:1px solid #d5e0e9;border-radius:0;padding:5px 8px;background:#f8fafc;color:var(--muted);font-size:12px;font-weight:bold}.chart-range-group button:last-child{border-right:0}.chart-range-group button.active,#graph-follow.active{background:#e9f5ef;color:var(--green);font-weight:bold}.last-chart-wrap{position:relative;height:520px;background:#fff;cursor:crosshair;user-select:none;touch-action:none}#chart{display:block;width:100%;height:100%;padding:0;cursor:crosshair;touch-action:none}.last-chart-info{display:grid;grid-template-columns:minmax(250px,1fr) minmax(280px,1fr) auto;align-items:center;gap:14px;min-height:38px;padding:7px 12px;border-top:1px solid var(--line);background:#fbfcfe;color:#526178;font-size:12px;font-variant-numeric:tabular-nums}.last-chart-info #graph-cursor{font-weight:bold;color:#263d53}.last-chart-help{text-align:right;color:var(--muted)}
@media(max-width:900px){.last-chart-wrap{height:400px}.last-chart-info{grid-template-columns:1fr}.last-chart-help{text-align:left}}
#screens:fullscreen{overflow:auto;width:100vw;height:100vh;border:0;border-radius:0;background:#edf2f6}#screens:fullscreen .screens-toolbar{position:sticky;top:0;z-index:3}#screens:fullscreen .count-2 .screen-card{height:calc(100vh - 80px)}#screens:fullscreen .count-4 .screen-card,#screens:fullscreen .count-6 .screen-card{height:calc((100vh - 88px)/2)}
@media(max-width:1100px){.screens-toolbar{align-items:flex-start;flex-wrap:wrap}.screens-grid.count-6{grid-template-columns:repeat(2,minmax(0,1fr))}.count-6 .screen-card{height:42vh}}
@media(max-width:720px){.screens-controls{flex-wrap:wrap}.screens-grid.count-2,.screens-grid.count-4,.screens-grid.count-6{grid-template-columns:1fr}.count-2 .screen-card,.count-4 .screen-card,.count-6 .screen-card{height:55vh}}
.telegram-form .telegram-chat{width:150px}

.screen-coin-tools select.screen-coin{width:130px;max-width:130px;font-size:12px;color:var(--ink);background:#fff;border:1px solid #c7d6e5;padding:3px 5px}.login-card form label{margin:0}.login-card #login-status{min-height:20px}#telegram .telegram-form input[type=checkbox]{width:15px}
