:root {
  --font-system: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: var(--font-system);
  --font-display: var(--font-system);
  --bg: #dce3ec;
  --bg-soft: #e8edf3;
  --bg-card: rgba(255, 255, 255, 0.72);
  --bg-elevated: rgba(255, 255, 255, 0.88);
  --text: #252a32;
  --text-soft: #454c57;
  --muted: #7a8491;
  --accent: #3d4654;
  --accent-hover: #323a46;
  --accent-light: rgba(61, 70, 84, 0.1);
  --border: rgba(37, 42, 50, 0.1);
  --border-strong: rgba(37, 42, 50, 0.16);
  --shadow-sm: 0 2px 10px rgba(37, 42, 50, 0.06);
  --shadow-md: 0 8px 24px rgba(37, 42, 50, 0.09);
  --success: #4f9d6e;
  --danger: #d45c5c;
  --radius: 18px;
  --radius-sm: 14px;
}

html.fonts-ready {
  --font-body: "Montserrat", var(--font-system);
  --font-display: "Unbounded", "Montserrat", var(--font-system);
}

* {
  box-sizing: border-box;
}

html {
  background-color: var(--bg);
}

html,
body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  touch-action: manipulation;
  -ms-touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html::-webkit-scrollbar-button,
body::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

h1,
h2,
.connect-title {
  font-family: var(--font-display);
  font-weight: 600;
}

body {
  position: relative;
  background-color: var(--bg);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    radial-gradient(ellipse 130% 90% at 50% -25%, #f5f7fb 0%, transparent 58%),
    radial-gradient(ellipse 70% 55% at -5% 35%, rgba(176, 192, 214, 0.55), transparent 62%),
    radial-gradient(ellipse 65% 50% at 105% 75%, rgba(168, 186, 210, 0.5), transparent 60%),
    linear-gradient(168deg, #e9eef4 0%, #dce3ec 42%, #e2e8f0 100%),
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.65) 0%, transparent 40%),
    radial-gradient(circle at 82% 22%, rgba(255, 255, 255, 0.4) 0%, transparent 36%),
    radial-gradient(circle at 62% 92%, rgba(194, 206, 222, 0.45) 0%, transparent 44%);
}

body::after {
  opacity: 0.28;
  background-image: radial-gradient(rgba(37, 42, 50, 0.08) 0.55px, transparent 0.55px);
  background-size: 20px 20px;
}

.cloud-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cloud-float {
  position: absolute;
  left: var(--x, auto);
  right: var(--r, auto);
  top: var(--y, 0);
  width: var(--w, 140px);
  height: calc(var(--w) * 0.5);
  opacity: var(--o, 0.8);
  pointer-events: none;
}

.cloud-float::before,
.cloud-float::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.cloud-float::before {
  inset: -10% -6%;
  filter: blur(6px);
}

.cloud-float::after {
  left: 10%;
  right: 10%;
  bottom: -4%;
  height: 40%;
  filter: blur(12px);
  background: radial-gradient(ellipse at 50% 100%, rgba(150, 168, 190, 0.22) 0%, transparent 70%);
}

.cloud-float--puff::before {
  background:
    radial-gradient(ellipse 48% 95% at 16% 58%, rgba(255, 255, 255, 0.96) 0%, transparent 70%),
    radial-gradient(ellipse 52% 105% at 38% 44%, rgba(255, 255, 255, 0.98) 0%, transparent 68%),
    radial-gradient(ellipse 46% 90% at 58% 52%, rgba(255, 255, 255, 0.94) 0%, transparent 66%),
    radial-gradient(ellipse 42% 82% at 78% 56%, rgba(252, 254, 255, 0.88) 0%, transparent 64%);
}

.cloud-float--wide {
  height: calc(var(--w) * 0.42);
}

.cloud-float--wide::before {
  background:
    radial-gradient(ellipse 38% 88% at 10% 62%, rgba(255, 255, 255, 0.92) 0%, transparent 68%),
    radial-gradient(ellipse 44% 100% at 30% 48%, rgba(255, 255, 255, 0.97) 0%, transparent 66%),
    radial-gradient(ellipse 40% 92% at 52% 54%, rgba(255, 255, 255, 0.95) 0%, transparent 65%),
    radial-gradient(ellipse 36% 85% at 72% 50%, rgba(255, 255, 255, 0.9) 0%, transparent 63%),
    radial-gradient(ellipse 34% 78% at 90% 58%, rgba(248, 251, 255, 0.82) 0%, transparent 60%);
}

.cloud-float--tall {
  height: calc(var(--w) * 0.62);
}

.cloud-float--tall::before {
  filter: blur(7px);
  background:
    radial-gradient(ellipse 55% 70% at 28% 68%, rgba(255, 255, 255, 0.94) 0%, transparent 68%),
    radial-gradient(ellipse 60% 85% at 50% 42%, rgba(255, 255, 255, 0.98) 0%, transparent 66%),
    radial-gradient(ellipse 48% 72% at 72% 58%, rgba(255, 255, 255, 0.9) 0%, transparent 64%),
    radial-gradient(ellipse 40% 55% at 42% 78%, rgba(240, 246, 252, 0.75) 0%, transparent 62%);
}

.cloud-float--bank {
  height: calc(var(--w) * 0.22);
}

.cloud-float--bank::before {
  inset: -20% -4%;
  filter: blur(8px);
  background:
    radial-gradient(ellipse 30% 120% at 8% 70%, rgba(255, 255, 255, 0.88) 0%, transparent 70%),
    radial-gradient(ellipse 28% 130% at 25% 55%, rgba(255, 255, 255, 0.94) 0%, transparent 68%),
    radial-gradient(ellipse 26% 125% at 42% 62%, rgba(255, 255, 255, 0.92) 0%, transparent 66%),
    radial-gradient(ellipse 28% 120% at 58% 52%, rgba(255, 255, 255, 0.9) 0%, transparent 65%),
    radial-gradient(ellipse 30% 115% at 75% 58%, rgba(255, 255, 255, 0.86) 0%, transparent 63%),
    radial-gradient(ellipse 32% 110% at 92% 65%, rgba(248, 251, 255, 0.8) 0%, transparent 60%);
}

.cloud-float--bank::after {
  opacity: 0.65;
}

.app {
  position: relative;
  z-index: 1;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  --app-header-gap: 6px;
  padding: calc(env(safe-area-inset-top, 0px) + var(--app-header-gap)) 16px max(10px, env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
}

.app-title {
  margin: 0 0 var(--app-header-gap);
  text-align: center;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: clamp(1.9rem, 7.5vw, 2.3rem);
  letter-spacing: -0.02em;
  color: var(--text);
}

.subscription-status-banner {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  animation: subscription-status-pulse 1.8s ease-in-out infinite;
}

.subscription-status-banner--active {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.45);
  color: #14532d;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.35);
}

.subscription-status-banner--trial {
  background: rgba(250, 204, 21, 0.28);
  border-color: rgba(234, 179, 8, 0.5);
  color: #713f12;
  box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.4);
}

.subscription-status-banner--inactive {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
  color: #7f1d1d;
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35);
}

.dev-mode-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 0.72rem;
  line-height: 1.45;
  color: #334155;
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed rgba(100, 116, 139, 0.45);
}

.dev-mode-banner strong {
  font-weight: 700;
}

.dev-mode-banner a {
  color: #1d4ed8;
  text-decoration: none;
  font-weight: 600;
}

.dev-mode-banner a:hover {
  text-decoration: underline;
}

.dev-mode-banner-btn {
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: inherit;
  color: #334155;
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

.dev-mode-banner-btn.is-active {
  border-color: rgba(29, 78, 216, 0.55);
  color: #1d4ed8;
  background: rgba(219, 234, 254, 0.85);
}

.dev-mode-banner-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
}

.dev-mode-banner-subtitle {
  margin: 10px 0 0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.dev-mode-banner-links--vip {
  margin-top: 4px;
}

.dev-mode-banner-links--vip .dev-mode-banner-btn {
  min-width: 28px;
  text-align: center;
}

@keyframes subscription-status-pulse {
  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0);
  }
  50% {
    opacity: 0.72;
    filter: brightness(1.08);
    box-shadow: 0 0 14px 2px currentColor;
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(10px);
}

.user-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.user-field-card {
  padding: 14px 16px;
  margin-bottom: 0;
  min-width: 0;
}

.user-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
}

@media (max-width: 360px) {
  .user-field-label {
    white-space: normal;
    font-size: 0.65rem;
  }
}

.user-field-value {
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

#userName {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  max-width: 100%;
}

.vpn-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.vpn-connect-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-radius: 12px;
  background: var(--accent);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.22s ease;
}

.vpn-connect-row:active {
  transform: scale(0.985);
  background: var(--accent-hover);
}

.vpn-connect-main {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  border: none;
  background: transparent;
  color: #f3f5f8;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  /* компенсация колонки QR → текст по центру всей кнопки */
  padding: 15px 0 15px 54px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.vpn-qr-btn {
  flex: 0 0 54px;
  width: 54px;
  margin: 0;
  padding: 8px 8px 8px 0;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.vpn-qr-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(243, 245, 248, 0.96);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.vpn-qr-icon {
  width: 22px;
  height: 22px;
  display: block;
  opacity: 0.92;
}

.vpn-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vpn-actions-row--single {
  grid-template-columns: 1fr;
}

.vpn-actions-row .btn-outline {
  width: 100%;
  padding: 14px 12px;
}

/* --- Подключение VPN / Покупка --- */
.main-wizard {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.main-wizard > .checkout-card,
.main-wizard > .devices-card {
  display: none;
}

.main-wizard.mode-checkout > .connect-card,
.main-wizard.mode-checkout > .devices-card {
  display: none;
}

.main-wizard.mode-checkout > .checkout-card {
  display: block;
}

/* Экран оплаты: только заголовок «Белый Аист» и блок checkout */
.app.checkout-pay-focus .subscription-status-banner,
.app.checkout-pay-focus .user-fields,
.app.checkout-pay-focus .vpn-actions {
  display: none !important;
}

.app.checkout-pay-focus {
  display: flex;
  flex-direction: column;
  min-height: var(--tg-viewport-stable-height, 100dvh);
  min-height: var(--tg-viewport-height, 100dvh);
}

.app.checkout-pay-focus #main {
  flex: 1 1 auto;
  min-height: 0;
}

.app.checkout-pay-focus .app-support {
  margin-top: 6px;
  padding-top: 0;
}

.app.checkout-pay-focus .footer {
  margin-top: auto;
  padding-top: 8px;
  margin-bottom: 0;
}

.app.checkout-pay-focus .app-title {
  margin-bottom: 12px;
}

.app.checkout-pay-focus .main-wizard.mode-checkout > .checkout-card {
  margin-top: 0;
}

.main-wizard.mode-devices > .connect-card,
.main-wizard.mode-devices > .checkout-card {
  display: none;
}

.main-wizard.mode-devices > .devices-card {
  display: block;
}

.main-wizard > .connect-card,
.main-wizard > .checkout-card,
.main-wizard > .devices-card {
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.connect-card,
.checkout-card,
.devices-card {
  scroll-margin-top: 14px;
}

.wizard-steps {
  position: relative;
}

.wizard-steps > .wizard-step.wizard-step--hidden {
  display: none;
}

.checkout-intro {
  margin: 0 0 14px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-soft);
}

.checkout-section-title {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--text);
}

.checkout-quote {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 3px solid rgba(61, 70, 84, 0.14);
  background: rgba(255, 255, 255, 0.42);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.checkout-quote-row {
  display: flex;
  gap: 8px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.checkout-quote-row + .checkout-quote-row {
  margin-top: 6px;
}

.checkout-quote-label,
.checkout-summary-label,
.checkout-pay-label {
  font-weight: 650;
  color: var(--text-soft);
}

.checkout-quote-value,
.checkout-summary-value {
  color: var(--text);
  font-weight: 600;
}

.checkout-quote-value--strong {
  font-size: 0.95rem;
  font-weight: 700;
}

.checkout-vip-line {
  font-size: 0.84rem;
  line-height: 1.45;
  font-weight: 600;
  color: var(--text);
}

.checkout-vip-line + .checkout-vip-line {
  margin-top: 4px;
}

.checkout-vip-empty {
  color: var(--muted);
  font-weight: 500;
}

.checkout-renew-arrow {
  text-align: center;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  margin: 2px 0 10px;
}

.checkout-summary {
  margin-bottom: 16px;
}

.checkout-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  margin-bottom: 6px;
}

.checkout-summary-row--pay .checkout-summary-value {
  font-weight: 700;
}

.checkout-summary-old {
  text-decoration: line-through;
  color: var(--muted);
  margin-right: 6px;
  font-weight: 500;
}

.checkout-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-control-label {
  margin: 0 0 8px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.checkout-stepper {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
}

.checkout-stepper-btn {
  height: 42px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-soft);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.checkout-stepper-btn:active {
  transform: scale(0.98);
}

.checkout-stepper-value {
  text-align: center;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
}

.checkout-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.checkout-preset-btn {
  padding: 10px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.checkout-preset-btn.is-active {
  border-color: rgba(61, 70, 84, 0.28);
  background: rgba(61, 70, 84, 0.08);
  color: var(--text);
}

.checkout-promo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkout-promo-label {
  font-size: 0.84rem;
  font-weight: 650;
  color: var(--text-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.checkout-promo-field {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 140px;
  max-width: 48%;
  height: 38px;
  margin-left: auto;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0 8px 0 10px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.checkout-promo-value {
  flex: 1;
  min-width: 0;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkout-promo-edit {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--muted);
  opacity: 0.72;
}

.checkout-promo-edit svg {
  width: 14px;
  height: 14px;
}

.checkout-promo-field.has-code .checkout-promo-value {
  color: var(--text);
  letter-spacing: 0.04em;
}

.checkout-promo-field:active {
  transform: scale(0.98);
}

.promo-sheet {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top, 0px)) 16px
    calc(env(safe-area-inset-bottom, 0px) + clamp(56px, 11vh, 96px));
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    visibility 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.promo-sheet.hidden {
  display: flex !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.promo-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  background: rgba(20, 28, 38, 0.38);
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.promo-sheet.hidden .promo-sheet-backdrop {
  opacity: 0;
}

.promo-sheet-card {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  margin: 0;
  padding: 20px 18px 18px;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition:
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.promo-sheet.hidden .promo-sheet-card {
  opacity: 0;
  transform: translateY(14px) scale(0.985);
}

.promo-sheet-card.is-success {
  padding: 28px 18px 24px;
}

.promo-sheet-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 6px;
  text-align: center;
}

.promo-sheet-success-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(79, 157, 110, 0.14);
  color: var(--success);
  display: grid;
  place-items: center;
  animation: promo-success-pop 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.promo-sheet-success-icon svg {
  width: 28px;
  height: 28px;
}

.promo-sheet-success-text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--success);
}

@keyframes promo-success-pop {
  0% {
    transform: scale(0.55);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.promo-sheet-title {
  margin: 0 0 14px;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}


.promo-sheet-field-hint {
  margin: 0 0 12px;
  min-height: 1.1em;
  text-align: center;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--text-soft);
  letter-spacing: -0.01em;
}

.promo-sheet-field-hint:not(.hidden) {
  display: block;
}

.promo-sheet-input {
  display: block;
  width: 100%;
  height: 46px;
  margin: 0 0 6px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
  -webkit-user-select: text;
  user-select: text;
}

.promo-sheet-input::placeholder {
  color: var(--muted);
  font-weight: 500;
  letter-spacing: normal;
  text-transform: none;
}

.promo-sheet-input:focus {
  outline: none;
  border-color: var(--accent);
}

#deviceRenameInput.promo-sheet-input {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
}

.device-rename-hint {
  margin: 0 0 14px;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
}

.promo-sheet-card .btn-block + .btn-block {
  margin-top: 8px;
}

body.promo-sheet-open {
  overflow: hidden;
}

.checkout-pay-summary {
  margin-top: 18px;
}

.checkout-pay-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.checkout-pay-summary-row + .checkout-pay-summary-row {
  margin-top: 6px;
}

.checkout-pay-summary-row--total {
  font-size: 0.95rem;
}

.checkout-pay-summary-row--total .checkout-pay-label,
.checkout-pay-summary-row--total .checkout-pay-value {
  font-weight: 700;
  color: var(--text);
}

.checkout-pay-value {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

.checkout-card .btn-block + .btn-block {
  margin-top: 0;
}

.checkout-controls #btnCheckoutBack {
  margin-top: 4px;
  padding-top: 2px;
  padding-bottom: 0;
}

.checkout-pay-summary--compact {
  margin-top: 14px;
  margin-bottom: 0;
}

.checkout-pay-step-summary {
  margin-bottom: 4px;
}

.checkout-pay-methods-title {
  margin-top: 18px;
  margin-bottom: 12px;
}

.checkout-pay-methods {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.checkout-pay-method-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.checkout-pay-method-btn__label {
  flex: 1;
  min-width: 0;
}

.checkout-pay-method-btn__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  overflow: hidden;
}

.checkout-pay-method-btn__icon img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  display: block;
}

.checkout-pay-method-btn--sbp .checkout-pay-method-btn__icon img {
  width: 26px;
  height: 30px;
}

.checkout-pay-method-btn--crypto .checkout-pay-method-btn__icon img {
  width: 26px;
  height: 30px;
}

.checkout-pay-method-btn--cbot .checkout-pay-method-btn__icon {
  background: transparent;
}

.checkout-pay-method-btn--cbot .checkout-pay-method-btn__icon img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
}

.cbot-bot-only-text {
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--muted);
  text-align: center;
}

body.cbot-bot-only-sheet-open {
  overflow: hidden;
}

.checkout-pay-method-btn:active {
  transform: scale(0.99);
  opacity: 0.92;
}

.checkout-pay-empty {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0 0 12px;
}

.checkout-invoice-warnings {
  margin: 10px 0 14px;
  padding-left: 18px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: var(--muted);
}

.checkout-invoice-warnings li + li {
  margin-top: 4px;
}

#checkoutStepPayMethods .btn-block,
#checkoutStepInvoice .btn-block {
  margin-top: 8px;
}

.checkout-pay-wait {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 18px;
}

.checkout-pay-wait-visual {
  position: relative;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
}

.checkout-pay-wait-spinner {
  width: 44px;
  height: 44px;
  margin: 4px auto 0;
  border: 3px solid rgba(37, 42, 50, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: splash-spin 0.75s linear infinite;
}

.checkout-pay-wait-success {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-pay-wait-success-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(72, 168, 104, 0.14);
  color: #3fa86a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-pay-wait-success-icon svg {
  width: 24px;
  height: 24px;
}

.checkout-pay-wait-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.checkout-pay-wait-timer {
  margin: 10px 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: var(--text);
}

.checkout-pay-wait.is-success .checkout-pay-wait-timer {
  display: none;
}

.checkout-pay-wait-actions {
  margin-top: 4px;
}

.checkout-pay-vpn-hint {
  margin: 0 0 4px;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  color: var(--danger);
}

.checkout-pay-wait.is-success + .checkout-pay-wait-actions {
  display: none;
}

#checkoutStepInvoice #btnInvoicePay {
  margin-top: 0;
}

.devices-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.devices-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  font-size: 0.88rem;
}

.devices-stat-label {
  color: var(--text-soft);
  font-weight: 500;
}

.devices-stat-value {
  color: var(--text);
  font-weight: 700;
}

.devices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.device-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.device-row-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.device-row-app-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.device-row-app-icon img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.device-row-text {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
  line-height: 1.35;
  overflow: hidden;
}

.device-row-text:has(.device-row-custom) {
  flex-direction: column;
  align-items: flex-start;
}

.device-row-platform {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
}

.device-row-custom {
  display: block;
  max-width: 100%;
  font-size: 0.86rem;
  font-weight: 650;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-row-meta {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-row-sep {
  flex-shrink: 0;
  width: 4px;
  height: 4px;
  margin: 0 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  align-self: center;
}

.device-row-model {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  word-break: break-word;
}

.device-row-label {
  flex: 1;
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  word-break: break-word;
}

.device-row-actions {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.device-row-rename {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(45, 90, 180, 0.1);
  color: #2d5ab4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.device-row-rename svg {
  width: 17px;
  height: 17px;
}

.device-row-rename:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.device-row-delete {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(220, 60, 60, 0.12);
  color: #e24a4a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.device-row-delete svg {
  width: 18px;
  height: 18px;
}

.device-row-delete:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.devices-empty {
  margin: 0 0 12px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

body.device-delete-sheet-open,
body.device-rename-sheet-open {
  overflow: hidden;
}

.connect-card {
  padding: 16px 14px;
  margin-bottom: 0;
  overflow: hidden;
}

#connectStep1,
#connectStep2 {
  min-width: 0;
  max-width: 100%;
}

.connect-head {
  margin-bottom: 16px;
}

.connect-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.connect-step-label {
  margin: 5px 0 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.connect-os-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.connect-hint {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-soft);
  flex: 1;
  min-width: 0;
}

.connect-os-row .connect-hint {
  flex: 1 1 auto;
  font-size: 0.82rem;
  line-height: 1.35;
  white-space: normal;
  letter-spacing: -0.01em;
}

.connect-hint--step2 {
  margin-bottom: 12px;
}

.connect-hint--after-install {
  margin: 0 0 14px;
  text-align: center;
  font-size: clamp(0.56rem, 2.55vw, 0.64rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  white-space: nowrap;
}

.manual-sub-help {
  margin-top: 8px;
}

.manual-sub-help-trigger.btn {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 8px;
  text-align: center;
}

.manual-sub-help-trigger-text {
  grid-column: 2;
  min-width: 0;
}

.manual-sub-help-chevron {
  grid-column: 3;
  justify-self: end;
}

.manual-sub-help-chevron,
.manual-sub-step-chevron {
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  opacity: 0.42;
}

.manual-sub-help-chevron::after,
.manual-sub-step-chevron::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-top: -4px;
  margin-left: -3px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}

.manual-sub-help.open .manual-sub-help-chevron::after {
  margin-top: -2px;
  transform: rotate(-135deg);
}

.manual-sub-help-panel-clip {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.manual-sub-help.open .manual-sub-help-panel-clip {
  max-height: 320px;
}

.manual-sub-help-panel {
  padding: 12px 0 2px;
}

.manual-sub-step:last-child {
  scroll-margin-bottom: 36px;
}

.manual-sub-step-title {
  margin: 0 0 10px;
  font-size: 0.84rem;
  line-height: 1.45;
  font-weight: 600;
  color: var(--text-soft);
}

.manual-sub-step-divider {
  display: flex;
  justify-content: center;
  padding: 4px 0 10px;
}

/* --- Выбор ОС --- */
.os-picker {
  position: relative;
  flex-shrink: 0;
}

.os-picker-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 100px;
  height: 32px;
  padding: 3px 8px 3px 3px;
  border: 1px solid rgba(37, 42, 50, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 3px rgba(37, 42, 50, 0.05);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.os-picker-trigger:active {
  box-shadow: 0 1px 2px rgba(37, 42, 50, 0.05);
}

.os-picker.open .os-picker-trigger {
  border-color: rgba(61, 70, 84, 0.22);
  box-shadow: 0 4px 14px rgba(37, 42, 50, 0.08);
}

.os-picker-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: linear-gradient(145deg, #4a5563, #353d49);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.os-picker-icon svg {
  width: 13px;
  height: 13px;
  display: block;
}

.os-picker-label {
  flex: 1;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1;
  padding-right: 1px;
}

.os-picker-chevron {
  position: relative;
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  opacity: 0.42;
}

.os-picker-chevron::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-top: -4px;
  margin-left: -3px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}

.os-picker-menu-clip {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  min-width: 132px;
  max-height: 0;
  overflow: hidden;
  z-index: 30;
  transition: max-height 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.os-picker.open .os-picker-menu-clip {
  max-height: 220px;
  pointer-events: auto;
}

.os-picker-menu {
  padding: 4px;
  border: 1px solid rgba(37, 42, 50, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 28px rgba(37, 42, 50, 0.11);
  transform: translateY(-6px);
  opacity: 0;
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.24s ease;
}

.os-picker.open .os-picker-menu {
  transform: translateY(0);
  opacity: 1;
}

.os-picker-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 30px;
  padding: 0 5px 0 2px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease;
}

.os-picker-item:hover,
.os-picker-item:focus-visible {
  background: rgba(61, 70, 84, 0.06);
  outline: none;
}

.os-picker-item.is-active {
  background: rgba(61, 70, 84, 0.08);
}

.os-picker-item .os-picker-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
}

.os-picker-item .os-picker-icon svg {
  width: 12px;
  height: 12px;
}

.os-picker-item .os-picker-label {
  flex: 1;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 600;
  padding-right: 22px;
}

.connect-card .app-tabs {
  margin-bottom: 12px;
}

.install-links {
  display: grid;
  gap: 8px;
  margin-bottom: 8px;
}

.install-links--duo {
  grid-template-columns: 1fr 1fr;
}

.install-links--stack {
  grid-template-columns: 1fr;
}

.install-link-btn {
  width: 100%;
  padding: 13px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
}

.connect-card .btn-block + .btn-block {
  margin-top: 8px;
}

.qr-sheet-card {
  text-align: center;
}

.qr-sheet-hint {
  margin: 0 0 16px;
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}

.qr-sheet-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  padding: 14px;
  width: fit-content;
  max-width: 100%;
  border-radius: 16px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(20, 28, 38, 0.06);
}

.qr-sheet-frame canvas {
  display: block;
  width: min(220px, 64vw);
  height: auto;
  border-radius: 4px;
}

.qr-sheet-warn {
  margin: 0 0 14px;
  padding: 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  color: #c62828;
}

.qr-sheet-error {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #b42318;
}

.qr-sheet-error.hidden {
  display: none;
}

body.qr-sheet-open {
  overflow: hidden;
}

.connect-app-badge {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--muted);
  box-shadow: none;
  padding-top: 6px;
}

.btn-ghost:active {
  background: transparent;
  color: var(--text-soft);
}

.section-title {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 10px 4px;
}

.select-wrap select {
  width: 100%;
  appearance: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 13px 14px;
  font-size: 0.95rem;
  font-weight: 500;
}

.app-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 16px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.app-tab-cell {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
}

.app-rec-badge {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--success);
  line-height: 1.2;
}

.app-tab {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--muted);
  padding: 12px 10px 12px 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, color 0.15s, background 0.15s, box-shadow 0.15s;
}

.app-tab-label {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.018em;
  font-feature-settings: "liga" 1, "calt" 1;
  line-height: 1.15;
  white-space: nowrap;
}

.app-tab-bgicon {
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  opacity: 0.22;
  pointer-events: none;
  transition: opacity 0.2s ease;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.12) 14%,
    rgba(0, 0, 0, 0.45) 32%,
    rgba(0, 0, 0, 0.82) 48%,
    #000 62%,
    #000 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    rgba(0, 0, 0, 0.12) 14%,
    rgba(0, 0, 0, 0.45) 32%,
    rgba(0, 0, 0, 0.82) 48%,
    #000 62%,
    #000 100%
  );
}

.app-tab-bgicon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: right center;
}

.app-tab-bgicon--incy {
  display: none;
}

.app-tab-bgicon--happ {
  right: -6px;
  width: 42px;
  height: 42px;
}

.app-tab-bgicon--v2ray {
  right: -4px;
  width: 36px;
  height: 36px;
}

.app-tab:hover .app-tab-bgicon {
  opacity: 0.28;
}

.app-tab.active {
  border-color: var(--border-strong);
  color: var(--text);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.app-tab.active .app-tab-label {
  color: var(--text);
}

.app-tab.active .app-tab-bgicon {
  opacity: 0.25;
}

.app-tab::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.app-tab.active::before {
  opacity: 0.7;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 14px;
  padding-bottom: 22px;
  position: relative;
}

.step:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 40px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--border-strong), transparent);
}

.step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  font-size: 14px;
  z-index: 1;
}

.step h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.step p {
  margin: 0 0 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    background 0.22s ease,
    box-shadow 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease,
    opacity 0.22s ease;
}

.btn:active {
  transform: scale(0.985);
  transition-duration: 0.08s;
}

.btn-primary {
  background: var(--accent);
  color: #f3f5f8;
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  box-shadow: var(--shadow-md);
}

.btn-primary:active {
  background: var(--accent-hover);
}

.btn-outline {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-soft);
  box-shadow: var(--shadow-sm);
}

.btn-outline:active {
  background: var(--bg-soft);
}

.hidden {
  display: none !important;
}

/* --- Splash --- */
.splash,
.splash * {
  font-family: var(--font-system) !important;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 130% 90% at 50% -25%, #f5f7fb 0%, transparent 58%),
    radial-gradient(ellipse 70% 55% at -5% 35%, rgba(176, 192, 214, 0.55), transparent 62%),
    radial-gradient(ellipse 65% 50% at 105% 75%, rgba(168, 186, 210, 0.5), transparent 60%),
    linear-gradient(168deg, #e9eef4 0%, #dce3ec 42%, #e2e8f0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: clamp(100px, 16vh, 136px);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash--exit {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-center {
  text-align: center;
  padding: 0 24px;
}

.splash-title {
  margin: 0;
  font-size: clamp(2.15rem, 9vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.splash-sub {
  margin: 1px 0 0;
  font-size: clamp(0.95rem, 4.2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}

.splash-loader {
  position: absolute;
  bottom: max(52px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  left: 50%;
  transform: translateX(-50%);
}

.splash-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(37, 42, 50, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: splash-spin 0.75s linear infinite;
}

@keyframes splash-spin {
  to {
    transform: rotate(360deg);
  }
}

.app--behind-splash {
  opacity: 0;
  transition: opacity 0.5s ease 0.08s;
}

.app--visible {
  opacity: 1;
}

.loading,
.error-box {
  text-align: center;
  padding: 48px 16px;
  color: var(--muted);
}

.error-box {
  color: var(--danger);
  background: rgba(212, 92, 92, 0.08);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 92, 92, 0.2);
}

.footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 8px 0 0;
}

.app-support {
  margin-top: 6px;
}
