:root{
  --bg0:#050712;
  --bg1:#070a18;
  --card:rgba(10,14,26,.80);
  --stroke:rgba(160,140,255,.28);
  --text:#eef1ff;
  --muted:rgba(238,241,255,.62);
  --good:#33d07a;
  --bad:#ff5070;
}

body.light{
  --bg0:#f6f7ff;
  --bg1:#eef0ff;
  --card:rgba(255,255,255,.88);
  --stroke:rgba(20,20,60,.14);
  --text:#0b0b12;
  --muted:rgba(10,10,20,.62);
  --good:#158a4a;
  --bad:#d21f3c;
}

*{box-sizing:border-box}
html,body{height:100%;max-width:100%;overflow-x:hidden;}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial;
  color:var(--text);
  background:
    radial-gradient(1100px 620px at 18% 0%, rgba(120,0,255,.34), transparent 55%),
    radial-gradient(880px 520px at 78% 45%, rgba(0,140,255,.10), transparent 60%),
    linear-gradient(180deg, var(--bg1), var(--bg0) 60%);
  overflow-x:hidden;
}

/* === Profile Trades feed layout === */
#trades.list { display: flex; flex-direction: column; gap: 10px; }

.feedRow{
  display:flex;
  align-items:stretch;
  gap:12px;
  padding:10px 12px;
  border-radius:14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
}

.feedRow:hover{
  background: rgba(255,255,255,0.05);
}

.feedRow .side{
  min-width:60px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:800;
  letter-spacing:.4px;
  border-radius:999px;
  padding:6px 10px;
  height:28px;
  margin-top:2px;
}

.feedRow .side.buy { background: rgba(46, 204, 113, 0.18); color: #7CFFB4; }
.feedRow .side.sell{ background: rgba(231, 76, 60, 0.18);  color: #FF8A80; }

.feedToken{
  flex:1;
  display:flex;
  gap:10px;
  align-items:center;
  min-width:0;
}

.feedRight{
  opacity:.75;
  font-size:12px;
  white-space:nowrap;
  display:flex;
  align-items:flex-end;
  padding-bottom:2px;
}

.feedToken .t1{
  font-weight:700;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.feedToken .t2{
  opacity:.75;
  font-size:12px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}


/* =========================
   HEADER / NAV
========================= */
.siteHeader{
  position:sticky;
  top:0;
  z-index:1000;
  background:rgba(5,7,18,.55);
  backdrop-filter: blur(10px);
  border-bottom:1px solid rgba(255,255,255,.06);
}
body.light .siteHeader{
  background:rgba(255,255,255,.65);
  border-bottom:1px solid rgba(10,10,20,.08);
}

.hdrInner{
  max-width:1820px;
  margin:0 auto;
  padding:10px 16px;
  display:flex;
  align-items:center;
  gap:14px;
}

.hdrLeft{display:flex;align-items:center;gap:14px;min-width:0;}
.hdrRight{margin-left:auto;display:flex;align-items:center;gap:10px;min-width:0;}

.burgerBtn{
  display:none;
  border:1px solid rgba(255,255,255,.13);
  background:rgba(0,0,0,.22);
  color:var(--text);
  padding:8px 12px;
  border-radius:12px;
  font-weight:900;
  cursor:pointer;
}

.brand{display:flex;align-items:center;gap:10px;min-width:0;text-decoration:none;color:var(--text);}
.brandText{
  font-weight:950;
  font-size:22px;
  letter-spacing:.2px;
  white-space:nowrap;
}

.navDesk{display:flex;gap:10px;align-items:center;flex-wrap:wrap;}
.navBtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  border:1px solid rgba(255,255,255,.13);
  background:rgba(0,0,0,.22);
  color:var(--text);
  padding:8px 14px;
  border-radius:12px;
  font-weight:900;
  font-size:13px;
  cursor:pointer;
  user-select:none;
  text-decoration:none;
}
.navBtn:hover{border-color:rgba(255,255,255,.22)}
body.light .navBtn{
  background:rgba(255,255,255,.65);
  border-color:rgba(10,10,20,.14);
}

/* ===== Header auth buttons ===== */
.hdrAuth{
  display:flex;
  align-items:center;
  gap:10px;
  margin-left:10px;
  flex-wrap:wrap;
}
.authBtn{
  padding:10px 16px;
  border-radius:14px;
  font-size:13px;
}
.secondaryBtn{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.20);
}
body.light .secondaryBtn{
  background:rgba(10,10,20,.06);
  border-color:rgba(10,10,20,.14);
}

.globalSearch{position:relative;min-width:240px;}
.globalSearchInp{
  width:100%;
  border-radius:12px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.18);
  color:var(--text);
  outline:none;
  font-weight:800;
}
.globalSearchInp::placeholder{color:rgba(238,241,255,.40)}
body.light .globalSearchInp::placeholder{color:rgba(10,10,20,.40)}

.globalSearchDropdown{
  position:absolute;
  top:44px;
  left:0;
  right:0;
  background:rgba(0,0,0,.75);
  border:1px solid rgba(255,255,255,.14);
  border-radius:12px;
  overflow:hidden;
  display:none;
  z-index:2000;
}
body.light .globalSearchDropdown{
  background:rgba(255,255,255,.92);
  border-color:rgba(10,10,20,.12);
}

.gItem{padding:10px 12px;cursor:pointer;font-weight:800;font-size:13px;}
.gItem small{display:block;color:var(--muted);font-weight:800;margin-top:2px}
.gItem:hover{background:rgba(255,255,255,.06)}
body.light .gItem:hover{background:rgba(10,10,20,.06)}

.gItem .rowTop{display:flex;align-items:center;gap:10px;}
.gAvatar{
  width:22px;height:22px;border-radius:999px;object-fit:cover;
  border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.06);
}
body.light .gAvatar{border-color:rgba(10,10,20,.12);}

.themeToggle{
  border:1px solid rgba(255,255,255,.13);
  background:rgba(0,0,0,.22);
  color:var(--text);
  padding:8px 10px;
  border-radius:12px;
  font-weight:900;
  cursor:pointer;
}
body.light .themeToggle{
  background:rgba(255,255,255,.65);
  border-color:rgba(10,10,20,.14);
}

/* mobile drawer */
.mobileMenu{
  max-width:1820px;
  margin:0 auto;
  padding:0 16px 12px;
}
.mobileMenuInner{
  background: rgba(10, 14, 26, .98);  /* ✅ quase sólido */
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  padding: 12px;
}
body.light .mobileMenuInner{
  background: rgba(255,255,255,.98); /* ✅ quase sólido em light */
  border-color: rgba(10,10,20,.12);
}
.mobileNav{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:10px;}
.mobileSearch{position:relative;}

/* =========================
   PAGE LAYOUT
========================= */

.homePanelSearch{
  padding:14px 14px 0 !important;
}
.homePanelSearch .inp,
.homePanelSearch input{
  margin-top:6px;
}

/* =========================
   PAGE LAYOUT
========================= */
.wrap{
  width:100%;
  max-width:1820px;
  margin:18px auto;
  padding:0 16px;
}

.grid{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap:16px;
  align-items:start;
  width:100%;
  min-width:0;
}
.col{display:flex;flex-direction:column;gap:14px;min-width:0;width:100%}

.card{
  background:var(--card);
  border:1px solid var(--stroke);
  border-radius:16px;
  box-shadow:0 0 0 1px rgba(0,0,0,.18) inset;
  min-width:0;
  width:100%;
  max-width:100%;
}
.pad{padding:16px;}
.row{display:flex;gap:12px;align-items:center;min-width:0;}
.avatar{width:56px;height:56px;border-radius:50%;object-fit:cover;border:1px solid rgba(255,255,255,.14)}

.nameRow{display:flex;align-items:center;gap:10px;min-width:0}
.nameBig{
  font-weight:950;
  font-size:28px;
  line-height:1.05;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.iconLinks{display:flex;gap:10px;align-items:center;margin-top:6px}
.iconBtn{
  width:34px;height:34px;border-radius:999px;
  display:inline-flex;align-items:center;justify-content:center;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.22);
  cursor:pointer;
  text-decoration:none;
  color:var(--text);
}
.iconBtn:hover{border-color:rgba(255,255,255,.22)}
.iconBtn svg{width:16px;height:16px;display:block;fill:currentColor}

.pillRow{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.pill{
  display:inline-flex;gap:8px;align-items:center;
  background:rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.12);
  padding:7px 10px;border-radius:999px;
  color:var(--text);
  font-size:12px;
  cursor:pointer;
  user-select:none;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.pill:hover{border-color:rgba(255,255,255,.22)}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}

.sectionTitle{padding:12px 16px;color:var(--muted);font-weight:800;font-size:13px}
.bio{padding:12px 16px;border-top:1px solid rgba(255,255,255,.06)}
.bio b{display:block;color:var(--muted);font-size:12px;margin-bottom:6px}
#bio{word-break:break-word}

.timeline{
  display:flex;gap:10px;justify-content:flex-start;flex-wrap:wrap;
  padding:14px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.tab{
  border:1px solid rgba(255,255,255,.13);
  background:rgba(0,0,0,.22);
  color:var(--text);
  padding:8px 14px;border-radius:12px;
  font-weight:800;font-size:13px;
  cursor:pointer;
  user-select:none;
}
.tab.active{background:#fff;color:#0b0b12;border-color:#fff;}

.filters{
  display:flex;gap:10px;flex-wrap:wrap;
  padding:14px;
  border-bottom:1px solid rgba(255,255,255,.06);
}
.filterBtn{
  border:1px solid rgba(255,255,255,.13);
  background:rgba(0,0,0,.22);
  color:var(--text);
  padding:8px 14px;border-radius:12px;
  font-weight:900;font-size:13px;
  cursor:pointer;
  user-select:none;
}
.filterBtn.active{background:#fff;color:#0b0b12;border-color:#fff;}

.pnlBox{padding:16px;}
.pnlTop{display:flex;justify-content:space-between;align-items:flex-end;gap:12px}
.pnlBig{font-size:40px;font-weight:950}
.pnlMini{
  margin-top:10px;
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  font-size:13px;
  color:var(--muted)
}
.pnlMini b{color:var(--text);font-weight:900}
.small{font-size:12px;color:var(--muted);margin-top:10px}

.col1{display:grid;grid-template-columns:1fr;gap:10px;padding:12px 16px 16px}

/* ✅ search dentro do panel */
.panelSearch{
  padding: 12px 16px 2px;      /* alinhado com o resto do card */
}
.panelSearch .inp{
  width: 100%;
}

/* cards do panel */
.miniCard{
  background:rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:10px 12px;
  display:flex;
  gap:12px;
  align-items:center;
  cursor:pointer;
  min-width:0;
  width:100%;
}
.miniCard:hover{border-color:rgba(255,255,255,.14)}

.tokenIcon{
  width:34px;height:34px;border-radius:50%;
  position:relative;flex:0 0 34px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  overflow:hidden;
}
.tokenIcon img{width:100%;height:100%;object-fit:cover;display:block}
.tokenLetter{
  position:absolute;inset:0;
  display:flex;align-items:center;justify-content:center;
  font-weight:950;font-size:14px;color:rgba(233,236,255,.92);
  background:rgba(0,0,0,.22);
}

.miniLeft{min-width:0;flex:1}
.tokenName{font-weight:950;line-height:1.1}
.tokenSub{color:var(--muted);font-size:12px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tokenSubWrap{color:var(--muted);font-size:12px;margin-top:2px;white-space:normal}

.miniRight{
  margin-left:auto;
  text-align:right;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:3px;
  min-width:120px;
}
.miniRight .usd{font-weight:950}
.miniRight .meta{font-size:12px;color:var(--muted)}

.list{padding:8px 16px 16px}
.trade{
  display:flex;gap:10px;align-items:center;
  padding:10px 12px;margin:8px 0;
  border:1px solid rgba(255,255,255,.07);
  border-radius:14px;
  background:rgba(0,0,0,.18);
  cursor:pointer;
  min-width:0;
  width:100%;
}
.trade:hover{border-color:rgba(255,255,255,.14)}
.side{font-weight:950;font-size:12px;padding:5px 10px;border-radius:999px}
.buy{background:rgba(51,208,122,.15);color:var(--good);border:1px solid rgba(51,208,122,.25)}
.sell{background:rgba(255,80,112,.12);color:var(--bad);border:1px solid rgba(255,80,112,.25)}

.tradeMain{flex:1;min-width:0}
.tradeMain .d1{font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tradeMain .d2{color:var(--muted);font-size:12px;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tradeMain .m1{font-weight:900}
.tradeMain .m2{color:var(--text); font-weight:900; margin-top:2px}
.tradeMain .m3{color:var(--muted); font-size:12px; margin-top:2px}
.tradeMain .m4{color:var(--muted); font-size:12px; margin-top:2px}
.tradeMain .m2, .tradeMain .m3, .tradeMain .m4{
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%;
}
.when{color:var(--muted);font-size:12px;white-space:nowrap;display:block}

.pager{display:flex;justify-content:space-between;align-items:center;padding:12px 16px 16px}
.btn{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.24);
  color:var(--text);
  padding:9px 14px;border-radius:12px;
  font-weight:900;cursor:pointer;
}
.btn:disabled{opacity:.35;cursor:not-allowed}

.errorBox{padding:14px 16px;color:#ffd3db}
.toast{
  position:fixed;left:50%;bottom:18px;transform:translateX(-50%);
  background:rgba(0,0,0,.75);
  border:1px solid rgba(255,255,255,.14);
  padding:10px 14px;border-radius:12px;
  color:var(--text);
  font-weight:900;
  display:none;
  z-index:9999;
  max-width:min(92vw, 520px);
  box-sizing:border-box;
  text-align:center;
}

.inp{
  width:100%;
  border-radius:12px;
  padding:10px 12px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(0,0,0,.18);
  color:var(--text);
  outline:none;
  font-weight:800;
}
.inp::placeholder{color:rgba(238,241,255,.40)}
body.light .inp::placeholder{color:rgba(10,10,20,.40)}

/* =========================
   MODAL — (o teu fix que funciona)
========================= */
#modalOverlay{
  position: fixed !important;
  inset: 0 !important;
  z-index: 2147483647 !important;
  display: block !important;

  padding: 18px !important;
  background: rgba(0,0,0,.55) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;

  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;

  transform: translateZ(0) !important;
  transition: opacity .12s ease, visibility .12s ease !important;
}

#modalOverlay.open{
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

#modalOverlay .modal{
  position: fixed !important;
  top: 50vh !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;

  width: min(640px, calc(100vw - 36px)) !important;
  max-height: calc(100vh - 36px) !important;
  overflow: auto !important;

  margin: 0 !important;

  background: var(--card) !important;
  border: 1px solid var(--stroke) !important;
  border-radius: 18px !important;
  box-shadow: 0 12px 40px rgba(0,0,0,.45) !important;
}

/* ✅ só um polish pequeno da modal (sem mexer no layout) */
.modalHdr{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:14px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.modalTitle{font-weight:950}
.modalClose{
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
  color:var(--text);
  width:34px;height:34px;border-radius:12px;
  cursor:pointer;
  font-weight:950;
}
.modalBody{padding:14px 16px;}
.modalActions{
  padding:14px 16px;
  display:flex;
  justify-content:flex-end;
  gap:10px;
  border-top:1px solid rgba(255,255,255,.08);
}

.btnPrimary{
  background:rgba(0,160,255,.75);
  border-color:rgba(0,160,255,.85);
}
.btnPrimary:hover{filter:brightness(1.05)}

.modalHint{
  margin-top:10px;
  font-size:12px;
  color:var(--muted);
  font-weight:800;
}
.siteHeader{ z-index: 10000; }
.mobileMenu{ z-index: 10001; }

/* =========================
   Responsive
========================= */
@media(max-width:980px){
  .hdrInner{padding:10px 12px;}
  .wrap{padding:0 12px}
  .grid{display:flex;flex-direction:column; width:100%}
  .col{width:100%}
  .card{width:100%; max-width:100%}
  .pnlBig{font-size:34px}
  .miniRight{min-width:100px}

  .burgerBtn{display:inline-flex;}
  .navDesk{display:none;}

  /* ✅ remove search e auth do header no mobile */
  .globalSearch{ display:none !important; }
  .hdrAuth{ display:none !important; }

  .when{display:none}
  .trade{align-items:flex-start}
  .tradeMain .d1, .tradeMain .d2{display:none}
  .tradeMain .m1, .tradeMain .m2, .tradeMain .m3, .tradeMain .m4{display:block}
}
@media(min-width:981px){
  .mobileMenu{display:none !important;}
  .when{display:block}
  .tradeMain .m1, .tradeMain .m2, .tradeMain .m3, .tradeMain .m4{display:none}
  .tradeMain .d1, .tradeMain .d2{display:block}
}

@media (max-width: 980px){
  .brandText{ display:none; }
}

body.menuOpen{ overflow:hidden; }

.mobileMenu{
  position: fixed;
  top: 72px; /* ajusta se precisares */
  left: 0;
  right: 0;
  z-index: 9999;
  max-width: none;   /* importante */
  margin: 0;         /* importante */
  padding: 0 12px 12px;
}
.mobileMenuInner{
  max-width: 1820px;
  margin: 0 auto;
}
