:root{
  --bg0:#070b12;
  --bg1:#0a1020;
  --card:#0f172a;
  --card2:#0b1223;
  --stroke: rgba(255,255,255,.08);
  --text: rgba(255,255,255,.92);
  --muted: rgba(255,255,255,.55);
  --brand:#60a5fa;
  --brand2:#a5b4fc;
  --ok:#22c55e;
  --bad:#ef4444;
  --shadow: 0 18px 40px rgba(0,0,0,.55);
  --shadow2: 0 10px 24px rgba(0,0,0,.35);
  --r: 22px;
}

:root[data-theme="light"]{
  --bg0:#f4f6fb;
  --bg1:#eef2ff;
  --card:#ffffff;
  --card2:#ffffff;
  --stroke: rgba(10,20,40,.10);
  --text: rgba(10,20,40,.92);
  --muted: rgba(10,20,40,.55);
  --brand:#2563eb;
  --brand2:#6366f1;
  --shadow: 0 18px 40px rgba(15,23,42,.12);
  --shadow2: 0 10px 22px rgba(15,23,42,.10);
}

*{box-sizing:border-box}
html,body{height:100%}
html,body{touch-action: manipulation}
body{
  margin:0;
  font-family:"Vazirmatn",system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color:var(--text);
  background:
    radial-gradient(1000px 800px at 20% 0%, rgba(96,165,250,.15), transparent 60%),
    radial-gradient(1000px 800px at 90% 20%, rgba(165,180,252,.12), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow:hidden;
}

/* smoother interactions */
:root{
  --ease: cubic-bezier(.2,.8,.2,1);
  --ease2: cubic-bezier(.16,1,.3,1);
}

@media (prefers-reduced-motion: reduce){
  *{animation-duration:0.001ms!important;animation-iteration-count:1!important;transition-duration:0.001ms!important;scroll-behavior:auto!important}
}

.app{
  height:100%;
  max-width:440px;
  margin:0 auto;
  padding: env(safe-area-inset-top) 16px calc(86px + env(safe-area-inset-bottom)) 16px;
  position:relative;
}

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-top: 10px;
}

.topLeft{display:flex; align-items:center; gap:10px;}
.userLevel{
  font-size: 12.5px;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  color: rgba(255,255,255,0.92);
  line-height: 1;
  white-space: nowrap;
}
.userLevel.ok{ color: rgba(25,214,132,0.95); border-color: rgba(25,214,132,0.25); background: rgba(25,214,132,0.10); }

.avatarBtn{border:none;background:transparent;padding:0;cursor:pointer}
.avatar{
  width:40px;height:40px;border-radius:14px;
  display:flex;align-items:center;justify-content:center;
  background: rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow2);
  font-weight:900;
}
.avatar.hasImg{padding:0; overflow:hidden}
.avatar.hasImg img{width:100%;height:100%;object-fit:cover;display:block}

.topTitle{flex:1}
.appName{font-weight:900;letter-spacing:.2px}
.appSub{margin-top:2px;font-size:12px;color:var(--muted)}

.topBtns{display:flex;gap:10px}
.iconBtn{
  width:40px;height:40px;border-radius:14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color:var(--text);
  box-shadow: var(--shadow2);
  cursor:pointer;
  position:relative;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.iconBtn.small{width:34px;height:34px;border-radius:12px}
.iconBtn:active{transform: scale(.98)}

/* Back button (replaces X) */
.backBtn{
  border: 1px solid var(--border);
  padding: 10px 12px;
  border-radius: 14px;
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  /* In dark mode it matches the app surface; in light mode we override to white */
  background: var(--card);
  box-shadow: var(--shadow2);
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
[data-theme="light"] .backBtn{ background: rgba(255,255,255,.98); box-shadow: 0 10px 26px rgba(0,0,0,.08); }
.backBtn:active{ transform: scale(.98); }

.iconSvg{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:20px;
  height:20px;
}
.iconSvg svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.badge{
  position:absolute;
  top:7px;
  right:7px;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  background: var(--bad);
  color:#fff;
  font-size:11px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 8px 18px rgba(0,0,0,.25);
}
.hidden{display:none!important}

.content{
  margin-top:14px;
  height: calc(100% - 68px);
  overflow:auto;
  padding-bottom: 22px;
  scrollbar-width:none;
}
.content::-webkit-scrollbar{display:none}

.screen{display:none; animation:up .22s var(--ease2)}
.screen.active{display:block}
@keyframes up{from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)}}

.hero{
  border-radius: var(--r);
  padding: 16px;
  background: linear-gradient(135deg, rgba(96,165,250,.18), rgba(165,180,252,.12));
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.heroTop{display:flex;align-items:center;justify-content:space-between}
.heroLabel{font-size:12px;color:var(--muted)}
.pill{
  padding:6px 10px;border-radius:999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  font-size:12px;color:var(--muted);
}
.heroValue{margin-top:10px;font-size:40px;font-weight:900;letter-spacing:-.5px}
.heroHint{margin-top:6px;font-size:12px;color:var(--muted)}

.miniRow{display:flex;gap:10px;margin-top:12px}
.miniBtn{
  flex:1;
  border:none;
  border-radius: 18px;
  padding: 12px 10px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow2);
  color:var(--text);
  display:flex;align-items:center;justify-content:center;gap:8px;
  cursor:pointer;
  font-weight:800;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.miniBtn:active{transform: scale(.99)}
.miniIcon{opacity:.95}

.sectionRow{display:flex;align-items:center;justify-content:space-between;margin:14px 2px 10px}
.sectionTitle{font-weight:900}
.sectionTitle.big{font-size:18px;margin:4px 2px 12px}

.link{border:none;background:transparent;color:var(--brand);font-weight:900;font-family:inherit;cursor:pointer}

.card{
  border-radius: var(--r);
  background: rgba(255,255,255,.04);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 12px;
}
:root[data-theme="light"] .card{background: rgba(255,255,255,.92)}

.list{display:flex;flex-direction:column;gap:8px}

.tile{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow2);
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.tile:active{transform: scale(.995)}

/* Status coloring (only applied in UI for withdraw & deposit lists) */
.tile.tile-ok{
  background: rgba(34, 197, 94, 0.08);
}
.tile.tile-bad{
  background: rgba(239, 68, 68, 0.08);
}

:root[data-theme="light"] .tile:not(.tile-ok):not(.tile-bad){background: rgba(15,23,42,.03)}
.left{display:flex;align-items:center;gap:10px}
.coin{
  width:40px;height:40px;border-radius:16px;
  display:flex;align-items:center;justify-content:center;
  background: rgba(96,165,250,.14);
  border:1px solid rgba(96,165,250,.18);
  font-weight:900;
}
.coin svg{width:22px;height:22px;}
.name{font-weight:900}
.sub{margin-top:2px;font-size:12px;color:var(--muted)}
.right{text-align:left}
.val{font-weight:900}
.small{margin-top:2px;font-size:12px;color:var(--muted)}

.row{margin-bottom:10px}

.assetBtn{
  width:100%;
  border:none;
  border-radius: 18px;
  padding: 12px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow2);
  color:var(--text);
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  cursor:pointer;
  transition: transform .18s var(--ease), background .18s var(--ease);
}
.assetBtn:active{transform: scale(.995)}
.assetLeft{display:flex;align-items:center;gap:10px}
.assetName{font-weight:900}
.assetSub{font-size:12px;color:var(--muted);margin-top:2px}
.chev{color:var(--muted)}

.amountLabel{margin-top:6px;font-size:12px;color:var(--muted)}
.amountValue{
  margin-top: 6px;
  display:flex;align-items:baseline;gap:8px;
}
.currency{font-size:18px;color:var(--muted);font-weight:900}
.amountValue input{
  width:100%;
  border:none;
  outline:none;
  background: transparent;
  color:var(--text);
  font-size:40px;
  font-weight:900;
  letter-spacing:-.5px;
  padding: 0;
}
.amountValue input::placeholder{color: rgba(130,140,160,.35)}

.fine{margin-top:8px;font-size:12px;color:var(--muted);line-height:1.7}
.note{margin-top:10px;font-size:12px;color:var(--brand);line-height:1.7}

.primary{
  margin-top: 12px;
  width:100%;
  border:none;
  border-radius: 18px;
  padding: 14px 0;
  cursor:pointer;
  color:#fff;
  font-weight:900;
  background: linear-gradient(90deg, var(--brand), var(--brand2));
  box-shadow: 0 16px 34px rgba(37,99,235,.22);
}
.primary:disabled{opacity:.6;cursor:not-allowed}

.field{margin-top:12px}
.fLabel{font-size:12px;color:var(--muted);margin-bottom:6px}
.field:focus-within{
  transform: translateY(-1px);
  transition: transform .18s var(--ease);
}
.field input{
  width:100%;
  border-radius: 16px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color:var(--text);
  padding: 12px 12px;
  outline:none;
  font-family:inherit;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
:root[data-theme="light"] .field input{background: rgba(15,23,42,.03)}

.field input:focus{
  border-color: rgba(96,165,250,.55);
  box-shadow: 0 10px 24px rgba(37,99,235,.14);
  background: rgba(255,255,255,.07);
}
:root[data-theme="light"] .field input:focus{background: rgba(15,23,42,.035)}

.bankBox{
  margin-top: 10px;
  display:flex;align-items:center;gap:10px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(34,197,94,.10);
  border:1px solid rgba(34,197,94,.18);
}
.bankIcon{
  width:40px;height:40px;border-radius:16px;
  display:flex;align-items:center;justify-content:center;
  background: rgba(34,197,94,.14);
}
.bankName{font-weight:900}
.bankHint{font-size:12px;color:var(--muted);margin-top:2px}

.confirm{
  margin-top:12px;
  border-radius: 18px;
  padding: 12px;
  border: 1px dashed rgba(96,165,250,.35);
  background: rgba(96,165,250,.08);
}
.confirmTitle{font-weight:900}
.confirmText{margin-top:8px;font-size:12px;color:var(--muted);line-height:1.8}
.confirmRow{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
.ghost{
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.05);
  color:var(--text);
  border-radius: 18px;
  padding: 12px 0;
  font-weight:900;
  cursor:pointer;
}

.swap{display:flex;flex-direction:column;gap:10px}
.swapBtn{
  width:54px;height:54px;
  border-radius: 18px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color:var(--text);
  box-shadow: var(--shadow2);
  cursor:pointer;
  margin: 0 auto;
  font-size:18px;
}

/* tabbar */
.tabbar{
  position: fixed;
  left:50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(420px, calc(100% - 24px));
  height: 72px;
  border-radius: 26px;
  background: rgba(15,23,42,.85);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  display:flex;align-items:center;justify-content:space-between;
  padding: 10px 12px;
  z-index: 40;
}
:root[data-theme="light"] .tabbar{background: rgba(255,255,255,.92)}
.tab{
  width:64px;height:56px;
  border:none;background:transparent;
  color:var(--muted);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  border-radius: 18px;
  cursor:pointer;
}
.tab.active{color:var(--text)}
.tIcon{display:flex;align-items:center;justify-content:center;height:20px}
.tText{font-size:12.5px;font-weight:900;letter-spacing:-.2px}
.tText{font-size:13.5px;font-weight:900;letter-spacing:-.2px;line-height:1}

.tab{transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease)}
.tab:active{transform: scale(.985)}
.tab.active{background: rgba(255,255,255,.06)}
:root[data-theme="light"] .tab.active{background: rgba(15,23,42,.04)}

/* notifications popover */
.popover{
  position: fixed;
  top: calc(env(safe-area-inset-top) + 68px);
  inset-inline-end: 16px;
  width: min(360px, calc(100% - 32px));
  border-radius: 22px;
  background: rgba(15,23,42,.96);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 10px 12px 12px;
  z-index: 80;
  opacity:0;
  transform: translateY(-6px) scale(.98);
  pointer-events:none;
  transition: opacity .18s var(--ease), transform .22s var(--ease2);
}
:root[data-theme="light"] .popover{background: rgba(255,255,255,.98)}
.popover.show{opacity:1; transform: translateY(0) scale(1); pointer-events:auto}
.popoverHead{display:flex;align-items:center;justify-content:space-between}
.popoverTitle{font-weight:900}
.popoverBody{margin-top:10px; max-height: 46vh; overflow:auto; scrollbar-width:none}
.popoverBody::-webkit-scrollbar{display:none}

.notifItem{
  display:flex;align-items:flex-start;gap:10px;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow2);
}
:root[data-theme="light"] .notifItem{background: rgba(15,23,42,.03)}
.notifDot{
  width:8px;height:8px;border-radius:999px;
  background: var(--brand);
  margin-top:6px;
  flex:0 0 8px;
}
.notifText{flex:1}
.notifTitle{font-weight:900}
.notifSub{margin-top:4px;font-size:12px;color:var(--muted);line-height:1.6}
.notifTime{margin-top:6px;font-size:11px;color:var(--muted)}

/* sheets */
.backdrop{
  position: fixed; inset:0;
  background: rgba(0,0,0,.55);
  opacity:0; pointer-events:none;
  transition: opacity .18s var(--ease);
  z-index: 60;
}
.backdrop.show{opacity:1; pointer-events:auto}

.sheet{
  position: fixed;
  left:50%;
  transform: translateX(-50%) translateY(120%);
  bottom: 10px;
  width: min(420px, calc(100% - 24px));
  border-radius: 26px;
  background: rgba(15,23,42,.95);
  border:1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 10px 12px 14px;
  z-index: 70;
  transition: transform .26s var(--ease2);
}
:root[data-theme="light"] .sheet{background: rgba(255,255,255,.96)}
.sheet.show{transform: translateX(-50%) translateY(0%)}
.sheetBar{
  width: 54px; height: 5px; border-radius: 999px;
  background: rgba(255,255,255,.22);
  margin: 4px auto 10px;
}
:root[data-theme="light"] .sheetBar{background: rgba(10,20,40,.18)}
.sheetHead{display:flex;align-items:center;justify-content:space-between}
.sheetTitle{font-weight:900}
.sheetBody{margin-top:12px; max-height: 62vh; overflow:auto; scrollbar-width:none}
.sheetBody::-webkit-scrollbar{display:none}

.searchBox input{
  width:100%;
  border-radius: 18px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color:var(--text);
  padding: 12px 12px;
  outline:none;
  font-family:inherit;
}
:root[data-theme="light"] .searchBox input{background: rgba(15,23,42,.03)}

/* ---- Support composer (modern) ---- */
.supportCard{
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  padding: 12px;
  box-shadow: var(--shadow2);
}
:root[data-theme="light"] .supportCard{ background: rgba(15,23,42,.03); }
.supportLabel{ font-weight: 900; font-size: 12px; opacity: .9; margin-bottom: 10px; }
.supportCard textarea{
  width: 100%;
  resize: none;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.08);
  color: var(--text);
  padding: 12px 12px;
  font-family: Vazirmatn, sans-serif;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.8;
  outline: none;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
:root[data-theme="light"] .supportCard textarea{ background: rgba(15,23,42,.03); }
.supportCard textarea:focus{ box-shadow: 0 0 0 4px rgba(96,165,250,.14); border-color: rgba(96,165,250,.45); }
.supportFooter{
  margin-top: 12px;
  display:flex;
  justify-content:flex-end;
}

.pCard{
  border-radius: 20px;
  background: rgba(255,255,255,.06);
  border:1px solid var(--stroke);
  padding: 12px;
}
:root[data-theme="light"] .pCard{background: rgba(15,23,42,.03)}
.pRow{display:flex;align-items:center;gap:10px}
.pMeta{flex:1;min-width:0}
.pNameRow{display:flex;align-items:flex-start;gap:10px}
.pLevelBadge{
  margin-inline-start:auto;
  padding:6px 10px;
  border-radius: 999px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  font-size: 11px;
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
}
:root[data-theme="light"] .pLevelBadge{background: rgba(15,23,42,.03)}
.pLevelBadge.ok{border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10)}
.pAvatar{
  width:50px;height:50px;border-radius:18px;
  display:flex;align-items:center;justify-content:center;
  background: rgba(96,165,250,.14);
  border:1px solid rgba(96,165,250,.18);
  font-weight:900;
}
.pAvatar.hasImg{padding:0; overflow:hidden}
.pAvatar.hasImg img{width:100%;height:100%;object-fit:cover;display:block}
.pName{font-weight:900}
.pUser{margin-top:2px;font-size:12px;color:var(--muted)}
.pGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.pItem{border-radius:18px;border:1px solid var(--stroke);background: rgba(255,255,255,.06);padding:10px}
:root[data-theme="light"] .pItem{background: rgba(15,23,42,.03)}
.pLabel{font-size:11px;color:var(--muted)}
.pVal{margin-top:4px;font-weight:900;font-size:12px}

/* profile quick actions */
.pActions{display:flex;gap:14px;justify-content:flex-start;margin-top:12px}
.pActionItem{display:flex;flex-direction:column;align-items:center;gap:6px}
.pActionText{font-size:11px;color:var(--muted);font-weight:800}
.quickBtn{
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  box-shadow: var(--shadow2);
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform .18s var(--ease), background .18s var(--ease);
}
:root[data-theme="light"] .quickBtn{background: rgba(15,23,42,.03)}
.quickBtn:active{transform: scale(.985)}
.quickBtn .iconSvg svg{width:20px;height:20px}

.list{display:flex;flex-direction:column;gap:8px}
.hint,.note{color:var(--muted);font-size:12px;margin-bottom:10px}

.txCard{
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  padding: 10px;
}
:root[data-theme="light"] .txCard{background: rgba(15,23,42,.03)}
.txTop{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.txIco{
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  flex: 0 0 auto;
}
:root[data-theme="light"] .txIco{background: rgba(15,23,42,.03)}
.txIco svg{width:18px;height:18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;}
.txIco.ok{border-color: rgba(34,197,94,.35)}
.txIco.bad{border-color: rgba(239,68,68,.35)}
.txIco.info{border-color: rgba(96,165,250,.35)}

/* icon colors by status */
.txIco{ color: var(--brand); }
.txIco.ok{ color: rgb(34,197,94); }
.txIco.bad{ color: rgb(239,68,68); }
.txMain{flex:1 1 auto; min-width: 0}
.txTitle{font-weight:900}
.txMeta{margin-top:4px;color:var(--muted);font-size:12px}
.txState{font-size:12px;color:var(--muted);font-weight:800;white-space:nowrap}
.chip{
  font-size: 11px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
}
:root[data-theme="light"] .chip{background: rgba(15,23,42,.03)}
.chip.ok{border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.10)}
.chip.warn{border-color: rgba(250,204,21,.35); background: rgba(250,204,21,.10)}
.chip.bad{border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.10)}
.themeToggle{
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  box-shadow: var(--shadow2);
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
  overflow: hidden;
}
:root[data-theme="light"] .themeToggle{background: rgba(15,23,42,.03)}
.themeToggle:active{transform: scale(.985)}
.themeToggle .iconSvg svg{width:20px;height:20px}
.themeGlow{
  position:absolute;inset:-40%;
  background: radial-gradient(circle, rgba(96,165,250,.18), transparent 60%);
  opacity:.0;
  transform: scale(.9);
  transition: opacity .24s var(--ease), transform .24s var(--ease2);
}
.themeToggle:hover .themeGlow{opacity:1;transform: scale(1)}

/* KYC button + sheet */
.kycBtn{
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 20px;
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color: var(--text);
  box-shadow: var(--shadow2);
  cursor: pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform .18s var(--ease), background .18s var(--ease);
}
:root[data-theme="light"] .kycBtn{background: rgba(15,23,42,.03)}
.kycBtn:active{transform: scale(.985)}
.kycBtn .iconSvg svg{width:20px;height:20px}
.kycDot{
  position:absolute;
  inset-inline-start: 7px;
  top: 7px;
  width: 9px;height:9px;
  border-radius: 99px;
  border: 2px solid rgba(0,0,0,.15);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
:root[data-theme="light"] .kycDot{border-color: rgba(255,255,255,.65)}
.kycDot.ok{background: rgba(34,197,94,1)}
.kycDot.pending{background: rgba(245,158,11,1)}
.kycDot.bad{background: rgba(239,68,68,1)}

/* Small green dot for "new" items on profile buttons */
.pNewDot{
  position:absolute;
  inset-inline-start: 7px;
  top: 7px;
  width: 9px;height:9px;
  border-radius: 99px;
  border: 2px solid rgba(0,0,0,.15);
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  background: rgba(34,197,94,1);
  opacity: 0;
  transform: scale(.85);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  pointer-events:none;
}
:root[data-theme="light"] .pNewDot{border-color: rgba(255,255,255,.65)}
.pNewDot.show{opacity:1; transform: scale(1)}

/* Announcements list + detail */
.annDetail{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  border-radius: 20px;
  padding: 12px 12px;
  margin-bottom: 10px;
}
:root[data-theme="light"] .annDetail{background: rgba(15,23,42,.03)}
.annDetailTitle{font-weight: 1000; margin-bottom: 6px}
.annDetailBody{white-space: pre-wrap; line-height: 1.8; color: var(--text)}

.annItem{
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 12px 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease);
}
:root[data-theme="light"] .annItem{background: rgba(15,23,42,.03)}
.annItem:active{transform: scale(.985)}
.annItem.active{box-shadow: 0 0 0 4px rgba(96,165,250,.14); border-color: rgba(96,165,250,.45)}
.annItemTitle{font-weight: 1000}
.annItemPreview{color: var(--muted); margin-top: 6px; line-height: 1.6}
.annItemTime{color: var(--muted); font-size: 12px; margin-top: 8px}

.seg{display:flex;gap:8px;margin:6px 0 10px}
.segBtn{
  flex:1;
  border:none;
  border-radius: 16px;
  padding: 12px 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--stroke);
  color: var(--muted);
  font-weight:900;
  cursor:pointer;
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
:root[data-theme="light"] .segBtn{background: rgba(15,23,42,.03)}
.segBtn:active{transform: scale(.985)}
.segBtn.active{color:var(--text); background: rgba(96,165,250,.12)}

.kycStatus{margin: 6px 0 10px; font-weight:900; color: var(--muted)}
.kycForm{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.field{display:block}
.lbl{font-size:12px;color:var(--muted);margin-bottom:6px}
.field input{
  width:100%;
  border-radius: 16px;
  padding: 14px 14px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
  color:var(--text);
  font-family: Vazirmatn, sans-serif;
  font-weight:700;
  font-size:14px;
  outline:none;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease), transform .18s var(--ease);
}
:root[data-theme="light"] .field input{background: rgba(15,23,42,.03)}
.field input:focus{box-shadow: 0 0 0 4px rgba(96,165,250,.14); border-color: rgba(96,165,250,.45)}


.hidden{display:none !important}

/* ---- Profile KYC mini (compact, not cluttered) ---- */
.pKycMini{ margin-top:12px; padding:12px; border-radius:18px; background: var(--card); box-shadow: var(--shadow); }
.pKycHead{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.pKycTitle{ font-weight:800; font-size:13px; letter-spacing:-0.2px; opacity:.95; }
.pKycState{ font-size:12px; opacity:.8; }
.pKycChips{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{ display:inline-flex; align-items:center; gap:6px; padding:8px 10px; border-radius:999px; background: var(--glass); border:1px solid var(--border); }
.chip .ck{ font-size:11px; opacity:.75; }
.chip .cv{ font-size:12px; font-weight:700; }

/* ---- Modal (animated, with status icon) ---- */
.modal{
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.98);
  width: min(92vw, 380px);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 30px 80px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  /* must be above sheets/popovers */
  z-index: 110;
  overflow: hidden;
}
.modal.show{
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.modalHead{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--border);
}
.modalTitle{ font-weight:900; font-size:14px; letter-spacing:-.2px; }
.modalBody{ padding: 12px; display:flex; flex-direction:column; gap:10px; }
.modalIcon{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  align-self:center;
  background: rgba(255,255,255,.10);
  border: 1px solid var(--border);
}
[data-theme="light"] .modalIcon{ background: rgba(0,0,0,.04); }
.modalIcon svg{ width: 24px; height: 24px; stroke-width: 2.2; stroke: var(--brand); }
.modalIcon.ok{ border-color: rgba(34,197,94,.35); }
.modalIcon.bad{ border-color: rgba(239,68,68,.35); }
.modalIcon.ok svg{ stroke: rgb(34,197,94); }
.modalIcon.bad svg{ stroke: rgb(239,68,68); }
.modalMsg{ line-height:1.8; text-align:center; opacity:.92; }
.modalActions{ display:flex; gap:10px; justify-content:center; }
.modalActions .primary{ min-width: 140px; }

/* make the shared backdrop animate for modal too */
#modalBackdrop{ z-index: 109; }


/* ---------- Toast + Skeleton ---------- */
.toast{
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 12px;
  max-width: min(520px, calc(100vw - 24px));
  border-radius: 14px;
  background: rgba(0,0,0,.72);
  color: #fff;
  font-size: 13px;
  line-height: 1.6;
  opacity: 0;
  pointer-events: none;
  z-index: 120;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
[data-theme="light"] .toast{ background: rgba(17,24,39,.90); }
.toast.show{ opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok{ background: rgba(34,197,94,.92); }
.toast.bad{ background: rgba(239,68,68,.92); }
.toast.info{ background: rgba(59,130,246,.92); }

.skeleton{
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(255,255,255,.06), rgba(255,255,255,.14), rgba(255,255,255,.06));
  background-size: 220% 100%;
  animation: shimmer 1.2s infinite;
  border: 1px solid var(--border);
}
[data-theme="light"] .skeleton{
  background: linear-gradient(90deg, rgba(0,0,0,.04), rgba(0,0,0,.08), rgba(0,0,0,.04));
}
@keyframes shimmer{
  0%{ background-position: 0% 0; }
  100%{ background-position: 200% 0; }
}


.subTitle{font-size:13px;opacity:.75;margin:10px 2px 6px 2px;}

.msgItem{padding:10px 12px;border-radius:14px;background:var(--card);border:1px solid rgba(255,255,255,.06);margin:8px 0;}
.msgMeta{display:flex;justify-content:space-between;gap:10px;font-size:12px;opacity:.7;margin-bottom:6px;}
.msgText{font-size:13px;line-height:1.6;white-space:pre-wrap;word-break:break-word;}
.moreBtn{width:100%;padding:10px 12px;border-radius:14px;border:1px dashed rgba(255,255,255,.16);background:transparent;color:var(--text);opacity:.85}

.globalLoader{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.8), rgba(255,255,255,0));
  background-size: 200% 100%;
  transform: translateY(-6px);
  transition: opacity .15s var(--ease), transform .15s var(--ease);
  animation: loaderMove 1.05s linear infinite;
}
[data-theme="light"] .globalLoader{
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(0,0,0,.55), rgba(0,0,0,0));
}
.globalLoader.show{
  opacity: 1;
  transform: translateY(0);
}
@keyframes loaderMove{
  0%{ background-position: 0% 0; }
  100%{ background-position: 200% 0; }
}


/* Exchange buttons row */
.rowBtns{display:flex;gap:10px;align-items:center;}
.rowBtns .primary{flex:1;}
.rowBtns .ghost{flex:1;}
