:root {
  --bg: #06100d;
  --bg-soft: #0a1813;
  --panel: rgba(14, 30, 24, 0.84);
  --panel-strong: #0e211a;
  --line: rgba(199, 246, 221, 0.13);
  --line-bright: rgba(171, 255, 207, 0.3);
  --text: #f5f8f6;
  --muted: #91a59b;
  --green: #90f7bc;
  --green-strong: #3be786;
  --green-dark: #123b28;
  --yellow: #d5f277;
  --danger: #ff9d86;
  --radius: 24px;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 17%, rgba(28, 115, 74, 0.16), transparent 27rem),
    linear-gradient(180deg, #07120e 0%, #07110e 44%, #091712 100%);
  font: 500 16px/1.55 "Manrope", sans-serif;
  overflow-x: hidden;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.ambient { position: fixed; pointer-events: none; filter: blur(110px); border-radius: 50%; opacity: .24; z-index: -1; }
.ambient-one { width: 420px; height: 420px; right: -190px; top: 9%; background: #167548; }
.ambient-two { width: 360px; height: 360px; left: -170px; top: 62%; background: #827c23; opacity: .09; }

.topbar, main, footer { width: min(1240px, calc(100% - 48px)); margin-inline: auto; }
.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: .78rem; letter-spacing: .16em; font-weight: 700; }
.brand b { color: var(--green); }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  color: #07120e; background: var(--green); font: 700 .72rem/1 "Unbounded", sans-serif;
  box-shadow: 0 0 26px rgba(144, 247, 188, .18);
}
nav { display: flex; align-items: center; gap: 34px; color: #a8b7af; font-size: .88rem; }
nav a { transition: color .2s ease; }
nav a:hover { color: var(--text); }
.wallet-button {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-bright); border-radius: 14px; background: rgba(16, 39, 29, .74); cursor: pointer;
  font-size: .84rem; font-weight: 700; transition: .2s ease;
}
.wallet-button:hover { transform: translateY(-1px); border-color: var(--green); background: #132c22; }
.wallet-dot, .live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green-strong); box-shadow: 0 0 12px var(--green-strong); }

.market-shell { min-height: 720px; padding: 82px 0 64px; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(380px, .82fr); gap: 92px; align-items: start; }
.market-copy { padding-top: 14px; }
.eyebrow, .card-kicker, .section-tag, .section-heading > span, .activity-head > div > span, .audit-label {
  color: var(--green); font-size: .72rem; font-weight: 800; letter-spacing: .19em;
}
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow span { width: 24px; height: 1px; background: var(--green); }
h1 { margin: 25px 0 24px; max-width: 720px; font: 600 clamp(3rem, 6vw, 5.7rem)/.98 "Unbounded", sans-serif; letter-spacing: -.06em; }
h1 em { color: var(--green); font-style: normal; }
.lead { max-width: 630px; margin: 0; color: #a7b8af; font-size: 1.06rem; line-height: 1.8; }
.price-row { margin-top: 46px; display: flex; align-items: center; gap: 56px; }
.metric-label { display: block; margin-bottom: 3px; color: var(--muted); font-size: .78rem; }
.price-row strong { display: block; font: 600 clamp(2.2rem, 4vw, 3.6rem)/1.1 "Unbounded", sans-serif; letter-spacing: -.04em; }
.price-row small { display: flex; align-items: center; gap: 8px; margin-top: 9px; color: #748c80; font-size: .72rem; }
.price-ring { width: 112px; aspect-ratio: 1; position: relative; display: grid; place-items: center; }
.price-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track, .ring-value { fill: none; stroke-width: 5; }
.ring-track { stroke: rgba(255,255,255,.07); }
.ring-value { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 270.2; stroke-dashoffset: 0; filter: drop-shadow(0 0 5px rgba(144,247,188,.45)); transition: stroke-dashoffset .5s ease; }
.price-ring > div { position: absolute; text-align: center; }
.price-ring b { display: block; font: 600 1.12rem/1.1 "Unbounded", sans-serif; }
.price-ring span { color: var(--muted); font-size: .62rem; }
.market-metrics { margin-top: 44px; padding-top: 25px; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.market-metrics article { min-width: 0; }
.market-metrics span { display: block; color: #71867b; font-size: .7rem; margin-bottom: 8px; }
.market-metrics b { display: block; overflow: hidden; text-overflow: ellipsis; font-size: .93rem; white-space: nowrap; }

.trade-card { position: sticky; top: 24px; padding: 29px; border: 1px solid var(--line-bright); border-radius: 28px; background: linear-gradient(145deg, rgba(16, 37, 29, .96), rgba(9, 25, 19, .96)); box-shadow: var(--shadow); backdrop-filter: blur(22px); }
.trade-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(130deg, rgba(144,247,188,.08), transparent 34%); pointer-events: none; }
.card-head { position: relative; display: flex; justify-content: space-between; align-items: start; }
.card-head h2 { margin: 5px 0 0; font: 600 1.45rem/1.2 "Unbounded", sans-serif; letter-spacing: -.04em; }
.mode-badge { padding: 7px 10px; border: 1px solid rgba(213,242,119,.25); border-radius: 9px; color: var(--yellow); background: rgba(213,242,119,.08); font-size: .63rem; font-weight: 800; letter-spacing: .12em; }
.mode-badge.live { color: var(--green); border-color: rgba(144,247,188,.28); background: rgba(144,247,188,.08); }
.tabs { position: relative; margin: 26px 0 24px; padding: 4px; display: grid; grid-template-columns: repeat(3,1fr); border: 1px solid var(--line); border-radius: 13px; background: rgba(3, 14, 10, .55); }
.tab { height: 40px; border: 0; border-radius: 9px; background: transparent; color: #7e9288; cursor: pointer; font-size: .8rem; font-weight: 700; }
.tab.active { color: #07120e; background: var(--green); box-shadow: 0 8px 22px rgba(76,222,137,.13); }
.field-label { display: flex; justify-content: space-between; gap: 10px; margin: 0 2px 8px; color: #81978b; font-size: .69rem; }
.amount-field { position: relative; height: 68px; display: flex; align-items: center; border: 1px solid rgba(187, 232, 206, .16); border-radius: 15px; background: rgba(3, 13, 10, .6); overflow: hidden; transition: border .2s ease; }
.amount-field:focus-within { border-color: var(--green); }
.amount-field.muted { background: rgba(4, 14, 10, .35); }
.amount-field input { width: 100%; height: 100%; padding: 0 132px 0 18px; border: 0; outline: 0; color: var(--text); background: transparent; font: 600 1.35rem/1 "Unbounded", sans-serif; }
.amount-field input::placeholder { color: #46594f; }
.currency-pill { position: absolute; right: 12px; display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 800; }
.currency-pill i { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 50%; font-style: normal; }
.token-usdt { color: #fff; background: #26a17b; }
.token-af { color: #06100d; background: var(--green); }
.swap-line { height: 43px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; color: #71887c; font-size: .67rem; }
.swap-line span { height: 1px; background: var(--line); }
.quote-details { margin: 19px 2px; display: grid; gap: 8px; color: #7d9186; font-size: .7rem; }
.quote-details div { display: flex; justify-content: space-between; gap: 15px; }
.quote-details b { color: #bdcac3; font-weight: 600; }
.primary-action { width: 100%; min-height: 55px; border: 0; border-radius: 14px; color: #06100d; background: var(--green); cursor: pointer; font-weight: 800; box-shadow: 0 14px 35px rgba(72, 228, 139, .16); transition: .2s ease; }
.primary-action:hover { transform: translateY(-2px); background: #a9ffce; box-shadow: 0 18px 45px rgba(72,228,139,.22); }
.primary-action:disabled { cursor: wait; opacity: .58; transform: none; }
.card-note { margin: 14px 7px 0; color: #62776c; font-size: .66rem; line-height: 1.55; text-align: center; }

.ticker { width: 100vw; margin-left: calc((100vw - 100%) / -2); min-height: 68px; padding: 0 max(28px, calc((100vw - 1240px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 28px; border-block: 1px solid var(--line); background: rgba(10, 25, 19, .65); color: #788e82; font-size: .7rem; letter-spacing: .07em; white-space: nowrap; overflow: hidden; }
.ticker span { display: inline-flex; gap: 8px; }
.ticker b { color: var(--text); }
.ticker i { width: 4px; height: 4px; border-radius: 50%; background: var(--green); }

.section { padding: 118px 0; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 45px; }
.section-heading h2, .formula-copy h2, .activity-head h2 { margin: 10px 0 0; font: 600 clamp(2.1rem, 4vw, 3.4rem)/1.1 "Unbounded", sans-serif; letter-spacing: -.05em; }
.mechanic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.mechanic-grid article { position: relative; min-height: 316px; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(12, 28, 22, .72); overflow: hidden; }
.mechanic-grid article::after { content:""; position:absolute; width:160px; height:160px; right:-90px; top:-90px; border-radius:50%; border:1px solid rgba(144,247,188,.12); }
.mechanic-grid .accent-card { border-color: rgba(144,247,188,.35); background: linear-gradient(150deg, #123625, #0c2119); }
.step { color: #587065; font: 600 .75rem/1 "Unbounded", sans-serif; }
.icon-box { width: 54px; height: 54px; margin: 46px 0 25px; display: grid; place-items: center; border: 1px solid var(--line-bright); border-radius: 15px; color: var(--green); background: rgba(144,247,188,.05); font-size: 1.35rem; }
.mechanic-grid h3 { margin: 0 0 10px; font: 600 1.05rem/1.25 "Unbounded", sans-serif; }
.mechanic-grid p { margin: 0; color: #82978c; font-size: .84rem; line-height: 1.7; }

.transparency { border-top: 1px solid var(--line); }
.formula-panel { padding: 56px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 80px; align-items: center; border: 1px solid var(--line); border-radius: 30px; background: radial-gradient(circle at 100% 0, rgba(55, 173, 105, .12), transparent 45%), rgba(10, 25, 19, .7); }
.formula-copy h2 { margin-top: 18px; }
.formula-copy p { max-width: 470px; margin: 23px 0 0; color: #879a90; line-height: 1.75; }
.formula-card { padding: 30px; border: 1px solid var(--line-bright); border-radius: 22px; background: rgba(4, 15, 11, .65); }
.formula-card > div:not(.fraction-line):not(.equals):not(.formula-result) { display: flex; justify-content: space-between; align-items: center; gap: 25px; color: #85998e; font-size: .78rem; }
.formula-card > div b { color: var(--text); font: 600 1rem/1.2 "Unbounded", sans-serif; }
.fraction-line { height: 1px; margin: 18px 0; background: linear-gradient(90deg, transparent, var(--line-bright), transparent); }
.equals { margin: 21px 0; color: var(--green); text-align: center; font: 600 1.4rem/1 "Unbounded", sans-serif; }
.formula-result { padding: 21px; display: flex; justify-content: space-between; align-items: center; border-radius: 15px; color: #90a499; background: rgba(144,247,188,.08); font-size: .78rem; }
.formula-result b { color: var(--green) !important; font-size: 1.3rem !important; }
.audit-grid { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.audit-grid article { min-height: 300px; padding: 34px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(11, 27, 21, .65); }
.audit-grid h3 { margin: 11px 0 28px; font: 600 1.2rem/1.3 "Unbounded", sans-serif; }
.audit-grid ul { margin: 0; padding: 0; list-style: none; }
.audit-grid li { padding: 13px 0; display: flex; justify-content: space-between; gap: 15px; border-top: 1px solid var(--line); color: #82978c; font-size: .8rem; }
.audit-grid li b { color: var(--text); }
.risk-card { background: linear-gradient(145deg, rgba(32,43,20,.75), rgba(11,27,21,.8)) !important; }
.risk-card p { max-width: 500px; color: #94a596; font-size: .88rem; line-height: 1.8; }
.text-button { margin-top: 24px; padding: 0; border: 0; color: var(--green); background: transparent; cursor: pointer; font-weight: 700; font-size: .8rem; }
.text-button span { margin-left: 9px; }

.activity { padding-top: 30px; }
.activity-head { margin-bottom: 30px; display: flex; justify-content: space-between; align-items: end; }
.activity-head h2 { font-size: 2rem; }
.network-pill { display: inline-flex; align-items: center; gap: 9px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: #7d9387; font-size: .7rem; }
.network-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); }
.table-wrap { border: 1px solid var(--line); border-radius: 20px; overflow-x: auto; background: rgba(8, 22, 16, .62); }
table { width: 100%; min-width: 720px; border-collapse: collapse; }
th, td { padding: 19px 24px; text-align: left; border-bottom: 1px solid var(--line); font-size: .77rem; }
th { color: #677d71; font-weight: 600; }
td { color: #9caf9f; }
tbody tr:last-child td { border-bottom: 0; }
.op-icon { width: 28px; height: 28px; margin-right: 9px; display: inline-grid; place-items: center; border-radius: 9px; }
.op-icon.buy { color: var(--green); background: rgba(144,247,188,.08); }
.op-icon.sell { color: var(--danger); background: rgba(255,157,134,.08); }
.op-icon.deposit { color: var(--yellow); background: rgba(213,242,119,.08); }
.status { padding: 5px 9px; border-radius: 7px; color: var(--green); background: rgba(144,247,188,.08); font-size: .68rem; }

footer { min-height: 170px; padding: 45px 0; display: grid; grid-template-columns: 1fr 1.5fr 1fr; align-items: center; gap: 30px; border-top: 1px solid var(--line); color: #667b70; font-size: .69rem; }
footer p { margin: 0; text-align: center; line-height: 1.6; }
footer > span { text-align: right; }

dialog { width: min(650px, calc(100% - 32px)); padding: 39px; border: 1px solid var(--line-bright); border-radius: 26px; color: var(--text); background: #0d2119; box-shadow: 0 30px 100px #000; }
dialog::backdrop { background: rgba(2,8,5,.78); backdrop-filter: blur(7px); }
dialog h2 { margin: 12px 0 29px; font: 600 1.7rem/1.25 "Unbounded", sans-serif; }
.dialog-close { position: absolute; right: 20px; top: 18px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; color: #8ea096; background: transparent; cursor: pointer; font-size: 1.2rem; }
.dialog-list { display: grid; gap: 12px; }
.dialog-list article { padding: 18px; display: grid; grid-template-columns: 38px 1fr; gap: 14px; border: 1px solid var(--line); border-radius: 15px; }
.dialog-list article > b { color: var(--green); font-family: "Unbounded", sans-serif; font-size: .72rem; }
.dialog-list h3 { margin: 0 0 5px; font-size: .9rem; }
.dialog-list p { margin: 0; color: #81958a; font-size: .78rem; line-height: 1.55; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 26px; transform: translate(-50%, 130px); max-width: min(430px, calc(100% - 30px)); padding: 13px 18px; border: 1px solid var(--line-bright); border-radius: 12px; color: #d9e9df; background: #112a20; box-shadow: var(--shadow); opacity: 0; transition: .3s ease; font-size: .78rem; text-align: center; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 980px) {
  nav { display: none; }
  .market-shell { grid-template-columns: 1fr; gap: 50px; padding-top: 60px; }
  .trade-card { position: relative; top: auto; max-width: 620px; width: 100%; }
  .mechanic-grid { grid-template-columns: 1fr; }
  .mechanic-grid article { min-height: 260px; }
  .icon-box { margin-top: 30px; }
  .formula-panel { grid-template-columns: 1fr; gap: 46px; padding: 40px; }
}

@media (max-width: 700px) {
  .topbar, main, footer { width: min(100% - 28px, 1240px); }
  .topbar { height: 76px; }
  .brand > span:last-child { display: none; }
  .wallet-button { padding-inline: 13px; }
  .market-shell { padding: 45px 0; }
  h1 { font-size: clamp(2.5rem, 13vw, 4rem); }
  .lead { font-size: .93rem; }
  .price-row { align-items: end; justify-content: space-between; gap: 16px; }
  .price-ring { width: 92px; }
  .market-metrics { grid-template-columns: 1fr 1fr; }
  .market-metrics article:last-child { grid-column: 1 / -1; }
  .trade-card { padding: 21px; border-radius: 22px; }
  .ticker { justify-content: start; }
  .section { padding: 82px 0; }
  .section-heading { display: block; }
  .section-heading h2 { margin-top: 15px; }
  .formula-panel { padding: 26px 20px; }
  .formula-card { padding: 21px 16px; }
  .formula-card > div:not(.fraction-line):not(.equals):not(.formula-result), .formula-result { align-items: start; flex-direction: column; gap: 8px; }
  .audit-grid { grid-template-columns: 1fr; }
  .activity-head { align-items: start; gap: 22px; flex-direction: column; }
  footer { grid-template-columns: 1fr; text-align: center; }
  footer .brand { justify-content: center; }
  footer .brand > span:last-child { display: inline; }
  footer > span { text-align: center; }
  dialog { padding: 31px 20px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (max-width: 700px) {
  .ticker { width: calc(100% + 28px); margin-left: -14px; padding-inline: 14px; }
}

