:root {
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --card: #fffdf8;
  --ink: #1a1814;
  --ink-2: #57524a;
  --line: #d9d1c1;
  --green: #1f8a4c;
  --green-bg: #dff1e4;
  --accent: #e8542f;
  --radius: 18px;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
em { font-style: italic; font-family: var(--serif); }
.muted { color: var(--ink-2); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border-radius: 999px; font-weight: 600; transition: transform .15s, background .15s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-dark { background: var(--ink); color: var(--paper); }
.btn-dark:hover { background: #000; }
.btn-ghost { border: 1.5px solid var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-light { background: #fff; color: var(--ink); padding: 12px 22px; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px clamp(16px, 4vw, 48px);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo { font-family: var(--serif); font-size: 30px; letter-spacing: -.5px; line-height: 1; }
.logo span { color: var(--accent); }
.nav nav { display: flex; align-items: center; gap: 14px; }
.nav-link { font-size: 14px; color: var(--ink-2); }
.nav-link b { color: var(--ink); font-family: var(--mono); font-weight: 600; margin-left: 4px; }
.x-link { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1.5px solid var(--ink); border-radius: 999px; color: var(--ink); transition: background .15s, color .15s; }
.x-link:hover { background: var(--ink); color: var(--paper); }
.x-foot { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.x-foot:hover { color: var(--ink); }

/* ---------- Views ---------- */
.view { display: none; }
.view.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center;
  padding: clamp(40px, 7vw, 96px) clamp(16px, 4vw, 48px) 56px;
  max-width: 1240px; margin: 0 auto;
}
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-2); margin-bottom: 18px;
}
h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(48px, 7.2vw, 96px); line-height: .98; letter-spacing: -2px;
}
h1 em { color: var(--accent); }
.lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 520px; margin: 24px 0 32px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
  list-style: none; display: flex; gap: 32px; margin-top: 48px; padding-top: 24px;
  border-top: 1px dashed var(--line); flex-wrap: wrap;
}
.hero-stats b { display: block; font-family: var(--mono); font-size: 22px; }
.hero-stats span { font-size: 13px; color: var(--ink-2); }

.hero-art { position: relative; display: flex; justify-content: center; padding: 20px 0 40px; }
.paper {
  position: relative; width: min(340px, 100%);
  background: var(--card); padding: 28px 24px 22px;
  font-family: var(--mono); font-size: 12.5px;
  box-shadow: 0 30px 60px -20px rgba(40, 30, 10, .25), 0 2px 6px rgba(0,0,0,.05);
  transform: rotate(-3deg);
  overflow: hidden;
}
.paper::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 10px;
  background: radial-gradient(circle 6px at 50% 100%, var(--paper) 98%, transparent) 0 0 / 14px 10px repeat-x;
}
.paper-head { text-align: center; margin-bottom: 18px; }
.paper-head strong { display: block; font-size: 15px; letter-spacing: 1px; }
.paper-head span { color: var(--ink-2); font-size: 11px; }
.paper-row { display: flex; justify-content: space-between; padding: 3px 0; }
.paper-row.total { font-weight: 600; font-size: 15px; }
.paper-sep { border-top: 1.5px dashed var(--ink); margin: 12px 0; }
.paper-barcode {
  height: 44px; margin-top: 20px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 5px, transparent 5px 8px, var(--ink) 8px 11px, transparent 11px 12px);
}
.scanline {
  position: absolute; left: 0; right: 0; height: 60px; top: -60px;
  background: linear-gradient(to bottom, transparent, rgba(232, 84, 47, .22), transparent);
  border-bottom: 2px solid var(--accent);
  animation: scan 3.2s ease-in-out infinite;
}
@keyframes scan { 0% { top: -60px; } 60%, 100% { top: 100%; } }

.chip {
  position: absolute; right: 0; bottom: 8px;
  display: flex; align-items: center; gap: 12px;
  background: var(--ink); color: var(--paper); padding: 12px 16px 12px 12px;
  border-radius: 16px; box-shadow: 0 20px 40px -12px rgba(0,0,0,.4);
  transform: rotate(2deg);
  animation: float 4s ease-in-out infinite;
}
.chip small { display: block; font-size: 11px; opacity: .7; }
.chip strong { font-family: var(--mono); font-size: 14px; }
.chip-logo {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  background: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 600;
}
.chip-up { color: #7ee2a4; font-family: var(--mono); font-size: 13px; margin-left: 6px; }
@keyframes float { 50% { transform: rotate(2deg) translateY(-8px); } }

/* ---------- Ticker ---------- */
.ticker-strip {
  border-block: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  overflow: hidden; padding: 12px 0;
}
.ticker-track {
  display: flex; gap: 40px; width: max-content;
  font-family: var(--mono); font-size: 14px;
  animation: marquee 40s linear infinite;
}
.ticker-track span b { margin-right: 8px; }
.ticker-track .up { color: #7ee2a4; }
.ticker-track .down { color: #ff9b85; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Sections ---------- */
.section { max-width: 1240px; margin: 0 auto; padding: 88px clamp(16px, 4vw, 48px) 0; }
.section-title {
  font-family: var(--serif); font-weight: 400; letter-spacing: -1px;
  font-size: clamp(38px, 5vw, 60px); line-height: 1; margin-bottom: 36px;
}
.section-title em { color: var(--accent); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 20px; flex-wrap: wrap; margin-bottom: 36px; }
.section-head .section-title { margin: 0; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px;
}
.step-n { font-family: var(--mono); font-size: 13px; color: var(--accent); }
.step h3 { font-family: var(--serif); font-weight: 400; font-size: 32px; margin: 36px 0 8px; }
.step p { color: var(--ink-2); font-size: 15px; }

.brands { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.brand {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 18px; display: flex; flex-direction: column; gap: 14px;
  transition: transform .15s, border-color .15s;
}
.brand:hover { transform: translateY(-3px); border-color: var(--ink); }
.brand-top { display: flex; justify-content: space-between; align-items: center; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 16px;
}
.brand-tk { font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.brand-name { font-weight: 600; }
.brand-price { font-family: var(--mono); font-size: 13px; display: flex; justify-content: space-between; }
.up { color: var(--green); }
.down { color: #c0392b; }

.calc-wrap { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: center; }
.calc {
  background: var(--ink); color: var(--paper); border-radius: 24px; padding: 32px;
}
.calc label { display: flex; justify-content: space-between; font-size: 14px; opacity: .85; }
.calc label b { font-family: var(--mono); font-size: 18px; opacity: 1; }
.calc input[type=range] { width: 100%; margin: 20px 0 28px; accent-color: var(--accent); }
.calc-results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.calc-results div { background: rgba(255,255,255,.07); border-radius: 14px; padding: 16px; }
.calc-results small { display: block; font-size: 12px; opacity: .65; }
.calc-results strong { font-family: var(--mono); font-size: clamp(18px, 2.4vw, 26px); }
.fine { font-size: 11.5px; opacity: .5; margin-top: 16px; }

.faq { border-top: 1px solid var(--ink); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 0; font-size: 18px; font-weight: 500;
  display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 22px; line-height: 1; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq p { color: var(--ink-2); padding-bottom: 22px; max-width: 640px; }

.footer {
  max-width: 1240px; margin: 100px auto 0; padding: 32px clamp(16px, 4vw, 48px) 48px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 13px;
}

/* ---------- Scan ---------- */
.view-scan.active { position: fixed; inset: 0; z-index: 50; background: #000; animation: none; }
.cam-shell { position: absolute; inset: 0; overflow: hidden; color: #fff; }
#video, #snapshot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: space-between; align-items: center;
  padding: max(16px, env(safe-area-inset-top)) 16px 16px;
  background: linear-gradient(rgba(0,0,0,.55), transparent);
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255,255,255,.14); backdrop-filter: blur(8px);
}
.cam-hint {
  font-size: 14px; background: rgba(0,0,0,.45); padding: 8px 14px; border-radius: 999px;
  backdrop-filter: blur(8px);
}
.frame {
  position: absolute; z-index: 2; left: 50%; top: 50%;
  width: min(78vw, 380px); height: min(64vh, 560px);
  transform: translate(-50%, -52%);
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.45);
  border-radius: 14px;
}
.frame .c { position: absolute; width: 34px; height: 34px; border: 4px solid #fff; }
.frame .tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
.frame .tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-radius: 0 14px 0 0; }
.frame .bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-radius: 0 0 0 14px; }
.frame .br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-radius: 0 0 14px 0; }
.frame-scan {
  position: absolute; left: 8px; right: 8px; height: 2px; top: 8px;
  background: var(--accent); box-shadow: 0 0 18px 4px rgba(232,84,47,.6);
  animation: frameScan 2.4s ease-in-out infinite alternate;
}
@keyframes frameScan { to { top: calc(100% - 10px); } }
.cam-bottom {
  position: absolute; bottom: 0; left: 0; right: 0; z-index: 3;
  display: flex; justify-content: center;
  padding: 24px 16px max(28px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0,0,0,.6));
}
.shutter {
  width: 78px; height: 78px; border-radius: 50%; border: 4px solid #fff;
  display: grid; place-items: center; transition: transform .1s;
}
.shutter span { width: 62px; height: 62px; border-radius: 50%; background: #fff; transition: transform .1s; }
.shutter:active span { transform: scale(.88); }
.shutter:disabled { opacity: .4; }

.cam-error {
  position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 32px;
  background: #111;
}
.cam-error h3 { font-family: var(--serif); font-weight: 400; font-size: 32px; }
.cam-error p { opacity: .7; max-width: 320px; margin-bottom: 8px; }
.cam-error[hidden] { display: none; }

.flash { position: absolute; inset: 0; z-index: 5; background: #fff; animation: flash .35s ease-out forwards; pointer-events: none; }
@keyframes flash { to { opacity: 0; } }

.processing {
  position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 16px;
  background: rgba(10, 9, 7, .72); backdrop-filter: blur(6px);
}
.processing[hidden] { display: none; }
.proc-card {
  background: var(--card); color: var(--ink); border-radius: 22px; padding: 28px;
  width: min(360px, 100%);
}
.proc-spinner {
  width: 44px; height: 44px; border-radius: 50%; margin-bottom: 20px;
  border: 3px solid var(--line); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.proc-steps { list-style: none; display: grid; gap: 12px; font-size: 15px; }
.proc-steps li { display: flex; align-items: center; gap: 10px; color: #b3ab9c; transition: color .2s; }
.proc-steps li::before {
  content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; flex: none;
}
.proc-steps li.on { color: var(--ink); }
.proc-steps li.on::before { border-color: var(--accent); border-top-color: transparent; animation: spin .7s linear infinite; }
.proc-steps li.done { color: var(--ink); }
.proc-steps li.done::before {
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/12px no-repeat;
  border-color: var(--green);
}

/* ---------- Result ---------- */
.view-result, .view-wallet { min-height: calc(100vh - 70px); }
.result { max-width: 440px; margin: 0 auto; padding: 48px 16px 64px; }
.result-receipt {
  position: relative; background: var(--card); padding: 36px 28px 40px;
  box-shadow: 0 30px 60px -24px rgba(40,30,10,.3);
  animation: printIn .7s cubic-bezier(.2,.8,.2,1);
}
@keyframes printIn { from { clip-path: inset(0 0 100% 0); transform: translateY(-20px); } to { clip-path: inset(0 0 0 0); transform: none; } }
.rr-head { text-align: center; padding-bottom: 24px; border-bottom: 1.5px dashed var(--ink); }
.rr-check {
  display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%;
  background: var(--green-bg); color: var(--green); margin-bottom: 16px;
}
.rr-head .eyebrow { margin-bottom: 6px; }
.rr-head h2 { font-family: var(--serif); font-weight: 400; font-size: 44px; line-height: 1.1; }
.rr-body { font-family: var(--mono); font-size: 14px; padding-top: 20px; }
.rr-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.rr-row span:first-child { color: var(--ink-2); }
.rr-row.big { font-size: 17px; font-weight: 600; }
.rr-row.big span:last-child { color: var(--green); }
.rr-sep { border-top: 1.5px dashed var(--ink); margin: 12px 0; }
.rr-tear {
  position: absolute; left: 0; right: 0; bottom: -8px; height: 16px;
  background: radial-gradient(circle 8px at 50% 100%, var(--paper) 98%, transparent) 0 0 / 16px 16px repeat-x;
}
.result-actions { display: grid; gap: 10px; margin-top: 36px; }

/* ---------- Wallet ---------- */
.wallet { max-width: 640px; margin: 0 auto; padding: 48px 16px 80px; }
.wallet-top { margin-bottom: 32px; }
.wallet-top .eyebrow { margin-bottom: 8px; }
.wallet-total { font-family: var(--mono); font-weight: 600; font-size: clamp(44px, 10vw, 64px); letter-spacing: -2px; line-height: 1.1; }
.holdings { display: grid; gap: 10px; }
.holding {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
}
.holding .brand-mark { flex: none; }
.holding-mid { flex: 1; min-width: 0; }
.holding-mid strong { display: block; }
.holding-mid small { font-family: var(--mono); color: var(--ink-2); font-size: 12px; }
.holding-val { text-align: right; font-family: var(--mono); }
.holding-val strong { display: block; }
.holding-val small { font-size: 12px; }
.wallet-h { font-family: var(--serif); font-weight: 400; font-size: 30px; margin: 44px 0 12px; }
.history { list-style: none; }
.history li {
  display: flex; justify-content: space-between; gap: 12px; padding: 14px 0;
  border-bottom: 1px dashed var(--line); font-size: 14px;
}
.history li small { display: block; color: var(--ink-2); font-size: 12px; }
.history .hv { text-align: right; font-family: var(--mono); }
.wallet-empty { text-align: center; padding: 48px 0; display: grid; gap: 20px; justify-items: center; color: var(--ink-2); }
.wallet-empty[hidden], .wallet-h[hidden] { display: none; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 100;
  background: var(--ink); color: var(--paper); padding: 12px 20px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  max-width: calc(100% - 32px); text-align: center;
}
.toast[hidden] { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-art { order: -1; padding-top: 0; }
  .paper { width: min(300px, 88%); font-size: 11.5px; }
  .chip { right: 4%; }
  .steps { grid-template-columns: 1fr; }
  .step h3 { margin-top: 16px; }
  .calc-wrap { grid-template-columns: 1fr; gap: 0; }
  .section { padding-top: 64px; }
}
@media (max-width: 480px) {
  .nav-link { display: none; }
  .hero-stats { gap: 20px; }
  .hero-cta .btn { flex: 1; }
  .calc { padding: 22px; }
  .calc-results { grid-template-columns: 1fr 1fr; }
  .calc-results div:last-child { grid-column: span 2; }
  .brands { grid-template-columns: 1fr 1fr; }
}

/* ---------- Live dot ---------- */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  margin-right: 8px; vertical-align: 1px; box-shadow: 0 0 0 0 rgba(31,138,76,.5);
  animation: pulse 2s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(31,138,76,0); } 100% { box-shadow: 0 0 0 0 rgba(31,138,76,0); } }

/* ---------- Pair (desktop QR) ---------- */
.view-pair { min-height: calc(100vh - 70px); }
.pair {
  max-width: 880px; margin: 0 auto; padding: clamp(32px, 8vh, 96px) 16px 64px;
  display: flex; flex-direction: column; align-items: center; gap: 24px;
}
.pair-card {
  width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 48px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 28px; padding: 40px;
  box-shadow: 0 30px 60px -30px rgba(40,30,10,.25);
}
.pair-qr {
  width: 260px; height: 260px; padding: 18px; background: #fff; border-radius: 18px;
  border: 1.5px solid var(--ink); display: grid; place-items: center; position: relative;
}
.pair-qr svg { width: 100%; height: 100%; display: block; }
.pair-qr .proc-spinner { margin: 0; }
.pair-copy h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(32px, 4vw, 44px); line-height: 1.05; letter-spacing: -.5px; }
.pair-steps { margin: 24px 0 28px; padding-left: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.pair-steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; color: var(--ink-2); }
.pair-steps li::before {
  content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--mono); font-size: 12px;
  background: var(--paper-2); color: var(--ink);
}
.pair-status {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  background: var(--paper-2); font-size: 14px; font-weight: 500;
}
.pair-status .dot { width: 9px; height: 9px; border-radius: 50%; background: #c9a227; animation: blink 1.2s infinite; }
.pair-status[data-s="connected"] { background: var(--green-bg); color: var(--green); }
.pair-status[data-s="connected"] .dot { background: var(--green); }
@keyframes blink { 50% { opacity: .3; } }
.link-btn { color: var(--ink-2); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--ink); }

/* ---------- Fail card ---------- */
.proc-card[hidden] { display: none; }
.proc-fail { text-align: center; display: grid; justify-items: center; gap: 10px; }
.proc-fail h3 { font-family: var(--serif); font-weight: 400; font-size: 32px; line-height: 1.1; }
.proc-fail p { color: var(--ink-2); font-size: 15px; margin-bottom: 10px; }
.proc-fail .btn { width: 100%; }
.fail-icon {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  background: #fde6df; color: var(--accent); font-family: var(--mono); font-weight: 600; font-size: 22px;
}

.paired-note { text-align: center; color: var(--green); font-size: 14px; font-weight: 500; margin-top: 24px; }
.paired-note[hidden] { display: none; }

@media (max-width: 720px) {
  .pair-card { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 28px 20px; gap: 28px; }
  .pair-qr { width: min(240px, 70vw); height: min(240px, 70vw); }
  .pair-steps { justify-items: center; }
}

/* ---------- Wallet connect ---------- */
[hidden] { display: none !important; }
.acct { position: relative; }
.acct-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px;
  border: 1.5px solid var(--ink); border-radius: 999px; font-family: var(--mono); font-size: 13px; font-weight: 600;
}
.acct-pill img { border-radius: 6px; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.25); display: grid;
}
.acct-menu button { text-align: left; padding: 10px 12px; border-radius: 8px; font-size: 14px; }
.acct-menu button:hover { background: var(--paper-2); }
.acct-menu .danger { color: #c0392b; }

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(20,18,14,.5); backdrop-filter: blur(4px); animation: fade .2s; }
.modal-card {
  position: relative; width: min(420px, 100%); background: var(--card); border-radius: 24px; padding: 32px 28px 24px;
  box-shadow: 0 40px 80px -20px rgba(0,0,0,.4); animation: pop .25s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: scale(.95) translateY(8px); } }
.modal-card .eyebrow { margin-bottom: 6px; }
.modal-card h2 { font-family: var(--serif); font-weight: 400; font-size: 36px; line-height: 1.1; }
.modal-card > .muted { font-size: 15px; margin: 8px 0 22px; }
.modal-x { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; }
.modal-x:hover { background: var(--paper-2); }
.wallet-opts { display: grid; gap: 10px; }
.wallet-opt {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px;
  border: 1.5px solid var(--line); border-radius: 16px; text-align: left; transition: border-color .15s, transform .1s;
}
.wallet-opt:hover { border-color: var(--ink); }
.wallet-opt:active { transform: scale(.98); }
.wallet-opt img { border-radius: 10px; }
.wallet-opt span { flex: 1; font-weight: 600; font-size: 16px; }
.wallet-opt small { font-size: 12px; color: var(--ink-2); background: var(--paper-2); padding: 4px 10px; border-radius: 999px; }
.wallet-opt small.ok { color: var(--green); background: var(--green-bg); }
.fine-dark { font-size: 12px; color: var(--ink-2); margin-top: 18px; text-align: center; }

.pair-wallet { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.pair-wallet b { font-family: var(--mono); color: var(--ink); }

@media (max-width: 480px) {
  .nav nav { gap: 8px; }
  .nav .btn-sm { padding: 8px 14px; }
  .acct-pill span { display: none; }
  .acct-pill { padding: 5px; }
}
