[data-theme="light"] {
  --bg-base: #f5f7fa;
  --surface-base: #ffffff;
  --surface-2-base: #f3f5f9;
  --ink-base: #0f172a;
  --muted-base: #7b8794;
  --line-base: #e7ebf1;
  --chip-base: #eef1f6;
}
[data-theme="dark"] {
  --bg-base: #0d1117;
  --surface-base: #161c25;
  --surface-2-base: #1d242f;
  --ink-base: #f1f5f9;
  --muted-base: #8b97a6;
  --line-base: #283040;
  --chip-base: #222b37;
}
:root {
  color-scheme: light dark;
  --bg: var(--tg-bg, var(--bg-base));
  --surface: var(--tg-surface, var(--surface-base));
  --surface-2: var(--surface-2-base);
  --ink: var(--tg-ink, var(--ink-base));
  --muted: var(--tg-muted, var(--muted-base));
  --line: var(--line-base);
  --chip: var(--chip-base);
  --primary: var(--tg-primary, #2f86eb);
  --primary-ink: var(--tg-primary-ink, #ffffff);
  --primary-soft: rgba(47, 134, 235, 0.12);
  --ok: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --violet: #8b5cf6;
  --cyan: #06b6d4;
  --rose: #f43f5e;
  --success-soft: rgba(34, 197, 94, 0.14);
  --danger-soft: rgba(239, 68, 68, 0.12);
  --shadow-soft: 0 18px 42px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 10px 26px rgba(15, 23, 42, 0.08);
  --ring: 0 0 0 1px rgba(255,255,255,0.68) inset, 0 0 0 1px rgba(47,134,235,0.12);
  --radius-md: var(--r-md);
  --border: var(--line);
  --text: var(--ink);
  --r-lg: 20px;
  --r-md: 16px;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; color: inherit; border: 0; background: none; }

.app { width: min(100%, 460px); margin: 0 auto; min-height: 100vh; }
.origin-shell {
  position: relative;
  isolation: isolate;
}
.origin-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 0%, rgba(6, 182, 212, 0.12), transparent 32%),
    radial-gradient(circle at 88% 6%, rgba(47, 134, 235, 0.10), transparent 28%),
    linear-gradient(180deg, rgba(47, 134, 235, 0.07), transparent 230px);
}
.origin-surface {
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-card);
}

.view-root {
  padding: max(12px, env(safe-area-inset-top)) 16px
           calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  animation: fade-in 200ms ease-out;
  transition: transform 160ms ease;
}
/* fill-mode backwards + "to" без transform: после анимации на элементе не остаётся
   transform, иначе он станет containing block и сломает position: fixed у шторок */
.view-root > * { animation: rise-in 320ms cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.view-root > *:nth-child(2) { animation-delay: 40ms; }
.view-root > *:nth-child(3) { animation-delay: 80ms; }
.view-root > *:nth-child(4) { animation-delay: 120ms; }
.view-root > *:nth-child(5) { animation-delay: 160ms; }
.view-root > *:nth-child(n+6) { animation-delay: 190ms; }
.view-root > #paymentDrawerMount,
.view-root > #historyDrawerMount,
.view-root > #withdrawConfirmMount,
.view-root > #planSummaryMount,
.view-root > #keyListMount,
.view-root > .routing-onboarding { animation: none; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } }
.app.is-loading .view-root { animation: none; }
.app.is-pulling .view-root, .app.is-refreshing .view-root { transform: translateY(var(--pull-y, 0px)); }

.pull-refresh {
  position: fixed; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -120%);
  z-index: 70; display: flex; align-items: center; gap: 8px;
  min-height: 34px; padding: 7px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); color: var(--ink);
  border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  opacity: 0; pointer-events: none;
  transition: transform 160ms ease, opacity 160ms ease;
}
[data-theme="dark"] .pull-refresh { background: rgba(22, 28, 37, 0.94); }
.app.is-pulling .pull-refresh, .app.is-refreshing .pull-refresh {
  transform: translate(-50%, 0); opacity: 1;
}
.pull-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--primary);
  transform: rotate(var(--pull-rotate, 0deg));
}
.app.is-refreshing .pull-spinner { animation: spin 720ms linear infinite; }
.pull-text { font-size: 12px; font-weight: 800; white-space: nowrap; color: var(--muted); }
.app.is-ready-to-refresh .pull-text { color: var(--primary); }

.toast-host {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom));
  z-index: 95;
  width: min(calc(100% - 32px), 428px);
  transform: translate(-50%, 18px) scale(0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.toast-host.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}
.origin-toast {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  align-items: center;
  padding: 12px 14px 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-left-width: 3px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(16px);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
}
.origin-toast-text { min-width: 0; }
.origin-toast-ico {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.origin-toast-ico svg { width: 17px; height: 17px; }
.origin-toast.info { border-left-color: var(--primary); }
.origin-toast.success { border-left-color: #22c55e; }
.origin-toast.warn { border-left-color: #f59e0b; }
.origin-toast.error { border-left-color: #ef4444; }
.origin-toast.success .origin-toast-ico { background: var(--success-soft); color: #15803d; }
.origin-toast.warn .origin-toast-ico { background: var(--warn-soft); color: #b45309; }
.origin-toast.error .origin-toast-ico { background: var(--danger-soft); color: #dc2626; }
.origin-tooltip {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  margin-left: 6px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 950;
}
.origin-tooltip:active { transform: translateY(1px); }
.tooltip-popover {
  position: fixed;
  z-index: 110;
  max-width: min(300px, calc(100vw - 32px));
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  color: var(--ink);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(16px);
  font-size: 12px;
  line-height: 1.38;
  font-weight: 750;
}

/* ---------- boot ---------- */
.boot { display: grid; place-items: center; gap: 14px; min-height: 70vh; color: var(--muted); }
.boot-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--primary);
  animation: spin 720ms linear infinite;
}
.skeleton-screen { display: grid; gap: 12px; padding-top: 12px; }
.skeleton-card {
  position: relative; overflow: hidden;
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 92px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.skeleton-card.hero {
  min-height: 210px;
  gap: 12px;
  background: linear-gradient(145deg, rgba(47,134,235,0.14), rgba(148,163,184,0.08));
}
.skeleton-card.row { min-height: 68px; border-radius: var(--r-md); }
.skeleton-bone {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--chip) 88%, var(--line));
}
.skeleton-bone.bone-xs { width: 42%; height: 9px; }
.skeleton-bone.bone-sm { width: 34%; height: 10px; }
.skeleton-bone.bone-md { width: 58%; }
.skeleton-bone.bone-lg { width: 72%; height: 18px; }
.skeleton-bone.bone-btn { width: 100%; height: 44px; border-radius: 14px; margin-top: 8px; }
.skeleton-bone.bone-icon { width: 28px; height: 28px; border-radius: 10px; margin: 0 auto; }
.skeleton-toolbar .skeleton-card {
  min-height: 72px;
  justify-items: center;
  padding: 14px 10px;
  gap: 8px;
}
.skeleton-card::after {
  content: ""; position: absolute; inset: 0;
  transform: translateX(-120%);
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.55), transparent 80%);
  animation: shimmer 1.45s ease-in-out infinite;
}

/* ---------- tabbar ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0;
  width: min(100%, 460px);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}
.tabbar.origin-tabbar {
  bottom: calc(8px + env(safe-area-inset-bottom));
  width: min(calc(100% - 24px), 436px);
  padding: 5px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(16px);
}
.tab-item {
  display: grid; justify-items: center; gap: 3px;
  color: var(--muted); font-size: 11px; font-weight: 700;
  padding: 8px 4px; border-radius: 14px;
  transition: color 140ms ease, background 140ms ease, transform 130ms ease;
}
.tabbar.origin-tabbar .tab-item {
  border-radius: 16px;
  min-height: 52px;
  transition: color 140ms ease, background 140ms ease;
}
.tabbar.origin-tabbar .tab-item.is-active {
  color: var(--primary);
  background: rgba(47, 134, 235, 0.12);
}
.tab-item.is-active { color: var(--primary); }
.tab-ico { width: 24px; height: 24px; display: grid; place-items: center; }
.tab-ico svg { width: 24px; height: 24px; }
.tab-item:active { transform: scale(0.94); }

/* ---------- origin tab / page heads ---------- */
.origin-tab-head,
.top-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.origin-tab-head-leading,
.top-id {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.origin-tab-head-main { min-width: 0; }
.origin-tab-head-brand,
.top-brand {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.origin-tab-head-title,
.top-title {
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
}
.origin-tab-head-title.is-only,
.top-title.only {
  margin: 4px 0 2px;
}

.origin-page-head,
.page-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}
.origin-page-back,
.back-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: var(--shadow-card);
}
.origin-page-back svg,
.back-btn svg { width: 22px; height: 22px; }
.origin-page-head-text,
.page-head-text { min-width: 0; }
.origin-page-head-text h2,
.page-head-text h2 { margin: 4px 0 0; font-size: 22px; font-weight: 900; }
.origin-page-head-text p,
.page-head-text p { margin: 4px 0 0; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }

.gift-btn, .add-btn, .origin-icon-btn {
  width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow-card);
  transition: transform 130ms ease;
}
.add-btn, .origin-icon-btn.is-primary { background: linear-gradient(135deg, var(--primary), #1453b8); color: var(--primary-ink); border-color: transparent; }
.gift-btn svg, .add-btn svg, .origin-icon-btn svg { width: 21px; height: 21px; }
.gift-btn:active, .add-btn:active, .origin-icon-btn:active { transform: scale(0.96); }

/* avatars */
.origin-avatar-wrap {
  position: relative;
  display: inline-grid;
  place-items: center;
  padding: 3px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  box-shadow: 0 10px 24px rgba(47, 134, 235, 0.22);
  flex: 0 0 auto;
}
.origin-avatar-wrap.is-lg { padding: 4px; }
.origin-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  display: grid;
  place-items: center;
  background-color: #ffb86b;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  border: 2px solid var(--surface);
}
.origin-avatar.is-lg { width: 76px; height: 76px; font-size: 30px; }
.origin-avatar.is-fallback { background-image: none !important; }
.avatar-sm, .avatar-lg {
  border-radius: 50%; background-size: cover; background-position: center;
  display: grid; place-items: center; flex: 0 0 auto;
  background-color: #ffb86b; color: #fff; font-weight: 800;
}
.avatar-sm { width: 38px; height: 38px; font-size: 16px; }
.avatar-lg { width: 76px; height: 76px; font-size: 30px; }

/* legacy banner (unused) */
.banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border-radius: var(--r-lg);
  padding: 15px; margin-bottom: 12px;
}
.banner-text { display: grid; gap: 5px; }
.banner-text b { font-size: 16px; font-weight: 800; }
.banner-text span { font-size: 13px; color: var(--muted); line-height: 1.35; }
.banner-illu { flex: 0 0 auto; color: var(--primary); opacity: 0.85; }
.banner-illu svg { width: 46px; height: 46px; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 18px; margin-bottom: 16px;
}
.hero-glass.hero-active {
  background:
    linear-gradient(150deg, rgba(47, 134, 235, 0.88), rgba(29, 98, 196, 0.92) 72%, rgba(37, 99, 180, 0.90));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 14px 32px rgba(20, 83, 184, 0.22);
}
.hero-glass.hero-active.hero-warn {
  background: linear-gradient(145deg, #f59e0b, #d97706 85%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 16px 32px rgba(217, 119, 6, 0.28);
}
.hero-glass.hero-active.hero-warn::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 48%);
}
.hero-glass.hero-active::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 48%);
  pointer-events: none;
}
.hero-active {
  background:
    linear-gradient(150deg, rgba(47, 134, 235, 0.92), rgba(29, 98, 196, 0.96) 72%);
  color: #fff; box-shadow: 0 14px 32px rgba(20, 83, 184, 0.22);
}
.hero-active::after {
  content: ""; position: absolute; right: -36px; top: -48px; width: 120px; height: 120px;
  border-radius: 999px; background: rgba(255,255,255,0.12); filter: blur(1px);
}
.hero-glass.hero-empty {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-card);
}
.hero-glass.hero-bonus,
.hero-glass.hero-partner {
  position: relative;
  overflow: hidden;
  text-align: center;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}
.hero-glass.hero-bonus {
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.92), rgba(79, 70, 229, 0.94) 68%, rgba(47, 134, 235, 0.88));
  box-shadow: 0 18px 40px rgba(79, 70, 229, 0.28);
}
.hero-glass.hero-partner {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.90), rgba(5, 150, 105, 0.94) 68%, rgba(47, 134, 235, 0.86));
  box-shadow: 0 18px 40px rgba(5, 150, 105, 0.24);
}
.hero-glass.hero-bonus::before,
.hero-glass.hero-partner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 52%);
  pointer-events: none;
}
.hero-glass.hero-bonus.is-compact { padding: 16px 18px; }
.hero-promo-illu { position: relative; z-index: 1; }
.hero-promo-illu svg { width: 92px; height: 92px; }
.hero-glass.hero-bonus.is-compact .hero-promo-illu svg { width: 68px; height: 68px; }
.hero-promo-title {
  position: relative;
  z-index: 1;
  margin: 10px 0 6px;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.2;
}
.hero-glass.hero-bonus.is-compact .hero-promo-title { margin: 6px 0 4px; font-size: 19px; }
.hero-promo-text {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.88);
}
.hero-glass.hero-bonus.is-compact .hero-promo-text { line-height: 1.35; }
.hero-glass.hero-bonus + .origin-stat-grid,
.hero-glass.hero-partner + .origin-stat-grid,
.hero-glass.hero-bonus + .origin-copy-field,
.hero-glass.hero-partner + .origin-copy-field { margin-top: 12px; }
.hero-empty { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.hero-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; }
.hero-body { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; }
.hero-metric { font-size: 34px; font-weight: 900; line-height: 1; }
.hero-sub { margin-top: 6px; font-size: 14px; color: rgba(255,255,255,0.82); overflow-wrap: anywhere; }
.hero-active .origin-btn-light, .hero-active .btn-light { position: relative; z-index: 1; margin-top: 16px; font-weight: 900; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18); }
.hero-active .btn-lg { min-height: 52px; font-size: 17px; }
.hero-active .hero-top { color: rgba(255,255,255,0.85); }
.hero-empty .hero-top { color: var(--muted); }
.badge { border-radius: 999px; padding: 5px 10px; font-size: 11px; font-weight: 900; letter-spacing: 0.04em; background: var(--chip); color: var(--muted); }
.badge-ok { background: var(--ok); color: #052e16; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 11px; font-weight: 900; letter-spacing: 0.02em;
  background: var(--chip); color: var(--muted);
}
.status-pill::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; opacity: 0.85; }
.status-pill.ok { background: var(--success-soft); color: #15803d; }
.status-pill.warn { background: var(--warn-soft); color: #b45309; }
.status-pill.danger { background: var(--danger-soft); color: #dc2626; }
.status-pill.info { background: var(--primary-soft); color: var(--primary); }
.hero-active .status-pill.ok {
  background: rgba(255, 255, 255, 0.94);
  color: #1453b8;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.16);
}
.hero-active .status-pill.ok::before { animation: dot-pulse 2.2s ease-in-out infinite; }
@keyframes dot-pulse {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.78); }
}
.hero-active .status-pill.ok::before {
  background: #22c55e;
  opacity: 1;
}

.empty-illu {
  position: relative;
  display: grid;
  place-items: center;
  margin: 18px auto 10px;
  width: 112px;
  height: 112px;
}
.empty-illu svg { width: 84px; height: 84px; position: relative; z-index: 1; }
.empty-illu.big svg { width: 120px; height: 120px; }
.empty-text { text-align: center; color: var(--muted); font-weight: 600; margin: 0 0 6px; }
.empty-sub {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 16px;
  opacity: 0.9;
}
.hero-empty .empty-text { color: var(--ink); font-weight: 800; font-size: 16px; }

/* progress ring */
.status-ring { position: relative; width: 64px; height: 64px; flex: 0 0 auto; }
.ring-svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255,255,255,0.24); stroke-width: 6; }
.ring-fill {
  fill: none; stroke: #fff; stroke-width: 6; stroke-linecap: round;
  transition: stroke-dashoffset 600ms ease;
  animation: ring-draw 900ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes ring-draw { from { stroke-dashoffset: var(--ring-circ, 163); } }
.ring-label { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; color: #fff; line-height: 1; }
.ring-label b { font-size: 17px; font-weight: 900; }
.ring-label span { font-size: 9px; opacity: 0.85; margin-top: 2px; }

/* ---------- buttons ---------- */
.origin-btn,
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--r-md);
  font-size: 16px; font-weight: 800;
  border: 1px solid transparent;
  transition: transform 130ms ease, opacity 130ms ease, box-shadow 130ms ease;
}
.origin-btn svg, .btn svg { width: 19px; height: 19px; }
.origin-btn:active:not(:disabled), .btn:active:not(:disabled) { transform: scale(0.98); }
.origin-btn:disabled, .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.origin-btn.is-busy:disabled, .btn.is-busy:disabled { opacity: 0.86; }
.origin-btn-spinner {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: 0.9;
  animation: spin 720ms linear infinite;
}
.origin-btn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.origin-btn-block, .btn-block { width: 100%; }
.origin-btn-sm, .btn-sm { min-height: 38px; font-size: 14px; padding: 0 14px; border-radius: 12px; }
.origin-btn-lg, .btn-lg { min-height: 54px; font-size: 17px; }
.origin-btn-primary, .btn-primary {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), #1453b8);
  color: var(--primary-ink);
  box-shadow: 0 10px 22px rgba(47,134,235,0.28);
}
.origin-btn-light, .btn-light {
  position: relative;
  overflow: hidden;
  background: #fff;
  color: #1453b8;
  border-color: rgba(255,255,255,0.72);
}
.has-ripple { isolation: isolate; }
.btn-ripple {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  transform: scale(0);
  animation: btn-ripple 520ms ease-out forwards;
  pointer-events: none;
  z-index: 0;
}
.btn-light .btn-ripple { background: rgba(47, 134, 235, 0.18); }
.btn-primary .btn-ripple { background: rgba(255, 255, 255, 0.35); }
.has-ripple > *:not(.btn-ripple) { position: relative; z-index: 1; }
@keyframes btn-ripple {
  to { transform: scale(1); opacity: 0; }
}
.origin-btn-soft, .btn-soft {
  background: var(--surface);
  color: var(--ink);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: var(--shadow-card);
}
.origin-btn-ghost, .btn-ghost {
  background: transparent;
  color: var(--primary);
  border-color: rgba(47, 134, 235, 0.22);
}
.mt { margin-top: 12px; } .mt-sm { margin-top: 8px; }

/* ---------- section title ---------- */
.section-title { margin: 20px 2px 11px; font-size: 18px; font-weight: 900; }

/* ---------- origin metric row ---------- */
.origin-metric-row,
.balance-row, .list-row {
  width: 100%; display: flex; align-items: center; gap: 12px;
  text-align: left;
}
.origin-metric-row {
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--r-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-card);
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease;
}
.origin-metric-row:active { transform: scale(0.99); background: var(--surface-2); }
.origin-metric-ico,
.balance-ico {
  width: 42px; height: 42px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary);
}
.origin-metric-ico svg,
.balance-ico svg { width: 22px; height: 22px; }
.origin-metric-text,
.balance-text { flex: 1 1 auto; min-width: 0; }
.origin-metric-text b,
.balance-text b { display: block; font-size: 16px; font-weight: 800; }
.origin-metric-text small,
.balance-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.row-chevron { color: var(--muted); flex: 0 0 auto; }
.row-chevron svg { width: 18px; height: 18px; }

/* info carousel */
.info-carousel { margin: 0 -16px 14px; }
.info-scroll {
  display: flex; align-items: stretch; gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 2px 16px 0; -ms-overflow-style: none; scrollbar-width: none;
  scroll-padding-left: 16px;
  scroll-padding-right: 16px;
}
.info-scroll::-webkit-scrollbar { display: none; }
.info-card {
  flex: 0 0 auto; width: max-content; max-width: min(78vw, 280px);
  scroll-snap-align: start; text-align: left;
  background: var(--surface-2); border-radius: var(--r-md); padding: 14px 15px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  display: grid; align-content: center; gap: 4px;
}
.info-card b { font-size: 15px; font-weight: 800; white-space: nowrap; }
.info-card span { font-size: 12px; line-height: 1.35; color: var(--muted); }
.info-card.alt { background: linear-gradient(135deg, #2f86eb, #1453b8 70%, #06b6d4); color: #fff; box-shadow: var(--shadow-card); }
.info-card.alt span { color: rgba(255,255,255,0.85); }
.info-dots {
  display: flex; justify-content: center; align-items: center; gap: 6px;
  padding: 9px 0 1px;
}
.info-dots button {
  width: 9px; height: 9px; border-radius: 999px; background: rgba(100, 116, 139, 0.28);
  box-shadow: inset 0 0 0 1px rgba(100, 116, 139, 0.08);
  transition: width 160ms ease, background 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}
.info-dots button.is-active {
  width: 22px; background: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 137, 213, 0.24);
}

/* list-card */
.origin-list-card,
.list-card {
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.origin-menu-row.list-row,
.list-row { padding: 14px; }
.origin-menu-row.list-row + .origin-menu-row.list-row,
.origin-menu-row.list-row + .list-row,
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row.static { cursor: default; }
.origin-menu-row.list-row:active:not(.static),
.list-row:active:not(.static) { background: var(--surface-2); }

.row-ico { width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto; display: grid; place-items: center; background: var(--chip); color: var(--primary); }
.row-ico svg { width: 19px; height: 19px; }
.row-text { flex: 1 1 auto; min-width: 0; }
.row-text b { display: block; font-size: 15px; font-weight: 700; }
.row-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.row-value { color: var(--muted); font-size: 14px; flex: 0 0 auto; }

/* ---------- origin action grid ---------- */
.origin-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: -4px 0 16px;
}
.origin-action {
  min-height: 82px;
  display: grid;
  align-content: space-between;
  gap: 10px;
  text-align: left;
  padding: 13px;
  border-radius: var(--r-md);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.origin-action svg { width: 21px; height: 21px; }
.origin-action b { display: block; font-size: 14px; font-weight: 900; }
.origin-action span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.25; }
.origin-action.primary {
  background: linear-gradient(135deg, rgba(47, 134, 235, 0.14), rgba(6, 182, 212, 0.12));
  color: var(--primary);
}
.origin-action.accent {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.14), rgba(244, 63, 94, 0.10));
  color: var(--violet);
}
.origin-action:active { transform: scale(0.98); }

.home-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.home-toolbar.is-help { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home-tool {
  display: grid;
  justify-items: center;
  gap: 6px;
  min-height: 72px;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-card);
}
.home-tool { transition: transform 120ms ease, border-color 150ms ease, box-shadow 150ms ease; }
.home-tool:active { transform: scale(0.96); }
.home-tool:active .home-tool-ico { transform: scale(1.08); }
.home-tool-ico { transition: transform 150ms ease; }
.home-tool-ico {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.home-tool-ico svg { width: 17px; height: 17px; }
.home-tool > span:last-child {
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
  text-align: center;
}
.skeleton-toolbar .skeleton-card { min-height: 72px; }

.connect-more {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  overflow: hidden;
}
.connect-more > summary {
  list-style: none;
  cursor: pointer;
  padding: 13px 14px;
  font-size: 14px;
  font-weight: 850;
  color: var(--ink);
}
.connect-more > summary::-webkit-details-marker { display: none; }
.connect-more > summary::after {
  content: "";
  float: right;
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 150ms ease;
}
.connect-more[open] > summary::after { transform: rotate(225deg); margin-top: 8px; }
.connect-more-body {
  display: grid;
  gap: 10px;
  padding: 0 14px 14px;
}

.current-key-select {
  display: grid;
  gap: 11px;
  margin: 0 0 12px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid rgba(47, 134, 235, 0.22);
  background:
    linear-gradient(135deg, rgba(47, 134, 235, 0.10), transparent 60%),
    var(--surface);
  box-shadow: var(--shadow-card);
}
.current-key-select-head {
  display: flex;
  align-items: center;
  gap: 11px;
}
.current-key-select-title { min-width: 0; }
.current-key-select-title b { display: block; font-size: 15px; font-weight: 900; }
.current-key-select-title small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.3; }
.origin-select {
  position: relative;
  display: block;
}
.origin-select select {
  width: 100%;
  min-height: 44px;
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 0 42px 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
}
.origin-select select:focus { outline: none; border-color: var(--primary); }
.origin-select-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) rotate(90deg);
  color: var(--muted);
  pointer-events: none;
}
.origin-select-chevron svg { width: 17px; height: 17px; }

/* ---------- origin segmented (tabs) ---------- */
.origin-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  margin: 0 0 12px;
  border-radius: var(--r-md);
  background: var(--chip);
  border: 1px solid rgba(148, 163, 184, 0.16);
}
.origin-segmented.is-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plan-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.plan-chip-check {
  width: 14px;
  height: 14px;
  display: inline-grid;
  place-items: center;
  color: var(--primary);
}
.plan-chip-check svg { width: 14px; height: 14px; }
.origin-segmented .plan-chip.selected {
  box-shadow: 0 0 0 1px rgba(47, 134, 235, 0.35), 0 8px 18px rgba(15, 23, 42, 0.10);
}
.origin-segmented.is-scroll {
  display: flex;
  overflow-x: auto;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.origin-segmented.is-scroll::-webkit-scrollbar { display: none; }
.origin-segmented.is-inset {
  margin: 0;
  grid-column: 1 / -1;
  background: var(--surface-2);
  border-color: var(--line);
}
.origin-segmented button {
  min-height: 38px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 130ms ease;
}
.origin-segmented.is-scroll button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
}
.origin-segmented button.selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}
.origin-segmented.is-inset button.selected {
  color: var(--primary);
  box-shadow: var(--shadow-card);
}
.origin-segmented button:active { transform: scale(0.98); }

/* ---------- keys ---------- */
.key-list { display: grid; gap: 10px; }
.origin-key-row,
.key-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--r-md);
  padding: 13px 14px;
  box-shadow: var(--shadow-card);
  transition: transform 130ms ease, border-color 130ms ease, background 130ms ease;
}
.origin-key-row:active, .key-card:active { transform: scale(0.99); background: var(--surface-2); }
.origin-key-row .origin-list-chevron { flex: 0 0 auto; color: var(--muted); }
.origin-key-row .origin-badge { flex: 0 0 auto; }
.key-card-ico { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.key-card-ico.expired { background: var(--chip); color: var(--muted); }
.key-card-ico svg { width: 22px; height: 22px; }
.key-card-text { flex: 1 1 auto; min-width: 0; }
.key-card-text b { display: block; font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.key-card-text small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.origin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.origin-badge.active, .origin-badge.ok { background: #dcfce7; color: #166534; }
.origin-badge.warn { background: var(--warn-soft); color: #b45309; }
.origin-badge.expired, .origin-badge.danger { background: #fee2e2; color: #991b1b; }
.origin-badge.info { background: var(--primary-soft); color: var(--primary); }

/* empty state */
.origin-empty {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 18px 32px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(120px 80px at 50% 28%, rgba(47,134,235,0.10), transparent 70%),
    color-mix(in srgb, var(--surface) 94%, transparent);
  text-align: center;
  overflow: hidden;
}
.origin-empty.is-tall { min-height: 70vh; align-content: center; }
.origin-empty-glow,
.empty-illu .origin-empty-glow {
  position: absolute;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(47,134,235,0.22), transparent 68%);
  filter: blur(2px);
  pointer-events: none;
}
.origin-empty-glow { top: 28px; }
.empty-illu .origin-empty-glow { inset: 8px; width: auto; height: auto; }
.origin-empty-ico { position: relative; z-index: 1; }
.origin-empty-ico svg { width: 84px; height: 84px; }
.origin-empty-title { margin: 0; font-size: 17px; font-weight: 850; color: var(--ink); }
.origin-empty-text { margin: 0; max-width: 280px; color: var(--muted); font-size: 13px; line-height: 1.45; font-weight: 600; }
.origin-empty-action { margin-top: 8px; width: min(100%, 280px); }
.empty-state { display: grid; place-items: center; padding: 40px 0; }
.empty-state.tall { min-height: 70vh; align-content: center; }

/* ---------- stacks / choices ---------- */
.stack { display: grid; gap: 10px; }
.origin-choice-row.list-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
}
.origin-choice-row .row-text b { font-weight: 800; }

/* origin stat grid */
.origin-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.origin-stat-grid.is-cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.origin-stat-grid.mt { margin-top: 12px; }
.origin-stat-cell {
  background: var(--surface);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--r-md);
  padding: 14px;
  box-shadow: var(--shadow-card);
}
.origin-stat-cell span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.origin-stat-cell b {
  display: block;
  margin-top: 5px;
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}
.hero-glass.hero-bonus + .origin-stat-grid,
.hero-glass.hero-partner + .origin-stat-grid { margin-top: 12px; }
.origin-stat-grid + .origin-btn, .origin-stat-grid + .btn { margin-top: 14px; }

/* legacy choice row (unused) */
.choice-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.choice-row b { display: block; font-size: 15px; font-weight: 800; overflow-wrap: anywhere; }
.choice-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }

/* origin description list */
.origin-desc-list {
  display: grid;
  gap: 0;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.origin-desc-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 12px;
  padding: 12px 14px;
  align-items: start;
}
.origin-desc-row + .origin-desc-row { border-top: 1px solid var(--line); }
.origin-desc-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.origin-desc-row b {
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  overflow-wrap: anywhere;
}

/* legacy kv (unused) */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.kv span { color: var(--muted); font-size: 13px; }
.kv b { font-size: 13px; text-align: right; overflow-wrap: anywhere; }

/* copy field */
.origin-copy-field { margin-top: 12px; }
.origin-copy-field.mt { margin-top: 12px; }
.origin-copy-field .origin-input-wrap.is-readonly {
  min-height: 46px;
  padding-right: 6px;
  background: var(--surface-2);
}
.origin-copy-value {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--ink);
}
.origin-copy-value code { font-size: inherit; font-family: inherit; }
.origin-copy-value code.is-masked {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-weight: 800;
}
.origin-copy-btn {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: var(--primary-soft);
  color: var(--primary);
}
.origin-copy-btn svg { width: 18px; height: 18px; }
.origin-copy-btn:active { transform: scale(0.96); }
.payment-sheet .origin-copy-field { margin-top: 0; }

/* legacy copy box (unused) */
.copy-box { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.copy-box code { font-size: 12px; overflow-wrap: anywhere; word-break: break-word; }
.copy-box code.is-masked {
  display: block;
  width: fit-content;
  max-width: 100%;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
}
.icon-btn { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--primary); }
.icon-btn svg { width: 18px; height: 18px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

/* info box */
.info-box { display: grid; gap: 4px; margin-top: 12px; padding: 14px; border-radius: var(--r-md); background: var(--primary-soft); color: var(--primary); font-size: 13px; line-height: 1.4; }
.info-box b { font-weight: 800; }
.info-box span { opacity: 0.9; }
.connect-alert-stack {
  display: grid;
  gap: 9px;
  margin: 0 0 12px;
}
.connect-alert-stack .origin-alert { margin: 0; }
.origin-alert {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 11px;
  align-items: start;
  margin: 0 0 12px;
  padding: 13px;
  border-radius: var(--r-md);
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.origin-alert-ico {
  width: 34px; height: 34px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}
.origin-alert-ico svg { width: 18px; height: 18px; }
.origin-alert b { display: block; font-size: 14px; font-weight: 900; }
.origin-alert-content { display: block; color: var(--ink); }
.origin-alert-content span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.origin-alert.warn { background: linear-gradient(135deg, rgba(245,158,11,0.12), var(--surface)); border-color: rgba(245,158,11,0.24); }
.origin-alert.warn .origin-alert-ico { background: var(--warn-soft); color: var(--warn); }
.origin-alert.info { background: linear-gradient(135deg, rgba(47,134,235,0.10), var(--surface)); border-color: rgba(47,134,235,0.20); }
.origin-alert.has-action .origin-alert-content .origin-btn { margin-top: 8px; }

.origin-stepper {
  position: relative;
  display: grid;
  gap: 0;
  margin: 12px 0;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.origin-step {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  min-height: 58px;
  padding: 10px;
}
.origin-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 26px;
  top: 45px;
  bottom: -13px;
  width: 2px;
  border-radius: 999px;
  background: var(--line);
}
.origin-step.done:not(:last-child)::after,
.origin-step.active:not(:last-child)::after {
  background: linear-gradient(180deg, var(--primary), rgba(47,134,235,0.18));
}
.origin-step-marker {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--chip);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  border: 1px solid var(--line);
}
.origin-step.done .origin-step-marker,
.origin-step.active .origin-step-marker {
  background: linear-gradient(135deg, var(--primary), #1453b8);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 7px 16px rgba(47, 134, 235, 0.22);
}
.origin-step-text b { display: block; font-size: 14px; font-weight: 900; }
.origin-step-text small { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.origin-stepper.is-guide .origin-step.guide:not(:last-child)::after {
  background: linear-gradient(180deg, rgba(47, 134, 235, 0.35), rgba(47, 134, 235, 0.12));
}
.origin-stepper.is-guide .origin-step.guide .origin-step-marker {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: rgba(47, 134, 235, 0.18);
  box-shadow: none;
}
.connect-steps {
  display: grid;
  gap: 9px;
  margin: 12px 0;
}
.connect-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 11px;
  align-items: start;
  padding: 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.connect-step span {
  width: 32px; height: 32px; border-radius: 11px;
  display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--cyan));
  font-size: 13px; font-weight: 900;
}
.connect-step b { display: block; font-size: 14px; font-weight: 900; }
.connect-step small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }

/* plans */
.plan-card { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 15px 16px; box-shadow: var(--shadow-card); }
.plan-card:nth-child(2) { border-color: rgba(47, 134, 235, 0.42); background: linear-gradient(135deg, var(--surface), rgba(47, 134, 235, 0.08)); }
.plan-card b { display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 800; }
.plan-card small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.plan-card strong { font-size: 20px; color: var(--primary); flex: 0 0 auto; }
.tag { font-style: normal; font-size: 10px; font-weight: 900; text-transform: uppercase; color: #166534; background: #dcfce7; border-radius: 999px; padding: 2px 7px; }

.pay-result { margin-top: 14px; display: grid; gap: 0; }
.pay-result .origin-btn-block, .pay-result .btn-block { margin-top: 10px; }
.plan-summary-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(47, 134, 235, 0.28);
  box-shadow: 0 0 0 1px rgba(47, 134, 235, 0.08), var(--shadow-card);
  background:
    linear-gradient(135deg, rgba(47,134,235,0.10), transparent 58%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}
@property --shine-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}
.plan-summary-card.has-shine { position: relative; }
.plan-summary-card.has-shine::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--r-lg);
  padding: 2px;
  background: conic-gradient(
    from var(--shine-angle),
    transparent 0%,
    transparent 72%,
    rgba(47, 134, 235, 0.85) 86%,
    rgba(6, 182, 212, 0.9) 93%,
    transparent 100%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: shine-rotate 3.4s linear infinite;
}
@keyframes shine-rotate { to { --shine-angle: 360deg; } }
.plan-summary-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.plan-summary-title b { display: block; font-size: 20px; font-weight: 900; }
.plan-summary-title span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.plan-summary-price { text-align: right; flex: 0 0 auto; }
.plan-summary-price strong { display: block; font-size: 24px; color: var(--primary); }
.plan-summary-price span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.plan-summary-card > .status-pill {
  width: 100%;
  justify-content: center;
}
.payment-sheet {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-lg);
  border: 1px solid rgba(47, 134, 235, 0.22);
  background:
    linear-gradient(180deg, rgba(47, 134, 235, 0.08), transparent 64px),
    var(--surface);
  box-shadow: var(--shadow-soft);
}
.payment-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.payment-sheet-title b { display: block; font-size: 16px; font-weight: 900; }
.payment-sheet-title span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.payment-sheet .copy-box { margin-top: 0; }
.payment-loading {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 20px 14px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-align: center;
}
.payment-loading b { font-size: 16px; font-weight: 900; }
.payment-loading span:last-child { color: var(--muted); font-size: 12px; }
.dots-loader {
  display: inline-flex;
  align-items: flex-end;
  gap: 6px;
  height: 26px;
  padding-bottom: 2px;
}
.dots-loader span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  animation: dot-bounce 1.05s ease-in-out infinite;
}
.dots-loader span:nth-child(2) { animation-delay: 0.14s; opacity: 0.85; }
.dots-loader span:nth-child(3) { animation-delay: 0.28s; opacity: 0.7; }
@keyframes dot-bounce {
  0%, 70%, 100% { transform: translateY(0); }
  35% { transform: translateY(-9px); }
}
.payment-fallback-actions { display: grid; gap: 8px; }
.payment-alternative { display: grid; gap: 10px; }
.payment-alternative-panel[hidden] { display: none; }
.payment-manual {
  border-color: rgba(245, 158, 11, 0.30);
  background:
    linear-gradient(180deg, rgba(245, 158, 11, 0.10), transparent 64px),
    var(--surface);
}
.origin-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  align-items: end;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(10px);
}
.origin-drawer {
  width: min(100%, 460px);
  margin: 0 auto;
  max-height: min(86vh, 720px);
  overflow: auto;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  box-shadow: 0 -20px 54px rgba(15, 23, 42, 0.24);
}
.origin-drawer-handle {
  width: 42px; height: 5px; border-radius: 999px;
  background: rgba(100, 116, 139, 0.30);
  margin: 0 auto 12px;
}
.origin-drawer-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 12px;
}
.origin-drawer-head b { display: block; font-size: 19px; font-weight: 900; }
.origin-drawer-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.origin-drawer-close {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted);
  font-size: 24px; line-height: 1;
}
.origin-drawer-body { display: grid; gap: 10px; }
.origin-confirm {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid rgba(47, 134, 235, 0.22);
  background: linear-gradient(135deg, rgba(47, 134, 235, 0.10), var(--surface));
}
.origin-confirm-head {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
}
.origin-confirm-ico {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.origin-confirm-ico svg { width: 18px; height: 18px; }
.origin-confirm b { display: block; font-size: 15px; font-weight: 900; }
.origin-confirm span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; line-height: 1.35; }
.origin-confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* legacy referral hero (unused) */
.ref-hero { text-align: center; background: var(--surface-2); border-radius: var(--r-lg); padding: 22px 18px; }
.ref-hero-illu svg { width: 92px; height: 92px; }
.ref-hero h2 { margin: 10px 0 6px; font-size: 21px; font-weight: 900; line-height: 1.2; }
.ref-hero p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.ref-hero-bonuses { padding: 16px 18px; }
.ref-hero-bonuses .ref-hero-illu svg { width: 68px; height: 68px; }
.ref-hero-bonuses h2 { margin: 6px 0 4px; font-size: 19px; }
.ref-hero-bonuses p { line-height: 1.35; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.stat-cell { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.stat-cell span { display: block; color: var(--muted); font-size: 12px; font-weight: 700; }
.stat-cell b { display: block; margin-top: 5px; font-size: 18px; font-weight: 900; }
.ref-hero + .stat-grid { margin-top: 12px; }
.stat-grid + .origin-btn, .stat-grid + .btn { margin-top: 14px; }

/* ---------- history ---------- */
.history-count { margin: 2px 2px 8px; color: var(--muted); font-size: 11px; font-weight: 700; }
.history-list { display: grid; gap: 8px; }
.origin-list-row,
.history-row {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: left;
  transition: transform 130ms ease, background 130ms ease;
}
.origin-list-row:active, .history-row:active { transform: scale(0.99); background: var(--surface-2); }
.origin-list-chevron {
  color: var(--muted);
  display: grid;
  place-items: center;
}
.origin-list-chevron svg { width: 18px; height: 18px; }
.history-operation-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.history-operation-ico svg { width: 20px; height: 20px; }
.history-operation-ico.renew { background: var(--success-soft); color: #15803d; }
.history-operation-ico.bonus { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.history-operation-ico.other { background: var(--chip); color: var(--muted); }
.history-row-main { min-width: 0; }
.history-row-main b { display: block; font-size: 14px; font-weight: 900; overflow-wrap: anywhere; }
.history-row-main small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.history-row-main .status-pill { min-height: 21px; margin-top: 6px; padding: 0 7px; font-size: 9px; }
.history-row-value { display: grid; justify-items: end; gap: 3px; color: var(--ink); font-size: 12px; font-weight: 850; white-space: nowrap; }
.history-skeleton { display: grid; gap: 9px; }
.history-error { display: grid; gap: 10px; }
.history-more { margin-top: 10px; }
.history-empty { padding: 28px 0; }
.history-detail-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.history-detail-summary b { display: block; font-size: 15px; font-weight: 900; }
.history-detail-summary small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.history-detail-summary .status-pill { align-self: start; }

/* ---------- settings ---------- */
.profile-head { display: flex; align-items: center; gap: 14px; padding: 6px 2px 12px; }
.profile-meta b { display: block; font-size: 19px; font-weight: 900; }
.profile-meta span { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }
.settings-field {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 11px;
  align-items: center;
  padding: 14px;
  border-top: 1px solid var(--line);
}
.settings-field .origin-segmented.is-inset { grid-column: 1 / -1; }
.settings-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 14px;
  border-top: 1px solid var(--line);
}
.settings-toggle:active { background: var(--surface-2); }
.origin-switch {
  position: relative;
  width: 44px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--chip);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.10);
  transition: background 180ms ease, border-color 180ms ease;
}
.origin-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.18);
  transition: transform 300ms cubic-bezier(0.34, 1.56, 0.64, 1), width 180ms ease;
}
.origin-switch.is-on {
  background: linear-gradient(135deg, var(--primary), #1453b8);
  border-color: transparent;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.20);
}
.origin-switch.is-on span { transform: translateX(18px); }
/* uiverse-style squish: the knob stretches while the toggle is pressed */
.settings-toggle:active .origin-switch span { width: 24px; }
.settings-toggle:active .origin-switch.is-on span { transform: translateX(12px); }
.foot { margin-top: 22px; opacity: 0.7; }

/* ---------- faq ---------- */
.origin-accordion {
  display: grid;
  gap: 9px;
}
.origin-accordion-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.origin-accordion-trigger {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  text-align: left;
  font-size: 15px;
  font-weight: 900;
}
.origin-accordion-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  transition: transform 160ms ease, color 160ms ease;
}
.origin-accordion-icon svg { width: 16px; height: 16px; }
.origin-accordion-item.is-open .origin-accordion-icon {
  transform: rotate(90deg);
  color: var(--primary);
}
.origin-accordion-panel {
  display: none;
  padding: 0 14px 14px;
}
.origin-accordion-item.is-open .origin-accordion-panel { display: block; }
.origin-accordion-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

/* ---------- misc text ---------- */
.muted-note { color: var(--muted); font-size: 13px; line-height: 1.4; margin: 12px 2px 0; }
.muted-note.center { text-align: center; }
.success-text { margin: 12px 2px 0; color: #15803d; font-weight: 800; font-size: 13px; }
.error-text { margin: 12px 2px 0; color: var(--danger); font-size: 14px; line-height: 1.4; }
.loading-line { position: relative; overflow: hidden; width: fit-content; max-width: 100%; padding-right: 22px; }
.loading-line::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(127,127,127,0.18), transparent); animation: shimmer 1.3s ease-in-out infinite; }

.qr-wrap { display: grid; place-items: center; margin: 4px auto 0; padding: 16px; width: 100%; max-width: 280px; aspect-ratio: 1/1; background: #fff; border-radius: 18px; border: 1px solid var(--line); }
.qr-wrap svg { width: 100%; height: 100%; display: block; }

@media (hover: hover) {
  .origin-metric-row:hover, .origin-key-row:hover, .key-card:hover, .origin-choice-row:hover, .plan-card:hover, .info-card:hover, .origin-menu-row.list-row:hover:not(.static) { border-color: var(--primary); }
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 300;
  pointer-events: none;
}

.btn-pulse { animation: btn-pulse 2s ease-in-out infinite; }
@keyframes btn-pulse {
  0% { box-shadow: 0 0 0 0 rgba(47, 134, 235, 0.32); }
  60% { box-shadow: 0 0 0 10px rgba(47, 134, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(47, 134, 235, 0); }
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 100% { transform: translateX(100%); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

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

/* ---------- dark theme polish ---------- */
[data-theme="dark"] .origin-tabbar {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-color: rgba(71, 85, 105, 0.45);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}
[data-theme="dark"] .origin-empty {
  border-color: rgba(100, 116, 139, 0.35);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}
[data-theme="dark"] .hero-glass.hero-active {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .hero-glass.hero-active.hero-warn {
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.42);
}
[data-theme="dark"] .hero-glass.hero-empty {
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-color: rgba(71, 85, 105, 0.45);
}
[data-theme="dark"] .hero-glass.hero-bonus,
[data-theme="dark"] .hero-glass.hero-partner {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}
[data-theme="dark"] .origin-desc-list,
[data-theme="dark"] .origin-desc-row + .origin-desc-row {
  border-color: rgba(71, 85, 105, 0.42);
}
[data-theme="dark"] .origin-badge.active,
[data-theme="dark"] .origin-badge.ok {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}
[data-theme="dark"] .origin-badge.expired,
[data-theme="dark"] .origin-badge.danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}
[data-theme="dark"] .origin-stat-cell {
  border-color: rgba(71, 85, 105, 0.42);
}
[data-theme="dark"] .origin-list-row,
[data-theme="dark"] .origin-key-row,
[data-theme="dark"] .origin-list-card {
  border-color: rgba(71, 85, 105, 0.42);
}
[data-theme="dark"] .origin-btn-soft,
[data-theme="dark"] .btn-soft {
  background: var(--surface-2);
  border-color: rgba(71, 85, 105, 0.45);
}
[data-theme="dark"] .origin-copy-field .origin-input-wrap.is-readonly {
  background: var(--surface-2);
}
[data-theme="dark"] .tooltip-popover,
[data-theme="dark"] .origin-toast {
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
}

/* ---------- urgency (expiry) ---------- */
.banner-warn { background: var(--warn-soft); }
.banner-warn .banner-illu { color: var(--warn); opacity: 1; }
.badge-warn { background: var(--warn); color: #3a2400; }
.hero-warn { background: linear-gradient(145deg, #f59e0b, #d97706 85%); box-shadow: 0 16px 32px rgba(217, 119, 6, 0.28); }
.hero-warn .status-pill.warn {
  background: rgba(255, 250, 235, 0.92);
  color: #92400e;
  border: 1px solid rgba(255, 255, 255, 0.58);
  box-shadow: 0 6px 16px rgba(120, 53, 15, 0.16);
}
.hero-warn .status-pill.warn::before {
  background: #d97706;
  opacity: 1;
}
.key-card.warn { border-color: var(--warn); }

/* ---------- promo ---------- */
.promo-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 8px;
  margin-top: 4px;
  align-items: center;
}
.promo-box .origin-field { display: contents; }
.promo-box .origin-input-wrap { grid-column: 1; grid-row: 1; }
.promo-box .origin-field-message { grid-column: 1 / -1; grid-row: 2; }
.promo-box .origin-btn, .promo-box .btn {
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  min-height: 46px;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}
.origin-field { display: grid; gap: 6px; }
.origin-input-wrap {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.origin-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 134, 235, 0.12); }
.origin-input-leading, .origin-input-suffix { flex: 0 0 auto; color: var(--muted); font-size: 13px; font-weight: 850; }
.origin-input-leading { width: 20px; height: 20px; display: grid; place-items: center; }
.origin-input-leading svg { width: 18px; height: 18px; }
.origin-input-control { width: 100%; min-width: 0; padding: 11px 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; }
.origin-input-clear {
  display: none;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--chip);
  color: var(--muted);
  font-size: 19px;
  line-height: 1;
}
.origin-field.has-value .origin-input-clear { display: grid; }
.origin-field-message { min-height: 15px; color: var(--muted); font-size: 11px; line-height: 1.35; }
.origin-field.is-error .origin-input-wrap, .origin-field.is-error .origin-textarea { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.10); }
.origin-field.is-error .origin-field-message { color: #dc2626; }
.origin-field.is-success .origin-input-wrap, .origin-field.is-success .origin-textarea { border-color: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.10); }
.origin-field.is-success .origin-field-message { color: #15803d; }
.promo-input { font-size: 15px; text-transform: uppercase; }
.promo-input::placeholder { color: var(--muted); text-transform: none; }
.withdraw-box { margin-top: 4px; }
.withdraw-amount { font-size: 18px; font-weight: 700; }
.origin-textarea {
  width: 100%;
  min-height: 104px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  outline: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  line-height: 1.45;
  resize: vertical;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.origin-textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47, 134, 235, 0.12); }
.withdraw-input::placeholder { color: var(--muted); }
.origin-field-footer { min-width: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.origin-field-footer .origin-field-message { flex: 1 1 auto; min-width: 0; }
.origin-field-counter { flex: 0 0 auto; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.withdraw-confirm-summary {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
}
.withdraw-confirm-ico { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; background: var(--success-soft); color: #15803d; }
.withdraw-confirm-ico svg { width: 20px; height: 20px; }
.withdraw-confirm-summary b { display: block; font-size: 20px; font-weight: 900; }
.withdraw-confirm-summary small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }

/* ---------- apps guide ---------- */
.app-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; display: grid; gap: 10px; }
.app-head b { font-size: 16px; font-weight: 800; }
.app-card .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------- routing profiles ---------- */
.routing-card {
  display: grid;
  gap: 12px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.routing-card.is-compact {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin: 14px 0 10px;
}
.current-key-select { margin: 0 0 10px; }
.home-toolbar { margin-top: 2px; }
.routing-compact-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.routing-compact-head b { font-size: 13px; font-weight: 900; }
.routing-compact-toggle {
  margin: 0;
  grid-template-columns: 1fr;
}
.routing-compact-toggle > span.selected {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--surface);
  color: var(--primary);
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--shadow-card);
}
.routing-card.is-compact .origin-alert { grid-column: 1 / -1; }
.routing-compact-hint {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid transparent;
  text-align: left;
  transition: opacity 140ms ease, transform 130ms ease;
}
.routing-compact-hint:disabled {
  opacity: 1;
  pointer-events: none;
}
.routing-card.is-busy .routing-compact-toggle {
  opacity: 0.78;
}
.routing-card.is-busy .routing-compact-hint {
  color: var(--primary);
  border-color: rgba(47, 134, 235, 0.18);
  background: rgba(47, 134, 235, 0.08);
}
.routing-card.is-busy .routing-hint-more { display: none; }
.routing-card.is-busy .routing-compact-hint [data-routing-hint] { color: var(--primary); }
.routing-busy-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}
.dots-loader.is-inline {
  height: 12px;
  gap: 4px;
  padding-bottom: 0;
  align-items: center;
}
.dots-loader.is-inline span {
  width: 5px;
  height: 5px;
}
.routing-status {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(47, 134, 235, 0.18);
  background: rgba(47, 134, 235, 0.08);
}
.routing-status[hidden] { display: none; }
.routing-choice.is-loading {
  position: relative;
  animation: pulse-soft 900ms ease-in-out infinite;
}
.routing-choice.is-loading::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  border-right-color: transparent;
  animation: spin 720ms linear infinite;
}
@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}
.routing-compact-hint:active { transform: scale(0.99); }
.routing-compact-hint [data-routing-hint] {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  animation: hint-swap 260ms ease-out both;
}
.routing-hint-more {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.routing-hint-more svg { width: 13px; height: 13px; }
@keyframes hint-swap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
.routing-card-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.routing-card-head > span:last-child { min-width: 0; }
.routing-card-head b { display: block; font-size: 15px; font-weight: 900; }
.routing-card-head small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.routing-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.routing-choice {
  min-width: 0;
  min-height: 76px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--ink);
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, transform 100ms ease;
}
.routing-choice:active { transform: scale(0.98); }
.routing-choice.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.routing-choice:disabled { opacity: 0.68; pointer-events: none; }
.routing-flag { font-size: 23px; line-height: 1; }
.routing-choice b { display: block; font-size: 14px; font-weight: 900; }
.routing-choice small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.routing-refresh-hint { margin: -2px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.routing-explain {
  display: grid;
  gap: 5px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
}
.routing-explain b { margin-top: 5px; font-size: 14px; }
.routing-explain p { margin: 0 0 7px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.routing-onboarding {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  align-items: end;
}
.routing-onboarding-backdrop { position: absolute; inset: 0; background: rgba(8, 15, 32, 0.58); backdrop-filter: blur(5px); }
.routing-onboarding-sheet {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 12px 18px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--line);
  border-radius: 28px 28px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 52px rgba(15, 23, 42, 0.24);
  animation: routing-sheet-in 220ms ease-out both;
}
.routing-sheet-handle { width: 42px; height: 5px; margin: 0 auto 2px; border-radius: 999px; background: var(--line-strong); }
.routing-onboarding-sheet h2 { margin: 0; font-size: 24px; line-height: 1.15; }
.routing-onboarding-sheet > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.routing-choice-grid.is-onboarding { grid-template-columns: 1fr 1fr; }
.routing-choice-grid.is-onboarding .routing-choice { min-height: 96px; padding: 14px; }
.routing-choice-grid.is-settings { margin-top: 4px; }
@keyframes routing-sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 360px) {
  .routing-choice-grid { grid-template-columns: 1fr; }
  .routing-choice { min-height: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .routing-onboarding-sheet { animation: none; }
}
