/* ============================================================
   Luna Wallet — user-system demo
   Visual language borrowed from luna-ivo.app: dark frosted glass,
   soft pink/lilac accents, phone-OS shell.
   ============================================================ */

:root {
  --bg: #07080c;
  --ink: #f7f4fa;
  --muted: rgba(247, 244, 250, 0.56);
  --faint: rgba(247, 244, 250, 0.34);
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.06);
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --pink: #ffb6d3;
  --pink-strong: #ff8fbe;
  --lilac: #c7b3ff;
  --mint: #9becbb;
  --sky: #a9e4ff;
  --danger: #ff9db0;
  --radius: 24px;
  --font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  min-height: 100dvh;
  background: #050609;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  user-select: none;
  touch-action: manipulation;
}

/* inline icon sprite */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { display: block; }
svg use { pointer-events: none; }

.stage {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 30px 20px;
}

.stage-aurora {
  position: fixed;
  inset: -12%;
  pointer-events: none;
  background:
    radial-gradient(42% 38% at 22% 18%, rgba(138, 108, 255, 0.16), transparent 70%),
    radial-gradient(38% 34% at 80% 78%, rgba(255, 110, 175, 0.13), transparent 70%),
    radial-gradient(30% 30% at 62% 8%, rgba(120, 220, 255, 0.06), transparent 70%);
  filter: blur(28px);
}

.device {
  position: relative;
  width: 390px;
  height: min(844px, calc(100dvh - 104px));
  min-height: 620px;
  padding: 5px;
  border-radius: 50px;
  background: linear-gradient(160deg, #2a2933, #08090d 35%, #14141b 70%, #2a2933);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 42px 110px rgba(0, 0, 0, 0.78),
    0 0 90px rgba(180, 130, 255, 0.07);
  flex: none;
}

.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 45px;
  overflow: hidden;
  overflow: clip;
  background: var(--bg);
  isolation: isolate;
}

/* ------------------------------- status bar ------------------------------ */
.statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 56px;
  padding: 12px 27px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 60;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.statusbar-time {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
}
.statusbar-right { display: flex; align-items: center; gap: 5px; }
.status-ic { width: 17px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.status-battery { width: 25px; height: 13px; }

/* --------------------------------- screens ------------------------------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.screen-home { z-index: 1; }
.screen-wallet {
  z-index: 10;
  background: var(--bg);
  transform: translateY(101%);
  visibility: hidden;
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.62s;
}
.screen-wallet.is-open { transform: translateY(0); visibility: visible; transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s; }
.screen-login {
  z-index: 20;
  background: var(--bg);
  transform: translateY(101%);
  visibility: hidden;
  transition: transform 0.58s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.58s;
}
.screen-login.is-open { transform: translateY(0); visibility: visible; transition: transform 0.58s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s; }

.is-hidden { display: none !important; }

/* ---------------------------------- home --------------------------------- */
.home-wall {
  position: absolute;
  inset: 0;
  background: url("../assets/wallpaper-moon.jpg") center / cover no-repeat;
  filter: saturate(0.96) brightness(0.9);
  transform: scale(1.02);
}
.home-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 24%, transparent 58%, rgba(0, 0, 0, 0.58)),
    radial-gradient(80% 50% at 50% 0%, rgba(10, 8, 16, 0.25), transparent 70%);
}
.home-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 66px 20px 118px;
  overflow: hidden;
}
.home-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 84px;
  column-gap: 14px;
  row-gap: 18px;
}
.home-grid-low { margin-top: 2px; }

.app-tile {
  position: relative;
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  color: #fff;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.18s ease;
}
.app-tile:active { transform: scale(0.94); }
.app-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}
.tile-icon {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.07));
  border: 1px solid rgba(255, 255, 255, 0.17);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 10px 22px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.tile-icon svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.tile-wallet {
  background: linear-gradient(155deg, rgba(255, 196, 222, 0.5), rgba(178, 150, 255, 0.34) 60%, rgba(255, 255, 255, 0.1));
  color: #fff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 0 1px rgba(255, 205, 230, 0.35),
    0 12px 30px rgba(255, 140, 195, 0.2);
}
.badge-new {
  position: absolute;
  top: -3px;
  right: 2px;
  padding: 2px 5px;
  border-radius: 6px;
  background: linear-gradient(135deg, #ffd9e9, #ffa8ce);
  color: #46142c;
  font-size: 7.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  z-index: 2;
}
.tile-kakao { background: #f7e14b; color: #3a2a00; font-size: 12px; letter-spacing: -0.5px; text-shadow: none; }
.tile-instagram { background: linear-gradient(150deg, #ffd36e, #ff7a59 38%, #d44b9e 70%, #7a5cff); color: #fff; }
.tile-x { background: #0b0b0e; color: #fff; font-size: 24px; font-weight: 600; }
.tile-script { background: linear-gradient(160deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.08)); color: #ffd9ea; }
.tile-tools { background: linear-gradient(160deg, rgba(220, 210, 255, 0.3), rgba(255, 255, 255, 0.06)); color: #e6ddff; }
.tile-settings { color: #fff; }
.tile-album { background: linear-gradient(150deg, rgba(255, 190, 220, 0.32), rgba(140, 190, 255, 0.28)); color: #fff; }

.app-tile-lg {
  grid-column: span 2;
  grid-row: span 2;
  align-items: stretch;
  justify-content: space-between;
  padding: 18px 18px 15px;
  border-radius: 33px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.045) 65%, rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    0 18px 44px rgba(0, 0, 0, 0.38);
}
.tile-lg-art { flex: 1; display: grid; place-items: center; }
.tile-lg-art img { width: 92px; height: 92px; filter: drop-shadow(0 8px 24px rgba(255, 150, 200, 0.28)); }
.app-tile-lg .app-label { align-self: center; font-size: 13px; font-weight: 500; }

.clock-widget {
  position: relative;
  flex: none;
  height: 158px;
  margin-top: 2px;
  border-radius: 29px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.155), rgba(255, 255, 255, 0.045) 65%, rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(28px) saturate(135%);
  -webkit-backdrop-filter: blur(28px) saturate(135%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 16px 40px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
}
.clock-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.76);
  letter-spacing: 0.2px;
}
.clock-sun { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.clock-sep { opacity: 0.55; }
.clock-time {
  font-size: 56px;
  font-weight: 300;
  line-height: 1.04;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}
.clock-sub { font-size: 11.5px; color: rgba(255, 255, 255, 0.7); }
.page-dots { display: flex; gap: 6px; margin-top: 7px; }
.page-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.28); }
.page-dots i.on { background: rgba(255, 255, 255, 0.9); }

.dock {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 34px;
  height: 82px;
  z-index: 2;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.07));
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(30px) saturate(140%);
  -webkit-backdrop-filter: blur(30px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 18px 40px rgba(0, 0, 0, 0.35);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  place-items: center;
  padding: 0 12px;
}
.dock-app {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.16s ease;
}
.dock-app:active { transform: scale(0.92); }
.dock-app svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dock-spotify { background: #1ed760; border-color: rgba(255, 255, 255, 0.25); color: #06230f; }

/* -------------------------------- app bar -------------------------------- */
.app-bar {
  position: relative;
  z-index: 5;
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 58px 16px 8px;
}
.app-bar-clear { background: transparent; }
.app-bar-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.app-bar-spacer { width: 38px; }
.icon-btn {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.16s ease;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.11); }
.icon-btn:active { transform: scale(0.93); }
.icon-btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.sync-chip {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(120, 240, 180, 0.18);
  background: rgba(120, 240, 180, 0.08);
  color: #b8f0cf;
  font-size: 10px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.sync-chip i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #7be3a8;
  box-shadow: 0 0 8px rgba(120, 240, 180, 0.8);
}
.sync-chip.is-syncing { color: var(--muted); border-color: var(--line); background: rgba(255, 255, 255, 0.05); }
.sync-chip.is-syncing i { background: var(--pink); box-shadow: 0 0 8px rgba(255, 182, 211, 0.8); animation: dotPulse 1s ease-in-out infinite; }

/* --------------------------------- login --------------------------------- */
.login-bg {
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(80% 55% at 50% -5%, rgba(255, 150, 200, 0.26), transparent 62%),
    radial-gradient(90% 60% at 108% 100%, rgba(150, 130, 255, 0.2), transparent 62%),
    url("../assets/wallpaper-moon.jpg") center / cover no-repeat;
  filter: blur(26px) brightness(0.38) saturate(1.1);
}
.login-scroll {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 46px 22px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scrollbar-width: none;
}
.login-scroll::-webkit-scrollbar { display: none; }
.login-hero { text-align: center; padding-top: 8px; }
.logo-orb {
  width: 78px;
  height: 78px;
  margin: 0 auto 20px;
  border-radius: 25px;
  display: grid;
  place-items: center;
  background: linear-gradient(155deg, rgba(255, 220, 236, 0.22), rgba(190, 165, 255, 0.12));
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 18px 46px rgba(255, 140, 195, 0.22);
  animation: floaty 6s ease-in-out infinite;
}
.logo-orb img { width: 52px; height: 52px; filter: drop-shadow(0 4px 16px rgba(255, 160, 205, 0.4)); }
.login-hero h1 { margin: 0 0 8px; font-size: 27px; font-weight: 600; letter-spacing: -0.4px; }
.login-hero p { margin: 0 auto; max-width: 300px; font-size: 12.8px; line-height: 1.7; color: var(--muted); }

.auth-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 28px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(26px) saturate(130%);
  -webkit-backdrop-filter: blur(26px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 22px 50px rgba(0, 0, 0, 0.34);
  animation: fadeUp 0.4s ease both;
}
.field-label { font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 14px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(0, 0, 0, 0.28);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.field:focus-within {
  border-color: rgba(255, 182, 211, 0.52);
  background: rgba(255, 182, 211, 0.06);
  box-shadow: 0 0 0 3px rgba(255, 182, 211, 0.08);
}
.field.is-error { border-color: rgba(255, 120, 150, 0.6); }
.field-icon { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  letter-spacing: 0.2px;
  user-select: text;
}
.field input::placeholder { color: rgba(255, 255, 255, 0.3); }

.field-error {
  display: none;
  margin: -4px 4px 0;
  color: #ff9db0;
  font-size: 11.5px;
  line-height: 1.5;
}
.field-error:not(:empty) { display: block; }

.btn {
  appearance: none;
  border: 0;
  height: 52px;
  padding: 0 20px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.2s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.42; pointer-events: none; }
.btn-block { width: 100%; }
.btn-primary {
  background: linear-gradient(135deg, #ffdbe9, #ffb1d3 46%, #cbb6ff);
  color: #2b1021;
  box-shadow: 0 12px 30px rgba(255, 150, 200, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.btn-ghost { background: rgba(255, 255, 255, 0.065); border: 1px solid rgba(255, 255, 255, 0.1); color: var(--ink); }
.btn-light { background: #fbf8fd; color: #17111c; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25); }
.btn-dark { background: rgba(255, 255, 255, 0.13); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.08); }
.btn-danger { background: rgba(255, 110, 130, 0.16); color: #ffa7b7; border: 1px solid rgba(255, 120, 145, 0.25); }

.auth-note { margin: 2px 0 0; font-size: 11px; line-height: 1.6; color: var(--faint); text-align: center; }
.auth-note b { color: rgba(255, 255, 255, 0.72); font-weight: 600; }
.legal { margin: 2px 0 6px; text-align: center; font-size: 10.5px; line-height: 1.7; color: var(--faint); }
.link {
  border: 0;
  padding: 0;
  background: none;
  color: rgba(255, 255, 255, 0.68);
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.text-btn {
  border: 0;
  padding: 0;
  background: none;
  color: rgba(255, 255, 255, 0.62);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.18s ease;
}
.text-btn:hover { color: var(--ink); }
.text-btn:disabled { color: var(--faint); cursor: default; }

.code-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--muted);
}
.code-head strong { color: var(--ink); font-weight: 600; }
.code-head .text-btn { margin-left: auto; color: var(--pink); font-size: 11.5px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input {
  width: 100%;
  height: 56px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  user-select: text;
}
.otp input:focus {
  border-color: rgba(255, 182, 211, 0.6);
  background: rgba(255, 182, 211, 0.09);
  box-shadow: 0 0 0 3px rgba(255, 182, 211, 0.08);
}
.otp input.is-filled { border-color: rgba(255, 255, 255, 0.24); background: rgba(255, 255, 255, 0.07); }
.otp.is-error { animation: shake 0.4s ease; }
.code-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.code-foot .text-btn:last-child { color: rgba(255, 255, 255, 0.78); }

/* -------------------------------- wallet --------------------------------- */
.wallet-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(95% 46% at 50% -6%, rgba(255, 150, 200, 0.15), transparent 62%),
    radial-gradient(70% 38% at 104% 26%, rgba(150, 130, 255, 0.08), transparent 70%),
    radial-gradient(70% 34% at -6% 62%, rgba(120, 200, 255, 0.045), transparent 70%),
    var(--bg);
}
.wallet-scroll {
  position: relative;
  z-index: 2;
  flex: 1;
  overflow-y: auto;
  padding: 6px 18px 124px;
  scrollbar-width: none;
  overscroll-behavior: contain;
}
.wallet-scroll::-webkit-scrollbar { display: none; }

.tabview { display: none; }
.tabview.is-active { display: block; animation: fadeUp 0.34s ease both; }

.greeting { display: flex; align-items: center; gap: 12px; margin: 8px 0 15px; }
.avatar {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #ffc9e0, #bda9ff);
  color: #2c1224;
  font-size: 17px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), 0 8px 20px rgba(255, 140, 195, 0.18);
}
.avatar-lg { width: 58px; height: 58px; border-radius: 20px; font-size: 22px; }
.greeting-copy { flex: 1; min-width: 0; }
.greeting-copy p { margin: 0 0 2px; font-size: 11.5px; }
.greeting-copy h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.muted { color: var(--muted); }

.balance-card {
  position: relative;
  overflow: hidden;
  border-radius: 29px;
  padding: 20px;
  min-height: 192px;
  background:
    linear-gradient(145deg, rgba(255, 183, 214, 0.22), rgba(185, 166, 255, 0.13) 56%, rgba(255, 255, 255, 0.075));
  border: 1px solid rgba(255, 255, 255, 0.17);
  backdrop-filter: blur(22px) saturate(135%);
  -webkit-backdrop-filter: blur(22px) saturate(135%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 22px 48px rgba(0, 0, 0, 0.3);
}
.card-orb {
  position: absolute;
  right: -58px;
  top: -70px;
  width: 210px;
  height: 210px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, rgba(255, 228, 240, 0.9), rgba(255, 150, 205, 0.38) 42%, transparent 72%);
  filter: blur(3px);
  opacity: 0.55;
  pointer-events: none;
}
.balance-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}
.balance-label { letter-spacing: 0.2px; }
.balance-tag {
  font-size: 9.5px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.62);
}
.balance-amount {
  position: relative;
  z-index: 1;
  margin: 11px 0 1px;
  font-size: 40px;
  font-weight: 300;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 18px rgba(255, 160, 205, 0.2);
}
.balance-sub { position: relative; z-index: 1; font-size: 11.5px; color: rgba(255, 255, 255, 0.55); }
.balance-actions { position: relative; z-index: 1; display: flex; gap: 8px; margin-top: 18px; }
.balance-actions .btn { height: 41px; padding: 0 18px; border-radius: 14px; font-size: 13px; }

.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 4px; }
.stat-card {
  padding: 13px 15px;
  border-radius: 20px;
  background: var(--panel);
  border: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-card span { font-size: 10.5px; color: var(--muted); }
.stat-card strong { font-size: 17px; font-weight: 600; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; }

.section { margin-top: 21px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 0 2px; }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.1px; }

.model-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -18px;
  padding: 2px 18px 8px;
  scrollbar-width: none;
}
.model-cards::-webkit-scrollbar { display: none; }
.model-card {
  position: relative;
  flex: none;
  width: 152px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.055);
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.model-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -34px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent, #ffb6d3), transparent 68%);
  opacity: 0.16;
  pointer-events: none;
}
.model-card:hover { border-color: rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.075); }
.model-card:active { transform: scale(0.97); }
.model-icon {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--accent, var(--pink));
  background: color-mix(in srgb, var(--accent, #ffb6d3) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent, #ffb6d3) 26%, transparent);
}
.model-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.model-name { position: relative; z-index: 1; margin-top: 9px; font-size: 13.5px; font-weight: 600; letter-spacing: 0.1px; }
.model-desc { position: relative; z-index: 1; min-height: 29px; font-size: 10.3px; line-height: 1.45; color: var(--muted); }
.model-price { position: relative; z-index: 1; margin-top: 5px; font-size: 13px; font-weight: 600; color: var(--accent, var(--pink)); font-variant-numeric: tabular-nums; }
.model-price em { font-style: normal; font-size: 9.5px; font-weight: 400; color: var(--faint); }
.model-use { position: relative; z-index: 1; margin-top: 7px; font-size: 10px; color: rgba(255, 255, 255, 0.7); display: inline-flex; align-items: center; gap: 3px; }
.model-use svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; }

.tx-list { border-radius: 22px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.042); overflow: hidden; }
.tx-row { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
.tx-row:last-child { border-bottom: 0; }
.tx-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent, rgba(255, 255, 255, 0.72));
}
.tx-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tx-main { flex: 1; min-width: 0; }
.tx-main strong { display: block; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main span { display: block; margin-top: 2px; font-size: 10px; color: var(--faint); }
.tx-amount { flex: none; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: 0.1px; }
.tx-amount.plus { color: var(--mint); }
.tx-amount.minus { color: rgba(255, 255, 255, 0.82); }
.tx-empty { padding: 28px 16px; text-align: center; font-size: 11.5px; color: var(--faint); }

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  font-size: 10.3px;
  color: var(--faint);
}
.secure-note svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }

/* legacy wallet notice / merge banner */
.legacy-banner {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: 20px;
  border: 1px solid rgba(199, 179, 255, 0.26);
  background:
    radial-gradient(120% 160% at 100% 0%, rgba(199, 179, 255, 0.18), transparent 60%),
    rgba(199, 179, 255, 0.07);
  animation: fadeUp 0.4s ease both;
}
.legacy-icon {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--lilac);
  background: rgba(199, 179, 255, 0.13);
  border: 1px solid rgba(199, 179, 255, 0.24);
}
.legacy-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.legacy-copy { flex: 1; min-width: 0; }
.legacy-copy strong { display: block; font-size: 12.3px; font-weight: 600; }
.legacy-copy p { margin: 3px 0 0; font-size: 10.4px; line-height: 1.5; color: var(--muted); }
.legacy-copy b { color: var(--mint); font-weight: 600; font-variant-numeric: tabular-nums; }
.legacy-cta {
  flex: none;
  height: 32px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid rgba(199, 179, 255, 0.3);
  background: rgba(199, 179, 255, 0.16);
  color: #e6ddff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, background 0.18s ease;
}
.legacy-cta:active { transform: scale(0.95); }
.legacy-merged {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding: 10px 13px;
  border-radius: 16px;
  border: 1px solid rgba(120, 240, 180, 0.16);
  background: rgba(120, 240, 180, 0.055);
  color: rgba(184, 240, 207, 0.86);
  font-family: inherit;
  font-size: 10.8px;
  text-align: left;
  cursor: pointer;
}
.legacy-merged > svg:first-child { width: 14px; height: 14px; flex: none; fill: none; stroke: #8ff0bb; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.legacy-merged b { color: #b8f0cf; font-weight: 600; font-variant-numeric: tabular-nums; }
.legacy-merged-chev { width: 14px; height: 14px; margin-left: auto; flex: none; fill: none; stroke: rgba(184, 240, 207, 0.5); stroke-width: 1.8; stroke-linecap: round; }

/* login legacy note */
.login-legacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}
.login-legacy-note .row-icon { width: 30px; height: 30px; border-radius: 10px; color: var(--lilac); background: rgba(199, 179, 255, 0.1); }
.login-legacy-note strong { display: block; font-size: 11.5px; font-weight: 600; }
.login-legacy-note em { display: block; margin-top: 3px; font-style: normal; font-size: 10.3px; line-height: 1.6; color: var(--faint); }

/* models tab */
.eyebrow { margin: 0 0 7px; font-size: 9.5px; letter-spacing: 1.8px; color: rgba(255, 182, 211, 0.85); }
.tab-head { margin: 12px 2px 17px; }
.tab-head h1 { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -0.5px; }
.tab-head > p:last-child { margin: 8px 0 0; font-size: 12.3px; line-height: 1.65; color: var(--muted); }
.model-list { display: flex; flex-direction: column; gap: 10px; }
.model-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}
.model-row .model-icon { width: 42px; height: 42px; border-radius: 14px; }
.model-row-info { flex: 1; min-width: 0; }
.model-row-info strong { display: block; font-size: 14px; font-weight: 600; }
.model-row-info span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); line-height: 1.4; }
.model-row-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.model-row-side .price { font-size: 13px; font-weight: 600; color: var(--accent, var(--pink)); font-variant-numeric: tabular-nums; }
.model-row-side .price em { font-style: normal; font-size: 9.5px; font-weight: 400; color: var(--faint); }
.model-row-side button {
  height: 29px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
}
.model-row-side button:active { transform: scale(0.96); }

.info-card {
  display: flex;
  gap: 11px;
  margin-top: 18px;
  padding: 15px;
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
}
.info-card > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: var(--pink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.info-card strong { font-size: 12.3px; font-weight: 600; }
.info-card p { margin: 4px 0 0; font-size: 11.2px; line-height: 1.65; color: var(--muted); }

/* profile tab */
.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
}
.profile-meta { flex: 1; min-width: 0; }
.profile-meta strong { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.profile-meta span { display: block; margin-top: 4px; font-size: 10px; color: var(--faint); font-family: var(--mono); }
.status-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(120, 240, 180, 0.08);
  border: 1px solid rgba(120, 240, 180, 0.18);
  color: #b8f0cf;
  font-size: 9.5px;
}
.status-pill i { width: 4px; height: 4px; border-radius: 50%; background: #7be3a8; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 12px 0;
  padding: 14px 4px;
  border-radius: 20px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
}
.profile-stats > div { display: flex; flex-direction: column; gap: 5px; text-align: center; border-right: 1px solid var(--line-soft); }
.profile-stats > div:last-child { border-right: 0; }
.profile-stats span { font-size: 10px; color: var(--faint); }
.profile-stats strong { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.list-card { margin-top: 12px; border-radius: 22px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.045); overflow: hidden; }
.list-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  background: none;
  color: var(--ink);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.list-row:last-child { border-bottom: 0; }
.list-row:active { background: rgba(255, 255, 255, 0.04); }
.row-icon { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.75); }
.row-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.row-title { flex: 1; font-size: 13px; }
.row-value { font-size: 11px; color: var(--faint); }
.row-chev { width: 15px; height: 15px; fill: none; stroke: var(--faint); stroke-width: 1.8; stroke-linecap: round; }
.list-row.danger, .list-row.danger .row-icon { color: var(--danger); }
.list-row.danger .row-icon { background: rgba(255, 110, 130, 0.09); }
.profile-foot { margin: 24px 0 10px; text-align: center; font-size: 10px; line-height: 1.7; color: var(--faint); }

/* tab bar */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  padding: 12px 34px 26px;
  background: linear-gradient(180deg, rgba(7, 8, 12, 0), rgba(7, 8, 12, 0.86) 34%, rgba(7, 8, 12, 0.97));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.tabbar button {
  flex: 1;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.36);
  font-family: inherit;
  font-size: 9.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.16s ease;
}
.tabbar button:active { transform: scale(0.94); }
.tabbar button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar button.is-active { color: #ffd2e5; }
.tabbar button.is-active svg { filter: drop-shadow(0 0 9px rgba(255, 170, 210, 0.45)); }

/* --------------------------------- sheets -------------------------------- */
.scrim {
  position: absolute;
  inset: 0;
  z-index: 65;
  background: rgba(3, 4, 8, 0.64);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  max-height: 92%;
  padding-bottom: 22px;
  border-radius: 30px 30px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 0;
  background: linear-gradient(170deg, #191a23 0%, #0e0f15 52%, #090a0f 100%);
  box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(110%);
  visibility: hidden;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear 0.5s;
  overflow: hidden;
}
.sheet.is-open { transform: translateY(0); visibility: visible; transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s; }
.sheet-tall { height: 80%; }
#sheet-bills { height: auto; max-height: 78%; }
#sheet-redeem { height: auto; max-height: 84%; }
.sheet-grab { width: 38px; height: 4px; flex: none; margin: 9px auto 2px; border-radius: 999px; background: rgba(255, 255, 255, 0.17); }
.sheet-head { display: flex; align-items: center; gap: 12px; flex: none; padding: 10px 18px 14px; }
.sheet-head .model-icon { width: 44px; height: 44px; border-radius: 14px; }
.sheet-head-copy { flex: 1; min-width: 0; }
.sheet-head-copy h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0.1px; }
.sheet-head-copy p { margin: 3px 0 0; font-size: 11px; color: var(--muted); }
.sheet-close { width: 34px; height: 34px; border-radius: 12px; }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 18px 8px; scrollbar-width: none; }
.sheet-body::-webkit-scrollbar { display: none; }

.cost-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 15px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.045);
  font-size: 11.5px;
  color: var(--muted);
}
.cost-pill strong { margin-left: 3px; font-size: 15px; color: var(--pink); font-weight: 600; font-variant-numeric: tabular-nums; }
.cost-balance { font-size: 10.5px; color: var(--faint); }
.cost-balance b { color: rgba(255, 255, 255, 0.75); font-weight: 600; }

.prompt-wrap {
  margin-top: 12px;
  padding: 12px 13px 9px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.045);
  transition: border-color 0.2s ease;
}
.prompt-wrap:focus-within { border-color: rgba(255, 182, 211, 0.42); }
.prompt-wrap textarea {
  width: 100%;
  min-height: 90px;
  max-height: 180px;
  resize: none;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  user-select: text;
}
.prompt-wrap textarea::placeholder { color: rgba(255, 255, 255, 0.28); }
.prompt-foot { display: flex; align-items: center; justify-content: space-between; font-size: 10px; color: var(--faint); }
.prompt-foot .text-btn { font-size: 10.5px; color: rgba(255, 255, 255, 0.55); }
.quick-prompts { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 16px; }
.chip {
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.18s ease;
}
.chip:hover { background: rgba(255, 255, 255, 0.08); }
.chip:active { transform: scale(0.97); }
.sheet-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 12px 0 2px;
  font-size: 9.8px;
  line-height: 1.5;
  color: var(--faint);
  text-align: center;
}
.sheet-note svg { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; }

.model-running { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 34px 24px 46px; text-align: center; }
.thinking-orb {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  margin-bottom: 14px;
  background: radial-gradient(circle at 36% 32%, #ffeaf4, #ffb2d5 34%, #b9a6ff 68%, rgba(185, 166, 255, 0.1) 74%);
  box-shadow: 0 0 70px rgba(255, 150, 200, 0.45);
  animation: breathe 2.1s ease-in-out infinite;
}
.thinking-orb::before {
  content: "";
  position: absolute;
  inset: -13px;
  border-radius: 50%;
  border: 1px solid rgba(255, 190, 220, 0.3);
  border-top-color: rgba(255, 225, 240, 0.8);
  animation: spin 2.6s linear infinite;
}
.model-running h3 { margin: 0; font-size: 16px; font-weight: 600; }
.model-running p { margin: 0; font-size: 11.5px; color: var(--muted); }
.thinking-bars { display: flex; gap: 5px; margin-top: 18px; }
.thinking-bars i { width: 4px; height: 14px; border-radius: 999px; background: var(--pink); animation: bar 1s ease-in-out infinite; }
.thinking-bars i:nth-child(2) { animation-delay: 0.15s; background: var(--lilac); }
.thinking-bars i:nth-child(3) { animation-delay: 0.3s; background: var(--sky); }

.model-done { padding-top: 4px; }
.result-badge { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 10px; }
.result-badge span {
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 182, 211, 0.32);
  background: rgba(255, 182, 211, 0.08);
  color: var(--pink);
  font-size: 8.5px;
  letter-spacing: 1.1px;
}
.result-badge b { font-size: 10.5px; font-weight: 500; color: var(--muted); }
.result-text {
  min-height: 130px;
  max-height: 250px;
  overflow-y: auto;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12.8px;
  line-height: 1.82;
  color: rgba(255, 255, 255, 0.88);
  white-space: pre-wrap;
  user-select: text;
  scrollbar-width: none;
}
.result-text::-webkit-scrollbar { display: none; }
.result-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 2px 0; font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.result-actions { display: flex; gap: 10px; margin-top: 14px; }
.result-actions .btn { flex: 1; height: 46px; }
.model-done .sheet-note { margin-top: 14px; }

.topup-icon { color: var(--mint) !important; background: rgba(155, 236, 187, 0.14) !important; border-color: rgba(155, 236, 187, 0.24) !important; }
.topup-balance { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.045); font-size: 11.5px; color: var(--muted); }
.topup-balance strong { font-size: 22px; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.amount-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.amount {
  height: 54px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.amount.is-selected {
  border-color: rgba(255, 182, 211, 0.55);
  background: rgba(255, 182, 211, 0.13);
  color: #ffd7e8;
  box-shadow: inset 0 0 0 1px rgba(255, 182, 211, 0.2);
}
.amount-summary { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 14px; font-size: 11.5px; color: var(--muted); }
.amount-summary strong { font-size: 16px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.success-ring { width: 74px; height: 74px; margin: 22px auto 12px; border-radius: 50%; display: grid; place-items: center; color: #8ff0bb; background: rgba(120, 240, 180, 0.13); border: 1px solid rgba(120, 240, 180, 0.35); box-shadow: 0 0 44px rgba(120, 240, 180, 0.15); animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
.success-ring svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#topupDone h3 { margin: 0 0 6px; text-align: center; font-size: 18px; font-weight: 600; }
.topup-success-amount { margin: 0 0 4px; text-align: center; font-size: 30px; font-weight: 400; color: var(--mint); font-variant-numeric: tabular-nums; }
#topupDone .muted { text-align: center; font-size: 11.5px; margin: 0; }
#topupDone .btn { margin-top: 24px; }

/* redeem sheet */
.redeem-icon { color: #ffd98a !important; background: rgba(255, 217, 138, 0.13) !important; border-color: rgba(255, 217, 138, 0.24) !important; }
.voucher-field { margin-top: 0; }
.voucher-demo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 14px;
  padding: 9px 11px;
  border-radius: 13px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  font-size: 10px;
  color: var(--faint);
}
.voucher-demo code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 9.3px;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.2px;
  user-select: text;
}
.voucher-demo .text-btn { flex: none; font-size: 10.5px; color: var(--pink); }
.redeem-rules { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.redeem-rules p { display: flex; gap: 8px; margin: 0; font-size: 10.2px; line-height: 1.6; color: var(--faint); }
.redeem-rules svg { width: 13px; height: 13px; flex: none; margin-top: 1px; fill: none; stroke: rgba(255, 255, 255, 0.4); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#redeemDone h3, #legacyViewDone h3 { margin: 0 0 6px; text-align: center; font-size: 18px; font-weight: 600; }
#redeemDone .muted, #legacyViewDone .muted { text-align: center; font-size: 11.5px; margin: 0; }
#redeemDone .btn, #legacyViewDone .btn { margin-top: 24px; }

/* legacy migration sheet */
.legacy-head-icon { color: var(--lilac) !important; background: rgba(199, 179, 255, 0.13) !important; border-color: rgba(199, 179, 255, 0.24) !important; }
.compat-icon { color: var(--sky) !important; background: rgba(169, 228, 255, 0.12) !important; border-color: rgba(169, 228, 255, 0.22) !important; }
.migrate-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 16px;
  text-align: center;
}
.migrate-hero-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 2px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: var(--lilac);
  background: rgba(199, 179, 255, 0.13);
  border: 1px solid rgba(199, 179, 255, 0.26);
  box-shadow: 0 0 38px rgba(199, 179, 255, 0.14);
}
.migrate-hero-icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.migrate-hero strong { font-size: 14.5px; font-weight: 600; }
.migrate-hero p { margin: 0; max-width: 300px; font-size: 11px; line-height: 1.65; color: var(--muted); }
.migrate-hero b { color: rgba(255, 255, 255, 0.82); font-weight: 500; }
.migrate-lead { margin: 6px 2px 14px; font-size: 11.8px; line-height: 1.7; color: var(--muted); }
.migrate-center { text-align: center; }
.migrate-done-title { margin: 0 0 6px; text-align: center; font-size: 18px; font-weight: 600; }
.migrate-card {
  margin: 12px 0;
  padding: 4px 14px;
  border-radius: 18px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
}
.migrate-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  font-size: 11px;
  color: var(--muted);
}
.migrate-row:last-child { border-bottom: 0; }
.migrate-row strong { font-size: 11.8px; font-weight: 600; color: rgba(255, 255, 255, 0.84); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.migrate-row strong.mint { color: var(--mint); font-variant-numeric: tabular-nums; }
.migrate-preview { margin-top: 2px; animation: fadeUp 0.3s ease both; }
#legacyViewBind .field { margin-top: 0; }
#legacyViewBind .field-error { margin-top: 6px; }
#legacyViewPending .btn, #legacyViewBind > .btn { margin-top: 12px; }
#legacyViewPending .info-card, #legacyViewBind .info-card, #legacyViewClaimed .info-card { margin-top: 14px; }

/* compat sheet */
.compat-intro {
  margin: 4px 2px 16px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(169, 228, 255, 0.12);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(169, 228, 255, 0.1), transparent 60%),
    rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.7);
}
.compat-list { display: flex; flex-direction: column; gap: 9px; }
.compat-step {
  display: flex;
  gap: 11px;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.035);
}
.compat-step i {
  width: 21px;
  height: 21px;
  flex: none;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  color: #2b1021;
  background: linear-gradient(135deg, #ffdbe9, #cbb6ff);
}
.compat-step strong { display: block; font-size: 12px; font-weight: 600; }
.compat-step p { margin: 3px 0 0; font-size: 10.5px; line-height: 1.65; color: var(--muted); }

.bills-icon { color: var(--sky) !important; background: rgba(169, 228, 255, 0.12) !important; border-color: rgba(169, 228, 255, 0.22) !important; }
.bills-month { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; margin-bottom: 14px; border-radius: 18px; border: 1px solid var(--line-soft); background: rgba(255, 255, 255, 0.045); }
.bills-month span { font-size: 11px; color: var(--muted); }
.bills-month strong { font-size: 20px; font-weight: 500; font-variant-numeric: tabular-nums; }
.bills-group h3 { margin: 16px 4px 8px; font-size: 10.5px; font-weight: 500; letter-spacing: 0.5px; color: var(--faint); }
.bills-group:first-of-type h3 { margin-top: 0; }
.bills-row { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.045); }
.bills-row:last-child { border-bottom: 0; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--faint); font-size: 12px; line-height: 1.7; }

.server-icon { color: var(--lilac) !important; background: rgba(199, 179, 255, 0.13) !important; border-color: rgba(199, 179, 255, 0.24) !important; }
.json-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 10px; }
.json-toolbar span { font-family: var(--mono); font-size: 9.5px; color: var(--faint); }
.json-toolbar .text-btn { font-size: 10.5px; color: rgba(255, 255, 255, 0.65); }
.json-toolbar svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.json-view {
  margin: 0;
  padding: 14px;
  max-height: 58vh;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: #07080d;
  color: #c9c6d4;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  user-select: text;
}

.sheet-confirm { padding-bottom: 26px; }
.confirm-body { padding: 8px 22px 2px; }
.confirm-body h2 { margin: 4px 0 8px; font-size: 18px; font-weight: 600; }
.confirm-body p { margin: 0; font-size: 12px; line-height: 1.7; color: var(--muted); }
.confirm-actions { display: flex; gap: 10px; margin-top: 20px; }
.confirm-actions .btn { flex: 1; height: 48px; }

/* -------------------------------- overlays ------------------------------- */
.sync-overlay {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(5, 6, 10, 0.74);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.sync-overlay.is-open { opacity: 1; pointer-events: auto; }
.logo-orb.small { width: 58px; height: 58px; border-radius: 19px; margin: 0; animation: floaty 3.5s ease-in-out infinite; }
.logo-orb.small img { width: 38px; height: 38px; }
.sync-overlay p { margin: 0; font-size: 12.5px; color: rgba(255, 255, 255, 0.7); letter-spacing: 0.2px; }
.sync-bar { width: 128px; height: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.sync-bar i { display: block; width: 42%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, transparent, var(--pink), var(--lilac), transparent); animation: slide 1.2s ease-in-out infinite; }

.toast {
  position: absolute;
  left: 50%;
  top: 96px;
  bottom: auto;
  z-index: 100;
  max-width: 84%;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(32, 33, 42, 0.94);
  backdrop-filter: blur(20px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -10px);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.home-indicator {
  position: absolute;
  left: 50%;
  bottom: 8px;
  z-index: 110;
  width: 134px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  transform: translateX(-50%);
  pointer-events: none;
}

.stage-caption {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.34);
  letter-spacing: 0.3px;
}
.stage-caption strong { font-weight: 600; color: rgba(255, 255, 255, 0.62); }
.stage-caption span { padding-left: 12px; border-left: 1px solid rgba(255, 255, 255, 0.12); }

/* -------------------------------- animations ----------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes breathe { 0%, 100% { transform: scale(1); box-shadow: 0 0 60px rgba(255, 150, 200, 0.4); } 50% { transform: scale(1.07); box-shadow: 0 0 90px rgba(255, 150, 200, 0.6); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bar { 0%, 100% { transform: scaleY(0.5); opacity: 0.5; } 50% { transform: scaleY(1); opacity: 1; } }
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes slide { 0% { transform: translateX(-120%); } 100% { transform: translateX(340%); } }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------- mobile -------------------------------- */
@media (max-width: 560px) {
  body { overflow: hidden; }
  .stage { padding: 0; gap: 0; min-height: 100dvh; }
  .stage-aurora, .stage-caption { display: none; }
  .device {
    width: 100vw;
    height: 100dvh;
    min-height: 0;
    max-height: none;
    padding: 0;
    border-radius: 0;
    background: #000;
    box-shadow: none;
  }
  .device-screen { border-radius: 0; }
  .statusbar { height: 50px; padding-top: max(10px, env(safe-area-inset-top)); }
  .home-content { padding-top: max(62px, calc(env(safe-area-inset-top) + 42px)); padding-bottom: 112px; }
  .app-bar { padding-top: max(54px, calc(env(safe-area-inset-top) + 34px)); }
  .tabbar { padding-bottom: max(22px, calc(env(safe-area-inset-bottom) + 12px)); }
  .home-indicator { display: none; }
}

@media (max-height: 700px) and (min-width: 561px) {
  .device { min-height: 0; height: calc(100dvh - 60px); }
  .stage { gap: 10px; padding: 14px 20px; }
  .stage-caption { display: none; }
}
