:root {
  color-scheme: dark;
  --bg: #050505;
  --ink: #f4f4f4;
  --muted: #9a9a9a;
  --line: rgba(255, 255, 255, .12);
  --soft: rgba(255, 255, 255, .06);
  --soft-2: rgba(255, 255, 255, .09);
  --ok: #9ae6b4;
  --warn: #f6e05e;
  --danger: #fc8181;
  --radius: 16px;
  --dock-h: calc(78px + env(safe-area-inset-bottom, 0px));
  --top-h: 68px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: Manrope, "Segoe UI", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

/* —— atmosphere —— */
.geo {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #050505;
}
.cloud {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .55;
  will-change: transform;
  mix-blend-mode: screen;
}
.cloud.c1 {
  width: 48vmax; height: 48vmax;
  left: -12vmax; top: -14vmax;
  background: radial-gradient(circle, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 70%);
  animation: flow1 28s ease-in-out infinite alternate;
}
.cloud.c2 {
  width: 42vmax; height: 42vmax;
  right: -10vmax; top: 8vmax;
  background: radial-gradient(circle, rgba(220,220,220,.22) 0%, rgba(255,255,255,0) 68%);
  animation: flow2 34s ease-in-out infinite alternate;
  filter: blur(100px);
}
.cloud.c3 {
  width: 56vmax; height: 40vmax;
  left: 18vmax; bottom: -18vmax;
  background: radial-gradient(circle, rgba(255,255,255,.18) 0%, rgba(255,255,255,0) 72%);
  animation: flow3 40s ease-in-out infinite alternate;
  filter: blur(110px);
}
.cloud.c4 {
  width: 36vmax; height: 36vmax;
  left: 35%; top: 28%;
  background: radial-gradient(circle, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 70%);
  animation: flow4 24s ease-in-out infinite alternate;
  filter: blur(90px);
  opacity: .4;
}
.cloud.c5 {
  width: 30vmax; height: 30vmax;
  right: 18%; bottom: 12%;
  background: radial-gradient(circle, rgba(240,240,240,.16) 0%, rgba(255,255,255,0) 70%);
  animation: flow5 32s ease-in-out infinite alternate;
  filter: blur(95px);
  opacity: .45;
}
.cloud.c6 {
  width: 40vmax; height: 40vmax;
  left: -8%; bottom: 22%;
  background: radial-gradient(circle, rgba(255,255,255,.12) 0%, rgba(255,255,255,0) 70%);
  animation: flow2 38s ease-in-out infinite alternate-reverse;
  filter: blur(100px);
  opacity: .35;
}
.geo .veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, transparent 20%, rgba(5,5,5,.55) 70%, rgba(5,5,5,.92) 100%);
}
@keyframes flow1 {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(12vmax, 8vmax, 0) scale(1.15); }
}
@keyframes flow2 {
  from { transform: translate3d(0,0,0) scale(1.05); }
  to { transform: translate3d(-14vmax, 10vmax, 0) scale(1.2); }
}
@keyframes flow3 {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(-10vmax, -8vmax, 0) scale(1.18); }
}
@keyframes flow4 {
  from { transform: translate3d(-6vmax, 4vmax, 0) scale(.95); }
  to { transform: translate3d(8vmax, -6vmax, 0) scale(1.25); }
}
@keyframes flow5 {
  from { transform: translate3d(4vmax, -3vmax, 0) scale(1); }
  to { transform: translate3d(-9vmax, 5vmax, 0) scale(1.2); }
}
@media (prefers-reduced-motion: reduce) {
  .cloud { animation: none !important; }
}

/* —— boot —— */
.boot {
 position: relative;
 z-index: 5;
 height: var(--app-vh, var(--tg-viewport-stable-height, 100%));
 min-height: 100%;
 display: grid;
 place-content: center;
 justify-items: center;
 gap: 20px;
}
.boot-logo {
  width: 72px; height: 72px;
  border-radius: 18px;
  border: 1px solid var(--line);
  object-fit: cover;
  box-shadow: 0 16px 40px rgba(0,0,0,.5);
}
.boot-spin {
  width: 22px; height: 22px;
  border: 2px solid var(--line);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* —— shell —— */
.app {
  position: fixed;
  z-index: 1;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  height: var(--app-vh, 100%);
  max-height: var(--app-vh, 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .45) rgba(255, 255, 255, .06);
  /* Desktop / trackpad: ensure the scrollport can receive wheel */
  touch-action: pan-y;
}
@media (hover: hover) and (pointer: fine) {
  .app-scroll {
    overflow-y: scroll;
  }
  .home-stage {
    min-height: auto;
    padding-bottom: 28px;
  }
}
.app-scroll::-webkit-scrollbar {
  width: 10px;
}
.app-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .04);
}
.app-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .35);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.app-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .55);
  background-clip: padding-box;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-text strong {
  font-family: Onest, Manrope, sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--muted);
}
.badge-ok { color: var(--ok); border-color: rgba(154,230,180,.35); background: rgba(154,230,180,.08); }
.badge-warn { color: var(--warn); border-color: rgba(246,224,94,.3); background: rgba(246,224,94,.08); }
.badge-muted { color: var(--muted); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.lang-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(12px);
}
.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .04em;
  padding: 8px 10px;
  border-radius: 10px;
  min-width: 40px;
}
.lang-btn.active {
  background: #fff;
  color: #050505;
}

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: background .15s ease, border-color .15s ease;
}
.icon-btn:active { background: var(--soft-2); }
.icon-btn svg {
  display: block;
  transform-origin: center;
  transform-box: fill-box;
}
.icon-btn.is-spinning svg {
  animation: refreshSpin .7s linear infinite;
}
@keyframes refreshSpin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .icon-btn.is-spinning svg { animation: none; }
}

/* —— screens —— */
.screens { position: relative; }
.screen { display: none; }
.screen.active { display: block; }
.screen-title {
  font-family: Onest, Manrope, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 4px 0 14px;
}
.screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.screen-head .screen-title { margin-bottom: 0; flex: 1; min-width: 0; }
.screen-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.hero-card {
  padding: 8px 2px 18px;
}
.home-stage {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--top-h) - var(--dock-h) - 28px);
  padding: 12px 2px 8px;
  animation: homeIn .55s var(--ease-out, cubic-bezier(.22,1,.36,1)) both;
}
@keyframes homeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .01em;
}
.hero-title {
  margin: 0 0 12px;
  font-family: Onest, Manrope, sans-serif;
  font-size: clamp(40px, 11vw, 52px);
  font-weight: 800;
  letter-spacing: -.055em;
  line-height: .95;
}
.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
  max-width: 28ch;
}

.home-pulse {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 28px 0 0;
  padding: 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  font-size: 13px;
  color: var(--muted);
  width: fit-content;
  max-width: 100%;
}
.home-pulse strong {
  color: var(--ink);
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: -.01em;
}
.home-pulse-metric b {
  color: var(--ink);
  font-weight: 700;
}
.home-pulse-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  flex-shrink: 0;
}
.home-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(154, 230, 180, 0);
}
.home-pulse.is-running .home-pulse-dot {
  background: var(--ok);
  animation: pulseDot 1.6s ease-out infinite;
}
.home-pulse.is-running strong { color: var(--ok); }
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(154, 230, 180, .45); }
  70% { box-shadow: 0 0 0 8px rgba(154, 230, 180, 0); }
  100% { box-shadow: 0 0 0 0 rgba(154, 230, 180, 0); }
}

.home-cta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 36px;
  max-width: 320px;
}
.btn-home-main {
  min-height: 54px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.02em;
  border-radius: 16px;
}
.btn-home-stop {
  min-height: 44px;
  border-radius: 14px;
  opacity: .85;
}
.btn-home-stop[disabled] {
  opacity: .35;
}

.home-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  padding-top: 4px;
}
.home-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.home-link:hover,
.home-link:active {
  color: var(--ink);
  background: var(--soft);
  border-color: var(--line);
}

.home-stage--paywall {
  min-height: auto;
  padding-bottom: 8px;
}
.home-stage--paywall .home-cta,
.home-stage--paywall .home-links,
.home-stage--paywall .home-pulse {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .home-stage { animation: none; }
  .home-pulse.is-running .home-pulse-dot { animation: none; }
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.stat {
  padding: 12px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--soft);
  text-align: center;
}
.stat-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.stat strong {
  font-family: Onest, Manrope, sans-serif;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
}

.card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.045);
  backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}
.card.stack { display: flex; flex-direction: column; gap: 10px; }
.card-h {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -.01em;
}
.kv {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  font-size: 14px;
}
.kv span { color: var(--muted); }
.kv strong { font-weight: 700; text-align: right; }

.muted { color: var(--muted); }
.small { font-size: 13px; line-height: 1.4; }
.mt { margin-top: 12px; }

/* —— controls —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:disabled { opacity: .45; pointer-events: none; }
.btn:active { transform: scale(.98); }
.btn-sm { padding: 8px 12px; border-radius: 12px; font-size: 13px; }
.btn-primary {
  background: #fff;
  color: #050505;
  box-shadow: 0 12px 36px rgba(255,255,255,.12);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.btn-stop {
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  font-weight: 700;
}
.btn-stop:disabled {
  opacity: .35;
}
.btn-danger {
  background: transparent;
  border: 1px solid rgba(252,129,129,.35);
  color: var(--danger);
}
.action-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.action-row > .btn { flex: 1; }
.action-row.wrap { flex-wrap: wrap; }

.warmup-hint {
  line-height: 1.45;
}
.warmup-hint b { color: var(--text); font-weight: 600; }

  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 4px;
}
.warmup-status .muted { color: var(--muted); }
.warmup-pick-list {
  max-height: 42vh;
  overflow: auto;
}
.warmup-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
  margin-bottom: 8px;
}
.warmup-pick-item .meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.warmup-pick-item .meta strong {
  font-size: 14px;
}
.warmup-pick-item .meta span {
  color: var(--muted);
  font-size: 12px;
}
.twink-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: #9ae6b4;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.quick {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 14px;
  padding: 14px 8px;
  font-weight: 600;
  font-size: 13px;
  transition: background .15s ease, border-color .15s ease;
}
.quick:active { background: var(--soft-2); }

.row-input {
  display: flex;
  gap: 8px;
}
.row-input input { flex: 1; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.35);
  border-radius: 12px;
  padding: 11px 12px;
  outline: none;
  transition: border-color .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(255,255,255,.35);
}
textarea { resize: vertical; min-height: 96px; }
.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.form label > :is(input, select, textarea) { color: var(--ink); font-weight: 500; }
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.toggle-row {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 2px;
}
.toggle-row input {
  width: 42px;
  height: 24px;
  accent-color: #fff;
}

/* —— lists —— */
.list { display: flex; flex-direction: column; gap: 8px; }
.list.compact { gap: 6px; }
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--soft);
}
.list-item .meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list-item .meta strong {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item .meta span {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item .actions { display: flex; gap: 6px; flex-shrink: 0; align-items: center; }
.list-item .actions select,
select.select-sm {
  max-width: 140px;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
}
.list-item.twink-row {
  flex-wrap: wrap;
  align-items: flex-start;
}
.list-item .twink-proxy-actions {
  flex: 1 1 100%;
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 6px;
  margin-top: 4px;
}
.list-item .twink-proxy-actions select.select-sm {
  max-width: none;
  width: 100%;
  min-width: 0;
}

/* —— paywall / plans —— */
.paywall {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.paywall h3 {
  margin: 0 0 8px;
  font-family: Onest, Manrope, sans-serif;
  font-size: 18px;
  font-weight: 800;
}
.paywall p { margin: 0 0 12px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.plans { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.plan {
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.plan-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.plan-top strong {
  font-family: Onest, Manrope, sans-serif;
  font-size: 18px;
  font-weight: 800;
}
.plan-top span { color: var(--muted); font-size: 13px; }
.plan-actions { display: flex; gap: 8px; }
.plan-actions .btn { flex: 1; font-size: 13px; padding: 10px 12px; }

/* —— wizard sheet —— */
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0 auto;
  width: min(560px, 100%);
  max-height: min(88vh, 720px);
  z-index: 40;
  background: rgba(8,8,8,.9);
  backdrop-filter: blur(22px) saturate(1.15);
  border: 1px solid rgba(255,255,255,.14);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,.55);
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  animation: sheetUp .25s ease;
  overflow: hidden;
}
@keyframes sheetUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--line);
}
.sheet-head h3 {
  margin: 0;
  font-family: Onest, Manrope, sans-serif;
  font-size: 18px;
  font-weight: 800;
}
.sheet-body {
  padding: 14px 16px 20px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.method-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.method-btn {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--soft);
  border-radius: 14px;
  padding: 14px;
}
.method-btn strong { display: block; margin-bottom: 4px; }
.method-btn span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.qr-box {
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.qr-box img {
  width: min(240px, 70vw);
  height: auto;
  display: block;
}
.steps-hint {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}
.file-pick {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 18px 14px;
  text-align: center;
  background: var(--soft);
  cursor: pointer;
}
.file-pick input { display: none; }
.file-pick strong { display: block; margin-bottom: 4px; }
.file-pick span { color: var(--muted); font-size: 12px; }

/* —— dock —— */
.dock {
  position: relative;
  flex: 0 0 auto;
  z-index: 30;
  left: auto;
  bottom: auto;
  transform: none;
  width: 100%;
  display: flex;
  gap: 4px;
  padding: 10px 8px calc(12px + env(safe-area-inset-bottom, 0px));
  background: rgba(5,5,5,.92);
  backdrop-filter: blur(22px) saturate(1.2);
  border-top: 1px solid rgba(255,255,255,.14);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .4) rgba(255, 255, 255, .06);
  touch-action: pan-x;
}
.dock::-webkit-scrollbar {
  height: 6px;
}
.dock::-webkit-scrollbar-track {
  background: rgba(255,255,255,.04);
}
.dock::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.35);
  border-radius: 8px;
}
.dock-item {
  flex: 1 0 auto;
  min-width: 68px;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 14px;
  padding: 12px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -.01em;
  transition: color .15s ease, background .15s ease, transform .15s ease;
}
.dock-item.active {
  color: #050505;
  background: #fff;
  box-shadow: 0 8px 24px rgba(255,255,255,.12);
}
.dock-item span { display: block; white-space: nowrap; }

/* —— toast —— */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + 12px);
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  color: #050505;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 16px 40px rgba(0,0,0,.4);
  animation: toastIn .2s ease;
}
.toast.err {
  background: #2a1212;
  color: #fecaca;
  border: 1px solid rgba(252,129,129,.35);
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 380px) {
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-row { gap: 6px; }
  .stat strong { font-size: 14px; }
}


/* —— purchase / plans upgrade —— */
.paywall-hero { display: grid; gap: 10px; }
.paywall-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-kicker {
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}
.pay-status-wrap { margin-bottom: 14px; }
.pay-status-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  border-radius: 18px;
  padding: 16px;
}
.pay-status-card.locked {
  background:
    linear-gradient(160deg, rgba(255,255,255,.08), rgba(255,255,255,.02));
}
.pay-status-title {
  margin-top: 4px;
  font-family: Onest, Manrope, sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.pay-status-meta { margin-top: 8px; color: var(--muted); font-size: 13px; }
.plan-card {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  border-radius: 20px;
  padding: 16px;
  display: grid;
  gap: 14px;
  margin-bottom: 0;
}
.plan-card.featured {
  border-color: rgba(255,255,255,.28);
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  background:
    linear-gradient(165deg, rgba(255,255,255,.09), rgba(255,255,255,.02));
}
.plan-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.plan-name {
  font-family: Onest, Manrope, sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -.03em;
}
.plan-days { margin-top: 4px; color: var(--muted); font-size: 13px; }
.plan-price { text-align: right; }
.plan-stars { font-weight: 750; font-size: 15px; }
.plan-usdt { margin-top: 4px; color: var(--muted); font-size: 13px; }
.plan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 420px) {
  .plan-actions { grid-template-columns: 1fr; }
}

/* ---- pay polish v7 ---- */
.plans { display: grid; gap: 12px; }
.plan-card {
  position: relative;
  overflow: hidden;
  transition: border-color .2s ease, transform .2s ease;
}
.plan-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  opacity: .55;
}
.market-cats {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
}
.market-cat {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .02em;
  padding: 10px 6px;
  border-radius: 10px;
}
.market-cat.active {
  background: #fff;
  color: #050505;
}
.market-empty {
  text-align: center;
  padding: 28px 14px;
}
.paywall {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 22px;
  padding: 20px 18px;
  background:
    linear-gradient(165deg, rgba(255,255,255,.1), rgba(255,255,255,.02));
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.paywall-hero h3 {
  font-family: Onest, Manrope, sans-serif;
  font-size: 28px;
  letter-spacing: -.04em;
  margin: 0;
}
.list-item .btn-danger.btn-sm {
  min-width: 72px;
  border-radius: 999px;
  font-size: 12px;
  padding: 6px 12px;
}

.promos-list { display: grid; gap: 12px; }
.promo-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05);
}
.promo-title {
  margin: 0 0 10px;
  font-size: 18px;
  font-weight: 700;
}
.promo-body { display: grid; gap: 8px; }
.promo-body p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; white-space: pre-wrap; }
.promo-status { margin: 14px 0 0; font-size: 13px; }
.promo-link-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.promo-link-input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  padding: 10px 12px;
}

/* ---- glass / busy v9 ---- */
.glass-card,
.card.glass-card {
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(18px) saturate(1.15);
  border-color: rgba(255,255,255,.16);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
}
.quick.glass {
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(14px);
  border-color: rgba(255,255,255,.16);
  padding: 16px 10px;
  font-size: 14px;
}
.settings-top {
  margin-bottom: 14px;
  grid-template-columns: 1fr 1fr;
}
.sheet {
  background: rgba(8,8,8,.88);
  backdrop-filter: blur(22px);
}
.wiz-busy {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5,5,5,.55);
  backdrop-filter: blur(8px);
  border-radius: inherit;
}
.wiz-busy.hidden { display: none !important; }
.wiz-busy-card {
  width: min(280px, 100%);
  text-align: center;
  padding: 22px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(20,20,20,.9);
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}
.wiz-busy-card .boot-spin {
  margin: 0 auto 14px;
}
.wiz-busy-card p {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}
.wiz-busy-card .btn {
  width: 100%;
}
.hero-card,
.pay-status-card,
.plan-card,
.paywall {
  backdrop-filter: blur(16px);
}
.stat {
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(12px);
}


/* ---- guide / instructions ---- */
.guide-intro { margin: -4px 0 14px; line-height: 1.45; }
.guide-list { display: grid; gap: 10px; }
.guide-item {
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(14px);
  overflow: hidden;
  transition:
    border-color .25s ease,
    background .25s ease,
    box-shadow .25s ease,
    transform .2s var(--ease-out, ease);
}
.guide-item.is-open {
  border-color: rgba(255,255,255,.22);
  background: rgba(255,255,255,.07);
  box-shadow: 0 12px 32px rgba(0,0,0,.22);
}
.guide-summary {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -.01em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border-radius: 16px;
  transition: background .2s ease;
}
.guide-summary:hover { background: rgba(255,255,255,.04); }
.guide-summary:active { background: rgba(255,255,255,.06); }
.guide-summary-text {
  flex: 1;
  min-width: 0;
}
.guide-chevron {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.05);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition:
    transform .35s cubic-bezier(.22, 1, .36, 1),
    background .2s ease,
    border-color .2s ease,
    color .2s ease;
}
.guide-chevron svg {
  width: 14px;
  height: 14px;
  display: block;
  transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}
.guide-item.is-open .guide-chevron {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.28);
  color: #fff;
  transform: rotate(180deg);
}
.guide-collapse {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .4s cubic-bezier(.22, 1, .36, 1);
}
.guide-item.is-open .guide-collapse {
  grid-template-rows: 1fr;
}
.guide-collapse-inner {
  overflow: hidden;
  min-height: 0;
}
.guide-body {
  padding: 0 16px 14px;
  display: grid;
  gap: 8px;
  border-top: 1px solid transparent;
  margin-top: 0;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity .28s ease .04s,
    transform .36s cubic-bezier(.22, 1, .36, 1),
    border-color .25s ease,
    padding-top .25s ease;
}
.guide-item.is-open .guide-body {
  opacity: 1;
  transform: none;
  border-top-color: rgba(255,255,255,.08);
  padding-top: 12px;
}
.guide-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.guide-item.is-open .guide-body p {
  animation: guideLine .34s cubic-bezier(.22, 1, .36, 1) both;
}
.guide-item.is-open .guide-body p:nth-child(1) { animation-delay: .06s; }
.guide-item.is-open .guide-body p:nth-child(2) { animation-delay: .11s; }
.guide-item.is-open .guide-body p:nth-child(3) { animation-delay: .16s; }
.guide-item.is-open .guide-body p:nth-child(4) { animation-delay: .21s; }
.guide-item.is-open .guide-body p:nth-child(n+5) { animation-delay: .26s; }
@keyframes guideLine {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .guide-collapse,
  .guide-body,
  .guide-chevron,
  .guide-chevron svg {
    transition: none !important;
  }
  .guide-item.is-open .guide-body p {
    animation: none !important;
  }
}


/* English: larger bottom dock */
html.lang-en,
html[lang="en"] {
  --dock-h: calc(92px + env(safe-area-inset-bottom, 0px));
}
html.lang-en .dock,
html[lang="en"] .dock {
  gap: 6px;
  padding: 12px 10px calc(14px + env(safe-area-inset-bottom, 0px));
}
html.lang-en .dock-item,
html[lang="en"] .dock-item {
  min-width: 82px;
  padding: 16px 12px;
  font-size: 13.5px;
  border-radius: 16px;
}
html.lang-en .quick,
html[lang="en"] .quick {
  padding: 16px 10px;
  font-size: 14px;
}


.field-hint {
  display: block;
  margin: 4px 0 8px;
  line-height: 1.4;
  font-weight: 500;
}
.field-hint code {
  font-size: 12px;
  color: var(--ink);
  background: rgba(255,255,255,.08);
  padding: 1px 5px;
  border-radius: 6px;
}

/* —— motion system —— */
:root {
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --motion-fast: .18s;
  --motion-med: .28s;
  --motion-slow: .45s;
}

.boot-logo {
  animation: bootPulse 1.6s var(--ease-out) infinite;
}
@keyframes bootPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 16px 40px rgba(0,0,0,.5); }
  50% { transform: scale(1.04); box-shadow: 0 20px 48px rgba(255,255,255,.12); }
}
.boot.boot-out {
  animation: bootFadeOut .28s var(--ease-out) forwards;
  pointer-events: none;
}
@keyframes bootFadeOut {
  to { opacity: 0; transform: scale(.96); }
}
.app.app-enter {
  animation: appReveal .42s var(--ease-out) both;
}
@keyframes appReveal {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.screen {
  display: none;
  animation: none;
}
.screen.active {
  display: block;
}
.screen.active.screen-enter {
  animation: screenIn var(--motion-med) var(--ease-out) both;
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.screen.active.screen-enter > *:nth-child(1) { animation: riseIn .38s var(--ease-out) both; animation-delay: .02s; }
.screen.active.screen-enter > *:nth-child(2) { animation: riseIn .38s var(--ease-out) both; animation-delay: .06s; }
.screen.active.screen-enter > *:nth-child(3) { animation: riseIn .38s var(--ease-out) both; animation-delay: .1s; }
.screen.active.screen-enter > *:nth-child(4) { animation: riseIn .38s var(--ease-out) both; animation-delay: .14s; }
.screen.active.screen-enter > *:nth-child(5) { animation: riseIn .38s var(--ease-out) both; animation-delay: .18s; }
.screen.active.screen-enter > *:nth-child(6) { animation: riseIn .38s var(--ease-out) both; animation-delay: .22s; }
.screen.active.screen-enter > *:nth-child(n+7) { animation: riseIn .38s var(--ease-out) both; animation-delay: .26s; }
/* Sheets/modals must not inherit riseIn — it zeroes transform and breaks centering. */
.screen.active.screen-enter > .sheet {
  animation: none !important;
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.btn {
  transition:
    transform var(--motion-fast) var(--ease-out),
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    opacity var(--motion-fast) ease,
    box-shadow var(--motion-fast) ease;
}
.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 14px 40px rgba(255,255,255,.18);
}
.btn:active:not(:disabled) {
  transform: scale(.97);
}

.icon-btn {
  transition:
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-out);
}
.icon-btn:hover { background: var(--soft-2); transform: translateY(-1px); }
.icon-btn:active { transform: scale(.94); }

.lang-btn {
  transition: background var(--motion-fast) ease, color var(--motion-fast) ease, transform var(--motion-fast) var(--ease-spring);
}
.lang-btn.active {
  animation: chipPop .28s var(--ease-spring);
}
@keyframes chipPop {
  from { transform: scale(.92); }
  to { transform: scale(1); }
}

.quick {
  transition:
    background var(--motion-fast) ease,
    border-color var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-out),
    box-shadow var(--motion-fast) ease;
}
.quick:hover {
  background: var(--soft-2);
  border-color: rgba(255,255,255,.22);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}
.quick:active { transform: scale(.97); }

.stat:hover,
.card:hover,
.pay-status-card:hover,
.plan-card:hover,
.list-item:hover,
.method-btn:hover,
.file-pick:hover,
.guide-item:hover {
  border-color: rgba(255,255,255,.22);
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0,0,0,.28);
}
.method-btn:active,
.file-pick:active {
  transform: scale(.98);
}

.list-item,
.guide-item,
.plan-card,
.method-btn {
  animation: listPop .34s var(--ease-out) both;
}
.list > .list-item:nth-child(1),
.guide-list > .guide-item:nth-child(1),
.plans > .plan-card:nth-child(1),
.method-grid > .method-btn:nth-child(1) { animation-delay: .02s; }
.list > .list-item:nth-child(2),
.guide-list > .guide-item:nth-child(2),
.plans > .plan-card:nth-child(2),
.method-grid > .method-btn:nth-child(2) { animation-delay: .06s; }
.list > .list-item:nth-child(3),
.guide-list > .guide-item:nth-child(3),
.plans > .plan-card:nth-child(3),
.method-grid > .method-btn:nth-child(3) { animation-delay: .1s; }
.list > .list-item:nth-child(4),
.guide-list > .guide-item:nth-child(4),
.plans > .plan-card:nth-child(4),
.method-grid > .method-btn:nth-child(4) { animation-delay: .14s; }
.list > .list-item:nth-child(5),
.guide-list > .guide-item:nth-child(5),
.plans > .plan-card:nth-child(5) { animation-delay: .18s; }
.list > .list-item:nth-child(6),
.guide-list > .guide-item:nth-child(6),
.plans > .plan-card:nth-child(6) { animation-delay: .22s; }
.list > .list-item:nth-child(n+7),
.guide-list > .guide-item:nth-child(n+7),
.plans > .plan-card:nth-child(n+7) { animation-delay: .26s; }
@keyframes listPop {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.quick-grid > .quick:nth-child(1) { animation: listPop .34s var(--ease-out) both .02s; }
.quick-grid > .quick:nth-child(2) { animation: listPop .34s var(--ease-out) both .05s; }
.quick-grid > .quick:nth-child(3) { animation: listPop .34s var(--ease-out) both .08s; }
.quick-grid > .quick:nth-child(4) { animation: listPop .34s var(--ease-out) both .11s; }
.quick-grid > .quick:nth-child(5) { animation: listPop .34s var(--ease-out) both .14s; }
.quick-grid > .quick:nth-child(6) { animation: listPop .34s var(--ease-out) both .17s; }
.quick-grid > .quick:nth-child(7) { animation: listPop .34s var(--ease-out) both .2s; }
.quick-grid > .quick:nth-child(n+8) { animation: listPop .34s var(--ease-out) both .23s; }

.stats-row > .stat:nth-child(1) { animation: listPop .34s var(--ease-out) both .04s; }
.stats-row > .stat:nth-child(2) { animation: listPop .34s var(--ease-out) both .1s; }
.stats-row > .stat:nth-child(3) { animation: listPop .34s var(--ease-out) both .16s; }

.badge {
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s var(--ease-spring);
}
.badge-ok, .badge-warn { animation: chipPop .32s var(--ease-spring); }

.dock-item {
  transition:
    color var(--motion-fast) ease,
    background var(--motion-fast) ease,
    transform var(--motion-fast) var(--ease-spring),
    box-shadow var(--motion-fast) ease;
}
.dock-item:hover:not(.active) {
  color: var(--ink);
  background: rgba(255,255,255,.08);
}
.dock-item:active { transform: scale(.96); }
.dock-item.active {
  animation: dockActive .32s var(--ease-spring);
}
@keyframes dockActive {
  0% { transform: scale(.94); }
  70% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

.sheet {
  animation: sheetUp .3s var(--ease-out);
}
.sheet.sheet-out {
  animation: sheetDown .22s var(--ease-out) forwards;
}
@keyframes sheetDown {
  from { transform: translateY(0); opacity: 1; }
  to { transform: translateY(28px); opacity: 0; }
}
.sheet-body.wiz-step-enter {
  animation: wizStep .28s var(--ease-out) both;
}
@keyframes wizStep {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: none; }
}
.wiz-busy {
  animation: fadeSoft .2s ease both;
}
@keyframes fadeSoft {
  from { opacity: 0; }
  to { opacity: 1; }
}

.toast {
  animation: toastIn .24s var(--ease-out);
}
.toast.toast-out {
  animation: toastOut .2s ease forwards;
}
@keyframes toastOut {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, 10px); }
}

input, select, textarea {
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(255,255,255,.08);
}

.brand-logo {
  transition: transform .25s var(--ease-spring);
}
.brand:hover .brand-logo {
  transform: scale(1.06) rotate(-3deg);
}

.hero-title {
  animation: riseIn .5s var(--ease-out) both .05s;
}
.hero-sub {
  animation: riseIn .5s var(--ease-out) both .12s;
}
.eyebrow {
  animation: riseIn .45s var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  .boot-logo,
  .boot.boot-out,
  .app.app-enter,
  .screen.active.screen-enter,
  .screen.active.screen-enter > *,
  .list-item,
  .guide-item,
  .plan-card,
  .method-btn,
  .quick-grid > .quick,
  .stats-row > .stat,
  .dock-item.active,
  .lang-btn.active,
  .badge-ok,
  .badge-warn,
  .sheet,
  .sheet.sheet-out,
  .sheet-body.wiz-step-enter,
  .toast,
  .toast.toast-out,
  .guide-body,
  .hero-title,
  .hero-sub,
  .eyebrow,
  .wiz-busy {
    animation: none !important;
  }
  .btn:hover:not(:disabled),
  .quick:hover,
  .stat:hover,
  .card:hover,
  .list-item:hover,
  .plan-card:hover,
  .method-btn:hover,
  .dock-item:active,
  .brand:hover .brand-logo {
    transform: none !important;
  }
}

.profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 14px;
}
.profile-avatar-box {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--card);
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.profile-avatar-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-avatar-placeholder {
  font-size: 28px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.profile-avatar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.profile-avatar-actions .btn {
  text-align: center;
  justify-content: center;
}
