:root {
  color-scheme: dark;
  --bg: #080b0c;
  --panel: #111617;
  --panel-2: #171d1e;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f5f5ef;
  --muted: #8d9998;
  --green: #b9f04b;
  --green-dark: #779b2e;
  --orange: #ff8e42;
  --danger: #ff6c64;
  --radius: 24px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(185, 240, 75, 0.11), transparent 32%),
    radial-gradient(circle at 92% 28%, rgba(255, 142, 66, 0.08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

button, input, select { font: inherit; }
button { color: inherit; }

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
}

.shell { width: min(1160px, calc(100% - 32px)); margin: 0 auto; padding: 22px 0 64px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; background: var(--green); color: #0a0d08; font-weight: 900; font-size: 22px; transform: rotate(-5deg); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .02em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 11px; }

.wallet-button { display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 999px; padding: 11px 16px; background: rgba(17, 22, 23, .88); cursor: pointer; transition: .2s ease; }
.wallet-button:hover { border-color: rgba(185, 240, 75, .45); transform: translateY(-1px); }
.wallet-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 12px rgba(255, 142, 66, .7); }
.wallet-button.connected .wallet-dot { background: var(--green); box-shadow: 0 0 12px rgba(185, 240, 75, .7); }

.hero { display: grid; grid-template-columns: 1.12fr .88fr; align-items: end; gap: 36px; padding: 74px 0 48px; }
.eyebrow, .section-kicker { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { margin: 15px 0 18px; font-size: clamp(46px, 7vw, 82px); line-height: .93; letter-spacing: -.055em; }
.hero p { max-width: 650px; margin: 0; color: #aeb8b7; font-size: 16px; line-height: 1.7; }
.hero code { color: var(--text); background: rgba(255,255,255,.06); border-radius: 6px; padding: 2px 6px; }

.route-map { display: grid; grid-template-columns: 86px 1fr 86px; align-items: center; min-height: 150px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(23, 29, 30, .92), rgba(10, 14, 15, .9)); }
.token-orb { display: grid; place-items: center; width: 86px; height: 86px; border-radius: 50%; font-weight: 900; }
.token-orb.usd { background: #ecfff7; color: #0c8560; box-shadow: 0 0 0 8px rgba(236,255,247,.05); }
.token-orb.dog { background: var(--orange); color: #211006; box-shadow: 0 0 0 8px rgba(255,142,66,.06); }
.route-line { position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; color: var(--muted); font-size: 11px; text-align: center; }
.route-line::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: linear-gradient(90deg, var(--green), rgba(255,255,255,.16), var(--orange)); transform: translateY(-50%); z-index: 0; }
.route-line span, .route-line strong { position: relative; z-index: 1; background: #121718; padding: 2px 8px; }
.route-line strong { color: var(--text); font-size: 12px; }

.content-grid { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr); gap: 22px; align-items: start; }
.swap-card, .info-card { border: 1px solid var(--line); background: rgba(17, 22, 23, .9); box-shadow: 0 22px 80px rgba(0,0,0,.22); }
.swap-card { border-radius: 30px; padding: 28px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.card-head h2, .info-card h3 { margin: 6px 0 0; }
.card-head h2 { font-size: 28px; }
.safe-badge { border: 1px solid rgba(185,240,75,.2); border-radius: 999px; padding: 8px 10px; color: var(--green); background: rgba(185,240,75,.06); font-size: 11px; }

.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin-bottom: 12px; border-radius: 14px; background: #0b0f10; }
.mode-tab { border: 0; border-radius: 10px; padding: 11px; background: transparent; color: var(--muted); cursor: pointer; }
.mode-tab.active { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

.amount-panel { border: 1px solid var(--line); border-radius: 20px; padding: 18px; background: #0d1213; }
.amount-panel:focus-within { border-color: rgba(185,240,75,.4); }
.output-panel { background: #121718; }
.amount-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--green); cursor: pointer; }
.amount-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-top: 12px; }
.amount-row input, .amount-row output { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: clamp(28px, 5vw, 42px); font-weight: 700; letter-spacing: -.035em; }
.amount-row input::placeholder { color: #485150; }
.token-pill { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 8px 11px 8px 8px; background: #1a2021; white-space: nowrap; }
.mini-token { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 900; }
.mini-token.usd { color: #0a7252; background: #dbfff2; }
.mini-token.dog { color: #2a1205; background: var(--orange); }
.balance-line { margin: 10px 0 0; color: #667170; font-size: 11px; }
.swap-direction { display: grid; place-items: center; width: 36px; height: 36px; margin: -3px auto; position: relative; z-index: 2; border: 5px solid var(--panel); border-radius: 12px; background: #293030; color: var(--green); font-weight: 900; }

.settings-row { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 12px; color: var(--muted); font-size: 12px; }
.slippage-control { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 10px; background: #111617; color: var(--text); }
.slippage-control:focus-within { border-color: rgba(187, 255, 66, .55); box-shadow: 0 0 0 3px rgba(187, 255, 66, .08); }
.slippage-control input { width: 64px; border: 0; outline: 0; padding: 7px 2px 7px 9px; background: transparent; color: var(--text); text-align: right; }
.slippage-control span { padding: 0 9px 0 4px; color: var(--green); font-weight: 800; }
.quote-details { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.quote-details div { display: flex; flex-direction: column; gap: 4px; padding: 12px; background: #111617; }
.quote-details span { color: var(--muted); font-size: 10px; }
.quote-details strong { font-size: 12px; }
.status-message { min-height: 18px; margin: 14px 2px 10px; color: var(--muted); font-size: 12px; }
.status-message.error { color: var(--danger); }
.status-message.success { color: var(--green); }
.primary-button { width: 100%; border: 0; border-radius: 16px; padding: 15px 18px; background: var(--green); color: #101407; font-weight: 900; cursor: pointer; transition: .2s ease; }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(185,240,75,.14); }
.primary-button:disabled { opacity: .35; cursor: not-allowed; }

.info-column { display: grid; gap: 16px; }
.info-card { border-radius: 22px; padding: 22px; }
.info-card h3 { font-size: 20px; }
.warning-card { background: linear-gradient(145deg, rgba(185,240,75,.09), rgba(17,22,23,.92) 55%); }
.check-list { display: grid; gap: 11px; margin: 18px 0 0; padding: 0; list-style: none; color: #c7cfce; font-size: 13px; }
.check-list li { position: relative; padding-left: 24px; }
.check-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }
.address-list { display: grid; gap: 8px; margin-top: 16px; }
.address-item { display: flex; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #0d1213; cursor: pointer; }
.address-item:hover { border-color: rgba(185,240,75,.3); }
.address-item span { color: var(--muted); font-size: 12px; }
.address-item code { font-size: 12px; }
.muted-card p { margin: 14px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.review-dialog { width: min(520px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 26px; padding: 0; background: #111617; color: var(--text); box-shadow: 0 30px 120px rgba(0,0,0,.65); }
.review-dialog::backdrop { background: rgba(0,0,0,.74); backdrop-filter: blur(8px); }
.review-dialog form { position: relative; padding: 28px; }
.review-dialog h2 { margin: 8px 0 20px; font-size: 25px; }
.dialog-close { position: absolute; top: 16px; right: 16px; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: #1a2021; cursor: pointer; }
.review-summary { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.review-summary div { display: flex; justify-content: space-between; gap: 18px; padding: 12px; background: #0d1213; }
.review-summary span { color: var(--muted); font-size: 12px; }
.review-summary strong, .review-summary code { text-align: right; font-size: 12px; }
.confirm-check { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; margin: 18px 2px; color: #b7c0bf; font-size: 12px; line-height: 1.55; }
.confirm-check input { margin-top: 3px; accent-color: var(--green); }
.dialog-note { margin: 10px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(360px, calc(100% - 40px)); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #171d1e; color: var(--text); font-size: 12px; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .hero, .content-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 54px; }
  .route-map { max-width: 560px; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1160px); padding-top: 12px; }
  .topbar { align-items: flex-start; }
  .wallet-button { max-width: 176px; padding: 9px 12px; }
  #walletLabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero { padding: 44px 4px 34px; }
  .hero h1 { font-size: 46px; }
  .route-map { grid-template-columns: 66px 1fr 66px; min-height: 120px; padding: 16px; }
  .token-orb { width: 66px; height: 66px; font-size: 12px; }
  .route-line span { display: none; }
  .swap-card { padding: 18px; border-radius: 23px; }
  .quote-details { grid-template-columns: 1fr; }
  .safe-badge { display: none; }
}
