:root {
  --bg: #08110d;
  --bg-2: #0a1712;
  --surface: rgba(23, 38, 30, .66);
  --surface-2: rgba(30, 48, 39, .7);
  --hair: rgba(150, 166, 158, .13);
  --hair-2: rgba(150, 166, 158, .24);
  --mint: #3ddc97;
  --mint-l: #7bffce;
  --mint-d: #159c67;
  --emerald: #12b981;
  --text: #eaf5ee;
  --muted: #86a597;
  --muted-2: #5f7a6d;
  --danger: #ff6b6b;
  --warn: #ffcf6b;
  --info: #6fc3ff;
  --r-lg: 12px;
  --r: 9px;
  --r-sm: 7px;
  --glow: 0 0 0 1px var(--hair), 0 10px 30px -12px rgba(0,0,0,.7);
  --glow-mint: 0 6px 18px -10px rgba(0,0,0,.55);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "SF Pro Text", Roboto, sans-serif;
  min-height: 100vh;
  padding-bottom: 92px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  letter-spacing: .1px;
}
/* layered ambient glow */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; border-radius: 50%;
  filter: blur(80px); opacity: .12; pointer-events: none;
}
body::before {
  width: 460px; height: 460px; top: -180px; left: -120px;
  background: radial-gradient(circle, rgba(61,220,151,.4), transparent 70%);
  animation: float1 16s ease-in-out infinite;
}
body::after {
  width: 400px; height: 400px; bottom: -160px; right: -120px;
  background: radial-gradient(circle, rgba(20,150,120,.32), transparent 70%);
  animation: float2 20s ease-in-out infinite;
}
@keyframes float1 { 50% { transform: translate(60px, 40px); } }
@keyframes float2 { 50% { transform: translate(-50px, -30px); } }
@media (prefers-reduced-motion: reduce) { body::before, body::after { animation: none; } }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- header ---------- */
.top { display: flex; align-items: center; gap: 12px; padding: 14px 18px 12px;
  position: sticky; top: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(8,17,13,.94), rgba(8,17,13,.62) 70%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.top::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(120,224,176,.22), transparent); }
.brandmark {
  width: 40px; height: 40px; border-radius: 9px; flex: 0 0 40px;
}
.brand { font-weight: 800; font-size: 18px; letter-spacing: .2px; line-height: 1.1; display: flex; align-items: center; gap: 2px; }
.brand span { color: var(--mint); }
.verified { width: 17px; height: 17px; margin-left: 3px; filter: drop-shadow(0 0 5px rgba(61,220,151,.5)); }
.tagline { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.top-pill {
  margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--mint);
  background: rgba(61,220,151,.1); border: 1px solid var(--hair-2);
  padding: 5px 10px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px;
}

/* ---------- screens ---------- */
.wrap { padding: 8px 16px 20px; }
.scr { animation: fade .28s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }
.h1 { font-size: 21px; font-weight: 800; letter-spacing: .2px; margin: 6px 2px 16px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.row + .row { margin-top: 8px; }
.hr { height: 1px; background: var(--hair); border: 0; margin: 14px 0; }

/* ---------- glass card ---------- */
.card {
  position: relative; background: var(--surface);
  border: 1px solid var(--hair); border-radius: var(--r-lg);
  padding: 15px; margin-bottom: 13px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 30px -22px rgba(0,0,0,.8);
}
.card.tap { cursor: pointer; transition: transform .12s ease, border-color .2s ease; }
.card.tap:active { transform: scale(.985); border-color: var(--hair-2); }
.card-hd { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }

/* ---------- chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted);
  background: rgba(10,22,16,.6); border: 1px solid var(--hair);
  border-radius: 7px; padding: 4px 9px;
}
.badge { font-size: 10.5px; font-weight: 700; padding: 4px 9px; border-radius: 6px; letter-spacing: .2px; }
.b-open { background: rgba(61,220,151,.14); color: var(--mint); }
.b-active { background: rgba(111,195,255,.15); color: var(--info); }
.b-wait { background: rgba(255,207,107,.15); color: var(--warn); }
.b-done { background: rgba(61,220,151,.16); color: var(--mint); }
.b-bad { background: rgba(255,107,107,.15); color: var(--danger); }

/* ---------- swap visual ---------- */
.swap { display: flex; align-items: stretch; gap: 10px; margin: 12px 0; }
.swap-leg {
  flex: 1; min-width: 0; background: rgba(10,22,16,.5); border: 1px solid var(--hair);
  border-radius: var(--r); padding: 11px; text-align: center;
}
.leg-amt { font-weight: 800; font-size: 16px; overflow-wrap: anywhere; }
.leg-as { color: var(--mint); font-size: 12px; font-weight: 800; }
.leg-mode { color: var(--muted-2); font-size: 10.5px; margin-top: 3px; text-transform: uppercase; letter-spacing: .4px; }
.swap-mid { display: flex; align-items: center; flex: 0 0 auto; color: var(--mint); }
.swap-mid svg { width: 18px; height: 18px; background: var(--bg-2);
  border: 1px solid var(--hair); border-radius: 999px; padding: 7px; }

/* ---------- wallet hero ---------- */
.hero {
  background: linear-gradient(150deg, rgba(61,220,151,.16), rgba(18,155,109,.06) 55%, rgba(10,22,16,.4));
  border: 1px solid var(--hair-2); border-radius: var(--r-lg); padding: 18px;
  margin-bottom: 14px; box-shadow: var(--glow-mint);
}
.hero-label { color: var(--muted); font-size: 12px; letter-spacing: .3px; }
.hero-total { font-size: 15px; color: var(--muted); margin-top: 2px; }
.asset-row { display: flex; align-items: center; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--hair); }
.asset-row:last-child { border-bottom: none; }
.coin {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 9px;
  display: grid; place-items: center; font-weight: 800; font-size: 12px; color: #04140d;
  background: #1c3a2c; color: var(--mint); border: 1px solid var(--hair-2);
}
.coin.c-crypto { background: #123026; color: #4fd6a0; }
.coin.c-fiat   { background: #16233f; color: #8fb0ff; }
.coin.c-stars  { background: #2c2512; color: #ffcf6b; }
.coin.c-nft    { background: #281640; color: #d99bff; }
.coin.c-custom { background: #123030; color: #7fd0c4; }
.asset-amt { margin-left: auto; text-align: right; font-weight: 800; font-size: 16px; }
.lockpill { display:inline-block; color: var(--warn); font-size: 11px; font-weight: 600; margin-top: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: block; width: 100%; text-align: center; cursor: pointer;
  background: linear-gradient(180deg, #3fca8c, #2fb079);
  color: #04150d; font-weight: 700; border: none; border-radius: 9px;
  padding: 14px; font-size: 15px; margin-top: 12px;
  box-shadow: 0 4px 14px -8px rgba(0,0,0,.6);
  transition: transform .12s ease, filter .2s ease;
}
.btn:active { transform: translateY(1px) scale(.99); filter: brightness(1.05); }
.btn.ghost { background: rgba(61,220,151,.08); color: var(--mint); border: 1px solid var(--hair-2); box-shadow: none; }
.btn.warn { background: linear-gradient(180deg,#ffe08a,#e0a72e); color: #241a00; box-shadow: none; }
.btn.danger { background: linear-gradient(180deg,#ff9a9a,#d94f4f); color: #2a0808; box-shadow: none; }
.btn.sm { padding: 10px; font-size: 13px; margin-top: 0; border-radius: 11px; box-shadow: none; }
.btn.icn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row .btn { margin-top: 0; }
.btn-col { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.btn-col .btn { margin-top: 0; }

/* segmented control */
.seg { display: flex; gap: 4px; background: rgba(10,22,16,.6); border: 1px solid var(--hair);
  border-radius: 9px; padding: 4px; }
.seg-opt { flex: 1; text-align: center; padding: 9px; border-radius: 6px; font-size: 13px;
  font-weight: 700; color: var(--muted); cursor: pointer; transition: .15s; }
.seg-opt.on { background: linear-gradient(180deg,var(--mint-l),var(--emerald)); color: #04150d; box-shadow: var(--glow-mint); }

/* create: simple leg + hint */
.card-hd + select, .card-hd + input, .card-hd + textarea { margin-top: 11px; }
.field-mt { margin-top: 11px; }
.leg-hint { font-size: 12px; color: var(--muted); margin-top: 10px;
  background: rgba(10,22,16,.5); border: 1px solid var(--hair); border-radius: 10px; padding: 9px 12px; }

/* toggle switch */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r); padding: 13px 15px; margin: 13px 0; }
.switch-title { font-weight: 700; font-size: 14.5px; }
.switch { position: relative; display: inline-block; width: 48px; height: 28px; flex: 0 0 48px; }
.switch input { display: none; }
.slider { position: absolute; inset: 0; background: rgba(10,22,16,.9); border: 1px solid var(--hair-2); border-radius: 999px; transition: .2s; }
.slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: var(--muted); border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: linear-gradient(180deg, var(--mint-l), var(--emerald)); border-color: transparent; }
.switch input:checked + .slider::before { transform: translateX(20px); background: #04150d; }

/* ---------- forms ---------- */
label { display: block; font-size: 12px; color: var(--muted); margin: 13px 0 6px; }
input, select, textarea {
  width: 100%; background: rgba(10,22,16,.6); color: var(--text);
  border: 1px solid var(--hair); border-radius: 9px; padding: 12px; font-size: 15px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--mint-d); box-shadow: 0 0 0 3px rgba(61,220,151,.12); }
textarea { resize: vertical; min-height: 62px; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; }

/* ---------- NFT gifts ---------- */
.gift-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.gift {
  position: relative; border-radius: 10px; overflow: hidden; border: 1px solid var(--hair-2);
  background: radial-gradient(120% 90% at 50% 0%, rgba(61,220,151,.18), rgba(10,22,16,.6));
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
}
.gift img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.gift .gift-ph { color: var(--muted-2); font-size: 26px; }
.gift-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 10px;
  background: linear-gradient(0deg, rgba(4,12,8,.92), transparent); }
.gift-name { font-size: 11.5px; font-weight: 800; line-height: 1.15; }
.gift-num { font-size: 10px; color: var(--mint); font-weight: 700; }
.gift-inline { display: flex; align-items: center; gap: 10px; }
.gift-thumb { position: relative; width: 46px; height: 46px; flex: 0 0 46px; border-radius: 11px; overflow: hidden;
  border: 1px solid var(--hair-2); background: radial-gradient(120% 90% at 50% 0%, rgba(61,220,151,.2), rgba(10,22,16,.6));
  display: grid; place-items: center; }
.gift-thumb .gift-ph { font-size: 18px; }
.gift-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }

/* ---------- deal legs / timeline ---------- */
.leg-line { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--hair); }
.leg-line:last-child { border-bottom: none; }
.leg-ic { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 9px; display: grid; place-items: center;
  background: rgba(10,22,16,.6); border: 1px solid var(--hair); color: var(--mint); }
.leg-body { flex: 1; min-width: 0; }
.flags { text-align: right; font-size: 11px; color: var(--muted); white-space: nowrap; }
.flag-ok { color: var(--mint); }
.flag-wait { color: var(--warn); }

/* ---------- chat ---------- */
.chat { max-height: 250px; overflow-y: auto; padding: 4px 0; margin-top: 6px; }
.msg { margin: 7px 0; }
.msg .who { font-size: 10.5px; color: var(--muted-2); }
.msg .bub { display: inline-block; max-width: 82%; background: rgba(10,22,16,.6); border: 1px solid var(--hair);
  border-radius: 13px; padding: 8px 12px; margin-top: 2px; overflow-wrap: anywhere; }
.msg.me { text-align: right; }
.msg.me .bub { background: rgba(61,220,151,.14); border-color: var(--hair-2); }

/* ---------- nav ---------- */
nav {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 2px; padding: 7px 6px; border-radius: 14px;
  background: rgba(10,20,15,.82); border: 1px solid var(--hair);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 14px 40px -12px rgba(0,0,0,.7);
}
.nav-i { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; color: var(--muted-2); font-size: 9.5px; font-weight: 600;
  padding: 7px 2px; border-radius: 13px; transition: color .2s, background .2s; }
.nav-i svg { width: 21px; height: 21px; }
.nav-i.active { color: var(--mint); background: rgba(61,220,151,.1); }
.nav-i.active::before { content: ""; position: absolute; top: 1px; left: 50%; transform: translateX(-50%);
  width: 16px; height: 3px; border-radius: 3px; background: var(--mint); }

/* ---------- skeleton ---------- */
.skel { border-radius: 10px; background: linear-gradient(100deg, rgba(255,255,255,.04) 30%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.04) 70%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-line { height: 12px; margin: 8px 0; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 46px 14px; }
.empty svg { width: 46px; height: 46px; color: var(--muted-2); margin-bottom: 10px; }
.toast { position: fixed; left: 50%; bottom: 104px; transform: translateX(-50%) translateY(10px);
  background: rgba(20,35,27,.96); border: 1px solid var(--hair-2); color: var(--text);
  padding: 12px 18px; border-radius: 13px; font-size: 14px; z-index: 60; max-width: 86%;
  text-align: center; box-shadow: 0 10px 34px rgba(0,0,0,.55); opacity: 0;
  border-left: 3px solid var(--mint-d); animation: toast .25s ease forwards; }
.toast.ok { border-left-color: var(--mint); }
.toast.err { border-left-color: var(--danger); }
@keyframes toast { to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pill { background: rgba(10,22,16,.6); border: 1px solid var(--hair); color: var(--muted);
  border-radius: 8px; padding: 6px 12px; font-size: 12px; cursor: pointer; transition: .15s; }
.pill.on { background: rgba(61,220,151,.14); color: var(--mint); border-color: var(--hair-2); }
.small { font-size: 12px; }
code.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--mint); }
.ic { width: 20px; height: 20px; vertical-align: middle; }

/* ---------- create: swap connector ---------- */
.swap-connector { display: flex; justify-content: center; margin: -4px 0 7px; }
.swap-connector svg { width: 20px; height: 20px; color: var(--mint); background: var(--bg-2);
  border: 1px solid var(--hair-2); border-radius: 999px; padding: 9px; box-shadow: var(--glow-mint); }

/* ---------- next-step hint ---------- */
.hint { border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--hair); background: rgba(10,22,16,.5); }
.hint-mine { border-color: var(--hair-2); background: linear-gradient(180deg, rgba(61,220,151,.16), rgba(61,220,151,.05)); }
.hint-wait { color: var(--warn); background: rgba(255,207,107,.08); border-color: rgba(255,207,107,.22); }
.hint-done { color: var(--mint); background: rgba(61,220,151,.1); border-color: var(--hair-2); }
.hint-bad { color: var(--danger); background: rgba(255,107,107,.08); border-color: rgba(255,107,107,.22); }
.hint .ttl { margin-top: 5px; font-size: 11.5px; font-weight: 600; opacity: .85; }

/* ---------- requisites + copy ---------- */
.reqline { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.reqline .small { overflow-wrap: anywhere; }
.copybtn { flex: 0 0 auto; background: rgba(61,220,151,.1); color: var(--mint); border: 1px solid var(--hair-2);
  border-radius: 8px; padding: 4px 10px; font-size: 11px; font-weight: 700; cursor: pointer; }
.copybtn:active { transform: scale(.96); }

/* ---------- wallet hero ---------- */
.hero-wallet { position: relative; overflow: hidden; }
.hero-wallet::after { content: ""; position: absolute; right: -16px; top: -16px; width: 116px; height: 116px;
  background: url('logo.svg') no-repeat center / contain; opacity: .09; transform: rotate(8deg); pointer-events: none; }
.hero-big { font-size: 34px; font-weight: 800; line-height: 1.1; margin: 4px 0 2px; }

/* ---------- trust strip ---------- */
.trust { display: flex; align-items: center; gap: 12px; margin-bottom: 13px;
  background: linear-gradient(150deg, rgba(61,220,151,.14), rgba(10,22,16,.5));
  border: 1px solid var(--hair-2); border-radius: var(--r-lg); padding: 13px 15px; }
.trust-ic { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; display: grid; place-items: center;
  font-size: 19px; background: rgba(61,220,151,.14); border: 1px solid var(--hair-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.15); }
.trust b { font-size: 13.5px; }
.trust-list { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.trust-list div { display: flex; gap: 8px; font-size: 12.5px; color: var(--muted); }
.trust-list b { color: var(--text); font-weight: 600; }

/* ---------- rich NFT card ---------- */
.giftc { border: 1px solid var(--hair-2); border-radius: 10px; overflow: hidden; background: rgba(10,22,16,.5); }
.giftc-img { position: relative; aspect-ratio: 1 / 1; display: grid; place-items: center;
  background: radial-gradient(120% 90% at 50% 0%, rgba(61,220,151,.18), rgba(10,22,16,.6)); }
.giftc-img .gift-ph { font-size: 26px; color: var(--muted-2); }
.giftc-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.giftc-info { padding: 9px 10px 11px; }
.nft-slot { display: flex; flex-direction: column; gap: 7px; }
.nft-slot .giftc { flex: 1; }
.gift-attrs { margin-top: 7px; display: flex; flex-direction: column; gap: 3px; }
.attr { display: flex; align-items: center; gap: 6px; font-size: 10.5px; }
.attr span { color: var(--muted); }
.attr b { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attr i { margin-left: auto; color: var(--mint); font-style: normal; font-size: 9.5px; font-weight: 700;
  background: rgba(61,220,151,.12); border: 1px solid var(--hair-2); border-radius: 999px; padding: 1px 6px; }
.attr i.r-rare { color: #c9a8ff; background: rgba(201,168,255,.14); border-color: rgba(201,168,255,.4); }
.attr i.r-leg { color: #ffd873; background: rgba(255,216,115,.15); border-color: rgba(255,216,115,.45);
  box-shadow: 0 0 10px -2px rgba(255,216,115,.5); }

/* ---------- invite / share ---------- */
.invite-link { font-size: 12px; color: var(--mint); background: rgba(10,22,16,.6);
  border: 1px solid var(--hair); border-radius: 10px; padding: 9px 11px; margin-top: 4px;
  overflow-wrap: anywhere; font-family: ui-monospace, Menlo, Consolas, monospace; }
