:root{
  --bg:#080c10;
  --bg2:#0d1117;
  --bg3:#141b24;
  --border:#1e2a38;
  --accent:#00e5ff;
  --accent2:#ff6b35;
  --accent3:#7cfc00;
  --danger:#ff3b5c;
  --warn:#ffb800;
  --text:#e0eaf4;
  --muted:#8aa0b0;
  --card:#0f1924;
}

*{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

body{
  background:var(--bg);
  color:var(--text);
  font-family:'Space Mono',monospace;
  min-height:100vh;
  overflow-x:hidden;
}

body::before{
  content:'';
  position:fixed;
  inset:0;
  background-image:linear-gradient(rgb(0 229 255 / 2.5%) 1px,transparent 1px),linear-gradient(90deg,rgb(0 229 255 / 2.5%) 1px,transparent 1px);
  background-size:60px 60px;
  pointer-events:none;
  z-index:0;
}

.app{
  position:relative;
  z-index:1;
  max-width:2250px;
  margin:0 auto;
  padding:36px;
}

/* ── OPTIMIZER PANEL ── */
.opt-panel{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:27px;
}

.opt-header{
  display:flex;
  align-items:center;
  gap:15px;
  margin-bottom:21px;
}

.opt-title{
  font-family:Urbanist,sans-serif;
  font-size:18px;
  font-weight:700;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--muted);
  flex:1;
}

.opt-conn-dot{
  width:12px;
  height:12px;
  border-radius:50%;
  flex-shrink:0;
  transition:background .3s;
}

.opt-conn-dot.ok{
  background:var(--accent3);
  box-shadow:0 0 9px var(--accent3);
}
.opt-conn-dot.err{background:var(--danger);}
.opt-conn-dot.unknown{background:var(--muted);}

.opt-conn-label{
  font-size:20px;
  color:var(--muted);
}

.opt-controls{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:21px;
  flex-wrap:wrap;
}

.opt-toggle-wrap{
  display:flex;
  align-items:center;
  gap:12px;
  padding:9px 18px;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:12px;
}

.opt-toggle-label{
  font-size:17px;
  color:var(--muted);
}

.opt-query-btn{
  padding:11px 21px;
  background:rgb(0 229 255 / 7%);
  border:1px solid rgb(0 229 255 / 20%);
  border-radius:11px;
  color:var(--accent);
  font-family:'Space Mono',monospace;
  font-size:20px;
  font-weight:700;
  cursor:pointer;
  text-transform:uppercase;
  letter-spacing:0.8px;
  transition:all .2s;
}
.opt-query-btn:hover{background:rgb(0 229 255 / 15%);}

.opt-query-btn:disabled{
  opacity:0.35;
  cursor:not-allowed;
}

.opt-url-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:18px;
  font-size:17px;
}

.opt-url-label{
  color:var(--muted);
  white-space:nowrap;
}

.opt-url-input{
  flex:1;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:9px;
  color:var(--text);
  font-family:'Space Mono',monospace;
  font-size:17px;
  padding:8px 14px;
  outline:none;
  transition:border-color .2s;
}
.opt-url-input:focus{border-color:var(--accent);}

.opt-ping-btn{
  padding:8px 15px;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:9px;
  color:var(--muted);
  font-family:'Space Mono',monospace;
  font-size:18px;
  cursor:pointer;
  transition:all .2s;
  white-space:nowrap;
}

.opt-ping-btn:hover{
  border-color:var(--accent);
  color:var(--accent);
}

.opt-auto-apply-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:11px 0;
  border-top:1px solid var(--border);
  font-size:17px;
  margin-top:6px;
}

/* Recommendation display */
.opt-rec-panel{
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:14px;
  padding:18px;
  margin-top:15px;
}
.opt-rec-panel.hidden{display:none;}

.opt-rec-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:15px;
}

.opt-rec-title{
  font-family:Urbanist,sans-serif;
  font-size:17px;
  font-weight:700;
  letter-spacing:0.8px;
  text-transform:uppercase;
  color:var(--muted);
}

.opt-rec-time{
  font-size:18px;
  color:var(--muted);
}
.opt-conf-bar-wrap{margin-bottom:15px;}

.opt-conf-bar{
  height:6px;
  border-radius:3px;
  background:var(--bg);
  overflow:hidden;
  margin:5px 0;
}

.opt-conf-fill{
  height:100%;
  border-radius:3px;
  transition:width .5s,background .3s;
}

.opt-conf-labels{
  display:flex;
  justify-content:space-between;
  font-size:18px;
  color:var(--muted);
}

.opt-rationale{
  font-size:20px;
  color:var(--muted);
  font-style:italic;
  padding:11px 14px;
  background:var(--bg);
  border-radius:9px;
  border:1px solid var(--border);
  margin-bottom:15px;
  line-height:1.5;
}

.opt-changes-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.opt-change-item{
  padding:9px 12px;
  background:var(--bg);
  border-radius:9px;
  border:1px solid var(--border);
  font-size:20px;
}

.opt-change-field{
  color:var(--muted);
  margin-bottom:3px;
  font-size:18px;
  text-transform:uppercase;
  letter-spacing:0.8px;
}

.opt-change-val{
  display:flex;
  align-items:center;
  gap:8px;
}

.opt-change-from{
  color:var(--muted);
  text-decoration:line-through;
}

.opt-change-to{
  color:var(--accent3);
  font-weight:700;
}

.opt-change-arrow{
  color:var(--muted);
  font-size:18px;
}

.opt-no-changes{
  font-size:20px;
  color:var(--muted);
  text-align:center;
  padding:12px;
}

.opt-apply-btn{
  width:100%;
  margin-top:15px;
  padding:12px;
  background:rgb(124 252 0 / 8%);
  border:1px solid rgb(124 252 0 / 20%);
  border-radius:11px;
  color:var(--accent3);
  font-family:'Space Mono',monospace;
  font-size:20px;
  font-weight:700;
  cursor:pointer;
  text-transform:uppercase;
  letter-spacing:1px;
  transition:all .2s;
}
.opt-apply-btn:hover{background:rgb(124 252 0 / 15%);}

.opt-apply-btn:disabled{
  opacity:0.35;
  cursor:not-allowed;
}

.opt-status-row{
  font-size:20px;
  color:var(--muted);
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:12px;
}
.opt-status-ok{color:var(--accent3);}
.opt-status-err{color:var(--danger);}

/* History list */
.opt-history{
  max-height:180px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:12px;
}

.opt-hist-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:6px 12px;
  background:var(--bg);
  border-radius:8px;
  font-size:18px;
  color:var(--muted);
}
.opt-hist-row.ok-row{border-left:3px solid var(--accent3);}
.opt-hist-row.err-row{border-left:3px solid var(--danger);}
.opt-hist-time{white-space:nowrap;}

.opt-hist-msg{
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

/* ── POSITION BROWSER ── */
.pos-browser-modal{
  max-width:1290px;
  max-height:calc(100vh - 60px);
  padding:24px 30px;
  display:flex;
  flex-direction:column;
}

.pos-browser-modal .modal-logo{margin-bottom:18px;}

.pos-search-filter-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:12px;
}

.pos-search-input-wrap{
  position:relative;
  flex:1;
  min-width:0;
}

.pos-search-row{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:18px;
}

.pos-search-input{
  width:100%;
  box-sizing:border-box;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:12px;
  color:var(--text);
  font-family:'Space Mono',monospace;
  font-size:17px;
  padding:12px 18px;
  outline:none;
  transition:border-color .2s;
}
.pos-search-input:focus{border-color:var(--accent);}

.pos-scan-btn{
  padding:12px 21px;
  background:rgb(0 229 255 / 7%);
  border:1px solid rgb(0 229 255 / 20%);
  border-radius:12px;
  color:var(--accent);
  font-family:'Space Mono',monospace;
  font-size:20px;
  cursor:pointer;
  white-space:nowrap;
  transition:all .2s;
}
.pos-scan-btn:hover{background:rgb(0 229 255 / 15%);}

.pos-scan-btn:disabled{
  opacity:0.4;
  cursor:not-allowed;
}

.pos-list{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-height:90px;
  max-height:285px;
  overflow-y:auto;
}

/* Inside the LP-browser modal the pos-list flex-fills the remaining
   viewport space so the scrollbar is a true fallback: it only appears
   when the list genuinely can't fit the available height. */
.pos-browser-modal .pos-list{
  flex:1 1 auto;
  max-height:none;
  min-height:120px;
}

.pos-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:8px 16px;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:10px;
  cursor:pointer;
  transition:all .2s;
  font-size:15px;
}

.pos-row:hover{
  border-color:var(--accent);
  background:rgb(0 229 255 / 3%);
}

.pos-row.selected{
  border-color:var(--accent);
  background:rgb(0 229 255 / 6%);
}

.pos-row.active-pos{
  border-color:var(--accent3);
  background:rgb(124 252 0 / 4%);
}

.pos-row-idx{
  min-width:30px;
  height:28px;
  padding:0 7px;
  border-radius:7px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:15px;
  font-weight:700;
  flex-shrink:0;
  background:var(--bg);
  color:var(--muted);
  border:1px solid var(--border);
}

.pos-row-idx.active-idx{
  background:rgb(124 252 0 / 10%);
  color:var(--accent3);
  border-color:rgb(124 252 0 / 30%);
}

.pos-row-body{
  flex:1;
  min-width:0;
}

.pos-row-title{
  font-weight:700;
  color:var(--text);
  margin-bottom:1px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.pos-row-meta{
  font-size:13px;
  color:var(--muted);
}

.pos-row-status{
  font-size:16px;
  font-weight:700;
  flex-shrink:0;
}
.pos-row-status.in{color:var(--accent3);}
.pos-row-status.out{color:var(--danger);}

.pos-row-status.closed{
  background:rgb(255 255 255 / 15%);
  color:#aaa;
  border-radius:15px;
  padding:3px 15px;
  font-size:17px;
}

.pos-type-chip{
  padding:1px 9px;
  border-radius:5px;
  font-size:18px;
  font-weight:700;
  text-transform:uppercase;
  flex-shrink:0;
}

.pos-type-chip.nft{
  background:rgb(196 113 237 / 15%);
  color:#c471ed;
  border:1px solid rgb(196 113 237 / 25%);
}

.pos-type-chip.erc20{
  background:rgb(255 107 53 / 12%);
  color:var(--accent2);
  border:1px solid rgb(255 107 53 / 25%);
}

.pos-pagination{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-top:auto;
  padding-top:15px;
  font-size:20px;
  color:var(--muted);
}

.pos-pag-btn{
  padding:8px 18px;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:9px;
  color:var(--muted);
  font-family:'Space Mono',monospace;
  font-size:20px;
  cursor:pointer;
  transition:all .2s;
}

.pos-pag-btn:hover:not(:disabled){
  border-color:var(--accent);
  color:var(--accent);
}

.pos-pag-btn:disabled{
  opacity:0.3;
  cursor:not-allowed;
}

.pos-empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:48px;
  color:var(--muted);
  font-size:17px;
  gap:12px;
}

.pos-empty-icon{
  font-size:42px;
  opacity:0.4;
}

.ws-pos-summary{
  display:flex;
  align-items:center;
  gap:9px;
  padding:5px 12px;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:8px;
  font-size:18px;
  cursor:pointer;
  transition:all .2s;
}

.ws-pos-summary:hover{
  border-color:var(--accent);
  color:var(--accent);
}


.ws-reveal-btn{
  height:53px;
  padding:0 12px;
  background:rgb(0 229 255 / 7%);
  border:1px solid rgb(0 229 255 / 20%);
  border-radius:8px;
  color:var(--accent);
  font-family:'Space Mono',monospace;
  font-size:18px;
  cursor:pointer;
  transition:all .2s;
  white-space:nowrap;
}

.ws-reveal-btn:hover{
  background:rgb(0 229 255 / 15%);
  border-color:var(--accent);
}

.realized-gains-row{
  margin-top:9px;
  border-top:1px solid var(--border);
  padding-top:8px;
}

.realized-gains-label{
  font-size:18px;
  color:var(--accent);
  cursor:pointer;
  transition:color .2s;
  text-decoration:none;
}

.realized-gains-label:hover {
  color: var(--text);
  text-decoration: underline;
}

.realized-gains-input-wrap{
  display:none;
  align-items:center;
  gap:6px;
  margin-top:6px;
}
.realized-gains-input-wrap.open{display:flex;}

.realized-gains-input{
  width:135px;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--text);
  font-family:'Space Mono',monospace;
  font-size:20px;
  padding:5px 9px;
  outline:none;
}
.realized-gains-input:focus{border-color:var(--accent);}

.realized-gains-save{
  padding:5px 12px;
  background:rgb(0 229 255 / 7%);
  border:1px solid rgb(0 229 255 / 20%);
  border-radius:8px;
  color:var(--accent);
  font-family:'Space Mono',monospace;
  font-size:18px;
  cursor:pointer;
}
.realized-gains-save:hover{background:rgb(0 229 255 / 15%);}

.save-range-btn{
  padding:5px 12px;
  background:rgb(0 229 255 / 7%);
  border:1px solid rgb(0 229 255 / 20%);
  border-radius:8px;
  color:var(--accent);
  font-family:'Space Mono',monospace;
  font-size:18px;
  cursor:pointer;
  margin-left:6px;
}
.save-range-btn:hover{background:rgb(0 229 255 / 15%);}


.pos-browser-btn{
  height:53px;
  padding:0 15px;
  background:rgb(0 229 255 / 7%);
  border:1px solid rgb(0 229 255 / 20%);
  border-radius:8px;
  font-family:'Space Mono',monospace;
  font-size:18px;
  color:var(--accent);
  cursor:pointer;
  transition:all .2s;
  display:flex;
  align-items:center;
  gap:9px;
}

.pos-browser-btn:disabled{
  opacity:0.4;
  cursor:default;
  pointer-events:none;
}

.pos-browser-btn:hover:not(:disabled){
  background:rgb(0 229 255 / 15%);
}

/* ── MODAL ── */
.modal-overlay{
  position:fixed;
  inset:0;
  background:rgb(0 0 0 / 88%);
  backdrop-filter:blur(9px);
  z-index:1000;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:30px;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.modal-overlay.hidden{display:none;}

/*
 * Lock page scroll while any modal or disclosure overlay is open so the
 * user can't accidentally scroll the app behind the dialog.  Uses :has()
 * (Chrome 105+, Safari 15.4+, Firefox 121+) — no JS body-lock needed.
 */
body:has(.modal-overlay:not(.hidden)),
body:has(.disclaimer-overlay:not(.hidden)),
body:has(.\39 mm-pos-mgr-modal-overlay){
  overflow:hidden;
}

.modal{
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:24px;
  width:100%;
  max-width:870px;
  padding:45px;
  position:relative;
  margin:auto;
  flex-shrink:0;
  overflow-x:hidden;
}

.modal-logo{
  display:flex;
  align-items:center;
  gap:18px;
  margin-bottom:33px;
}

.modal-logo-icon{
  height:57px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-family:Urbanist,sans-serif;
  font-weight:800;
  font-size:23px;
}

.modal-logo h2{
  font-family:Urbanist,sans-serif;
  font-size:27px;
  font-weight:800;
  color:var(--accent);
}

.modal-logo p{
  font-size:20px;
  color:var(--muted);
  letter-spacing:1px;
  text-transform:uppercase;
}

.modal-tabs{
  display:flex;
  gap:9px;
  margin-bottom:33px;
}

.modal-tab{
  flex:1;
  padding:14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--bg3);
  color:var(--muted);
  font-family:'Space Mono',monospace;
  font-size:20px;
  cursor:pointer;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:0.8px;
  transition:all .2s;
}

.modal-tab.active{
  border-color:var(--accent);
  color:var(--accent);
  background:rgb(0 229 255 / 7%);
}
.modal-tab:hover:not(.active){color:var(--text);}
.modal-panel{display:none;}.modal-panel.active{display:block;}
.modal-field{margin-bottom:21px;}

.modal-field label{
  display:block;
  font-size:20px;
  color:var(--muted);
  letter-spacing:1px;
  text-transform:uppercase;
  margin-bottom:9px;
}

.modal-input{
  width:100%;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:12px;
  color:var(--text);
  font-family:'Space Mono',monospace;
  font-size:18px;
  padding:15px 18px;
  outline:none;
  transition:border-color .2s;
  resize:none;
}
.modal-input:focus{border-color:var(--accent);}

.modal-btn{
  width:100%;
  padding:17px;
  border-radius:14px;
  border:none;
  font-family:'Space Mono',monospace;
  font-size:18px;
  font-weight:700;
  cursor:pointer;
  text-transform:uppercase;
  letter-spacing:1px;
  margin-top:6px;
  transition:all .2s;
}

.modal-btn:disabled{
  opacity:0.35;
  cursor:not-allowed;
  pointer-events:none;
}

.modal-btn.primary{
  background:linear-gradient(135deg,var(--accent),#06f);
  color:#000;
}
.modal-btn.primary:hover{opacity:0.9;}

.modal-btn.secondary{
  background:var(--bg3);
  border:1px solid var(--border);
  color:var(--muted);
}

.modal-btn.secondary:hover{
  border-color:var(--accent);
  color:var(--accent);
}

.modal-divider{
  height:1px;
  background:var(--border);
  margin:24px 0;
}

.gen-result{
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:12px;
  padding:21px;
  margin-top:18px;
  font-size:17px;
}

.grl{
  font-size:18px;
  color:var(--muted);
  letter-spacing:1px;
  text-transform:uppercase;
  margin-bottom:6px;
}

.grv{
  color:var(--text);
  word-break:break-all;
  line-height:1.5;
}
.grv.sm{font-size:20px;}

.warn-note{
  color:var(--warn);
  font-size:20px;
  margin-top:12px;
  line-height:1.5;
}

.copy-btn{
  background:none;
  border:1px solid var(--border);
  border-radius:8px;
  color:var(--muted);
  font-family:'Space Mono',monospace;
  font-size:18px;
  padding:3px 11px;
  cursor:pointer;
  margin-left:9px;
  transition:all .2s;
}

.copy-btn:hover{
  border-color:var(--accent);
  color:var(--accent);
}

.modal-warning{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:15px 18px;
  background:rgb(255 59 92 / 7%);
  border:1px solid rgb(255 59 92 / 20%);
  border-radius:12px;
  font-size:20px;
  color:var(--danger);
  margin-bottom:21px;
  line-height:1.5;
}

.modal-info{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:15px 18px;
  background:rgb(0 229 255 / 5%);
  border:1px solid rgb(0 229 255 / 15%);
  border-radius:12px;
  font-size:20px;
  color:var(--accent);
  margin-bottom:21px;
  line-height:1.5;
}

/* ── HEADER ── */
header{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:15px;
  margin-bottom:6px;
  padding-bottom:9px;
  border-bottom:1px solid var(--border);
}

.logo{
  display:flex;
  align-items:center;
  gap:21px;
}

.logo-icon{
  height:63px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  cursor:pointer;
}

.logo-text h1{
  font-family:Rye,Urbanist,sans-serif;
  font-size:30px;
  font-weight:400;
  letter-spacing:0.8px;
}

.logo-text p{
  font-size:17px;
  color:var(--muted);
  letter-spacing:1px;
  text-transform:uppercase;
}

.pchain-link{
  height:63px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-decoration:none;
  cursor:pointer;
}

.header-right{
  display:flex;
  align-items:center;
  gap:15px;
  position:relative;
}

.header-middle{
  display:flex;
  align-items:center;
  gap:15px;
  margin-left:auto;
}

.status-pill{
  display:flex;
  align-items:center;
  gap:12px;
  height:53px;
  padding:0 21px;
  border-radius:1499px;
  font-size:17px;
  font-weight:700;
  letter-spacing:0.8px;
  text-transform:uppercase;
}

.status-pill.active{
  background:rgb(124 252 0 / 10%);
  color:var(--accent3);
  border:1px solid rgb(124 252 0 / 20%);
}

.status-pill.warning{
  background:rgb(255 184 0 / 10%);
  color:var(--warn);
  border:1px solid rgb(255 184 0 / 20%);
}

.status-pill.danger{
  background:rgb(255 59 92 / 10%);
  color:var(--danger);
  border:1px solid rgb(255 59 92 / 20%);
}

.chain-badge{
  padding:9px 18px;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:9px;
  font-size:17px;
  color:var(--muted);
}

/* ── HISTORY TABLES ── */
.hist-table{
  width:100%;
  border-collapse:collapse;
  font-size:17px;
}

.hist-table th{
  text-align:left;
  padding:9px 12px;
  color:var(--muted);
  border-bottom:1px solid var(--border);
  font-size:18px;
  text-transform:uppercase;
  letter-spacing:0.8px;
}

.hist-table th.\39 mm-pos-mgr-text-right{
  text-align:right;
}

.hist-table td{
  padding:8px 12px;
  border-bottom:1px solid rgb(30 42 56 / 40%);
  color:var(--text);
}
.hist-table td.pos{color:var(--accent3);}.hist-table td.neg{color:var(--danger);}

/* Every header and cell stays on one line except the Routed Via
   cell (.hist-via-cell), which is allowed to wrap when long
   aggregator names like "NineMM_V3,NineMM_V3,NineMM_V3 (corrective)"
   would otherwise overflow the card width. The TIME cell is still
   two lines because its template puts <br> between the UTC and
   local spans — nowrap only prevents unintended wraps. */
.hist-table th,
.hist-table td{
  white-space:nowrap;
}

.hist-table td.hist-via-cell{
  white-space:normal;
  overflow-wrap:anywhere;
}

/* Padding rows added to short pages so every page is the same
   height as a full page. Cells are non-breaking spaces; opacity 0
   hides them completely while preserving row height. */
.hist-table tr.hist-pad-row td{
  opacity:0;
}

/* Keep both history cards (Per-Day P&L and Rebalance Events) at the
   same minimum height so the Rebalance card does not visually shrink
   on its last page, where padded rows can render slightly shorter
   than data rows (two-line TIME cell vs nbsp padding). Grid stretch
   on .row.c2-hist keeps the two cards aligned once the floor is set. */
.row.c2-hist .card{
  min-height:743px;
}

.help-tip{
  display:inline-block;
  width:24px;
  height:24px;
  line-height:24px;
  text-align:center;
  font-size:15px;
  border-radius:50%;
  background:rgb(255 255 255 / 10%);
  color:var(--muted);
  text-transform:none;
  cursor:help;
  margin-left:9px;
  vertical-align:middle;
  padding-left:1px;
  padding-bottom:1px;
}

.help-tip:hover{
  color:var(--accent);
}

/* Wide variant for multi-character labels (e.g. "Stats"). Keeps the
   same accent-on-hover and cursor:help semantics, but expands from a
   fixed 24px circle into a pill that grows with its text. */
.help-tip.help-tip-wide{
  width:auto;
  height:auto;
  line-height:1;
  padding:6px 12px;
  border-radius:12px;
  font-size:13px;
  letter-spacing:0.5px;
  text-transform:uppercase;
}

.help-tip.help-tip-warn{
  background:rgb(255 59 92 / 15%);
  color:var(--danger);
}

.hwbtn{
  height:53px;
  padding:0 15px;
  background:rgb(0 229 255 / 7%);
  border:1px solid rgb(0 229 255 / 20%);
  border-radius:8px;
  font-family:'Space Mono',monospace;
  font-size:18px;
  color:var(--accent);
  cursor:pointer;
  transition:all .2s;
  display:flex;
  align-items:center;
  gap:9px;
}

.hwbtn:hover{
  background:rgb(0 229 255 / 15%);
}

.dot{
  width:11px;
  height:11px;
  border-radius:50%;
  animation:blink 2s infinite;
}
.dot.green{background:var(--accent3);}.dot.yellow{background:var(--warn);}.dot.red{background:var(--danger);}

@keyframes blink{0%,100%{opacity:1;}50%{opacity:0.4;}}

/* ── WALLET STRIP ── */
.wallet-strip-row{
  display:flex;
  gap:12px;
  margin-bottom:21px;
}

.wallet-strip{
  display:flex;
  align-items:center;
  padding:15px 21px;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:12px;
  font-size:20px;
  color:var(--muted);
  flex-wrap:wrap;
  gap:12px;
  flex:1;
}

.ws-addr{
  color:var(--muted);
  font-weight:700;
}

.ws-badge{
  height:53px;
  display:inline-flex;
  align-items:center;
  padding:0 12px;
  border-radius:1499px;
  font-size:14px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.8px;
  margin-left:auto;
}

.ws-badge.gen{
  background:rgb(0 229 255 / 10%);
  color:var(--accent);
  border:1px solid rgb(0 229 255 / 20%);
}

.ws-badge.imp{
  background:rgb(124 252 0 / 10%);
  color:var(--accent3);
  border:1px solid rgb(124 252 0 / 20%);
}

.ws-badge.none{
  background:rgb(255 59 92 / 10%);
  color:var(--danger);
  border:1px solid rgb(255 59 92 / 20%);
}

/* position token type badge */
.pt-badge{
  padding:3px 12px;
  border-radius:6px;
  font-size:18px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.8px;
}

.pt-badge.nft{
  background:rgb(196 113 237 / 12%);
  color:#c471ed;
  border:1px solid rgb(196 113 237 / 25%);
}

.pt-badge.erc20{
  background:rgb(247 151 30 / 12%);
  color:var(--accent2);
  border:1px solid rgb(247 151 30 / 25%);
}

/* ── KPI ── */
.kpi-grid{
  display:grid;
  grid-template-columns:2fr 1.5fr 2fr;
  gap:12px;
  margin-bottom:21px;
}

.kpi-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:20px;
  position:relative;
  overflow:hidden;
  transition:border-color .2s;
}
.kpi-card:hover{border-color:var(--accent);}

.kpi-card::before{
  content:'';
  position:absolute;
  top:0;
  left:0;
  right:0;
  height:3px;
}
.kpi-card.pos::before{background:linear-gradient(90deg,var(--accent3),transparent);}
.kpi-card.neg::before{background:linear-gradient(90deg,var(--danger),transparent);}
.kpi-card.neu::before{background:linear-gradient(90deg,var(--accent),transparent);}
.kpi-card.wrn::before{background:linear-gradient(90deg,var(--warn),transparent);}
.kpi-card.dbl::before{background:linear-gradient(90deg,#c471ed,transparent);}

.kpi-label{
  font-size:18px;
  color:var(--muted);
  letter-spacing:2px;
  text-transform:uppercase;
  margin-bottom:9px;
}

.kpi-value{
  font-family:Urbanist,sans-serif;
  font-size:27px;
  font-weight:700;
  line-height:1;
  margin-bottom:6px;
}
.kpi-value.pos{color:var(--accent3);}.kpi-value.neg{color:var(--danger);}
.kpi-value.neu{color:var(--text);}.kpi-value.wrn{color:var(--warn);}
.kpi-value.dbl{color:#c471ed;}

.kpi-sub{
  font-size:18px;
  font-family:Urbanist,sans-serif;
  color:var(--muted);
}

/* ── CARD ── */
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:27px;
  min-width:0;
}

.card:has(.pos-pagination){
  display:flex;
  flex-direction:column;
}

.card-title{
  font-family:Urbanist,sans-serif;
  font-size:24px;
  font-weight:700;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:21px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.tag{
  color:var(--accent);
  font-size:20px;
  font-family:'Space Mono',monospace;
  font-weight:400;
}

.row{
  display:grid;
  gap:18px;
  margin-bottom:18px;
}
.row.c3{grid-template-columns:1fr 1fr 540px;}
.row.c2{grid-template-columns:1fr 1fr;}
.row.c2-hist{grid-template-columns:2fr 3fr;}
.row.c1{grid-template-columns:1fr;}

/* ── RANGE MONITOR ── */
.range-status-banner{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:15px;
  padding:12px 24px;
  border-radius:12px;
  margin-bottom:20px;
  font-size:17px;
  font-weight:700;
  letter-spacing:1px;
  text-transform:uppercase;
}

.range-status-banner.in{
  background:rgb(124 252 0 / 7%);
  border:1px solid rgb(124 252 0 / 20%);
  color:var(--accent3);
}

.range-status-banner.out{
  background:rgb(255 59 92 / 7%);
  border:1px solid rgb(255 59 92 / 30%);
  color:var(--danger);
  animation:flash 1.5s infinite;
}

.range-status-banner.wait{
  background:rgb(255 184 0 / 7%);
  border:1px solid rgb(255 184 0 / 30%);
  color:var(--warn);
}

.range-status-banner.dbl{
  background:rgb(196 113 237 / 7%);
  border:1px solid rgb(196 113 237 / 30%);
  color:#c471ed;
  animation:flash2 1.5s infinite;
}

.range-status-banner.residual{
  background:rgb(255 184 0 / 7%);
  border:1px solid rgb(255 184 0 / 30%);
  color:var(--warn);
  animation:flash3 1.5s infinite;
}

@keyframes flash{0%,100%{border-color:rgb(255 59 92 / 20%);}50%{border-color:rgb(255 59 92 / 80%);}}

@keyframes flash2{0%,100%{border-color:rgb(196 113 237 / 20%);}50%{border-color:rgb(196 113 237 / 80%);}}

@keyframes flash3{0%,100%{border-color:rgb(255 184 0 / 20%);}50%{border-color:rgb(255 184 0 / 80%);}}

.range-visual{
  position:relative;
  height:132px;
  margin:23px 0 33px;
  overflow:hidden;
}

.range-track{
  position:absolute;
  top:50%;
  left:0;
  right:0;
  height:8px;
  background:var(--bg3);
  border-radius:5px;
  transform:translateY(-50%);
}

.range-active{
  position:absolute;
  top:50%;
  height:8px;
  background:linear-gradient(90deg,var(--accent),var(--accent3));
  border-radius:5px;
  transform:translateY(-50%);
  transition:all .4s;
}

.rhandle{
  position:absolute;
  top:50%;
  transform:translate(-50%,-50%);
  width:18px;
  height:18px;
  border-radius:50%;
  background:var(--bg);
  border:3px solid var(--accent);
  box-shadow:0 0 12px rgb(0 229 255 / 40%);
}

.rhandle.r{
  border-color:var(--accent3);
  box-shadow:0 0 12px rgb(124 252 0 / 40%);
}

.price-marker{
  position:absolute;
  top:50%;
  transform:translate(-50%,-50%);
  z-index:10;
  visibility:hidden;
}

.pline{
  width:3px;
  height:45px;
  background:var(--accent2);
  box-shadow:0 0 11px var(--accent2);
  margin:0 auto;
  position:relative;
  top:-23px;
}

.rlabel{
  position:absolute;
  bottom:3px;
  font-size:18px;
  color:var(--muted);
  transform:translateX(-50%);
  white-space:nowrap;
}

.plabel{
  position:absolute;
  top:-48px;
  font-size:18px;
  color:var(--accent2);
  transform:translateX(-50%);
  white-space:nowrap;
  font-weight:700;
}

.comp-bar{
  height:9px;
  border-radius:5px;
  background:var(--bg3);
  overflow:hidden;
  display:flex;
  margin:14px 0 8px;
}

.comp0{
  background:var(--accent);
  transition:width .4s;
}

.comp1{
  background:var(--accent2);
  transition:width .4s;
}

.comp-labels{
  display:flex;
  justify-content:space-between;
  font-size:20px;
  color:var(--muted);
}

.stat-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}

.stat-item{
  padding:12px;
  background:var(--bg3);
  border-radius:11px;
  border:1px solid var(--border);
}

.stat-label{
  font-size:18px;
  color:var(--muted);
  letter-spacing:1px;
  text-transform:uppercase;
  margin-bottom:5px;
}

.stat-val{
  font-size:17px;
  font-weight:700;
  color:var(--text);
}
.stat-val.acc{color:var(--accent);}

/* ── ERC20 POSITION LIST ── */
.erc20-pos-list{
  max-height:180px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:6px;
  margin-top:9px;
}

.erc20-pos-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:9px 14px;
  background:var(--bg3);
  border-radius:9px;
  border:1px solid var(--border);
  font-size:20px;
}

.erc20-pos-row.active-pos{
  border-color:var(--accent);
  background:rgb(0 229 255 / 4%);
}

.erc20-pos-bal{
  color:var(--accent3);
  font-weight:700;
  flex:1;
}

.erc20-pos-range{
  color:var(--muted);
  font-size:18px;
}

/* ── BOT CONFIG ── */
.cfg-block{
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:15px;
  padding:20px;
  margin-bottom:15px;
}

.cfg-title{
  font-family:Urbanist,sans-serif;
  font-size:20px;
  font-weight:700;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:15px;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.live-badge{
  background:rgb(124 252 0 / 10%);
  color:var(--accent3);
  border:1px solid rgb(124 252 0 / 20%);
  border-radius:1499px;
  height:53px;
  display:inline-flex;
  align-items:center;
  padding:0 15px;
  font-size:18px;
  font-family:'Space Mono',monospace;
}

.warn-badge{
  background:rgb(255 184 0 / 10%);
  color:var(--warn);
  border:1px solid rgb(255 184 0 / 20%);
  border-radius:6px;
  padding:3px 11px;
  font-size:18px;
  font-family:'Space Mono',monospace;
}

.dbl-badge{
  background:rgb(196 113 237 / 10%);
  color:#c471ed;
  border:1px solid rgb(196 113 237 / 20%);
  border-radius:6px;
  padding:3px 11px;
  font-size:18px;
  font-family:'Space Mono',monospace;
}

.active-trigger-row{
  display:flex;
  align-items:center;
  gap:12px;
  padding:11px 17px;
  background:rgb(0 229 255 / 4%);
  border:1px solid rgb(0 229 255 / 12%);
  border-radius:11px;
  margin-bottom:15px;
  font-size:21px;
}
.at-label{color:var(--muted);}

.at-value{
  color:var(--accent);
  font-weight:700;
  flex:1;
}

.ttype-row{
  display:flex;
  gap:8px;
  margin-bottom:15px;
}

.ttype-btn{
  flex:1;
  padding:9px 3px;
  border-radius:9px;
  border:1px solid var(--border);
  background:var(--bg);
  color:var(--muted);
  font-family:'Space Mono',monospace;
  font-size:18px;
  cursor:pointer;
  text-align:center;
  transition:all .2s;
  text-transform:uppercase;
  letter-spacing:0.8px;
}

.ttype-btn.active{
  border-color:var(--accent);
  color:var(--accent);
  background:rgb(0 229 255 / 7%);
}
.ttype-btn:hover:not(.active){color:var(--text);}

.prow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:17px;
  padding:6px 9px;
  margin-bottom:0;
  border-radius:5px;
}
.prow:nth-child(odd){background:rgb(255 255 255 / 3%);}
.prow:hover{background:rgb(255 255 255 / 7%);}
.prow:last-child{margin-bottom:0;}
.plbl{color:var(--muted);}

.pinput{
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:9px;
  color:var(--text);
  font-family:'Space Mono',monospace;
  font-size:18px;
  font-weight:700;
  padding:6px 12px;
  text-align:left;
  outline:none;
  transition:border-color .2s;
}
.pinput:focus{border-color:var(--accent);}

.pinput.w55 {
  width: 90px;
  padding-left: 15px;
  padding-right: 0;
  margin-right: 0;
}

.pinput.w70 {
  width: 113px;
  padding-left: 15px;
  padding-right: 0;
  margin-right: 0;
}

.pinput.w100 {
  width: 158px;
  padding-left: 15px;
  padding-right: 0;
  margin-right: 0;
}

.pinput.full{
  width:100%;
  margin-top:6px;
  text-align:left;
}

.punit{
  color:var(--muted);
  font-size:20px;
  min-width:30px;
}

.pcol{
  display:flex;
  flex-direction:column;
  font-size:17px;
  margin-bottom:12px;
}

/* ── RPC combo input ── */

.rpc-combo{
  position:relative;
  display:flex;
  align-items:stretch;
}

.rpc-combo-input{
  flex:1;
  border-top-right-radius:0;
  border-bottom-right-radius:0;
}

.rpc-combo-toggle{
  background:var(--bg3);
  border:1px solid var(--border);
  border-left:0;
  border-radius:0 9px 9px 0;
  color:var(--muted);
  cursor:pointer;
  font-size:15px;
  padding:0 12px;
  transition:background .2s;
}

.rpc-combo-toggle:hover{
  background:var(--border);
}

.rpc-combo-list{
  display:none;
  position:absolute;
  top:100%;
  left:0;
  right:0;
  list-style:none;
  background:var(--bg2);
  border:1px solid var(--border);
  border-radius:0 0 9px 9px;
  z-index:20;
  max-height:270px;
  overflow-y:auto;
}

.rpc-combo-list.open{
  display:block;
}

.rpc-combo-list li{
  padding:12px 15px;
  font-size:18px;
  color:var(--text);
  cursor:pointer;
  transition:background .15s;
}

.rpc-combo-list li:hover{
  background:var(--bg3);
}

/* Token type selector */
.pos-type-row{
  display:flex;
  gap:9px;
  margin-bottom:15px;
}

.pos-type-btn{
  flex:1;
  padding:11px 6px;
  border-radius:11px;
  border:1px solid var(--border);
  background:var(--bg);
  color:var(--muted);
  font-family:'Space Mono',monospace;
  font-size:20px;
  cursor:pointer;
  text-align:center;
  transition:all .2s;
}

.pos-type-btn.active-nft{
  border-color:#c471ed;
  color:#c471ed;
  background:rgb(196 113 237 / 8%);
}

.pos-type-btn.active-erc{
  border-color:var(--accent2);
  color:var(--accent2);
  background:rgb(255 107 53 / 8%);
}
.pos-type-btn:hover:not(.active-nft, .active-erc){color:var(--text);}

/* Throttle */
.throttle-section{margin-top:12px;}

.throttle-bar{
  height:8px;
  border-radius:5px;
  background:var(--bg);
  overflow:hidden;
  margin:6px 0;
}

.throttle-fill{
  height:100%;
  border-radius:5px;
  transition:width .4s,background .4s;
}

.throttle-row{
  display:flex;
  justify-content:space-between;
  font-size:18px;
  color:var(--muted);
}

/* Doubling mode status panel */
.dbl-panel{
  padding:15px 18px;
  background:rgb(196 113 237 / 6%);
  border:1px solid rgb(196 113 237 / 20%);
  border-radius:12px;
  margin-top:12px;
}
.dbl-panel.hidden{display:none;}

.dbl-title{
  font-size:20px;
  font-weight:700;
  color:#c471ed;
  margin-bottom:9px;
  display:flex;
  align-items:center;
  gap:9px;
}

.dbl-row{
  display:flex;
  justify-content:space-between;
  font-size:20px;
  margin-bottom:5px;
}
.dbl-key{color:var(--muted);}

.dbl-val{
  color:#c471ed;
  font-weight:700;
}

.countdown{
  font-family:Urbanist,sans-serif;
  font-size:27px;
  font-weight:700;
  color:#c471ed;
  text-align:center;
  margin:12px 0 6px;
  letter-spacing:3px;
}
.countdown.ok{color:var(--accent3);}

.countdown-label{
  font-size:18px;
  color:var(--muted);
  text-align:center;
}

.apply-btn{
  width:100%;
  margin-top:15px;
  padding:12px;
  background:rgb(0 229 255 / 7%);
  border:1px solid rgb(0 229 255 / 20%);
  border-radius:11px;
  color:var(--accent);
  font-family:'Space Mono',monospace;
  font-size:20px;
  font-weight:700;
  cursor:pointer;
  text-transform:uppercase;
  letter-spacing:1px;
  transition:all .2s;
}
.apply-btn:hover:not(:disabled){background:rgb(0 229 255 / 14%);}

.apply-btn:disabled{
  opacity:0.35;
  cursor:default;
}

.apply-btn.saved{
  border-color:var(--accent3);
  color:var(--accent3);
  background:rgb(124 252 0 / 7%);
}

.config-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:11px 0;
  border-bottom:1px solid var(--border);
  font-size:17px;
}
.config-row:last-child{border-bottom:none;}
.ck{color:var(--muted);}

.cv{
  color:var(--text);
  font-weight:700;
}.cv.acc{color:var(--accent);}

.toggle{
  width:60px;
  height:32px;
  background:var(--bg3);
  border:1px solid var(--border);
  border-radius:17px;
  position:relative;
  cursor:pointer;
  transition:background .2s;
}

.toggle.on{
  background:rgb(0 229 255 / 18%);
  border-color:var(--accent);
}

.tknob{
  position:absolute;
  top:5px;
  left:5px;
  width:20px;
  height:20px;
  border-radius:50%;
  background:var(--muted);
  transition:all .2s;
}

.toggle.on .tknob{
  left:33px;
  background:var(--accent);
  box-shadow:0 0 8px var(--accent);
}

/* ── ACTIVITY ── */
.activity-list{
  display:flex;
  flex-direction:column;
  gap:9px;
  max-height:750px;
  overflow-y:auto;
}

.ai{
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:14px;
  padding:14px 15px;
  background:var(--bg3);
  border-radius:11px;
  border:1px solid var(--border);
  font-size:17px;
}

.ai-ctx{
  width:100%;
  color:var(--muted);
  font-size:17px;
  opacity:0.75;
  border-top:1px solid var(--border);
  padding-top:8px;
  margin-top:3px;
}

.aico{
  width:54px;
  height:54px;
  border-radius:9px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.aico.rebalance{background:rgb(0 229 255 / 10%);}.aico.fee{background:rgb(124 252 0 / 10%);}
.aico.alert{background:rgb(255 59 92 / 10%);}.aico.start{background:rgb(255 107 53 / 10%);}
.aico.wallet{background:rgb(196 113 237 / 10%);}.aico.dbl{background:rgb(196 113 237 / 15%);}

.ab{
  flex:1;
  min-width:0;
  overflow-wrap:break-word;
}

.att{
  font-weight:700;
  color:var(--text);
  margin-bottom:1px;
}

.adt{
  color:var(--muted);
  font-size:20px;
}

.atm{
  font-size:18px;
  color:var(--muted);
  white-space:nowrap;
}

/* ── CHART ── */
canvas{
  display:block;
  width:100%;
}

.chart-legend{
  display:flex;
  gap:21px;
  flex-wrap:wrap;
  margin-top:14px;
}

.cl-item{
  display:flex;
  align-items:center;
  gap:9px;
  font-size:20px;
}

.cl-dot{
  width:14px;
  height:14px;
  border-radius:3px;
  flex-shrink:0;
}

/* ── TABLES ── */
.table-wrap{overflow-x:auto;}

table{
  width:100%;
  border-collapse:collapse;
  font-size:17px;
}

thead th{
  text-align:left;
  color:var(--muted);
  font-size:18px;
  letter-spacing:1px;
  text-transform:uppercase;
  padding:0 12px 14px 0;
  border-bottom:1px solid var(--border);
}

tbody td{
  padding:12px 12px 12px 0;
  border-bottom:1px solid rgb(30 42 56 / 40%);
  vertical-align:middle;
}
tbody tr:last-child td{border-bottom:none;}
tbody tr.live-row{background:rgb(0 229 255 / 2%);}

.ep-badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:3px 11px;
  border-radius:6px;
  font-size:18px;
  font-weight:700;
}

.ep-dot{
  width:9px;
  height:9px;
  border-radius:50%;
}

.badge{
  display:inline-block;
  padding:3px 11px;
  border-radius:6px;
  font-size:18px;
  font-weight:700;
}

.badge.s{
  background:rgb(124 252 0 / 10%);
  color:var(--accent3);
}

.badge.a{
  background:rgb(0 229 255 / 10%);
  color:var(--accent);
}

.badge.w{
  background:rgb(255 184 0 / 10%);
  color:var(--warn);
}

.badge.d{
  background:rgb(196 113 237 / 10%);
  color:#c471ed;
}

/* ── WALLET VALIDATION ── */
.wv-status{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:15px 18px;
  border-radius:12px;
  font-size:20px;
  margin-top:12px;
  line-height:1.5;
  transition:all .2s;
}

.wv-status.valid-known{
  background:rgb(124 252 0 / 6%);
  border:1px solid rgb(124 252 0 / 22%);
  color:var(--accent3);
}

.wv-status.valid-new{
  background:rgb(255 184 0 / 6%);
  border:1px solid rgb(255 184 0 / 25%);
  color:var(--warn);
}

.wv-status.invalid{
  background:rgb(255 59 92 / 6%);
  border:1px solid rgb(255 59 92 / 20%);
  color:var(--danger);
}

.wv-status.neutral{
  background:var(--bg3);
  border:1px solid var(--border);
  color:var(--muted);
}

.wv-status-icon{
  font-size:21px;
  flex-shrink:0;
  line-height:1.2;
}
.wv-status-body{flex:1;}

.wv-status-title{
  font-weight:700;
  margin-bottom:3px;
}

.wv-status-addr{
  font-family:'Space Mono',monospace;
  font-size:18px;
  opacity:0.75;
  word-break:break-all;
  margin-top:5px;
}

.wv-confirm-panel{
  background:rgb(255 184 0 / 4%);
  border:1px solid rgb(255 184 0 / 20%);
  border-radius:12px;
  padding:18px 21px;
  margin-top:15px;
  display:none;
}

.wv-confirm-title{
  font-size:20px;
  font-weight:700;
  color:var(--warn);
  letter-spacing:0.8px;
  margin-bottom:12px;
}

.wv-confirm-body{
  font-size:20px;
  color:var(--muted);
  line-height:1.6;
  margin-bottom:15px;
}

.wv-confirm-check{
  display:flex;
  align-items:flex-start;
  gap:14px;
  cursor:pointer;
  font-size:20px;
  color:var(--text);
}

.wv-confirm-check input[type="checkbox"]{
  margin-top:1px;
  accent-color:var(--warn);
  width:20px;
  height:20px;
  flex-shrink:0;
}
.wv-confirm-check span{line-height:1.5;}

::-webkit-scrollbar{
  width:6px;
  height:6px;
}::-webkit-scrollbar-track{background:transparent;}

::-webkit-scrollbar-thumb{
  background:var(--border);
  border-radius:3px;
}

/* ── DISCLAIMER MODAL ── */
.disclaimer-overlay{
  position:fixed;
  inset:0;
  z-index:10000;
  background:rgb(0 0 0 / 85%);
  display:flex;
  align-items:flex-start;
  justify-content:center;
  backdrop-filter:blur(6px);
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:30px 0;
}
.disclaimer-overlay.hidden{display:none;}

.disclaimer-box{
  background:var(--bg2);
  border:1px solid var(--danger);
  border-radius:21px;
  max-width:930px;
  width:92%;
  max-height:none;
  flex-shrink:0;
  margin:auto;
  display:flex;
  flex-direction:column;
  box-shadow:0 0 60px rgb(255 59 92 / 15%);
}

.disclaimer-header{
  padding:30px 36px 18px;
  border-bottom:1px solid var(--border);
}

.disclaimer-header h2{
  font-family:Urbanist,sans-serif;
  font-size:24px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:2.3px;
  color:var(--accent);
}

.disclaimer-body{
  padding:24px 36px;
  overflow-y:auto;
  font-size:18px;
  line-height:1.7;
  color:var(--muted);
}

.disclaimer-body h3{
  margin-top:30px;
  color:var(--accent);
}

.disclaimer-body ul,
.disclaimer-body ol{
  padding-left:48px;
}
.disclaimer-body p{margin-bottom:18px;}
.disclaimer-body ol{margin:0 0 18px 27px;}
.disclaimer-body ol li{margin-bottom:9px;}
.disclaimer-body strong{color:var(--text);}

.disclaimer-body a{
  color:var(--accent);
  text-decoration:none;
}
.disclaimer-body a:hover{text-decoration:underline;}

.disclaimer-footer{
  padding:21px 36px 27px;
  border-top:1px solid var(--border);
  display:flex;
  flex-direction:column;
  gap:18px;
}

.disclaimer-btns{
  display:flex;
  gap:15px;
  justify-content:center;
}

.disclaimer-btn{
  padding:14px 33px;
  border-radius:12px;
  font-family:'Space Mono',monospace;
  font-size:17px;
  font-weight:700;
  cursor:pointer;
  text-transform:uppercase;
  letter-spacing:0.8px;
  transition:all .2s;
  border:1px solid;
}

.disclaimer-btn.accept{
  background:rgb(0 229 255 / 10%);
  border-color:var(--accent);
  color:var(--accent);
}
.disclaimer-btn.accept:hover{background:rgb(0 229 255 / 20%);}

.disclaimer-btn.decline{
  background:rgb(255 59 92 / 7%);
  border-color:rgb(255 59 92 / 30%);
  color:var(--danger);
}
.disclaimer-btn.decline:hover{background:rgb(255 59 92 / 15%);}

/* Gray-out overlay when user declines */
.app-disabled-overlay{
  position:fixed;
  inset:0;
  z-index:9999;
  background:rgb(0 0 0 / 70%);
  display:none;
  align-items:center;
  justify-content:center;
}
.app-disabled-overlay.active{display:flex;}

.app-disabled-msg{
  color:var(--muted);
  font-size:20px;
  text-align:center;
  line-height:1.8;
}

/* ── RESPONSIVE: below 1981px, header middle reflows to its own row and
   multi-column panel rows collapse to single column ── */
@media (width <= 1980px){
  .header-middle{
    flex-basis:100%;
    order:2;
    margin-left:0;
    padding-top:9px;
    border-top:1px solid var(--border);
  }

  .header-right{
    margin-left:auto;
  }

  .wallet-strip-row{
    flex-direction:column;
  }

  .kpi-grid{
    grid-template-columns:1fr;
  }

  .row.c2,
  .row.c3,
  .row.c2-hist{
    grid-template-columns:1fr;
  }
}
