/* Стилі сайту: Дашборд / Боти / Статистика / Гаманець. Увесь CSS заскоповано
   під #newDashboardRoot, палітра — локальні custom properties на ньому ж. */
body {
  margin:0; padding:0; background:#f7f7f8; overscroll-behavior-y:none;
  font-family:"Poppins",-apple-system,BlinkMacSystemFont,"SF Pro Text","Helvetica Neue",Helvetica,Arial,sans-serif;
}
:root[data-theme="dark"] body {background:#121212;}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {background:#121212;}
}
#newDashboardRoot, #newDashboardRoot * {box-sizing:border-box;}
  #newDashboardRoot {
    --bg:#f7f7f8; --panel:#ffffff; --panel-2:#f1efec; --border:#e4e1db;
    --text:#1c1a17; --text-dim:#6b645c;
    --green:#2f9e58; --red:#d9463c;
    --accent:#9a5b2e; --accent-hover:#7f491f;
    --unreal:#ff8a3d; --realized:#9a5b2e;
    --chart-grid: rgba(0,0,0,0.06);

    margin:0; background:var(--bg); color:var(--text);
    font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;
    transition:background .15s,color .15s;
  }
  #newDashboardRoot:has(.wrap:not(.hidden)) { min-height:100vh; }
  :root[data-theme="dark"] #newDashboardRoot {
    --bg:#121212; --panel:#1b1b1d; --panel-2:#232325; --border:#2e2e31;
    --text:#ececec; --text-dim:#9a9a9d;
    --green:#4caf6e; --red:#e5675d;
    --accent:#c98a4b; --accent-hover:#dba066;
    --unreal:#ff9a52; --realized:#f0c94e;
    --chart-grid: rgba(255,255,255,0.06);
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) #newDashboardRoot {
      --bg:#121212; --panel:#1b1b1d; --panel-2:#232325; --border:#2e2e31;
      --text:#ececec; --text-dim:#9a9a9d;
      --green:#4caf6e; --red:#e5675d;
      --accent:#c98a4b; --accent-hover:#dba066;
      --unreal:#ff9a52; --realized:#f0c94e;
      --chart-grid: rgba(255,255,255,0.06);
    }
  }
  #newDashboardRoot .topnav {
    display:flex; align-items:center; gap:28px;
    background:var(--panel); border-bottom:1px solid var(--border);
    padding:0 32px; height:56px;
  }
  #newDashboardRoot .topnav .brand {font-weight:700; font-size:16px; color:var(--accent); margin-right:8px;}
  #newDashboardRoot .topnav a {
    color:var(--text-dim); text-decoration:none; font-size:14px; padding:8px 0;
    border-bottom:2px solid transparent; cursor:pointer;
  }
  #newDashboardRoot .topnav a.active {color:var(--text); border-bottom-color:var(--accent);}
  #newDashboardRoot .nav-links {display:contents;}
  #newDashboardRoot .topnav .nav-burger, #newDashboardRoot .nav-backdrop {display:none;}
  #newDashboardRoot .fetched {margin-left:auto; color:var(--text-dim); font-size:12px;}
  #newDashboardRoot .icon-btn {
    background:var(--panel-2); border:1px solid var(--border); color:var(--text);
    border-radius:8px; width:32px; height:32px; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
  }
  #newDashboardRoot .icon-btn:hover {border-color:var(--accent); color:var(--accent);}
  #newDashboardRoot .icon-btn svg {width:16px; height:16px; display:block;}
  #newDashboardRoot .icon-btn, #newDashboardRoot .period-btn, #newDashboardRoot .toggle-btn, #newDashboardRoot .save-btn, #newDashboardRoot .cal-nav, #newDashboardRoot .chart-toggle-btn, #newDashboardRoot .archive-toggle {
    transition: transform .15s cubic-bezier(.34,1.56,.64,1), background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  }
  #newDashboardRoot .icon-btn:active, #newDashboardRoot .period-btn:active, #newDashboardRoot .toggle-btn:active, #newDashboardRoot .save-btn:active, #newDashboardRoot .cal-nav:active, #newDashboardRoot .chart-toggle-btn:active {
    transform: scale(.94);
  }
  #newDashboardRoot .period-btn:hover:not(.active), #newDashboardRoot .toggle-btn:hover:not(:disabled) {
    border-color: var(--accent); color: var(--text);
  }
  #newDashboardRoot .save-btn:hover { box-shadow: 0 4px 14px rgba(0,0,0,.18); }
  #newDashboardRoot .wrap {width:100%; margin:0; padding:24px 32px;}
  #newDashboardRoot .hidden {display:none;}
  #newDashboardRoot .demo-notice {
    position:fixed; left:50%; bottom:28px; transform:translate(-50%, 16px);
    background:var(--panel); color:var(--text); border:1px solid var(--accent);
    border-radius:10px; padding:12px 20px; font-size:13px; box-shadow:0 8px 24px rgba(0,0,0,0.25);
    opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:200;
    max-width:90vw; text-align:center;
  }
  #newDashboardRoot .demo-notice.show {opacity:1; transform:translate(-50%, 0);}
  #newDashboardRoot .modal-overlay {
    position:fixed; inset:0; background:rgba(0,0,0,0.55);
    display:flex; align-items:center; justify-content:center; z-index:300;
    padding:20px;
  }
  #newDashboardRoot .modal-overlay.hidden {display:none;}
  #newDashboardRoot .modal-box {
    background:var(--panel); border:1px solid var(--border); border-radius:14px;
    padding:24px; width:340px; max-width:100%;
  }
  #newDashboardRoot .modal-title {font-size:16px; font-weight:700; margin-bottom:10px;}
  #newDashboardRoot .modal-text {font-size:13px; color:var(--text-dim); line-height:1.5; margin-bottom:20px;}
  #newDashboardRoot .modal-actions {display:flex; gap:10px; justify-content:flex-end; margin-top:0;}
  #newDashboardRoot .journal-list {display:flex; flex-direction:column; gap:8px;}
  #newDashboardRoot .journal-row {
    display:flex; justify-content:space-between; align-items:center; gap:10px;
    background:var(--panel-2); border:1px solid var(--border); border-radius:8px;
    padding:10px 14px; font-size:13px;
  }
  #newDashboardRoot .journal-row-info {display:flex; flex-direction:column; gap:2px;}
  #newDashboardRoot .journal-row-date {font-size:11px; color:var(--text-dim);}
  #newDashboardRoot .journal-cancel-btn {
    background:transparent; border:1px solid var(--border); color:var(--red);
    border-radius:6px; padding:5px 12px; font-size:12px; cursor:pointer; flex-shrink:0;
  }
  #newDashboardRoot .journal-cancel-btn:hover {background:var(--red); color:#fff; border-color:var(--red);}
  #newDashboardRoot .err {color:var(--red); font-size:13px; padding:12px; background:var(--panel-2); border:1px solid var(--red); border-radius:8px; margin-bottom:12px;}
  #newDashboardRoot .pos {color:var(--green);}
  #newDashboardRoot .neg {color:var(--red);}
  #newDashboardRoot .empty {color:var(--text-dim); font-size:13px; padding:20px; text-align:center;}
  #newDashboardRoot .withdraw-card {
    background:var(--panel); border:1px solid var(--border); border-radius:12px;
    padding:16px;
  }
  #newDashboardRoot .withdraw-inputs {display:flex; gap:24px; flex-wrap:wrap; align-items:center; margin-bottom:14px; padding-bottom:14px; border-bottom:1px solid var(--border);}
  #newDashboardRoot .withdraw-input-lbl {display:flex; align-items:center; gap:8px; font-size:13px; color:var(--text-dim);}
  #newDashboardRoot .withdraw-input-lbl b {color:var(--accent); font-size:14px;}
  #newDashboardRoot .withdraw-inputs input[type="number"] {
    width:60px; background:var(--panel-2); border:1px solid var(--border); color:var(--text);
    border-radius:6px; padding:6px 8px; font-size:13px; font-family:inherit;
  }
  #newDashboardRoot .withdraw-inputs input[type="number"]::-webkit-outer-spin-button, #newDashboardRoot .withdraw-inputs input[type="number"]::-webkit-inner-spin-button {-webkit-appearance:none; margin:0;}
  #newDashboardRoot .withdraw-row {
    display:grid; grid-template-columns:40px 1.15fr 0.9fr 0.9fr 0.9fr 0.9fr 1.3fr; gap:8px;
    padding:10px 0; font-size:13px; align-items:center;
    border-bottom:1px solid var(--border);
  }
  #newDashboardRoot .withdraw-row:last-of-type {border-bottom:none;}
  #newDashboardRoot .withdraw-row.head {color:var(--text-dim); font-size:11px; text-transform:uppercase; letter-spacing:.03em; border-bottom:none;}
  #newDashboardRoot .withdraw-since {font-size:11px; color:var(--text-dim); font-weight:400;}
  #newDashboardRoot .withdraw-bot-name-row {display:flex; align-items:center; gap:6px;}
  #newDashboardRoot .withdraw-lock-col {display:flex; align-items:center; justify-content:center;}
  #newDashboardRoot .withdraw-hidden-list {margin-top:8px; display:flex; flex-direction:column; gap:8px;}
  #newDashboardRoot .withdraw-hidden-item {
    display:flex; justify-content:space-between; align-items:center;
    background:var(--panel-2); border:1px solid var(--border); border-radius:8px;
    padding:10px 14px; font-size:13px;
  }
  #newDashboardRoot .withdraw-action {display:flex; gap:6px; align-items:center;}
  #newDashboardRoot .withdraw-action input[type="number"] {
    width:80px; background:var(--panel-2); border:1px solid var(--border); color:var(--text);
    border-radius:6px; padding:6px 8px; font-size:13px; font-family:inherit;
  }
  #newDashboardRoot .withdraw-action input[type="number"]::-webkit-outer-spin-button, #newDashboardRoot .withdraw-action input[type="number"]::-webkit-inner-spin-button {-webkit-appearance:none; margin:0;}
  #newDashboardRoot .withdraw-action button {padding:6px 12px; font-size:12px;}
  #newDashboardRoot .withdraw-alltime-row {
    display:flex; gap:24px; flex-wrap:wrap; margin-top:14px; padding-top:14px;
    border-top:1px solid var(--border); font-size:13px; color:var(--text-dim);
  }
  #newDashboardRoot .withdraw-available-now {
    display:flex; justify-content:space-between; align-items:center; gap:12px;
    background:var(--panel-2); border:1px solid var(--accent); border-radius:8px;
    padding:12px 14px; margin-bottom:14px; font-size:13px; color:var(--text-dim);
  }
  #newDashboardRoot .withdraw-available-now b {color:var(--accent); font-size:18px;}
  #newDashboardRoot .withdraw-action-empty {font-size:12px; color:var(--text-dim);}
  #newDashboardRoot .withdraw-lock-btn {
    width:30px; height:30px; display:flex; align-items:center; justify-content:center;
    background:var(--panel-2); border:1px solid var(--border); color:var(--text-dim);
    cursor:pointer; border-radius:7px; flex-shrink:0;
  }
  #newDashboardRoot .withdraw-lock-btn:hover {border-color:var(--accent); color:var(--accent);}
  #newDashboardRoot .withdraw-lock-btn.active {background:var(--accent); border-color:var(--accent); color:#fff;}
  #newDashboardRoot .withdraw-action.locked {opacity:.45; cursor:not-allowed;}
  #newDashboardRoot .withdraw-action.locked input, #newDashboardRoot .withdraw-action.locked button {pointer-events:none;}
  @media (max-width:700px){#newDashboardRoot .withdraw-row {grid-template-columns:1fr 1fr; row-gap:6px;}
  #newDashboardRoot .withdraw-row > span::before {content:attr(data-label) ": "; color:var(--text-dim); font-size:11px; display:block;}
  #newDashboardRoot .withdraw-row.head {display:none;}
  #newDashboardRoot .withdraw-action {grid-column:1 / -1;}
  #newDashboardRoot .withdraw-lock-col {grid-column:1 / -1; justify-content:flex-start;}
  #newDashboardRoot .withdraw-lock-col::before {display:none !important;}
  }
  #newDashboardRoot .withdraw-two-col {display:grid; grid-template-columns:1fr 1fr; gap:20px; align-items:start;}
  @media (max-width:860px){#newDashboardRoot .withdraw-two-col {grid-template-columns:1fr;} }
  #newDashboardRoot .stats-table {
    background:var(--panel); border:1px solid var(--border); border-radius:12px;
    overflow:hidden;
  }
  #newDashboardRoot .stats-row {
    display:grid; grid-template-columns:1.5fr 0.9fr 0.6fr 0.7fr 0.9fr 0.9fr 0.7fr 0.8fr 0.8fr 0.9fr;
    gap:8px; padding:12px 16px; align-items:center; font-size:12.5px;
    border-bottom:1px solid var(--border);
  }
  #newDashboardRoot .stats-row:last-child {border-bottom:none;}
  #newDashboardRoot .stats-head {
    color:var(--text-dim); font-size:11px; text-transform:uppercase; letter-spacing:.03em;
    background:var(--panel-2);
  }
  #newDashboardRoot .stats-row.best {background:var(--panel-2);}
  #newDashboardRoot .stats-bot-name {font-weight:600;}
  #newDashboardRoot .stats-row.best .stats-bot-name {color:var(--accent);}
  @media (max-width:760px){#newDashboardRoot .stats-row {grid-template-columns:1fr; grid-template-areas:none; gap:2px; text-align:left;}
  #newDashboardRoot .stats-row > span::before {content:attr(data-label) ": "; color:var(--text-dim); font-size:11px;}
  #newDashboardRoot .stats-head {display:none;}
  }
  #newDashboardRoot .section-label {font-size:15px; font-weight:600; margin:0 0 12px;}
  /* minmax(0,1fr) замість голого 1fr — бере колонку графіка з неявним
     min-width:0, а не auto (= max-content вмісту, тобто canvas), інакше
     колонка може не розтягнутись рівно на ширину контейнера, якщо вміст
     (сам canvas) має власну інтринзик-ширину, залишену з попереднього
     рендеру на вужчому вікні. */
  #newDashboardRoot .dashboard-grid {display:grid; grid-template-columns:minmax(0,1fr) minmax(300px,420px); gap:20px; align-items:start;}
  @media (max-width:860px){#newDashboardRoot .dashboard-grid {grid-template-columns:1fr;} }
  #newDashboardRoot .balance-card {
    background:var(--panel); border:1px solid var(--border); border-radius:12px;
    padding:20px; margin-bottom:16px;
    /* .balance-card теж є класом старого сайту (.balance-card, .positions-card
       у ../style.css) з жорсткими margin-right/box-shadow/width/max-width —
       без явного reset тут вони протікали б крізь скоуп (наша вища
       специфічність перекриває тільки властивості, які МИ теж оголошуємо).
       2026-09-30, фідбек користувача: max-width:600px зі старого сайту
       НЕ був скинутий раніше — картка балансу рендерилась лише на 600px
       замість розтягування на всю ширину грід-колонки (~958px+ на
       широкому вікні), лишаючи порожній розрив до картки "Боти". */
    margin-right:0; box-shadow:none; width:100%; max-width:none;
  }
  #newDashboardRoot .balance-label {
    color:var(--text-dim); font-size:13px; margin-bottom:6px;
    font-weight:400; /* старий .balance-label форсує font-weight:500 */
  }
  #newDashboardRoot .balance-value {font-size:36px; font-weight:700; letter-spacing:-0.5px;}
  #newDashboardRoot .balance-onchain-note {font-size:12px; color:var(--text-dim); margin-top:2px;}
  #newDashboardRoot .balance-delta {
    font-size:14px; font-weight:600;
    /* Реальний баг (фідбек 2026-09-30): .balance-delta — теж клас старого
       сайту (окрема картка-дельта деінде), з хардкодним
       padding/background/border/border-radius/margin-top. Ми раніше
       заскопували лише font-size/font-weight — тому сірий "пігулка"-фон
       старого класу й досі протікав крізь наш скоуп. Явний reset: */
    background:none; border:none; border-radius:0; padding:0; margin-top:0;
  }
  #newDashboardRoot .pnl-split-row {display:flex; gap:28px; margin-top:10px; flex-wrap:wrap;}
  #newDashboardRoot .pnl-split-item {display:flex; align-items:center; gap:6px; font-size:13px; color:var(--text-dim);}
  #newDashboardRoot .pnl-split-item .dot {width:8px; height:8px; border-radius:50%; flex-shrink:0;}
  #newDashboardRoot .legend-row {display:flex; gap:18px; margin-top:10px; font-size:13px; color:var(--text-dim);}
  #newDashboardRoot .legend-row span.dot {display:inline-block; width:10px; height:10px; border-radius:50%; margin-right:6px; vertical-align:middle;}
  #newDashboardRoot .periods {display:flex; gap:6px; margin:16px 0 8px;}
  #newDashboardRoot .period-btn {
    background:transparent; border:1px solid var(--border); color:var(--text-dim);
    padding:6px 14px; border-radius:6px; font-size:13px; cursor:pointer;
  }
  #newDashboardRoot .period-btn.active {background:var(--panel-2); color:var(--accent); border-color:var(--accent);}
  #newDashboardRoot .period-btn svg {width:14px; height:14px; vertical-align:-2px;}
  #newDashboardRoot .chart-box {height:360px; margin-top:12px;}
  #newDashboardRoot .calendar-panel {
    background:var(--panel-2); border:1px solid var(--border); border-radius:10px;
    padding:14px; margin:0 0 8px; width:280px;
  }
  #newDashboardRoot .cal-header {display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;}
  #newDashboardRoot .cal-header .cal-month-label {font-size:13px; font-weight:600;}
  #newDashboardRoot .cal-nav {
    background:transparent; border:1px solid var(--border); color:var(--text-dim);
    border-radius:6px; width:26px; height:26px; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
  }
  #newDashboardRoot .cal-nav:hover {color:var(--accent); border-color:var(--accent);}
  #newDashboardRoot .cal-nav svg {width:12px; height:12px;}
  #newDashboardRoot .cal-weekdays {
    display:grid; grid-template-columns:repeat(7,1fr); gap:2px;
    font-size:11px; color:var(--text-dim); text-align:center; margin-bottom:4px;
  }
  #newDashboardRoot .cal-grid {display:grid; grid-template-columns:repeat(7,1fr); gap:2px;}
  #newDashboardRoot .cal-day {
    aspect-ratio:1; display:flex; align-items:center; justify-content:center;
    font-size:12px; border-radius:6px; cursor:pointer; color:var(--text);
    background:transparent; border:none;
  }
  #newDashboardRoot .cal-day:hover:not(.cal-disabled):not(.cal-empty) {background:var(--panel); outline:1px solid var(--accent);}
  #newDashboardRoot .cal-day.cal-empty {cursor:default; visibility:hidden;}
  #newDashboardRoot .cal-day.cal-disabled {color:var(--text-dim); opacity:.35; cursor:not-allowed;}
  #newDashboardRoot .cal-day.cal-in-range {background:var(--panel); color:var(--accent);}
  #newDashboardRoot .cal-day.cal-endpoint {background:var(--accent); color:#fff; font-weight:600;}
  #newDashboardRoot .cal-footer {
    display:flex; align-items:center; justify-content:space-between;
    margin-top:12px; padding-top:10px; border-top:1px solid var(--border);
  }
  #newDashboardRoot .cal-range-label {font-size:11px; color:var(--text-dim);}
  #newDashboardRoot .cal-actions {display:flex; gap:8px;}
  #newDashboardRoot .cal-actions button {
    border-radius:6px; padding:6px 12px; font-size:12px; cursor:pointer; font-weight:600; border:none;
  }
  #newDashboardRoot #nd-calCancel {background:transparent; border:1px solid var(--border); color:var(--text-dim);}
  #newDashboardRoot #nd-calApply {background:var(--accent); color:#fff;}
  #newDashboardRoot #nd-calApply:hover {background:var(--accent-hover);}
  #newDashboardRoot #nd-calApply:disabled {opacity:.5; cursor:not-allowed;}
  #newDashboardRoot .bots-panel {
    background:var(--panel); border:1px solid var(--border); border-radius:12px;
    padding:16px;
  }
  #newDashboardRoot .bots-list {display:flex; flex-direction:column; gap:10px;}
  #newDashboardRoot .section-label-row {display:flex; align-items:center; justify-content:space-between; margin-bottom:12px;}
  #newDashboardRoot .section-label-row .section-label {margin:0;}
  #newDashboardRoot .wallet-row {
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    background:var(--panel-2); border:1px solid var(--border); border-radius:10px;
    padding:12px 14px; transition:transform .18s ease, border-color .18s ease;
  }
  #newDashboardRoot .wallet-row:hover {transform:translateY(-2px); border-color:var(--accent);}
  #newDashboardRoot .wallet-row-name {font-weight:600; font-size:13px;}
  #newDashboardRoot .wallet-row-balance {font-size:12px; color:var(--text-dim); margin-top:2px;}
  #newDashboardRoot .wallet-row-actions {display:flex; gap:4px; flex-shrink:0;}
  #newDashboardRoot .wallet-row-btn {
    background:transparent; border:none; color:var(--text-dim); cursor:pointer;
    padding:5px; display:flex; align-items:center; border-radius:6px;
  }
  #newDashboardRoot .wallet-row-btn:hover {background:var(--panel); color:var(--accent);}
  #newDashboardRoot .wallet-row-btn.danger:hover {color:var(--red);}
  #newDashboardRoot .wallet-form-fields {display:flex; flex-direction:column; gap:8px; margin-bottom:20px;}
  #newDashboardRoot .wallet-form-fields input {
    background:var(--panel-2); border:1px solid var(--border); color:var(--text);
    border-radius:6px; padding:8px 10px; font-size:13px; font-family:inherit;
  }
  #newDashboardRoot .wallet-form-fields input:disabled {opacity:.55;}
  #newDashboardRoot .bot-row {
    background:var(--panel-2); border:1px solid var(--border); border-radius:10px;
    padding:12px 14px;
    transition: transform .18s ease, border-color .18s ease;
  }
  #newDashboardRoot .bot-row:hover {transform:translateY(-2px); border-color:var(--accent);}
  #newDashboardRoot .bot-name {display:flex; align-items:center; gap:8px; font-size:13px; font-weight:600; margin-bottom:8px;}
  #newDashboardRoot .bot-dot {width:8px; height:8px; border-radius:50%; background:var(--green); flex-shrink:0;}
  #newDashboardRoot .bot-figures {display:flex; flex-direction:column; gap:5px; font-size:13px;}
  #newDashboardRoot .bot-figure {display:flex; justify-content:space-between; gap:8px;}
  #newDashboardRoot .bot-figure .k {color:var(--text-dim);}
  #newDashboardRoot .pct {font-size:11px;}
  /* HL "до ліквідації" — 40-70% попереджувальний (жовто-оранж, той самий
     колір, що й "Нереалізовано"), >=70% небезпека (.neg, червоний). */
  #newDashboardRoot .liq-warn {color:var(--unreal); font-weight:700;}
  #newDashboardRoot .bot-cards {display:flex; flex-direction:column; gap:12px;}
  #newDashboardRoot .bot-card {
    background:var(--panel); border:1px solid var(--border); border-radius:12px;
    overflow:hidden;
    transition: transform .18s ease, border-color .18s ease;
  }
  #newDashboardRoot .bot-card:hover {transform:translateY(-2px); border-color:var(--accent);}
  #newDashboardRoot .bot-card-head {
    display:flex; align-items:center; gap:12px; padding:14px 18px; cursor:pointer;
  }
  #newDashboardRoot .bot-status-dot {width:9px; height:9px; border-radius:50%; background:var(--text-dim); flex-shrink:0;}
  #newDashboardRoot .bot-status-dot.running {background:var(--green);}
  #newDashboardRoot .bot-card-name {font-size:14px; font-weight:600;}
  #newDashboardRoot .bot-card-sub {font-size:12px; color:var(--text-dim);}
  #newDashboardRoot .bot-card-spacer {flex:1;}
  #newDashboardRoot .bot-card-figures {display:flex; gap:20px; font-size:13px; margin-right:12px;}
  #newDashboardRoot .bot-card-figures .k {color:var(--text-dim); margin-right:4px;}
  #newDashboardRoot .toggle-btn {
    border:1px solid var(--border); border-radius:6px; padding:6px 14px;
    font-size:12px; font-weight:600; cursor:pointer; background:transparent; color:var(--text);
  }
  #newDashboardRoot .toggle-btn.start {color:var(--green); border-color:var(--green);}
  #newDashboardRoot .toggle-btn.stop {color:var(--red); border-color:var(--red);}
  #newDashboardRoot .toggle-btn:disabled {opacity:.5; cursor:not-allowed;}
  #newDashboardRoot .chevron {width:14px; height:14px; color:var(--text-dim); transition:transform .15s; flex-shrink:0;}
  #newDashboardRoot .bot-card.open .chevron {transform:rotate(90deg);}
  #newDashboardRoot .chevron.rotated {transform:rotate(90deg);}
  #newDashboardRoot .chevron-link {color:var(--text-dim);}
  #newDashboardRoot .back-link {
    display:inline-block; color:var(--text-dim); text-decoration:none; font-size:13px;
    margin-bottom:16px;
  }
  #newDashboardRoot .back-link:hover {color:var(--accent);}
  #newDashboardRoot .bot-detail-head {
    display:flex; align-items:center; gap:12px; font-size:14px;
  }
  #newDashboardRoot .bot-detail-name {font-size:18px; font-weight:700;}
  #newDashboardRoot .bot-detail-card {
    background:var(--panel); border:1px solid var(--border); border-radius:12px;
  }
  #newDashboardRoot .bot-detail-body {padding:18px;}
  #newDashboardRoot .chart-toggle-btn {
    background:transparent; border:1px solid var(--border); color:var(--text-dim);
    border-radius:8px; width:32px; height:32px; cursor:pointer; margin-left:8px;
    display:flex; align-items:center; justify-content:center; flex-shrink:0;
  }
  #newDashboardRoot .chart-toggle-btn:hover {border-color:var(--accent); color:var(--accent);}
  #newDashboardRoot .chart-toggle-btn.on {background:var(--panel-2); color:var(--accent); border-color:var(--accent);}
  #newDashboardRoot .bot-detail-grid {
    display:grid; grid-template-columns:1.3fr 1fr; gap:16px; margin-top:16px; align-items:start;
  }
  #newDashboardRoot .bot-detail-grid.chart-collapsed {grid-template-columns:1fr;}
  #newDashboardRoot .bot-detail-grid .bot-detail-card {margin-top:0;}
  @media (max-width:1000px){#newDashboardRoot .bot-detail-grid {grid-template-columns:1fr;} }
  #newDashboardRoot .chart-panel {
    background:var(--panel); border:1px solid var(--border); border-radius:12px;
    padding:14px; position:relative;
  }
  #newDashboardRoot .chart-panel.hidden {display:none;}
  #newDashboardRoot .chart-panel.loading {opacity:.6;}
  #newDashboardRoot .chart-panel-tf {display:flex; gap:6px; margin-bottom:10px;}
  #newDashboardRoot .chart-panel-box {height:460px;}
  @media (max-width:1000px){#newDashboardRoot .chart-panel-box {height:320px;} }
  #newDashboardRoot .archive-toggle {
    display:flex; align-items:center; gap:8px; cursor:pointer; color:var(--text-dim);
    font-size:13px; font-weight:600; margin:16px 0 12px; padding:4px 0;
  }
  #newDashboardRoot .archive-toggle:hover {color:var(--text);}
  #newDashboardRoot .bot-card-body {display:none; padding:0 18px 18px; border-top:1px solid var(--border);}
  #newDashboardRoot .bot-card.open .bot-card-body {display:block;}
  #newDashboardRoot .lock-note {
    font-size:12px; color:var(--text-dim); background:var(--panel-2); border-radius:8px;
    padding:10px 12px; margin:14px 0;
  }
  #newDashboardRoot .field-grid {display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:12px;}
  #newDashboardRoot .field {display:flex; flex-direction:column; gap:4px;}
  #newDashboardRoot .field label {font-size:12px; color:var(--text-dim);}
  #newDashboardRoot .field input[type="text"], #newDashboardRoot .field input[type="number"], #newDashboardRoot .field input[type="password"], #newDashboardRoot .field select {
    background:var(--panel-2); border:1px solid var(--border); color:var(--text);
    border-radius:6px; padding:7px 9px; font-size:13px; font-family:inherit;
  }
  #newDashboardRoot .field input:disabled, #newDashboardRoot .field select:disabled {opacity:.55; cursor:not-allowed;}
  #newDashboardRoot .field input[type="number"]::-webkit-outer-spin-button, #newDashboardRoot .field input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance:none; margin:0;
  }
  #newDashboardRoot .field input[type="number"] {-moz-appearance:textfield; appearance:textfield;}
  #newDashboardRoot .field-info {
    background:var(--panel-2); border:1px solid var(--border); color:var(--text-dim);
    border-radius:6px; padding:7px 9px; font-size:13px;
  }
  #newDashboardRoot .field-check {flex-direction:row; align-items:center; gap:8px;}
  #newDashboardRoot .field-check label {font-size:13px; color:var(--text);}
  #newDashboardRoot .form-actions {display:flex; align-items:center; gap:12px; margin-top:18px;}
  #newDashboardRoot .save-btn {
    background:var(--accent); border:none; color:#fff; border-radius:6px;
    padding:8px 18px; font-size:13px; font-weight:600; cursor:pointer;
  }
  #newDashboardRoot .save-btn:hover {background:var(--accent-hover);}
  #newDashboardRoot .save-btn:disabled {opacity:.5; cursor:not-allowed;}
  #newDashboardRoot .save-msg {font-size:12px;}
  #newDashboardRoot .save-msg.ok {color:var(--green);}
  #newDashboardRoot .save-msg.error {color:var(--red);}

/* ── Телефон (≤700px): вкладки ховаються у лівий висувний сайдбар,
   у шапці лишається гамбургер, назва й кнопка теми. ── */
@media (max-width:700px){
  #newDashboardRoot {overflow-x:hidden;}
  #newDashboardRoot .topnav {gap:12px; padding:0 12px;}
  #newDashboardRoot .topnav .brand {margin-right:0; font-size:15px;}
  #newDashboardRoot .fetched {display:none;}
  #newDashboardRoot .topnav .icon-btn#nd-themeToggle {margin-left:auto;}
  #newDashboardRoot .topnav .nav-burger {display:flex;}
  #newDashboardRoot .nav-links {
    position:fixed; top:0; left:0; bottom:0; width:260px; max-width:80vw; z-index:260;
    display:flex; flex-direction:column; gap:2px; padding:72px 12px 16px;
    background:var(--panel); border-right:1px solid var(--border);
    transform:translateX(-100%); visibility:hidden;
    transition:transform .22s ease, visibility 0s linear .22s;
    box-shadow:none;
  }
  #newDashboardRoot.nav-open .nav-links {
    transform:translateX(0); visibility:visible;
    transition:transform .22s ease, visibility 0s;
    box-shadow:8px 0 24px rgba(0,0,0,.25);
  }
  #newDashboardRoot .topnav .nav-links a {
    font-size:16px; padding:12px 14px; border-bottom:none; border-radius:10px;
  }
  #newDashboardRoot .topnav .nav-links a.active {background:var(--panel-2); color:var(--accent);}
  #newDashboardRoot .nav-backdrop {
    display:block; position:fixed; inset:0; z-index:250; background:rgba(0,0,0,.45);
    opacity:0; pointer-events:none; transition:opacity .22s ease;
  }
  #newDashboardRoot.nav-open .nav-backdrop {opacity:1; pointer-events:auto;}
  #newDashboardRoot .wrap {padding:16px 12px;}

  /* Картка бота: назва + шеврон зверху, показники і кнопки — нижніми рядками. */
  #newDashboardRoot .bot-card-head {flex-wrap:wrap; padding:12px 14px; row-gap:10px;}
  #newDashboardRoot .bot-card-head > div:nth-of-type(1) {order:2; flex:1; min-width:0;}
  #newDashboardRoot .bot-card-head .bot-status-dot {order:1;}
  #newDashboardRoot .bot-card-head .chevron {order:3;}
  #newDashboardRoot .bot-card-spacer {display:none;}
  #newDashboardRoot .bot-card-figures {order:4; flex-basis:100%; margin-right:0; flex-wrap:wrap; gap:6px 16px;}
  #newDashboardRoot .bot-card-head .toggle-btn {order:5;}
  /* Сторінка бота: той самий принцип — кнопки не виходять за екран. */
  #newDashboardRoot .bot-detail-head {flex-wrap:wrap; row-gap:10px;}
  #newDashboardRoot .bot-detail-head .toggle-btn {margin-left:0 !important;}
  #newDashboardRoot .bot-detail-body {padding:14px;}
}

/* ── Телефон (≤700px): компактний блок виводу та таблиця ефективності ── */
@media (max-width:700px){
  #newDashboardRoot .withdraw-card {padding:12px;}
  #newDashboardRoot .withdraw-inputs {gap:8px 16px; margin-bottom:10px; padding-bottom:10px;}
  #newDashboardRoot .withdraw-available-now {padding:10px 12px; margin-bottom:8px;}
  #newDashboardRoot .withdraw-available-now b {font-size:17px;}

  /* Рядок бота: замок | назва + «На вивід» / Прибуток · Реінвест · Маржа / Вивести */
  #newDashboardRoot .withdraw-row {
    grid-template-columns:34px 1fr 1fr 1fr; gap:4px 10px; padding:10px 0;
    align-items:start;
  }
  #newDashboardRoot .withdraw-row > span::before {font-size:10px; margin-bottom:1px;}
  #newDashboardRoot .withdraw-row > span[data-label="Бот"]::before,
  #newDashboardRoot .withdraw-row > span[data-label="Вивести"]::before {display:none;}
  #newDashboardRoot .withdraw-row > .withdraw-lock-col {grid-column:1; grid-row:1 / span 3; justify-content:flex-start;}
  #newDashboardRoot .withdraw-row > span:nth-child(2) {grid-column:2 / 4; grid-row:1; font-weight:600;}
  #newDashboardRoot .withdraw-row > span:nth-child(6) {grid-column:4; grid-row:1; text-align:right;}
  #newDashboardRoot .withdraw-row > span:nth-child(3) {grid-column:2; grid-row:2;}
  #newDashboardRoot .withdraw-row > span:nth-child(4) {grid-column:3; grid-row:2;}
  #newDashboardRoot .withdraw-row > span:nth-child(5) {grid-column:4; grid-row:2;}
  #newDashboardRoot .withdraw-row > .withdraw-action {grid-column:2 / -1; grid-row:3;}
  #newDashboardRoot .withdraw-action input[type="number"] {flex:1; width:auto; min-width:0; padding:5px 8px;}
  #newDashboardRoot .withdraw-lock-btn {width:28px; height:28px;}
  #newDashboardRoot .withdraw-alltime-row {gap:6px 16px; margin-top:8px; padding-top:10px;}

  /* Таблиця «Ефективність ботів»: дві колонки замість одного довгого стовпчика */
  #newDashboardRoot .stats-row {grid-template-columns:1fr 1fr; gap:3px 12px; padding:10px 12px;}
  #newDashboardRoot .stats-row > .stats-bot-name {grid-column:1 / -1; margin-bottom:2px;}
  #newDashboardRoot .stats-row > span::before {font-size:10px;}
}

  /* Картка бота на Дашборді відкриває модалку з повною інформацією */
  #newDashboardRoot #nd-botsList .bot-row[data-bidx] {cursor:pointer;}
  #newDashboardRoot .nd-bm {
    background:var(--panel); border:1px solid var(--border); border-radius:16px;
    width:440px; max-width:100%; max-height:90vh; overflow-y:auto; padding:20px;
    box-shadow:0 20px 50px rgba(0,0,0,.3);
  }
  #newDashboardRoot .nd-bm-head {display:flex; align-items:flex-start; justify-content:space-between; gap:12px;}
  #newDashboardRoot .nd-bm-titles {min-width:0;}
  #newDashboardRoot .nd-bm-title {display:flex; align-items:center; flex-wrap:wrap; gap:8px; font-size:18px; font-weight:700;}
  #newDashboardRoot .nd-bm-chip {
    font-size:11px; font-weight:700; padding:3px 8px; border-radius:6px;
    background:color-mix(in srgb, var(--green) 16%, transparent); color:var(--green);
  }
  #newDashboardRoot .nd-bm-chip.short {background:color-mix(in srgb, var(--red) 16%, transparent); color:var(--red);}
  #newDashboardRoot .nd-bm-acc {font-size:12px; color:var(--text-dim); margin-top:4px; word-break:break-word;}
  #newDashboardRoot .nd-bm-close {
    flex-shrink:0; width:32px; height:32px; border-radius:8px; border:1px solid var(--border);
    background:var(--panel-2); color:var(--text-dim); font-size:20px; line-height:1; cursor:pointer;
  }
  #newDashboardRoot .nd-bm-close:hover {color:var(--accent); border-color:var(--accent);}
  #newDashboardRoot .nd-bm-hero {margin:18px 0 6px;}
  #newDashboardRoot .nd-bm-hero-label {font-size:12px; color:var(--text-dim); margin-bottom:2px;}
  #newDashboardRoot .nd-bm-hero-val {font-size:30px; font-weight:700; letter-spacing:-.5px; font-variant-numeric:tabular-nums;}
  #newDashboardRoot .nd-bm-hero-val .pct {font-size:14px; font-weight:600; margin-left:6px;}
  #newDashboardRoot .nd-bm-hero-val.pos {color:var(--green);}
  #newDashboardRoot .nd-bm-hero-val.neg {color:var(--red);}
  #newDashboardRoot .nd-bm-hero-val.none {font-size:15px; font-weight:500; color:var(--text-dim); letter-spacing:0;}
  #newDashboardRoot .nd-bm-range {margin:14px 0 4px; background:var(--panel-2); border:1px solid var(--border); border-radius:12px; padding:14px;}
  #newDashboardRoot .nd-bm-range:empty {display:none;}
  #newDashboardRoot .nd-bm-track {position:relative; height:6px; border-radius:3px; background:var(--border); margin:8px 6px 14px;}
  #newDashboardRoot .nd-bm-fill {position:absolute; top:0; bottom:0; border-radius:3px;}
  #newDashboardRoot .nd-bm-fill.pos {background:var(--green);}
  #newDashboardRoot .nd-bm-fill.neg {background:var(--red);}
  #newDashboardRoot .nd-bm-dot {position:absolute; top:50%; width:10px; height:10px; border-radius:50%; transform:translate(-50%,-50%); border:2px solid var(--panel-2);}
  #newDashboardRoot .nd-bm-dot.liq {background:var(--red);}
  #newDashboardRoot .nd-bm-dot.tp {background:var(--green);}
  #newDashboardRoot .nd-bm-dot.entry {background:var(--text);}
  #newDashboardRoot .nd-bm-dot.cur {width:14px; height:14px; background:var(--accent); border-color:var(--panel);}
  #newDashboardRoot .nd-bm-legend {display:grid; grid-template-columns:repeat(4,1fr); gap:6px;}
  #newDashboardRoot .nd-bm-legend > div {min-width:0;}
  #newDashboardRoot .nd-bm-legend .k {display:flex; align-items:center; gap:5px; font-size:11px; color:var(--text-dim);}
  #newDashboardRoot .nd-bm-legend .k i {width:7px; height:7px; border-radius:50%; display:inline-block;}
  #newDashboardRoot .nd-bm-legend .v {font-size:13px; font-weight:600; margin-top:2px; font-variant-numeric:tabular-nums; overflow:hidden; text-overflow:ellipsis;}
  #newDashboardRoot .nd-bm-grid {margin:12px 0 4px;}
  #newDashboardRoot .nd-bm-grid:empty {display:none;}
  #newDashboardRoot .nd-bm-grid-top {display:flex; justify-content:space-between; font-size:13px; margin-bottom:6px;}
  #newDashboardRoot .nd-bm-grid-top .k {color:var(--text-dim);}
  #newDashboardRoot .nd-bm-grid-top b {font-variant-numeric:tabular-nums;}
  #newDashboardRoot .nd-bm-segs {display:flex; gap:3px;}
  #newDashboardRoot .nd-bm-segs span {flex:1; height:8px; border-radius:3px; background:var(--border);}
  #newDashboardRoot .nd-bm-segs span.on {background:var(--accent);}
  #newDashboardRoot .nd-bm-sec {margin:18px 0 8px; font-size:12px; font-weight:600; color:var(--text-dim);}
  #newDashboardRoot .nd-bm-tiles {display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px;}
  #newDashboardRoot .nd-bm-sec + .nd-bm-tiles {margin-top:0;}
  #newDashboardRoot .nd-bm-tile {background:var(--panel-2); border:1px solid var(--border); border-radius:10px; padding:10px 12px; min-width:0;}
  #newDashboardRoot .nd-bm-tile .k {font-size:11px; color:var(--text-dim);}
  #newDashboardRoot .nd-bm-tile .v {font-size:14px; font-weight:600; margin-top:3px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere;}
  @media (max-width:600px) {
    #newDashboardRoot #nd-posModal {align-items:flex-end; padding:0;}
    #newDashboardRoot .nd-bm {width:100%; border-radius:16px 16px 0 0; max-height:88vh; padding:18px 16px 24px;}
    #newDashboardRoot .nd-bm-legend {grid-template-columns:1fr 1fr; row-gap:10px;}
  }

  /* Календар прибутку (вкладка Статистика): зелені/червоні дні за сумою закритих угод */
  #newDashboardRoot .pnlcal-card {background:var(--panel); border:1px solid var(--border); border-radius:12px; padding:16px;}
  #newDashboardRoot .pnlcal-head {display:flex; align-items:center; gap:10px; margin-bottom:12px;}
  #newDashboardRoot .pnlcal-month {font-weight:600; font-size:14px; min-width:120px; text-align:center;}
  #newDashboardRoot .pnlcal-nav {
    width:30px; height:30px; border-radius:8px; border:1px solid var(--border);
    background:var(--panel-2); color:var(--text); font-size:18px; line-height:1; cursor:pointer;
  }
  #newDashboardRoot .pnlcal-nav:disabled {opacity:.35; cursor:default;}
  #newDashboardRoot .pnlcal-summary {margin-left:auto; display:flex; align-items:center; gap:10px; font-size:13px; font-weight:600;}
  #newDashboardRoot .pnlcal-dot {display:inline-flex; align-items:center; gap:5px; font-size:12px;}
  #newDashboardRoot .pnlcal-dot::before {content:""; width:8px; height:8px; border-radius:50%; background:currentColor;}
  #newDashboardRoot .pnlcal-grid {display:grid; grid-template-columns:repeat(7, minmax(0,1fr)); gap:8px;}
  #newDashboardRoot .pnlcal-wd {text-align:center; font-size:11px; color:var(--text-dim); text-transform:uppercase; padding-bottom:2px;}
  #newDashboardRoot .pnlcal-day, #newDashboardRoot .pnlcal-empty {min-width:0; height:56px;}
  #newDashboardRoot .pnlcal-day {
    display:flex; flex-direction:column; justify-content:space-between; align-items:stretch;
    padding:6px 7px; border-radius:8px; border:1px solid var(--border);
    background:var(--panel-2); color:var(--text); font:inherit; text-align:left; cursor:pointer;
  }
  #newDashboardRoot .pnlcal-day:disabled {cursor:default; opacity:.55; background:transparent;}
  #newDashboardRoot .pnlcal-day.pos {background:color-mix(in srgb, var(--green) var(--pc-alpha, 14%), transparent); border-color:color-mix(in srgb, var(--green) 40%, var(--border));}
  #newDashboardRoot .pnlcal-day.neg {background:color-mix(in srgb, var(--red) var(--pc-alpha, 14%), transparent); border-color:color-mix(in srgb, var(--red) 40%, var(--border));}
  #newDashboardRoot .pnlcal-day.today {box-shadow:inset 0 0 0 1.5px var(--text-dim);}
  #newDashboardRoot .pnlcal-day.selected {box-shadow:inset 0 0 0 2px var(--text);}
  #newDashboardRoot .pnlcal-num {font-size:11px; color:var(--text-dim);}
  #newDashboardRoot .pnlcal-val {font-size:12.5px; font-weight:600; align-self:flex-end;}
  #newDashboardRoot .pnlcal-day.pos .pnlcal-val {color:var(--green);}
  #newDashboardRoot .pnlcal-day.neg .pnlcal-val {color:var(--red);}
  #newDashboardRoot .pnlcal-detail:not(:empty) {margin-top:14px; border-top:1px solid var(--border); padding-top:12px; font-size:12.5px;}
  #newDashboardRoot .pnlcal-detail-head {display:flex; justify-content:space-between; font-weight:600; margin-bottom:8px;}
  #newDashboardRoot .pnlcal-detail-row {display:grid; grid-template-columns:1.5fr 1fr 1fr; gap:8px; padding:5px 0; color:var(--text-dim);}
  #newDashboardRoot .pnlcal-detail-row span:last-child {text-align:right; font-weight:600;}
  @media (max-width:600px) {
    #newDashboardRoot .pnlcal-card {padding:12px;}
    #newDashboardRoot .pnlcal-grid {gap:6px;}
    #newDashboardRoot .pnlcal-day, #newDashboardRoot .pnlcal-empty {height:50px;}
    #newDashboardRoot .pnlcal-day {padding:4px 5px;}
    #newDashboardRoot .pnlcal-val {font-size:10.5px;}
    #newDashboardRoot .pnlcal-summary {font-size:12px; gap:6px;}
    #newDashboardRoot .pnlcal-month {min-width:0;}
  }

/* ── Керування ботами: створення, шаблони, небезпечні дії ── */
  #newDashboardRoot .bot-new-btn {text-decoration:none; padding:8px 16px; font-size:13px; white-space:nowrap;}
  #newDashboardRoot .bot-templates {display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px;}
  #newDashboardRoot .bot-run-note {font-size:12px; color:var(--text-dim); margin:0 0 14px; line-height:1.5;}
  #newDashboardRoot .bot-form-err {color:var(--red, #ef5350); font-size:13px; min-height:18px; margin-top:10px;}
  #newDashboardRoot .field.hidden {display:none;}
  #newDashboardRoot .form-actions {flex-wrap:wrap;}
  #newDashboardRoot .toggle-btn:disabled {opacity:.45; cursor:not-allowed;}
