:root{
  --bg:#0b0b0c;
  --panel:#0f0f12;
  --text:#f4f4f5;
  --muted:#a1a1aa;
  --accent:#e5e7eb;
  --border:rgba(255,255,255,.08);
  --shadow:0 20px 60px rgba(0,0,0,.35);
}
:root[data-theme="light"]{
  --bg:#f6f7fb;
  --panel:#ffffff;
  --text:#0b1220;
  --muted:#4b5563;
  --accent:#0f172a;
  --border:rgba(10,18,32,.12);
  --shadow:0 10px 30px rgba(17,24,39,.10);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(255,255,255,.06), transparent 60%),
              radial-gradient(800px 400px at 90% -10%, rgba(255,255,255,.04), transparent 60%),
              var(--bg);
  color:var(--text);
  font:14px/1.5 "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

.app{display:grid; grid-template-columns:290px 1fr; min-height:100vh;}
.sidebar{
  background: linear-gradient(180deg, rgba(18,18,22,.96), rgba(12,12,16,.96));
  border-right:1px solid var(--border);
  padding:18px;
  position:sticky; top:0; height:calc(100vh - 44px);
  backdrop-filter: blur(8px);
}
:root[data-theme="light"] .sidebar{
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(242,245,255,.98));
}

.sb-brand{display:flex; align-items:center; gap:12px; padding:10px 10px 14px; width:100%;}
.brand-actions{display:flex; align-items:center; gap:5px; margin-left:auto; flex-wrap:wrap; justify-content:flex-end;}
.mobile-actions{display:none;}
.desktop-actions{display:none;}

@media (min-width:1021px){
  .mobile-actions{display:none;}
  .desktop-actions{display:flex;}
}
.sb-icon{
  width:38px; height:38px; display:grid; place-items:center;
  background: rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.12);
  border-radius:12px;
}
:root[data-theme="light"] .sb-icon{background: rgba(10,18,32,.04); border-color: rgba(10,18,32,.12)}
.sb-title{font-weight:900; letter-spacing:.2px; font-size:16px; margin-left:8px}

.theme-switch{display:flex; gap:8px; margin:6px 0 12px;}
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  gap:8px; padding:10px 14px; border-radius:999px;
  font-weight:700; border:1px solid rgba(255,255,255,.08);
  background: #f4f4f5; color:#0b0b0c; cursor:pointer;
}
.btn.secondary{
  background: rgba(255,255,255,.06);
  color: var(--text);
  border:1px solid var(--border);
}
:root[data-theme="light"] .btn{
  background: rgba(10,18,32,.08);
  color:#0b1220;
  border:1px solid rgba(10,18,32,.12);
}
:root[data-theme="light"] .btn.secondary{background: rgba(10,18,32,.03);}
:root[data-theme="light"] .card{background: rgba(255,255,255,.95); border:1px solid rgba(0,0,0,.08); box-shadow:0 12px 30px rgba(0,0,0,.08);} 
:root[data-theme="light"] .bot-card{background:#ffffff; border:1px solid rgba(0,0,0,.08); box-shadow:0 12px 30px rgba(0,0,0,.08);} 
:root[data-theme="light"] .balance-item{background: rgba(0,0,0,.03); border:1px solid rgba(0,0,0,.08);} 
:root[data-theme="light"] .bot-meta{color: rgba(0,0,0,.6);} 
:root[data-theme="light"] .bot-badge{color: rgba(0,0,0,.6); border-color: rgba(0,0,0,.2);} 
:root[data-theme="light"] .bot-settings .in{background: rgba(0,0,0,.03); border:1px solid rgba(0,0,0,.12); color:#0b1220;} 
:root[data-theme="light"] .sb-item{color: rgba(0,0,0,.55);} 
:root[data-theme="light"] .sb-item.active{background: rgba(0,0,0,.06); border-color: rgba(0,0,0,.12); color:#0b1220;} 
:root[data-theme="light"] .stat-card{background: rgba(0,0,0,.03); border:1px solid rgba(0,0,0,.08); box-shadow:none; color:#0b1220;}
:root[data-theme="light"] .bal-chip{background: rgba(0,0,0,.04); color:#0b1220;}
:root[data-theme="light"] .bots-controls .row .k,
:root[data-theme="light"] .bots-controls .chk{color: rgba(0,0,0,.55);} 
:root[data-theme="light"] .content-footer{background: var(--bg); color:#0b1220;}

.sb-nav{display:flex; flex-direction:column; gap:6px; margin-top:8px}
.sb-item{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px; border-radius:12px;
  border:1px solid transparent;
  background: transparent;
  color:var(--muted);
  cursor:pointer; user-select:none;
}
.sb-item:hover{background: rgba(255,255,255,.05); color:var(--text)}
.sb-item.active{background: rgba(255,255,255,.08); border-color: var(--border); color:var(--text)}
:root[data-theme="light"] .sb-item:hover{background: rgba(10,18,32,.04)}
.sb-item .meta{font-size:11px; color: rgba(231,238,252,.55)}
:root[data-theme="light"] .sb-item .meta{color: rgba(11,18,32,.45)}

.sb-footer{margin-top:18px; padding:10px; border-top:1px solid var(--border)}
.sb-chip{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  background: rgba(255,255,255,.04);
  border:1px solid var(--border);
  color:var(--muted); font-size:12px;
}
.sb-footnote{margin-top:10px; color: rgba(156,163,175,.95); font-size:12px}

.content{padding:22px 22px 0; background: transparent;}
.topbar{display:flex; align-items:center; justify-content:space-between; gap:14px; margin-bottom:18px;
  position: static; z-index: 20;
  background: transparent; backdrop-filter: none;
  padding:12px 0; border-bottom: none;
}
:root[data-theme="light"] .topbar{background: transparent;}
.topbar-right{display:flex; align-items:center; gap:5px;}
.page-title{font-weight:950; font-size:22px; letter-spacing:.1px}
.page-subtitle{color:var(--muted); margin-top:4px}

.btn:disabled{opacity:.6; cursor:not-allowed}
.result{color:var(--muted); font-size:13px}
.date-wrap{display:inline-block; position:relative; width:160px; cursor:pointer;}
.date-wrap .in{width:100%; cursor:pointer;}
.date-wrap:before{content:''; position:absolute; inset:0; border-radius:10px; pointer-events:none;}

.events-filters{padding-bottom:4px;}
.events-top-row{display:grid !important; grid-template-columns:repeat(4,1fr); gap:10px; align-items:start;}
.events-top-row .row{min-width:0; flex-direction:column; align-items:stretch; gap:6px; margin:0; padding:0; background:transparent; border:0; box-shadow:none;}
.events-row-mid{margin-top:10px; padding:0; background:transparent; border:0; box-shadow:none;}
.events-row-mid .k{font-size:11px; color:var(--muted);} 
.events-top-row .k{font-size:11px; color:var(--muted);} 
.events-top-row .v{margin-top:0; font-weight:600;}
.events-filters .k{font-size:11px; color:var(--muted);}
.events-filters .v{margin-top:0; font-weight:600;}

.an-strategy-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:12px;}
@media (max-width: 900px){.an-strategy-grid{grid-template-columns:1fr;}}
.an-strategy-card{padding:14px; border-radius:16px; border:1px solid var(--border); background: rgba(15,15,18,.7);}
.an-strategy-card .title{font-weight:800; font-size:14px; margin-bottom:6px;}
.an-strategy-card .meta{color:var(--muted); font-size:12px; margin-bottom:8px;}
.an-report-head .sort{cursor:pointer; color:var(--muted); font-size:12px;}
.an-report-head .sort.active{color:#fff; font-weight:800;}
.an-report-head .sep{margin:0 6px; color:var(--muted);}

.grid{display:grid; grid-template-columns:repeat(12,1fr); gap:14px}
.card{
  background: rgba(15,15,18,.9);
  border:1px solid var(--border);
  border-radius:20px;
  box-shadow: var(--shadow);
  padding:18px;
  overflow:hidden;
}
:root[data-theme="light"] .card{
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(242,245,255,.98));
}
.card h3{margin:0 0 10px; font-size:14px; letter-spacing:.2px}
.hint{color:var(--muted); font-size:12px; margin-top:-4px; margin-bottom:10px}

.modal{
  position:fixed; inset:0; display:none; align-items:center; justify-content:center;
  background: rgba(0,0,0,.55); z-index: 500;
}
.modal.open{display:flex;}
.modal-card{background:var(--panel); border:1px solid var(--border); border-radius:16px; width:min(720px, 92vw); padding:18px; box-shadow: var(--shadow);}
.modal-header{display:flex; align-items:center; justify-content:space-between; margin-bottom:8px;}
.modal-body{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
.modal-body .row{display:flex; flex-direction:column; gap:6px;}
.modal-footer{display:flex; justify-content:flex-end; gap:8px; margin-top:12px;}
.modal-close{background:transparent; border:0; color:var(--muted); font-size:18px; cursor:pointer;}
@media (max-width:720px){
  .modal-body{grid-template-columns:1fr;}
}

.modal-card .in{
  background: rgba(255,255,255,.06);
  border:1px solid var(--border);
  border-radius:12px;
  color:var(--text);
  padding:10px 12px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}
.modal-card .in:focus{outline:2px solid rgba(255,255,255,.18);}

.col-12{grid-column: span 12}
.col-6{grid-column: span 6}
.col-4{grid-column: span 4}

.pill{
  display:inline-flex; align-items:center; gap:8px;
  padding:6px 10px; border-radius:999px;
  background: rgba(255,255,255,.04);
  border:1px solid var(--border);
  color:var(--muted); font-size:12px;
}

.list{display:flex; flex-direction:column; gap:0}
.list .row{background:transparent; border:0; box-shadow:none; padding-left:0; padding-right:0;}
.list .row *{border-color:rgba(255,255,255,0.02);}
.row{
  padding:10px 12px; border-radius:12px;
  background: rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
}
:root[data-theme="light"] .row{background: rgba(10,18,32,.02); border-color: rgba(10,18,32,.06)}
.row .k{color:var(--muted); font-size:12px}
.row .v{font-weight:800; margin-top:4px}

.inner-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:12px}
.content-footer{position:fixed; left:0; right:0; bottom:0; z-index:5;
  color: rgba(156,163,175,.95); font-size:12px; border-top:1px solid var(--border);
  padding:10px 22px; background: var(--bg);}
.content{padding-bottom:50px;}

.bot-indicator{
  display:flex;
  align-items:center;
  gap:6px;
  padding:10px 12px;
  border-radius:12px;
  font-weight:800;
  font-size:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  height:40px;
  box-sizing:border-box;
}

.ping-indicator{
  display:flex;
  align-items:center;
  padding:10px 12px;
  border-radius:12px;
  font-weight:800;
  font-size:12px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  height:40px;
  box-sizing:border-box;
  color: var(--text);
}
.bot-indicator .dot{
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  border:1px solid var(--border);
  opacity:.35;
}
.bot-indicator .dot.on{ background:#22c55e; }
.bot-indicator .dot.off{ background:#ef4444; }
.bot-indicator .label{ margin-right:4px; color: var(--muted); }
.bot-indicator.active-on .dot.on{ opacity:1; box-shadow:0 0 8px rgba(34,197,94,.6); }
.bot-indicator.active-off .dot.off{ opacity:1; box-shadow:0 0 8px rgba(239,68,68,.6); }
.bot-indicator.active-on .label.on{ color:#22c55e; }
.bot-indicator.active-off .label.off{ color:#ef4444; }

@media (max-width:1020px){
  .app{grid-template-columns:220px 1fr}
  .sidebar{position:relative; height:auto}
  .topbar{flex-wrap:wrap; gap:8px;}
  .brand-actions{justify-content:flex-end;}
  .content{padding-top:12px;}
  .grid{grid-template-columns:1fr;}
  .col-6,.col-4{grid-column:span 12;}
}

@media (max-width:1200px){
  .app{grid-template-columns:220px 1fr;}
  .space-card{flex:1 1 calc(50% - 10px); min-width:220px;}
  .bot-card{width: calc((100% - 10px)/2);}
  .bot-controls{position:static; margin-top:8px;}
}

/* Auth forms (login/register) */
.app .pos-field{margin-top:6px;}
.app .pos-field .k{color:var(--muted); font-size:12px; margin-bottom:6px;}
.app input.in,
.app select.in,
.app .in{
  width:100%;
  box-sizing:border-box;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
  color: var(--text, #e7eefc);
  outline:none;
  appearance: none;
}
:root[data-theme="light"] .app input.in,
:root[data-theme="light"] .app select.in,
:root[data-theme="light"] .app .in{
  border:1px solid rgba(0,0,0,.10);
  background: rgba(0,0,0,.02);
}
.app input.in:focus,
.app select.in:focus,
.app .in:focus{
  border-color: rgba(255,255,255,.25);
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}

.app select.in{
  color:var(--text, #e7eefc); font-weight:800;
}
.app select.in option{
  background:#16181d;
  color:var(--text, #e7eefc); font-weight:800;
}
:root[data-theme="light"] .app select.in{
  color:#000; font-weight:800;
}
:root[data-theme="light"] .app select.in option{
  color:#000; font-weight:800;
}

.dd{position:relative; width:100%;}
.dd-btn{width:100%; text-align:left; background:rgba(255,255,255,.04); color:#fff; font-weight:800; border-radius:12px; border:1px solid var(--border); padding:10px 36px 10px 12px; cursor:pointer; position:relative;}
.dd-btn::after{content:'▾'; position:absolute; right:10px; top:50%; transform:translateY(-50%); color:rgba(255,255,255,.7); font-size:12px;}
.dd-btn:hover{border-color:rgba(255,255,255,.35); background:rgba(255,255,255,.08);}
.dd-btn:focus-visible{outline:2px solid rgba(255,255,255,.35); outline-offset:2px;}
.dd-list{position:absolute; top:calc(100% + 4px); left:0; right:0; background:rgba(15,15,18,.98); color:#fff; border:1px solid var(--border); border-radius:12px; max-height:220px; overflow:auto; display:none; z-index:50; box-shadow:var(--shadow);}
.dd.open .dd-list{display:block;}
.dd-item{width:100%; text-align:left; background:transparent; border:0; padding:8px 10px; font-weight:800; color:#fff; cursor:pointer;}
.dd-item:hover{background:rgba(255,255,255,.08);}
.dd-list{padding:8px;}
.dd-search{
  width:100%;
  height:40px;
  border-radius:10px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.05);
  color:var(--text);
  padding:0 12px;
  font-size:14px;
  margin-bottom:8px;
  outline:none;
  box-shadow:none;
}
.dd-search::placeholder{
  color:var(--muted);
}
.dd-search:focus{
  border-color:rgba(255,255,255,.22);
  background:rgba(255,255,255,.07);
  box-shadow:0 0 0 2px rgba(255,255,255,.08);
}
.dd-empty{
  border:1px dashed rgba(255,255,255,.08);
  border-radius:10px;
  background:rgba(255,255,255,.03);
  margin-bottom:6px;
}
.dd-item{
  border-radius:10px;
  padding:10px 12px;
  font-size:14px;
  line-height:1.35;
}
.dd-list::-webkit-scrollbar{
  width:8px;
}
.dd-list::-webkit-scrollbar-track{
  background:transparent;
}
.dd-list::-webkit-scrollbar-thumb{
  background:rgba(255,255,255,.14);
  border-radius:999px;
}
.dd-list::-webkit-scrollbar-thumb:hover{
  background:rgba(255,255,255,.22);
}
:root[data-theme="light"] .dd-search{
  background:rgba(0,0,0,.03);
  color:#0b1220;
  border-color:rgba(0,0,0,.12);
}
:root[data-theme="light"] .dd-search:focus{
  border-color:rgba(10,18,32,.18);
  background:#fff;
  box-shadow:0 0 0 2px rgba(10,18,32,.06);
}

.app select.in{
  background-image: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0));
}

.seg{
  display:inline-flex;
  align-items:center;
  background: rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:12px;
  padding:4px;
  gap:4px;
  width: fit-content;
}
.seg-btn{
  border:0;
  background: transparent;
  color: var(--text);
  padding:8px 12px;
  border-radius:10px;
  cursor:pointer;
  font-weight:700;
}
.seg-btn.active{
  background: rgba(255,255,255,.12);
  border:1px solid var(--border);
}

.space-list{display:flex; gap:10px; flex-wrap:wrap;}
.space-meta{font-size:12px; opacity:.9; margin-top:6px;}
.space-card{
  position:relative;
  padding:5px 16px 10px;
  border:1px solid var(--border);
  border-radius:12px;
  background: rgba(255,255,255,.03);
  min-width:170px;
  cursor:pointer;
}
.space-card.active{outline:2px solid rgba(255,255,255,.18)}
.space-title{font-weight:800;}
.space-title[contenteditable]{outline:none;}
.space-sub{font-size:12px; color:var(--muted); margin-top:2px}
.space-actions{
  position:absolute; right:8px; top:8px; display:flex; gap:6px;
  opacity:0; pointer-events:none; transition: .15s ease;
}
.space-card:hover .space-actions{opacity:1; pointer-events:auto;}
.space-actions .btn{padding:4px 6px; border-radius:8px; font-weight:700; font-size:12px;}
@media (hover: none){
  .space-actions{opacity:1; pointer-events:auto;}
}
.space-edit{display:none; margin-top:6px; gap:6px; align-items:center;}
.space-edit .in{padding:6px 8px; border-radius:8px;}
.space-edit .btn{padding:6px 8px; font-size:12px;}
.space-edit .btn.icon-only{width:34px; height:30px; padding:0; border-radius:999px; font-weight:900;}
.space-card.editing .space-actions{display:none;}
.space-card.dragging{opacity:.6;}
.space-card.editing .space-edit{display:flex;}

.bots-stats{display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:12px;}
.stat-card{background: rgba(16,16,18,.75); border:1px solid rgba(255,255,255,.06); border-radius:16px; padding:12px 14px; box-shadow: var(--shadow);} 
.stat-label{font-size:11px; color:var(--muted);} 
.stat-value{font-size:18px; font-weight:900; margin-top:6px;}

.bots-controls{display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; align-items:center; margin-bottom:12px;}
.bots-controls .row{display:flex; align-items:center; gap:8px;}
.bots-controls .seg{width:100%;}
.bots-controls .seg-btn{flex:1; text-align:center;}
.bots-controls #botsStrategyEdit{padding:6px 10px; border-radius:10px;}
.bots-controls .row .k{font-size:12px; color:var(--muted);} 
.bots-controls .chk{display:flex; align-items:center; gap:6px; font-size:12px; color:var(--muted);} 
.chk-row{display:flex; gap:14px; align-items:center; flex-wrap:wrap; margin-top:8px;}
.chk-row .chk{display:flex; align-items:center; gap:6px; cursor:pointer; user-select:none;}
.actions-panel .row{border:0; padding:6px 0;}
.actions-panel .row + .row{border-top:0;}
.actions-panel .row{display:flex; align-items:center; gap:0;}
.actions-panel .row .k{min-width:90px;}
.actions-panel .row .k:empty{min-width:0; width:0; margin:0; padding:0;}
.actions-panel .row{background:transparent;}
.actions-panel .row .v{display:flex; align-items:center; margin-top:0; font-weight:600;}
.actions-panel .row .v{flex:1;}
.actions-panel .row .v > .seg{width:100%;}
.actions-panel .seg{background:transparent; border:0; padding:0; box-shadow:none;}
.actions-panel .seg .seg-btn{border:1px solid rgba(255,255,255,0.02); background:transparent;}
.actions-panel .seg .seg-btn.active{background:rgba(255,255,255,0.04);}
.an-status-line{display:flex; align-items:center; gap:10px; line-height:32px;}
.an-status-line .btn{height:32px;}
.an-status-line #anStatus{display:inline-flex; align-items:center; height:32px; line-height:32px;}
.an-status-line #anStatus{margin:0; padding:0; margin-top:0; font-weight:600;}
.an-status-line #anStatus.status-done{margin:0 0 5px 0;}
.an-status-line .hint{margin-top:0; margin-bottom:5px;}
.q{display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; border-radius:50%; background:rgba(255,255,255,0.06); border:1px solid rgba(255,255,255,0.08); color:var(--text); font-size:11px; margin-left:6px; cursor:help;}
.q{position:relative;}
.q:hover::after{
  content: attr(data-tip);
  position:absolute;
  left:20px;
  top:-6px;
  background:rgba(16,16,18,.95);
  color:var(--text);
  border:1px solid rgba(255,255,255,0.08);
  padding:8px 10px;
  border-radius:12px;
  box-shadow:0 12px 30px rgba(0,0,0,0.35);
  font-size:12px;
  white-space:nowrap;
  z-index:9999;
}

/* toast notifications */
.toast-box{position:fixed; top:16px; left:16px; z-index:9999; display:flex; flex-direction:column; gap:8px;}
.toast-box.pos-tr{top:16px; right:16px; left:auto;}
.toast-box.pos-br{bottom:16px; right:16px; top:auto; left:auto;}
.toast-box.pos-bl{bottom:16px; left:16px; top:auto; right:auto;}
.toast{
  background: rgba(15,15,18,0.95);
  color:var(--text);
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:0 10px 30px rgba(0,0,0,0.25);
  padding:10px 12px;
  border-radius:12px;
  min-width:220px;
  max-width:360px;
  font-size:12px;
  line-height:1.35;
  animation:toastIn 160ms ease-out;
}
.toast .t-title{font-weight:600; margin-bottom:4px;}
.toast .t-body{color:var(--muted);} 
.toast .t-meta{font-size:11px; color:var(--muted); margin-top:4px;}
@keyframes toastIn{from{transform:translateY(-6px); opacity:0;} to{transform:translateY(0); opacity:1;}}

/* notification prompt modal */
.notif-modal .modal-card{max-width:420px;}
.notif-modal .modal-body{color:var(--muted); font-size:13px;}
.notif-actions{display:flex; gap:8px; justify-content:flex-end; margin-top:12px;}
.bot-settings input[type="checkbox"],
.bots-controls input[type="checkbox"],
.chk input[type="checkbox"]{
  appearance:none; -webkit-appearance:none;
  width:16px; height:16px; border-radius:4px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.03);
  display:inline-grid; place-items:center;
  transition:all .12s ease;
}
.bot-settings input[type="checkbox"]:checked,
.bots-controls input[type="checkbox"]:checked,
.chk input[type="checkbox"]:checked{
  border-color:#f472b6;
  background: rgba(244,114,182,0.2);
}
.bot-settings input[type="checkbox"]:checked::after,
.bots-controls input[type="checkbox"]:checked::after,
.chk input[type="checkbox"]:checked::after{
  content:"";
  width:8px; height:8px; border-radius:2px;
  background:#f472b6;
}

.strategy-card{display:flex; flex-direction:column; gap:12px;}
.strategy-head{display:flex; align-items:center; justify-content:space-between; gap:12px;}
.strategy-head > div{display:flex; flex-direction:column; gap:4px;}
.strategy-title{font-weight:900; font-size:16px;}
.strategy-desc{color:var(--muted); font-size:12px; margin-top:4px;}
.strategy-edit{margin-top:12px;}

.bot-grid{display:flex; flex-wrap:wrap; gap:8px;}
.bot-card{
  border:1px solid rgba(255,255,255,.06);
  border-radius:20px;
  padding:14px 12px 12px 12px;
  background: rgba(16,16,18,.75);
  box-shadow: 0 20px 50px rgba(0,0,0,.35);
  margin:0;
  position:relative;
  width: calc((100% - 32px)/5);
  min-width: 180px;
}
.bot-head{display:flex; align-items:flex-start; justify-content:space-between; gap:10px;}
.bot-head-badges{display:flex; align-items:center; gap:8px; flex-wrap:wrap; justify-content:flex-end;}
.bot-title{font-weight:900; font-size:14px; letter-spacing:.15px;}

.bot-subtitle{margin-top:3px; color:var(--muted); font-size:11px;}
.bot-section{margin-top:6px; padding:7px 8px; border-radius:10px; background:rgba(255,255,255,.03); border:0;}
.bot-section-title{font-size:10px; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin-bottom:5px; font-weight:800;}
.bot-section-compact .bot-meta{margin-top:4px;}
.bot-badge{font-size:10px; padding:4px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.12); color:var(--muted); white-space:nowrap; flex:0 0 auto;}
.bot-badge.on{color:#22c55e; border-color:rgba(34,197,94,.4);}
.bot-badge.off{color:#f87171; border-color:rgba(248,113,113,.4);}
.bot-badge.stop-after{color:#fbbf24; border-color:rgba(251,191,36,.45); background:rgba(251,191,36,.08);}
.bot-actions-close{width:100%; margin-top:8px;}
.bot-actions-close .bot-close-now{width:100%; justify-content:center;}
.bot-actions-bottom{width:100%; display:flex; gap:8px; margin-top:8px;}
.bot-actions-bottom .bot-toggle, .bot-actions-bottom .bot-stop-after{flex:1 1 0;}
.bot-meta{margin-top:4px; color:var(--muted); font-size:10px;}
.bot-meta.price{font-weight:800; color:#fff;}
.bot-meta.price.up{color:#86efac;}
.bot-meta.price.down{color:#fca5a5;}
.price-chip{display:block; width:100%; box-sizing:border-box; padding:7px 9px; border-radius:10px; background:#fff; color:#000; font-weight:800; font-size:10px; white-space:normal; line-height:1.3; border:0; box-shadow:none;}
.pnl-pos{color:#86efac; font-weight:800;}
.pnl-neg{color:#fca5a5; font-weight:800;}
.bot-meta.signal-long,
.bot-meta.signal-short{
  display:inline-flex; align-items:center;
  padding:6px 10px; border-radius:999px;
  font-weight:800; color:#fff; font-size:11px; white-space:nowrap;
}
.tpsl-chip{
  display:inline-flex; align-items:center;
  padding:6px 10px; border-radius:999px;
  font-weight:800; color:#fff; font-size:11px; white-space:nowrap;
  margin-right:6px;
}
.tpsl-long{background:rgba(134,239,172,.35);}
.tpsl-short{background:rgba(252,165,165,.35);}
.bot-meta.signal-long{background:rgba(134,239,172,.35); border:0;}
.bot-meta.signal-short{background:rgba(252,165,165,.35); border:0;}
.bot-spark{margin-top:10px; height:60px; width:100%; border-radius:12px; background: rgba(255,255,255,.02); overflow:hidden;}
.bot-controls{display:flex; gap:4px; position:static; margin-top:8px; flex-wrap:wrap;}
.bot-controls .btn{padding:4px 8px; font-size:10px; border-radius:999px;}
.bot-actions{
  position:static; display:flex; gap:6px;
  opacity:1; pointer-events:auto; transition:.15s ease; margin-top:12px; flex-wrap:wrap;
}
.bot-card:hover .bot-actions{opacity:1; pointer-events:auto;}
.bot-footer{display:flex; align-items:center; justify-content:space-between; gap:6px; margin-top:8px; flex-wrap:wrap;}
.bot-actions .btn{padding:3px 5px; border-radius:8px; font-weight:700; font-size:10px;}
.bot-actions .btn.active{background:rgba(255,255,255,.12); border-color:rgba(255,255,255,.25);}
.bot-controls .btn.icon-only{width:28px; height:28px; padding:0; display:flex; align-items:center; justify-content:center;}
.bot-card{display:flex; flex-direction:column;}
.bot-footer{margin-top:auto; padding-top:12px;}
@media (min-width:601px){
  .bot-footer{display:grid; grid-template-columns:auto 1fr; align-items:end; column-gap:12px; row-gap:8px; width:100%;}
  .bot-controls{width:auto; display:flex; gap:8px; justify-content:flex-start; align-self:end; margin-top:0; grid-column:1;}
  .bot-actions{width:100%; display:flex; justify-content:flex-end; align-items:end; flex-wrap:wrap; gap:8px; margin-top:0; grid-column:2;}
}
.icon-svg{width:18px; height:18px;}
.bot-settings{margin-top:10px; display:none; grid-template-columns:repeat(3,1fr); gap:8px;}
.bot-settings{grid-template-columns:repeat(2,1fr);}
.bot-settings .martingale-row{grid-column:1/-1;}
.bot-settings .atr-row{grid-column:1/-1;}
.bot-settings .trailing-row{grid-column:1/-1;}
.bot-settings .ema-row{grid-column:1/-1;}
.bot-settings .toggle-row{display:flex; flex-direction:row; align-items:center; justify-content:flex-start; gap:12px;}
.bot-settings .toggle-row .k{margin:0;}
.bot-settings .toggle-row input[type="checkbox"]{margin-left:6px;}
.toggle-group{grid-column:1/-1; display:flex; flex-wrap:wrap; gap:14px; align-items:center; margin:6px 0;}
.toggle-item{display:flex; align-items:center; gap:6px; color:var(--text); font-size:12px;}
.martingale-settings{display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:8px; grid-column:1/-1;}
.martingale-settings .row{background:transparent; border:0; box-shadow:none; border-radius:10px; padding:6px 0;}
.martingale-settings .row{display:flex; flex-direction:column;}
.martingale-settings .k{font-size:11px; color:var(--muted); margin-bottom:4px; display:block;}
.martingale-settings .in{width:100%;}

.atr-settings{display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:8px; grid-column:1/-1;}
.atr-settings .row{background:transparent; border:0; box-shadow:none; border-radius:10px; padding:6px 0; display:flex; flex-direction:column;}
.atr-settings .k{font-size:11px; color:var(--muted); margin-bottom:4px; display:block;}
.atr-settings .in{width:100%;}

.trailing-settings{display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:8px; grid-column:1/-1;}
.trailing-settings .row{background:transparent; border:0; box-shadow:none; border-radius:10px; padding:6px 0; display:flex; flex-direction:column;}
.trailing-settings .k{font-size:11px; color:var(--muted); margin-bottom:4px; display:block;}
.trailing-settings .in{width:100%;}

.ema-settings{display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:8px; grid-column:1/-1;}
.ema-settings .row{background:transparent; border:0; box-shadow:none; border-radius:10px; padding:6px 0; display:flex; flex-direction:column;}
.ema-settings .k{font-size:11px; color:var(--muted); margin-bottom:4px; display:block;}
.ema-settings .in{width:100%;}

@media (max-width: 980px){
  .martingale-settings{grid-template-columns:repeat(2,1fr);}
}
@media (max-width: 720px){
  .martingale-settings{grid-template-columns:1fr;}
}
.bot-card.editing .bot-settings{display:grid;}
.bot-settings .row{display:flex; flex-direction:column; gap:4px; background:transparent; border:0; box-shadow:none; padding:6px 0;}
.bot-settings .in{padding:8px 10px; border-radius:10px; background: transparent; border:0; box-shadow:none; color:var(--text);}
.bot-settings .btn{grid-column:1/-1; justify-self:flex-start;}
.bot-settings .seg{flex-wrap:wrap; width:100%; background:transparent; border:0; box-shadow:none;}
.bot-settings .seg-btn{white-space:nowrap;}
.bot-settings .seg-btn{flex:1; text-align:center;}
@media (max-width:1200px){
  .bot-card{width: calc((100% - 16px)/3); min-width: 0;}
}
@media (max-width:900px){
  .bot-settings{grid-template-columns:1fr 1fr;}
  .bot-card{width: calc((100% - 8px)/2); min-width: 0;}
}
@media (max-width:600px){
  .bot-settings{grid-template-columns:1fr;}
  .bot-card{width: 100%;}
  .bot-settings .seg{gap:6px;}
  .bot-settings .seg-btn{padding:6px 10px; font-size:12px;}
}

@media (max-width:900px){
  .app{grid-template-columns:1fr}
  .sidebar{position:sticky; top:0; z-index:99; box-shadow:0 8px 24px rgba(0,0,0,.45);}
  .desktop-actions{display:none;}
  .mobile-actions{display:flex;}
  .sb-nav{
    flex-direction:row;
    overflow-x:auto;
    gap:8px;
    padding-bottom:8px;
    -webkit-overflow-scrolling:touch;
  }
  .sb-item{white-space:nowrap; flex:0 0 auto;}
  .sb-footer{display:none;}
  .content{padding:16px;}
  .topbar{gap:10px;}
  .bots-balance{grid-template-columns:1fr 1fr;}
  .bots-stats{grid-template-columns:repeat(2,1fr);}
  .bot-controls{flex-wrap:wrap;}
  .bots-controls{grid-template-columns:1fr;}
  .bot-actions{position:static; margin-top:10px; justify-content:flex-end; gap:8px;}
  .exchange-card{grid-template-columns: 1fr; gap:8px;}
  .exchange-ping{justify-content:flex-start;}
  .exchange-status{margin-left:0;}
  .events-top-row{grid-template-columns:repeat(2,1fr);}
  .space-list{flex-direction:column;}
  .space-card{min-width:auto;}
  .bot-card{width:100%; min-width:0;}
  .chart-controls-row{flex-wrap:wrap; gap:8px;}
}

@media (max-width:600px){
  .content{padding:12px;}
  .bots-balance{grid-template-columns:1fr;}
  .bots-stats{grid-template-columns:1fr;}
  .balance-list{overflow-x:auto;}
  .bot-controls .btn{width:100%;}
  .modal-card{width:100%; max-width:100%;}
  .modal-body{grid-template-columns:1fr;}
  .events-top-row{grid-template-columns:1fr;}
  .events-row-mid{overflow-x:auto;}
  .table{overflow-x:auto;}
  .content-footer{position:static;}
}

.exchange-top{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;}
.exchange-grid{display:flex; flex-direction:column; gap:0;}
.exchange-card{
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px 14px;
  background: rgba(255,255,255,.03);
  position:relative;
  width:100%;
  display:grid;
  grid-template-columns: 140px 1fr auto auto auto auto;
  align-items:stretch;
  gap:14px;
  min-height:44px;
  margin:0;
}
.exchange-card *{margin:0;}
.exchange-name{font-weight:900; text-transform:uppercase; display:flex; align-items:center;}
.exchange-status{font-size:11px; color:#f472b6; margin-left:auto; display:flex; align-items:center;}
.exchange-status.off{color:var(--muted);}
.exchange-key{color:var(--muted); font-size:12px; display:flex; align-items:center;}
.exchange-del{padding:4px 6px; font-size:12px;}
.exchange-ping{color:var(--muted); font-size:12px; display:flex; align-items:center; justify-content:center; height:100%; line-height:1;}
.exchange-ping-btn{padding:4px 6px; font-size:12px; display:flex; align-items:center; justify-content:center;}
.exchange-ping{display:flex; align-items:center; gap:8px; margin-top:0;}
.exchange-form{margin-top:12px; border:1px solid var(--border); border-radius:12px; padding:12px; background: rgba(255,255,255,.03);}
.exchange-form .row{display:flex; flex-direction:column; gap:6px; margin-bottom:8px;}

.app select.in{
  background-image: linear-gradient(45deg, transparent 50%, rgba(255,255,255,.6) 50%),
                    linear-gradient(135deg, rgba(255,255,255,.6) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 10px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 32px;
  color-scheme: dark;
}
:root[data-theme="light"] .app select.in{
  background-image: linear-gradient(45deg, transparent 50%, rgba(0,0,0,.6) 50%),
                    linear-gradient(135deg, rgba(0,0,0,.6) 50%, transparent 50%);
  color-scheme: light;
}
.table{display:grid; gap:6px;}
#reportTable{overflow-x:auto;}
#reportTable .trow{min-width:760px;}
.trow{display:grid; grid-template-columns: 140px 100px 80px 120px 140px 90px 80px 70px; gap:14px; padding:6px 0; border-bottom:1px solid rgba(255,255,255,.06); font-size:12px; color:var(--text);} 
.trow.thead{color:var(--muted); text-transform:uppercase; font-size:10px; letter-spacing:.6px;}
.chart-controls{display:flex; flex-direction:column; gap:8px; margin-bottom:10px;}
.chart-controls .seg{align-self:flex-start;}
.chart-controls-row{display:flex; gap:8px; align-items:center;}
.chart-controls .in{max-width:180px;}
.chart-controls .btn{width:44px; height:36px; border-radius:12px; padding:0;}
.bots-balance{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:12px;}
.balance-item{background: rgba(16,16,18,.75); border:1px solid rgba(255,255,255,.06); border-radius:16px; padding:12px 14px;}
.balance-label{font-size:11px; color:var(--muted);} 
.balance-value{font-size:18px; font-weight:900; margin-top:6px;}
.balance-value.pos{color:#22c55e;}
.balance-value.neg{color:#ef4444;}
.balance-list{display:flex; flex-wrap:nowrap; gap:8px; margin-bottom:12px; overflow-x:auto;}
.bal-chip{background: rgba(255,255,255,.04); border:0; padding:6px 10px; border-radius:999px; font-size:12px; color:var(--text); font-weight:800;} 
.btn.icon-only{padding:4px; border-radius:999px; background:transparent; border:0;}
.btn.icon-only{color:var(--text); opacity:.8;}
.btn.icon-only:hover{opacity:1;}
.evt-list{margin:6px 0 0; padding-left:14px; color:var(--muted); font-size:12px; display:flex; flex-direction:column; gap:4px;}
.event-item{padding:12px; border:1px solid var(--border); border-radius:14px; background: rgba(255,255,255,.02); margin-bottom:10px;}
.evt-list li{list-style:none; border:0; padding:4px 0; background: transparent;} 
.event-item .row{background:transparent; border:0; padding:4px 0;}
.event-group{margin-bottom:14px; padding:12px; border:1px solid var(--border); border-radius:14px; background: rgba(255,255,255,.02);}
.event-group-title{font-weight:800; font-size:13px; color:#fff; margin-bottom:8px; display:flex; align-items:center; gap:8px; cursor:pointer;}
.event-group-title .caret{display:inline-block; transform:rotate(90deg); transition:.15s ease; opacity:.8;}
.event-group.collapsed .event-group-title .caret{transform:rotate(0deg);}
.event-group.collapsed .event-item{display:none;}


.signal-wait{display:inline-flex; align-items:center; padding:5px 8px; border-radius:999px; font-weight:800; color:#f8fafc; font-size:10px; white-space:normal; background:rgba(96,165,250,.20); border:0;} 
.status-line{font-weight:700;}
.bot-section .bot-meta + .bot-meta{margin-top:8px;}
.bot-section .price-chip{margin-top:2px;}

.price-chip br{content:"";}

.bot-section-compact{display:none;}
.bot-card.editing .bot-section-compact{display:block;}


/* Add Bot modal responsive polish */
#addBotModal .modal-card{
  width:min(860px, 96vw);
  max-height:min(92vh, 980px);
  display:flex;
  flex-direction:column;
  padding:16px;
}
#addBotModal .modal-header{
  margin-bottom:12px;
}
#addBotModal .modal-header h3{
  font-size:20px;
  line-height:1.2;
  margin:0;
}
#addBotModal .modal-body{
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  overflow:auto;
  padding-right:4px;
}
#addBotModal .modal-body .row,
#addBotModal .chk-row,
#addBotModal #botTinkoffTypeRow{
  min-width:0;
}
#addBotModal .modal-body .row{
  background:rgba(255,255,255,.02);
  border:1px solid var(--border);
  border-radius:14px;
  padding:10px 12px;
}
#addBotModal .row .k{
  font-size:12px;
  margin-bottom:2px;
}
#addBotModal .dd,
#addBotModal .seg,
#addBotModal .in,
#addBotModal select.in{
  width:100%;
}
#addBotModal .chk-row{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
  padding-top:4px;
}
#addBotModal .chk{
  display:flex;
  align-items:center;
  gap:8px;
  background:rgba(255,255,255,.02);
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  min-width:0;
}
#addBotModal .modal-footer{
  margin-top:14px;
  padding-top:10px;
  border-top:1px solid var(--border);
}
@media (max-width:1024px){
  #addBotModal .modal-card{
    width:min(760px, 96vw);
  }
}
@media (min-width:769px) and (max-width:1024px){
  .bot-card{
    display:flex;
    flex-direction:column;
  }
  .bot-footer{
    display:flex;
    align-items:flex-end;
    justify-content:space-between;
    gap:12px;
    flex-wrap:nowrap;
    margin-top:auto;
    padding-top:12px;
  }
  .bot-controls{
    width:auto;
    flex:0 0 auto;
    justify-content:flex-start;
    align-self:flex-end;
    margin-top:0;
    order:1;
  }
  .bot-actions{
    width:auto;
    flex:1 1 auto;
    justify-content:flex-end;
    align-items:flex-end;
    flex-wrap:wrap;
    margin-top:0;
    order:2;
  }
}
@media (max-width:768px){
  #addBotModal{align-items:flex-end;}
  #addBotModal .modal-card{
    width:100%;
    max-width:100%;
    max-height:92vh;
    border-radius:18px 18px 0 0;
    padding:14px;
  }
  #addBotModal .modal-body{
    grid-template-columns:1fr;
    gap:10px;
  }
  #addBotModal .chk-row{
    grid-template-columns:1fr;
  }
  #addBotModal .modal-footer{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  #addBotModal .modal-footer .btn{
    width:100%;
  }
}
@media (max-width:480px){
  #addBotModal .modal-card{
    padding:12px;
  }
  #addBotModal .modal-header h3{
    font-size:18px;
  }
  #addBotModal .modal-body .row{
    padding:9px 10px;
  }
  #addBotModal .seg{
    overflow:auto;
  }
  #addBotModal .seg .seg-btn{
    flex:1 0 auto;
    white-space:nowrap;
  }
  #addBotModal .modal-footer{
    grid-template-columns:1fr;
  }

  .content{
    padding:10px;
  }
  .page-title,
  h1{
    font-size:16px;
  }
  .bots-balance,
  .bots-stats{
    gap:8px;
  }
  .balance-item,
  .stat-card{
    padding:10px 12px;
    border-radius:14px;
    min-width:0;
  }
  .balance-label,
  .stat-label{
    font-size:11px;
    line-height:1.3;
  }
  .balance-value,
  .stat-value{
    font-size:16px;
    line-height:1.2;
    word-break:break-word;
  }
  .list .row,
  .bots-controls .row,
  .bot-settings .row,
  .bot-section .row{
    display:flex;
    flex-direction:column;
    align-items:stretch;
    gap:8px;
  }
  .list .row .k,
  .bots-controls .row .k,
  .bot-settings .row .k,
  .bot-section .row .k{
    min-width:0;
    width:100%;
    font-size:12px;
    line-height:1.3;
  }
  .list .row .v,
  .bots-controls .row .v,
  .bot-settings .row .v,
  .bot-section .row .v{
    width:100%;
    min-width:0;
  }
  .list .row .in,
  .bots-controls .row .in,
  .bot-settings .row .in,
  .bot-section .row .in,
  .list .row .dd,
  .bots-controls .row .dd,
  .bot-settings .row .dd,
  .bot-section .row .dd{
    width:100%;
    min-width:0;
  }
  .bots-controls{
    gap:10px;
  }
  .sidebar{
    padding:10px 10px 8px;
  }
  .sb-brand{
    gap:10px;
    margin-bottom:10px;
  }
  .sb-title{
    font-size:24px;
  }
  .sb-nav{
    gap:6px;
    padding-bottom:6px;
    scrollbar-width:none;
  }
  .sb-nav::-webkit-scrollbar{
    display:none;
  }
  .sb-item{
    padding:10px 12px;
    font-size:13px;
    border-radius:14px;
  }
  .sb-item .meta{
    display:none;
  }
  .topbar{
    margin-bottom:12px;
  }
  .bot-card,
  .exchange-card,
  .stat-card,
  .balance-item{
    border-radius:14px;
  }
  .bot-card{
    padding:12px;
  }
  .bot-head{
    gap:8px;
  }
  .bot-title{
    font-size:16px;
    line-height:1.25;
    word-break:break-word;
  }
  .bot-meta{
    font-size:12px;
    line-height:1.35;
    word-break:break-word;
  }
  .bot-footer{
    gap:10px;
    margin-top:10px;
  }
  .bot-controls,
  .bot-actions{
    width:100%;
  }
  .bot-actions{
    justify-content:stretch;
    flex-wrap:wrap;
  }
  .bot-actions .btn{
    flex:1 1 calc(50% - 6px);
    min-width:0;
  }
  .bot-controls .btn.icon-only{
    width:36px;
    height:36px;
  }
  .space-list{
    gap:8px;
  }
}


#addBotModal .bot-modal-sections{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
}
#addBotModal .bot-section{
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  border-radius:16px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
}
#addBotModal .bot-section-wide{
  grid-column:1 / -1;
}
#addBotModal .bot-section-title{
  font-size:13px;
  font-weight:800;
  color:var(--text);
  opacity:.95;
  margin-bottom:2px;
}
#addBotModal .bot-section .row{
  background:transparent;
  border:0;
  padding:0;
}
@media (max-width:768px){
  #addBotModal .bot-modal-sections{
    grid-template-columns:1fr;
  }
  #addBotModal .bot-section-wide{
    grid-column:auto;
  }
}

@media (min-width:601px){
  .bot-card{display:flex; flex-direction:column;}
  .bot-footer{display:flex !important; align-items:flex-end !important; justify-content:space-between !important; gap:12px !important; flex-wrap:nowrap !important; width:100% !important; margin-top:auto !important; padding-top:12px !important;}
  .bot-controls{width:auto !important; display:flex !important; gap:8px !important; justify-content:flex-start !important; align-items:flex-end !important; flex:0 0 auto !important; margin-top:0 !important;}
  .bot-actions{width:auto !important; display:flex !important; justify-content:flex-end !important; align-items:flex-end !important; gap:8px !important; flex:1 1 auto !important; margin-top:0 !important;}
}


.bot-live-indicator{
  margin-top:6px;
  font-size:12px;
  line-height:1.3;
  opacity:.92;
}
.bot-live-indicator.on{
  color:#86efac;
}
.bot-live-indicator.off{
  color:#fca5a5;
}


.bots-risk-inline{
  display:grid;
  grid-template-columns:minmax(240px,320px) minmax(220px,1fr) minmax(220px,1fr);
  gap:0;
  align-items:stretch;
  background:var(--panel-2, #161616);
  border:1px solid var(--line, rgba(255,255,255,.08));
  border-radius:14px;
  overflow:hidden;
}
.bots-risk-inline .row{
  margin:0;
  padding:10px 12px;
  background:transparent;
  border:0;
  border-right:1px solid var(--line, rgba(255,255,255,.08));
  min-height:100%;
}
.bots-risk-inline .row:last-child{
  border-right:0;
}
@media (max-width:900px){
  .bots-risk-inline{
    grid-template-columns:1fr;
  }
  .bots-risk-inline .row{
    border-right:0;
    border-bottom:1px solid var(--line, rgba(255,255,255,.08));
  }
  .bots-risk-inline .row:last-child{
    border-bottom:0;
  }
}


.bots-top-wallets-card{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:12px;
  padding:12px;
  background:var(--panel-2, #161616);
  border:1px solid var(--line, rgba(255,255,255,.08));
  border-radius:14px;
}
.bots-top-wallets-card .bal-chip{
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.08);
  border-radius:10px;
  padding:8px 12px;
  font-weight:600;
}


.bots-stats{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:0;
  background:var(--panel-2, #161616);
  border:1px solid var(--line, rgba(255,255,255,.08));
  border-radius:14px;
  overflow:hidden;
}
.bots-stats .stat-card{
  margin:0;
  border:0;
  border-right:1px solid var(--line, rgba(255,255,255,.08));
  border-radius:0;
  box-shadow:none;
  background:transparent;
}
.bots-stats .stat-card:last-child{
  border-right:0;
}
@media (max-width:900px){
  .bots-stats{
    grid-template-columns:1fr 1fr;
  }
  .bots-stats .stat-card{
    border-right:1px solid var(--line, rgba(255,255,255,.08));
    border-bottom:1px solid var(--line, rgba(255,255,255,.08));
  }
  .bots-stats .stat-card:nth-child(2n){
    border-right:0;
  }
  .bots-stats .stat-card:nth-last-child(-n+2){
    border-bottom:0;
  }
}


.bots-risk-actions{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:10px;
  margin-top:10px;
}
@media (max-width:900px){
  .bots-risk-actions{
    justify-content:stretch;
    flex-direction:column;
    align-items:stretch;
  }
}


.bots-risk-inline .row{
  display:flex;
  align-items:center;
  gap:10px;
}
.bots-risk-inline .row .k{
  min-width:110px;
  margin:0;
  white-space:nowrap;
}
.bots-risk-inline .row .in,
.bots-risk-inline .row .seg,
.bots-risk-inline .row .v{
  flex:1 1 auto;
  margin:0;
}
.bots-risk-inline .row .in{
  min-width:0;
}
.bots-risk-actions{
  justify-content:center;
  margin-top:8px;
}
.bots-risk-actions .hint{
  display:none;
}


.bots-risk-inline{
  grid-template-columns:minmax(240px,300px) minmax(180px,220px) minmax(180px,220px) 140px !important;
}
.bots-risk-save-cell{
  justify-content:center;
}
.bots-risk-save-cell .k{
  display:none;
}
.bots-risk-save-cell .hint{
  display:none;
}
.bots-risk-save-cell .btn{
  width:100%;
}
@media (max-width:900px){
  .bots-risk-inline{
    grid-template-columns:1fr !important;
  }
}


.bots-risk-inline{
  grid-template-columns:335px 1fr 1fr 160px !important;
}
.bots-risk-inline .row{
  padding:12px 14px;
}
.bots-risk-inline .row .k{
  min-width:96px;
  font-size:12px;
}
.bots-risk-inline .row .in{
  max-width:none;
  width:100%;
}
.bots-risk-inline .row .seg{
  min-width:0;
}
.bots-risk-save-cell{
  align-items:center !important;
}
.bots-risk-save-cell .btn{
  width:100%;
  min-width:120px;
}


.bots-risk-inline .row:first-child{
  grid-template-columns:96px 1fr;
}
.bots-risk-inline .row:first-child .seg{
  display:flex;
  width:100%;
  justify-content:stretch;
}
.bots-risk-inline .row:first-child .seg .seg-btn{
  flex:1 1 0;
  text-align:center;
}


.bots-risk-inline .row:first-child .seg{
  padding-right:5px;
  box-sizing:border-box;
}


#botsRiskExchange .seg-btn:last-child{
  margin-right:5px;
}

.bot-footer{align-items:flex-end !important;}
.bot-actions{align-items:stretch !important;}
.bot-actions .btn{height:32px !important; display:inline-flex !important; align-items:center !important; justify-content:center !important; box-sizing:border-box !important;}
.bot-controls .btn.icon-only{height:32px !important; width:32px !important;}

.bot-actions{display:grid !important; grid-auto-flow:column !important; grid-auto-columns:max-content !important; justify-content:end !important; align-items:end !important; gap:8px !important;}
.bot-actions .btn{min-width:32px !important; padding:0 10px !important; border-radius:10px !important; line-height:1 !important;}
.bot-actions .btn.secondary.bot-edit,
.bot-actions .btn.secondary.bot-del{padding:0 !important; width:32px !important;}
.bot-stop-after{white-space:nowrap !important;}

.bot-actions{display:flex !important; justify-content:flex-end !important; align-items:flex-end !important; gap:8px !important; flex-wrap:nowrap !important;}
.bot-actions .btn{height:auto !important; min-width:0 !important; padding:3px 5px !important; border-radius:8px !important;}
.bot-controls .btn.icon-only{width:28px !important; height:28px !important;}
.bot-edit,.bot-del{background:transparent !important; border-color:transparent !important; box-shadow:none !important; padding:0 2px !important;}

.bot-actions{gap:5px !important;}
.bot-edit,.bot-del{padding:0 !important; margin:0 !important; min-width:auto !important; width:auto !important;}

.bot-actions .btn.secondary.bot-edit,
.bot-actions .btn.secondary.bot-del{padding:0 !important; width:auto !important; min-width:0 !important; height:auto !important;}

.bot-actions{align-items:center !important;}
.bot-edit,.bot-del{position:relative !important; top:1px !important; line-height:1 !important;}


/* Bots page responsive cleanup, 2026-04-28 */
.bots-top-wallets-card{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  padding:12px;
  margin-bottom:12px;
}
.bots-top-wallets-card .bal-chip{
  margin:0;
}
.bots-balance{
  display:grid !important;
  grid-template-columns:1fr;
  gap:8px;
  margin-bottom:12px;
}
.bots-stats{
  display:grid !important;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-bottom:12px;
  border-radius:14px;
  overflow:hidden;
}
.bots-stats .stat-card{
  min-width:0;
}
.bots-risk-inline{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:8px !important;
  background:transparent !important;
  border:0 !important;
  border-radius:0 !important;
  overflow:visible !important;
  margin-bottom:12px;
}
.bots-risk-inline .row{
  display:flex !important;
  flex-direction:column !important;
  align-items:stretch !important;
  gap:6px !important;
  padding:10px 12px !important;
  border:1px solid var(--line, rgba(255,255,255,.08)) !important;
  border-radius:12px !important;
  background:var(--panel-2, #161616) !important;
}
.bots-risk-inline .row .k{
  min-width:0 !important;
  margin:0 !important;
  font-size:12px;
}
.bots-risk-inline .row .in,
.bots-risk-inline .row .seg,
.bots-risk-inline .row .v{
  width:100% !important;
  max-width:none !important;
  margin:0 !important;
}
.bots-risk-save-cell .k,
.bots-actions-block .k{
  display:none;
}
.bots-risk-save-cell .v,
.bots-actions-block .v{
  width:100%;
}
.bots-risk-save-cell .btn,
.bots-actions-block .btn{
  width:100%;
}
.bot-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:12px;
}
.bot-card{
  width:100% !important;
  min-width:0 !important;
}
.bot-footer{
  display:flex !important;
  flex-wrap:wrap !important;
  align-items:flex-end !important;
  justify-content:space-between !important;
  gap:10px !important;
}
.bot-controls{
  display:flex !important;
  gap:8px !important;
  width:auto !important;
  margin-top:0 !important;
}
.bot-actions{
  display:flex !important;
  flex-wrap:nowrap !important;
  justify-content:flex-end !important;
  align-items:center !important;
  gap:5px !important;
  width:auto !important;
}
@media (min-width: 481px){
  .bots-balance{grid-template-columns:1fr 1fr;}
  .bot-grid{grid-template-columns:1fr;}
}
@media (min-width: 768px){
  .bots-balance{grid-template-columns:repeat(3, minmax(0, 1fr));}
  .bots-stats{grid-template-columns:repeat(4, minmax(0, 1fr));}
  .bots-risk-inline{
    grid-template-columns:minmax(260px,320px) minmax(180px,1fr) minmax(180px,1fr) 140px !important;
    gap:0 !important;
    background:var(--panel-2, #161616) !important;
    border:1px solid var(--line, rgba(255,255,255,.08)) !important;
    border-radius:14px !important;
    overflow:hidden !important;
  }
  .bots-risk-inline .row{
    flex-direction:row !important;
    align-items:center !important;
    border:0 !important;
    border-right:1px solid var(--line, rgba(255,255,255,.08)) !important;
    border-radius:0 !important;
    padding:12px 14px !important;
    min-height:100%;
  }
  .bots-risk-inline .row:last-child{border-right:0 !important;}
  .bots-risk-inline .row .k{
    min-width:96px !important;
    white-space:nowrap;
  }
  .bots-risk-inline .row .in,
  .bots-risk-inline .row .seg,
  .bots-risk-inline .row .v{
    width:auto !important;
    flex:1 1 auto;
  }
  .bots-risk-save-cell .btn,
  .bots-actions-block .btn{
    width:auto;
  }
  .bot-grid{grid-template-columns:repeat(2, minmax(0, 1fr));}
}
@media (min-width: 1025px){
  .bot-grid{grid-template-columns:repeat(auto-fit, minmax(280px, 1fr));}
}
@media (min-width: 1700px){
  .bot-grid{grid-template-columns:repeat(5, minmax(0, 1fr));}
}

@media (min-width: 768px) and (max-width: 1024px){
  .bots-risk-inline{
    grid-template-columns:1fr 1fr 140px !important;
    grid-template-areas:
      "exchange exchange exchange"
      "risk stop save" !important;
  }
  .bots-risk-inline .row:nth-child(1){grid-area:exchange;}
  .bots-risk-inline .row:nth-child(2){grid-area:risk;}
  .bots-risk-inline .row:nth-child(3){grid-area:stop;}
  .bots-risk-inline .row:nth-child(4){grid-area:save;}
  .bots-risk-inline .row:nth-child(1){border-right:0 !important; border-bottom:1px solid var(--line, rgba(255,255,255,.08)) !important;}
  .bots-risk-inline .row:nth-child(2),
  .bots-risk-inline .row:nth-child(3){border-bottom:0 !important;}
}

@media (min-width: 768px) and (max-width: 1024px){
  .bots-risk-inline{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 120px !important;}
  .bots-risk-inline .row:nth-child(1) .seg{display:flex !important; width:100% !important; min-width:0 !important;}
  .bots-risk-inline .row:nth-child(1) .seg .seg-btn{flex:1 1 0 !important; min-width:0 !important; padding-left:8px !important; padding-right:8px !important;}
  .bots-risk-inline .row:nth-child(2),
  .bots-risk-inline .row:nth-child(3){min-width:0 !important;}
  .bots-risk-inline .row:nth-child(2) .in,
  .bots-risk-inline .row:nth-child(3) .in{min-width:0 !important; width:100% !important;}
}

#botsRiskSave{padding:6px 10px !important; font-size:10px !important;}

@media (min-width: 768px) and (max-width: 1024px){
  .bots-risk-inline .row:nth-child(2),
  .bots-risk-inline .row:nth-child(3){flex-direction:column !important; align-items:stretch !important; gap:6px !important;}
  .bots-risk-inline .row:nth-child(2) .k,
  .bots-risk-inline .row:nth-child(3) .k{min-width:0 !important; white-space:normal !important;}
  .bots-risk-save-cell{justify-content:center !important; align-items:center !important;}
  .bots-risk-save-cell .v{display:flex !important; justify-content:center !important; align-items:center !important;}
  #botsRiskSave{width:auto !important; min-width:86px !important; padding:6px 8px !important; font-size:10px !important;}
}

.bots-risk-save-cell{cursor:pointer !important;}
.bots-risk-save-cell .v{justify-content:center !important; text-align:center !important;}
#botsRiskSave{background:transparent !important; border-color:transparent !important; box-shadow:none !important; text-align:center !important;}

@media (max-width: 480px){
  html, body{overflow-x:hidden;}
  .app, .content, .grid, #pageGrid{max-width:100%; overflow-x:hidden;}
  .sidebar, .topbar, .card, .list, .row, .bot-grid, .bot-card, .space-list, .space-card{min-width:0 !important; max-width:100% !important;}
  .sb-nav{overflow-x:auto; overflow-y:hidden;}
  .sb-item{min-width:max-content;}
  .bots-top-wallets-card, .bots-balance, .bots-stats, .bots-risk-inline{min-width:0 !important; max-width:100% !important;}
  .bots-risk-inline .row, .bots-actions-block .row, .list .row{min-width:0 !important;}
  .bots-risk-inline .row .seg, .bots-risk-inline .row .in, .bots-risk-inline .row .v{min-width:0 !important; width:100% !important;}
  .bot-footer{flex-direction:column !important; align-items:stretch !important;}
  .bot-controls, .bot-actions{width:100% !important; justify-content:flex-start !important;}
  .bot-actions{flex-wrap:wrap !important;}
  .bot-actions .btn{max-width:100%;}
}

@media (max-width: 480px){
  .bot-grid{display:grid !important; grid-template-columns:1fr !important;}
  .bot-card{width:100% !important; min-width:0 !important; padding:12px 10px !important;}
  .space-list{display:grid !important; grid-template-columns:1fr !important; width:100% !important;}
  .space-card{min-width:0 !important; width:100% !important; box-sizing:border-box !important;}
  .bots-stats{grid-template-columns:1fr !important;}
  .bots-balance{grid-template-columns:1fr !important;}
  .bots-top-wallets-card{display:grid !important; grid-template-columns:1fr !important;}
  .bal-chip{width:100% !important; box-sizing:border-box !important;}
  .bot-title, .bot-meta, .space-title, .space-sub, .space-meta{overflow-wrap:anywhere;}
  .bot-actions{display:grid !important; grid-template-columns:auto auto 1fr !important; justify-content:start !important; width:100% !important;}
  .bot-toggle, .bot-stop-after{min-width:0 !important; white-space:normal !important;}
}

@media (max-width: 480px){
  .topbar, .topbar-left, .topbar-right, .sb-brand{min-width:0 !important;}
  .page-title, .page-subtitle, .sb-title{overflow-wrap:anywhere; word-break:break-word;}
  .bot-footer{display:flex !important; flex-direction:column !important; flex-wrap:wrap !important; align-items:stretch !important; justify-content:flex-start !important;}
  .bot-controls, .bot-actions{display:flex !important; flex-wrap:wrap !important; min-width:0 !important; max-width:100% !important;}
  .bot-actions{gap:6px !important;}
  .bot-meta.signal-long, .bot-meta.signal-short, .tpsl-chip{white-space:normal !important; max-width:100% !important;}
  .sb-item{min-width:0 !important;}
  .seg, .seg-btn, .dd-btn, .dd-list, .dd-item{min-width:0 !important; max-width:100% !important;}
  .seg{display:flex !important; flex-wrap:wrap !important;}
  .seg-btn{flex:1 1 calc(50% - 4px) !important; white-space:normal !important; text-align:center !important;}
}

@media (max-width: 480px){
  .sb-nav{
    display:grid !important;
    grid-template-columns:1fr 1fr !important;
    overflow-x:visible !important;
    gap:8px !important;
    width:100% !important;
  }
  .sb-item{
    white-space:normal !important;
    flex:initial !important;
    min-width:0 !important;
    width:100% !important;
    justify-content:center !important;
    text-align:center !important;
  }
}

/* Bots text alignment */
.bot-grid .row .k,
.bot-grid .row .v,
#spaceList,
.space-list,
.space-card,
.space-title,
.space-sub,
.space-meta{
  text-align:center;
}
.space-list{justify-content:center;}
.space-card{align-items:center;}

#pageTitle{text-align:center;}
#addSpaceBtn{display:inline-flex; align-items:center; justify-content:center;}
#spaceList + #spaceEmpty + #addSpaceBtn,
#addSpaceBtn{margin-left:auto; margin-right:auto;}

.topbar-left{width:100%;} 
#pageTitle{display:block; width:100%; text-align:center !important;}

@media (max-width: 480px){
  .bot-actions .btn{padding:8px 10px !important; font-size:12px !important; border-radius:10px !important;}
  .bot-actions .btn.secondary.bot-edit,
  .bot-actions .btn.secondary.bot-del,
  .bot-controls .btn.icon-only{width:36px !important; height:36px !important; padding:0 !important; font-size:14px !important;}
  .bot-toggle, .bot-stop-after{min-height:36px !important;}
}

@media (max-width: 480px){
  .bot-controls{display:none !important;}
  .bot-actions .bot-chart-mobile, .bot-actions .bot-report-mobile{display:inline-flex !important;}
}
@media (min-width: 481px){
  .bot-actions .bot-chart-mobile, .bot-actions .bot-report-mobile{display:none !important;}
}

@media (min-width: 768px){
  .space-title{font-weight:900 !important; margin-bottom:2px !important;}
}

@media (min-width: 768px){
  #spaceList .space-title,
  .list .row .k{font-weight:900 !important;}
  .list .row .k{margin-bottom:2px !important;}
}

.list .row .k{font-weight:900 !important;}
@media (min-width: 768px){
  #spaceList, .space-list, .space-card, .space-title, .space-sub, .space-meta{text-align:left !important;}
  .space-list{justify-content:flex-start !important;}
}

@media (min-width: 768px){
  #addSpaceBtn{margin-left:0 !important; margin-right:0 !important;}
}

.bot-card.in-trade .bot-edit{display:none !important;}

@media (min-width: 1025px) and (max-width: 1366px){
  .bot-grid{grid-template-columns:repeat(2, minmax(0, 1fr)) !important;}
}

.ai-result-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  padding:12px;
  border-radius:14px;
  margin-bottom:12px;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(255,255,255,.03);
}
.ai-result-head.is-long{border-color:rgba(34,197,94,.35); background:rgba(34,197,94,.08);}
.ai-result-head.is-short{border-color:rgba(248,113,113,.35); background:rgba(248,113,113,.08);}
.ai-result-head.is-wait{border-color:rgba(250,204,21,.28); background:rgba(250,204,21,.06);}
.ai-result-label{font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.08em;}
.ai-result-decision{font-size:24px; font-weight:900; line-height:1.1; margin-top:4px;}
.ai-result-metrics{display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end;}
.ai-chip{padding:6px 10px; border-radius:999px; border:1px solid rgba(255,255,255,.1); background:rgba(0,0,0,.18); font-size:12px; font-weight:700;}
@media (max-width: 768px){
  .ai-result-head{flex-direction:column;}
  .ai-result-metrics{justify-content:flex-start;}
}

.ai-confidence-block{
  margin:0 0 12px;
  padding:10px 12px;
  border-radius:12px;
  background:rgba(255,255,255,.03);
  border:1px solid rgba(255,255,255,.06);
}
.ai-confidence-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:8px;
  font-size:12px;
  color:var(--muted);
}
.ai-confidence-top strong{
  color:var(--text);
  font-size:13px;
}
.ai-confidence-bar{
  height:10px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  overflow:hidden;
}
.ai-confidence-bar span{
  display:block;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, #f59e0b 0%, #22c55e 100%);
}

#aiTraderResult .row,
#pageGrid .card:has(#aiAnalyzeBtn) .row{
  min-width:0;
}
#pageGrid .card:has(#aiAnalyzeBtn) .list{
  overflow:hidden;
}
#pageGrid .card:has(#aiAnalyzeBtn) .row .v{
  min-width:0;
}
@media (max-width: 1024px){
  #pageGrid .card:has(#aiAnalyzeBtn){
    border-radius:18px;
  }
  #pageGrid .card:has(#aiAnalyzeBtn) .row{
    flex-direction:column;
    align-items:stretch;
    gap:6px;
  }
  #pageGrid .card:has(#aiAnalyzeBtn) .row .k,
  #pageGrid .card:has(#aiAnalyzeBtn) .row .v{
    width:100%;
    min-width:0;
  }
  #pageGrid .card:has(#aiAnalyzeBtn) .seg{
    width:100%;
    display:flex;
    flex-wrap:wrap;
    gap:8px;
  }
  #pageGrid .card:has(#aiAnalyzeBtn) .seg-btn{
    flex:1 1 120px;
    text-align:center;
  }
  #aiAnalyzeBtn,
  #aiCreateBotBtn{
    min-height:40px;
  }
}
@media (max-width: 768px){
  #pageGrid .card:has(#aiAnalyzeBtn) .row .v[style*='display:flex']{
    flex-direction:column !important;
    align-items:stretch !important;
  }
  #aiAnalyzeBtn,
  #aiCreateBotBtn{
    width:100%;
  }
  .ai-chip{
    width:100%;
    text-align:center;
  }
  .ai-result-decision{
    font-size:22px;
  }
}

.bot-actions-close, .bot-actions-bottom{width:100% !important;}
.bot-actions-close{display:block !important;}
.bot-actions-close .bot-close-now{display:flex !important; width:100% !important; max-width:100% !important; box-sizing:border-box !important; justify-content:center !important;}
.bot-actions-bottom{display:grid !important; grid-template-columns:1fr 1fr !important; gap:8px !important; align-items:stretch !important;}
.bot-actions-bottom .bot-toggle, .bot-actions-bottom .bot-stop-after{width:100% !important; max-width:100% !important; box-sizing:border-box !important; justify-content:center !important;}

.bot-actions .bot-edit, .bot-actions .bot-del{width:28px !important; height:28px !important; padding:0 !important; display:inline-flex !important; align-items:center !important; justify-content:center !important; border-radius:999px !important;}
@media (max-width: 480px){
  .bot-actions .bot-edit, .bot-actions .bot-del{width:36px !important; height:36px !important; font-size:14px !important;}
}

.bot-actions .bot-edit, .bot-actions .bot-del{border:0 !important; background:transparent !important; opacity:.8 !important; color:var(--text) !important; font-size:14px !important;}
.bot-actions .bot-edit:hover, .bot-actions .bot-del:hover{opacity:1 !important;}

.bots-balance-explain{margin-bottom:12px; display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:12px;}
.bots-balance-explain-item{display:flex; flex-direction:column; align-items:flex-start; justify-content:flex-start;}
.bots-balance-explain .balance-label{margin-top:0 !important;}

.bots-balance-explain .q{background:rgba(255,255,255,.08); border-color:rgba(255,255,255,.12); font-weight:800;}

.bots-balance-explain .balance-label{display:flex; align-items:center; gap:6px; flex-wrap:wrap;}
.bots-balance-explain .q{position:relative;}
.bots-balance-explain .q::after{content:attr(data-tip); position:absolute; left:50%; top:calc(100% + 8px); transform:translateX(-50%); min-width:180px; max-width:240px; padding:8px 10px; border-radius:10px; background:#17191f; color:#fff; border:1px solid rgba(255,255,255,.10); box-shadow:var(--shadow); font-size:12px; line-height:1.35; font-weight:700; white-space:normal; opacity:0; pointer-events:none; z-index:80;}
.bots-balance-explain .q:hover::after,.bots-balance-explain .q:focus-visible::after{opacity:1;}

.exchange-unified-card{display:flex; flex-direction:column; gap:10px; padding:0; background:transparent; border:0; border-radius:0;}
.exchange-row-card{display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:12px; align-items:center; border:1px solid rgba(255,255,255,.06); border-radius:14px; padding:12px; background:rgba(255,255,255,.03);}
.exchange-row-main{min-width:0; display:flex; flex-direction:column; gap:4px;}
.exchange-row-side{display:flex; flex-direction:column; gap:6px; align-items:flex-start;}
.exchange-row-actions{display:flex; gap:8px; align-items:center; justify-content:flex-end;}
@media (max-width: 720px){.exchange-row-card{grid-template-columns:1fr;} .exchange-row-actions{justify-content:flex-start;} }
