@font-face {
  font-family: "Outfit"; src: url("/assets/fonts/Outfit-latin.woff") format("woff");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Sora"; src: url("/assets/fonts/Sora-latin.woff") format("woff");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

:root {
  --ink: #0f1515;
  --ink-2: #141c1b;
  --ink-3: #1a2423;
  --line: rgba(220, 245, 233, 0.09);
  --line-2: rgba(220, 245, 233, 0.16);
  --paper: #eef3f0;
  --muted: #9aaba5;
  --faint: #7a8c86;
  --accent: #5ce0a6;
  --accent-dim: rgba(92, 224, 166, 0.12);
  --logo-from: #2fa673;
  --logo-to: #6ee8b2;
  --tile-fg: #062a1b;
  --screen: #121a19;
  --toast-bg: #1b2524;
  --tile-shadow: rgba(92, 224, 166, 0.45);
  --btn-bg: #5ce0a6;
  --btn-fg: #062a1b;
  --btn-hover: #7aebb9;
  --nav-bg: rgba(15, 21, 21, 0.78);
  --glow: rgba(92, 224, 166, 0.12);
  --glow-2: rgba(238, 243, 240, 0.03);
  --card-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.6);
  --sans: "Outfit", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --display: "Sora", "Outfit", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 24px;
  color-scheme: dark;
}

[data-theme="light"] {
  --ink: #f7f5f0;
  --ink-2: #ffffff;
  --ink-3: #ffffff;
  --line: rgba(15, 61, 46, 0.10);
  --line-2: rgba(15, 61, 46, 0.18);
  --paper: #111413;
  --muted: #4d5c57;
  --faint: #5f6e68;
  --accent: #1a7a50;
  --accent-dim: rgba(26, 122, 80, 0.10);
  --logo-from: #0f3d2e;
  --logo-to: #1f8a5b;
  --tile-fg: #f7f5f0;
  --screen: #ffffff;
  --toast-bg: #f7f5f0;
  --tile-shadow: rgba(15, 61, 46, 0.55);
  --btn-bg: #0f3d2e;
  --btn-fg: #f7f5f0;
  --btn-hover: #17573f;
  --nav-bg: rgba(247, 245, 240, 0.82);
  --glow: rgba(26, 122, 80, 0.12);
  --glow-2: rgba(17, 20, 19, 0.04);
  --card-shadow: 0 30px 60px -30px rgba(15, 61, 46, 0.22);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }
button, input { font: inherit; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -9999px; top: 12px; }
.skip:focus { left: 12px; z-index: 10; background: var(--btn-bg); color: var(--btn-fg); padding: 8px 14px; border-radius: 8px; }

.wrap { width: min(1024px, 100% - 48px); margin-inline: auto; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.mono { font-family: var(--mono); font-size: 0.86em; letter-spacing: -0.01em; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 5;
  background: var(--nav-bg);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 32px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 600; letter-spacing: -0.03em; font-size: 18px; }
.brand img { border-radius: 0; }
.nav__links { display: flex; gap: 28px; margin-left: auto; font-size: 15px; color: var(--muted); }
.nav__links a:hover, .footer__links a:hover { color: var(--paper); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px; padding: 0 22px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 500; font-size: 16px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:hover { background: var(--btn-hover); }
.btn:active { transform: scale(0.98); }
.btn--small { height: 38px; padding: 0 16px; font-size: 14px; }
.btn--ghost { background: transparent; color: var(--paper); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn--ghost:hover { background: var(--ink-3); }

/* Hero */
.hero { padding: 96px 0 112px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(60rem 30rem at 85% -10%, var(--glow), transparent 60%),
    radial-gradient(40rem 24rem at -10% 20%, var(--glow-2), transparent 60%);
}
.hero__grid { display: grid; grid-template-columns: 1.35fr 0.85fr; gap: 48px; align-items: center; position: relative; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted);
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

h1 {
  margin-top: 24px;
  font-family: var(--display); font-weight: 600; font-size: clamp(38px, 5vw, 56px); line-height: 1.08; letter-spacing: -0.04em;
}
h1 em, h2 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--logo-from), var(--logo-to));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--accent);
}

.lede { margin-top: 22px; max-width: 500px; font-size: 19px; line-height: 1.6; color: var(--muted); text-wrap: pretty; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.fine { margin-top: 20px; font-size: 14px; color: var(--faint); }
.fine a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* Sections */
.section { padding: 112px 0; border-top: 1px solid var(--line); }
.eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
h2 { margin-top: 14px; font-family: var(--display); font-weight: 600; font-size: clamp(32px, 4vw, 46px); line-height: 1.1; letter-spacing: -0.035em; max-width: 720px; text-wrap: balance; }
.center h2 { margin-inline: auto; }
.body { margin-top: 20px; font-size: 19px; color: var(--muted); line-height: 1.65; }
h3 { font-family: var(--display); font-size: 17px; font-weight: 500; letter-spacing: -0.02em; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 56px; counter-reset: none; }
.steps li { position: relative; padding: 26px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line); }
.step__n { position: absolute; top: 28px; right: 26px; font-size: 13px; letter-spacing: 0.08em; color: var(--faint); }
.steps p, .features p { margin-top: 8px; color: var(--muted); font-size: 16px; }

.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 56px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.features article { padding: 36px; background: var(--ink); }


.closing { padding: 128px 0; }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 40px 0 36px; }
.footer__top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer .brand { font-size: 16px; }
.footer__links { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
.footer__links > a:first-child { margin-right: 12px; }
.icon-link {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2);
}
.icon-link:hover { color: var(--paper); background: var(--ink-3); }
.icon-link svg { width: 16px; height: 16px; }
.footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px;
  margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--faint);
}

/* Responsive */
@media (max-width: 900px) {
  .hero { padding: 64px 0 80px; }
  .hero__grid { grid-template-columns: 1fr; gap: 48px; }
  .steps, .features { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
  .nav__links { display: none; }
  .nav__inner .theme { margin-left: auto; }
}

@media (max-width: 480px) {
  .wrap { width: calc(100% - 32px); }
  .cta .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

.features a { color: var(--accent); }
.features a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Theme toggle */
.theme {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 999px;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.theme:hover { color: var(--paper); background: var(--ink-3); }
.theme svg { width: 18px; height: 18px; }
.theme .sun { display: none; }
[data-theme="light"] .theme .sun { display: block; }
[data-theme="light"] .theme .moon { display: none; }
@media (max-width: 900px) { .nav__inner { gap: 12px; } }
@media (max-width: 480px) { .nav__inner .btn--small { display: none; } }

/* FAQ */
.faq { margin-top: 40px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 22px 0; cursor: pointer; list-style: none;
  font-family: var(--display); font-size: 18px; font-weight: 500; letter-spacing: -0.02em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--sans); font-size: 22px; color: var(--muted); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--muted); max-width: 620px; }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }

/* Icon tiles: logo gradient, soft 3D finish */
.icon {
  position: relative; display: grid; place-items: center;
  width: 38px; height: 38px; border-radius: 11px; margin-bottom: 20px;
  color: var(--tile-fg);
  background: linear-gradient(145deg, var(--logo-to), var(--logo-from));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 8px 16px -8px var(--tile-shadow);
}
.icon::after {
  content: ""; position: absolute; inset: 1px 1px 50% 1px; border-radius: 10px 10px 8px 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.icon svg { position: relative; width: 20px; height: 20px; }

/* Logo: richer contrast on the light background */
[data-theme="light"] .brand img {
  filter: saturate(1.2) brightness(0.86) contrast(1.08);
}

/* Hero animation: link → coin → phone */
.stage {
  position: relative; width: 100%; max-width: 440px; margin-left: auto;
  aspect-ratio: 1 / 1.08; container-type: inline-size; perspective: 1400px;
}
.stage__glow {
  position: absolute; inset: 12% 0 6% 18%; border-radius: 50%;
  background: radial-gradient(closest-side, var(--glow), transparent 72%);
  filter: blur(6px);
}
.chip {
  position: absolute; left: 0; top: 68%; z-index: 3;
  display: flex; align-items: center; gap: 2.6cqw;
  padding: 2.6cqw 3.4cqw 2.6cqw 2.6cqw; border-radius: 4.5cqw;
  background: var(--ink-2); border: 1px solid var(--line-2);
  box-shadow: var(--card-shadow);
  animation: float 6s ease-in-out infinite;
}
.chip__icon {
  display: grid; place-items: center; width: 8.6cqw; height: 8.6cqw; border-radius: 2.6cqw;
  color: var(--tile-fg); background: linear-gradient(145deg, var(--logo-to), var(--logo-from));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.chip__icon svg { width: 4.6cqw; height: 4.6cqw; }
.chip__text { display: grid; line-height: 1.25; }
.chip__label { font-size: 2.7cqw; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.chip__url { font-size: 3.4cqw; font-weight: 500; color: var(--paper); }

.phone {
  position: absolute; right: 3%; top: 2%; width: 52%; height: 92%; z-index: 2;
  border-radius: 9cqw; padding: 1.6cqw;
  background: linear-gradient(160deg, #26302e, #0b100f 60%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 40px 70px -30px rgba(10, 20, 18, 0.55),
    0 18px 30px -18px rgba(10, 20, 18, 0.4);
  transform: rotateY(-16deg) rotateX(6deg) rotateZ(1deg);
  transform-style: preserve-3d;
  animation: phone-float 6s ease-in-out infinite;
}
.phone__screen {
  position: relative; height: 100%; overflow: hidden;
  border-radius: 7.6cqw; padding: 13cqw 4.6cqw 4.6cqw;
  background: var(--screen); color: var(--paper);
  animation: screen-pulse 5s ease-in-out infinite;
}
.phone__notch {
  position: absolute; top: 2.8cqw; left: 50%; width: 15cqw; height: 4.4cqw;
  transform: translateX(-50%); border-radius: 99px; background: #0b100f;
}
.app__head { display: flex; align-items: center; gap: 1.6cqw; font-family: var(--display); font-weight: 600; font-size: 3.6cqw; letter-spacing: -0.03em; }
.app__head img { width: 4.6cqw; height: 4.6cqw; }
.app__label { margin-top: 7cqw; font-size: 2.8cqw; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.app__bal { position: relative; height: 9.5cqw; margin-top: 1.2cqw; font-family: var(--display); font-weight: 600; font-size: 8.4cqw; letter-spacing: -0.04em; line-height: 1.1; }
.app__unit { font-size: 3cqw; color: var(--muted); margin-top: 0.6cqw; }
.app__list { margin-top: 6cqw; border-top: 1px solid var(--line); }
.app__list li { display: flex; justify-content: space-between; align-items: center; padding: 3cqw 0; border-bottom: 1px solid var(--line); font-size: 3.2cqw; }
.tag { position: relative; display: inline-grid; justify-items: end; min-width: 13cqw; }
.tag > span { grid-area: 1 / 1; padding: 0.6cqw 2cqw; border-radius: 99px; font-size: 2.7cqw; font-weight: 500; }
.tag--paid { background: var(--accent-dim); color: var(--accent); }
.tag--wait { background: rgba(242, 181, 68, 0.16); color: #a8710f; }
[data-theme="dark"] .tag--wait { color: #f2c26b; }

.swap { display: inline-block; }
.app__bal .swap { position: absolute; left: 0; top: 0; }
.swap--a { animation: swap-out 5s ease-in-out infinite; }
.swap--b { animation: swap-in 5s ease-in-out infinite; }

.toast {
  position: absolute; left: 3.4cqw; right: 3.4cqw; top: 9cqw; z-index: 2;
  display: flex; align-items: center; gap: 2.6cqw;
  padding: 2.8cqw; border-radius: 4.2cqw;
  background: var(--toast-bg); border: 1px solid var(--line-2);
  box-shadow: 0 14px 28px -16px rgba(10, 20, 18, 0.45);
  animation: toast 5s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
}
.toast__icon {
  display: grid; place-items: center; flex: none; width: 7.4cqw; height: 7.4cqw; border-radius: 2.4cqw;
  color: var(--tile-fg); background: linear-gradient(145deg, var(--logo-to), var(--logo-from));
}
.toast__icon svg { width: 4.2cqw; height: 4.2cqw; }
.toast__title { display: block; font-size: 3.2cqw; font-weight: 500; }
.toast__sub { display: block; font-size: 2.9cqw; color: var(--accent); }

.coin {
  position: absolute; z-index: 4; width: 13cqw; height: 13cqw;
  left: 16%; top: 56%; perspective: 400px;
  animation: coin-path 5s cubic-bezier(0.45, 0, 0.25, 1) infinite;
}
.coin__face {
  width: 100%; height: 100%; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 600; font-size: 6.4cqw; color: #f7f5f0;
  background: radial-gradient(circle at 32% 28%, #8af0c2, #2fa673 45%, #0f3d2e 100%);
  box-shadow:
    inset 0 0 0 0.9cqw rgba(255, 255, 255, 0.22),
    inset 0 -1.2cqw 1.6cqw rgba(0, 0, 0, 0.25),
    0 1.2cqw 2.4cqw rgba(15, 61, 46, 0.35);
  animation: coin-spin 5s linear infinite;
}

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.6cqw); } }
@keyframes phone-float {
  0%, 100% { transform: rotateY(-16deg) rotateX(6deg) rotateZ(1deg) translateY(0); }
  50% { transform: rotateY(-12deg) rotateX(4deg) rotateZ(1deg) translateY(-1.8cqw); }
}
@keyframes coin-path {
  0%   { left: 14%; top: 66%; opacity: 0; transform: scale(0.5); }
  8%   { left: 16%; top: 56%; opacity: 1; transform: scale(1); }
  26%  { left: 30%; top: 30%; opacity: 1; transform: scale(1.08); }
  42%  { left: 56%; top: 30%; opacity: 1; transform: scale(0.75); }
  48%  { left: 62%; top: 36%; opacity: 0; transform: scale(0.4); }
  100% { left: 62%; top: 36%; opacity: 0; transform: scale(0.4); }
}
@keyframes coin-spin { 0% { transform: rotateY(0); } 44% { transform: rotateY(720deg); } 100% { transform: rotateY(720deg); } }
@keyframes toast {
  0%, 46%   { opacity: 0; transform: translateY(-140%) scale(0.96); }
  54%, 86%  { opacity: 1; transform: translateY(0) scale(1); }
  94%, 100% { opacity: 0; transform: translateY(-140%) scale(0.96); }
}
@keyframes swap-out { 0%, 48% { opacity: 1; transform: translateY(0); } 54%, 92% { opacity: 0; transform: translateY(-30%); } 98%, 100% { opacity: 1; transform: translateY(0); } }
@keyframes swap-in  { 0%, 48% { opacity: 0; transform: translateY(30%); } 54%, 92% { opacity: 1; transform: translateY(0); } 98%, 100% { opacity: 0; transform: translateY(30%); } }
@keyframes screen-pulse {
  0%, 46%, 70%, 100% { box-shadow: inset 0 0 0 0 transparent; }
  52% { box-shadow: inset 0 0 0 0.6cqw var(--accent-dim); }
}

@media (max-width: 900px) { .stage { margin: 0 auto; max-width: 400px; } }
@media (prefers-reduced-motion: reduce) {
  .chip, .phone, .phone__screen, .coin, .coin__face, .toast, .swap { animation: none; }
  .coin { display: none; }
  .phone { transform: rotateY(-14deg) rotateX(5deg) rotateZ(1deg); }
  .swap--a { opacity: 0; }
  .swap--b { opacity: 1; }
}

.footer__legal { display: flex; gap: 20px; }
.footer__legal a { color: var(--muted); }
.footer__legal a:hover { color: var(--paper); }
.footer__note { margin-left: auto; }
@media (max-width: 700px) { .footer__note { margin-left: 0; width: 100%; } }

/* Legal pages */
.legal { padding: 72px 0 96px; }
.legal .wrap { max-width: 720px; }
.legal h1 { font-size: clamp(36px, 5vw, 52px); margin-top: 14px; }
.legal__updated { margin-top: 14px; color: var(--faint); font-size: 15px; }
.legal__intro { margin-top: 28px; font-size: 18px; color: var(--muted); }
.legal h2 { margin-top: 48px; font-size: 22px; letter-spacing: -0.02em; line-height: 1.3; }
.legal p, .legal li { margin-top: 12px; color: var(--muted); }
.legal ul { margin-top: 8px; padding-left: 20px; list-style: disc; }
.legal li { margin-top: 8px; }
.legal a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.legal strong { color: var(--paper); font-weight: 500; }

/* Waitlist form */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.join { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; max-width: 480px; }
.join__input {
  flex: 1 1 220px; min-width: 0; height: 48px; padding: 0 20px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--ink-2); color: var(--paper);
  font: 400 16px var(--sans);
}
.join__input::placeholder { color: var(--faint); }
.join__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.join .btn { border: 0; cursor: pointer; }
.join .btn:disabled { opacity: 0.7; cursor: progress; }
.join__msg { flex-basis: 100%; min-height: 1.4em; margin: 2px 0 0 4px; font-size: 14px; }
.join__msg--ok { color: var(--accent); }
.join__msg--error { color: #c2410c; }
[data-theme="dark"] .join__msg--error { color: #fb923c; }
.hero .fine a { color: var(--muted); }
.closing .join { margin: 32px auto 0; justify-content: center; }
.closing .join__msg { text-align: center; margin-left: 0; }
@media (max-width: 480px) { .join .btn { width: 100%; justify-content: center; } }

/* App and payment pages */
.app-body { min-height: 100vh; }
.badge { margin-left: auto; padding: 5px 12px; border-radius: 99px; background: rgba(242, 181, 68, 0.16); color: #8a5a06; font-size: 13px; font-weight: 500; }
[data-theme="dark"] .badge { color: #f2c26b; }
.app { padding: 40px 0 80px; }
.app__wrap { max-width: 640px; display: grid; gap: 20px; }
.app__wrap--narrow { max-width: 520px; }
#dash { display: grid; gap: 20px; }
.panel { padding: 28px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line-2); box-shadow: 0 20px 40px -32px rgba(15, 61, 46, 0.35); }
.panel h1 { font-size: 32px; margin: 0; }
.panel h2 { font-size: 20px; margin: 0; max-width: none; }
.panel--center { text-align: center; display: grid; gap: 16px; justify-items: center; padding: 48px 28px; }
.panel--center p { max-width: 420px; }
.panel__head { display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.fine .link { font-size: inherit; }
.mono-sm { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; text-align: right; }

.balance { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.balance__amount { font-family: var(--display); font-weight: 600; font-size: 44px; letter-spacing: -0.04em; line-height: 1.1; margin-top: 6px; }
.balance__side { display: grid; justify-items: end; gap: 8px; }
.chip-btn { border: 1px solid var(--line-2); background: var(--ink); color: var(--paper); border-radius: 99px; padding: 6px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; cursor: pointer; }

.form { display: grid; gap: 14px; margin-top: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.field em { font-style: normal; color: var(--faint); }
.field input {
  height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--ink); color: var(--paper); font-size: 16px; min-width: 0;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.field--short { max-width: 220px; }
.form .btn, .panel .btn { border: 0; cursor: pointer; justify-content: center; }
.form .btn { justify-self: start; }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn--block { width: 100%; margin-top: 24px; }
.form__msg { min-height: 1.3em; font-size: 14px; color: var(--muted); }
.form__msg--ok { color: var(--accent); font-weight: 500; }
.form__msg--error { color: #c2410c; }
[data-theme="dark"] .form__msg--error { color: #fb923c; }

.share { margin-top: 20px; padding: 18px; border-radius: 14px; background: var(--accent-dim); display: grid; gap: 8px; }
.share__title { font-weight: 500; color: var(--accent); }
.share__link { display: flex; gap: 8px; }
.share__link input { flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--ink-2); color: var(--paper); font-size: 14px; }
.share .link { justify-self: start; }

.invoices { margin-top: 12px; }
.invoice-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.invoice-row:last-child { border-bottom: 0; }
.invoice-row__title { font-weight: 500; }
.invoice-row__side { display: grid; justify-items: end; gap: 4px; flex: none; }
.invoice-row__amount { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; }
.pill--paid { background: var(--accent-dim); color: var(--accent); }
.pill--wait { background: rgba(242, 181, 68, 0.16); color: #8a5a06; }
[data-theme="dark"] .pill--wait { color: #f2c26b; }

.invoice-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.invoice-card__from { font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: -0.02em; margin-top: 4px; word-break: break-word; }
.invoice-card__amount { margin-top: 28px; font-family: var(--display); font-weight: 600; font-size: 56px; letter-spacing: -0.045em; line-height: 1; }
.rows { margin-top: 24px; border-top: 1px solid var(--line); }
.rows > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rows dt { color: var(--faint); flex: none; }
.rows dd { text-align: right; word-break: break-word; }
.no-wallet { margin-top: 16px; display: grid; gap: 8px; text-align: center; color: var(--muted); }
.no-wallet .btn--block { margin-top: 4px; }
.paid-box { margin-top: 24px; padding: 18px; border-radius: 14px; background: var(--accent-dim); text-align: center; display: grid; gap: 4px; justify-items: center; }
.paid-box__title { font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--accent); }
.note { margin-top: 20px; font-size: 13px; color: var(--faint); text-align: center; }

@media (max-width: 520px) {
  .panel { padding: 22px; }
  .form__row { grid-template-columns: 1fr; }
  .field--short { max-width: none; }
  .form .btn { justify-self: stretch; }
  .balance { align-items: flex-start; }
  .balance__side { justify-items: start; }
  .invoice-card__amount { font-size: 46px; }
}
.app .label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--faint); }
.app .pill { border: 0; text-transform: none; letter-spacing: 0; padding: 4px 12px; font-size: 13px; }
.wallets { margin-top: 24px; display: grid; gap: 10px; }
.wallets__list { display: grid; gap: 8px; }
.wallet-opt { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--ink); color: var(--paper); font: inherit; font-weight: 500; cursor: pointer; text-align: left; }
.wallet-opt:hover { border-color: var(--accent); }
.wallet-opt img { border-radius: 8px; }
.wallet-opt__letter { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent-dim); color: var(--accent); font-weight: 600; font-size: 14px; flex: none; }
.wallet-opt img { flex: none; object-fit: contain; }

.panel__actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.field select { height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--ink); color: var(--paper); font-size: 16px; }
.field input[readonly] { color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--paper); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.warn-box { padding: 14px 16px; border-radius: 12px; background: rgba(242, 181, 68, 0.12); color: var(--paper); font-size: 14px; }
.warn-box ul { margin-top: 6px; padding-left: 18px; list-style: disc; color: var(--muted); }
.warn-box li + li { margin-top: 4px; }
.review { padding: 18px; border-radius: 14px; border: 1px solid var(--accent); background: var(--accent-dim); display: grid; gap: 6px; }
.review__title { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }
.review .mono-sm { text-align: left; }
.review__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.subsection { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.book { margin-top: 8px; }
.book__row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.book__row:last-child { border-bottom: 0; }
.book__row span:first-child { font-weight: 500; flex: 1; }
.panel--center .btn--ghost { margin-top: -6px; }
@media (max-width: 520px) { .panel__head { flex-wrap: wrap; gap: 8px; } .panel__actions { justify-content: flex-start; } .review__actions .btn { flex: 1; } }

/* ---------- Escrow / milestones */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: var(--ink); border: 1px solid var(--line-2); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 10px 12px; border-radius: 10px; text-align: center; font-size: 14px; font-weight: 500; color: var(--muted); transition: background .15s, color .15s; }
.seg input:checked + span { background: var(--ink-2); color: var(--paper); box-shadow: 0 1px 3px rgba(15, 61, 46, 0.14), inset 0 0 0 1px var(--line-2); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.ms-edit, .ms-edit__head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 32px; gap: 8px; align-items: center; }
.ms-edit__head { margin-bottom: 6px; }
.ms-edit { margin-bottom: 8px; }
.ms-edit input { height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--ink); color: var(--paper); font: inherit; font-size: 16px; min-width: 0; }
.ms-edit input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.ms-remove { height: 32px; width: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-size: 20px; cursor: pointer; }
.ms-remove:hover { background: var(--line); color: var(--paper); }
.ms-edit__foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }

.escrow-box { margin: 18px 0; padding: 18px; border-radius: 16px; background: var(--ink); border: 1px solid var(--line-2); }
.escrow-box > .small { margin-top: 6px; line-height: 1.55; }
.milestones { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.ms { padding: 14px; border-radius: 14px; background: var(--ink-2); border: 1px solid var(--line); }
.ms__head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ms__title { font-weight: 600; color: var(--paper); }
.ms__side { display: grid; justify-items: end; gap: 6px; flex-shrink: 0; }
.ms__amount { font-weight: 600; font-variant-numeric: tabular-nums; }
.ms__note { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-dim); font-size: 14px; color: var(--paper); }
.ms__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.ms__actions .link { margin-left: 4px; }
.ms__split { display: flex; gap: 8px; margin-top: 10px; }
.ms__split input { flex: 1; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--ink); color: var(--paper); font: inherit; font-size: 16px; min-width: 0; }
.ms .form__msg { margin-top: 8px; }
.ms .form__msg:empty { display: none; }
.pill--warn { background: rgba(214, 92, 64, 0.14); color: #a3402a; }
[data-theme="dark"] .pill--warn { color: #f0a08c; }
.pill--muted { background: var(--line); color: var(--muted); }
.invoice-row--open { flex-wrap: wrap; }
.invoice-row__detail { flex-basis: 100%; }
.invoice-row__detail .milestones { margin-top: 4px; }
.invoice-row__detail .fine { margin-top: 10px; text-align: left; }

@media (max-width: 560px) {
  .ms-edit, .ms-edit__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 32px; }
  .ms-edit .ms-title { grid-column: 1 / -1; }
  .ms-edit__head span:nth-child(1), .ms-edit__head span:nth-child(4) { display: none; }
  .ms-edit .ms-remove { grid-column: 3; grid-row: 2; }
  .ms__actions .btn { flex: 1 1 auto; }
}

/* ---------- Confirmation sheet */
.sheet { border: 0; padding: 0; background: transparent; max-width: 440px; width: calc(100% - 32px); color: var(--paper); }
.sheet::backdrop { background: rgba(10, 20, 17, 0.45); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheet-in .18s ease-out; }
.sheet__card { padding: 26px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line-2); box-shadow: var(--card-shadow); }
.sheet__title { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.sheet__body { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.55; }
.sheet__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.btn--danger { background: #b4442c; color: #fff; }
.btn--danger:hover { background: #9c3a25; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@media (max-width: 560px) {
  .sheet { margin: auto auto 16px; }
  .sheet__actions { flex-direction: column-reverse; }
  .sheet__actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .sheet[open] { animation: none; } }
.sheet__actions .btn { justify-content: center; }
.sheet .btn:focus { outline: none; }
.sheet .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
