:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #edf5ff;
  --text: #17212b;
  --muted: #6a7b8f;
  --line: #dfe7f0;
  --accent: #2aabee;
  --accent-strong: #168acd;
  --danger: #e55b64;
  --warning: #d99a21;
  --shadow: 0 10px 28px rgba(30, 75, 115, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.design-preview {
  --bg: #f3f7fb;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-soft: rgba(229, 244, 255, 0.82);
  --text: #111a24;
  --muted: #697a8d;
  --line: rgba(123, 153, 184, 0.2);
  --accent: #2aabee;
  --accent-strong: #137fbf;
  --shadow: 0 18px 48px rgba(38, 77, 113, 0.14);
  background:
    radial-gradient(circle at 50% -8%, rgba(42, 171, 238, 0.18), transparent 34%),
    radial-gradient(circle at 92% 18%, rgba(53, 199, 164, 0.1), transparent 28%),
    linear-gradient(180deg, #f7fbff 0%, #eef4fa 100%);
  font-variant-numeric: tabular-nums;
}

body.design-preview::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(17, 26, 36, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 26, 36, 0.02) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), transparent 62%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
.copy-field:focus-within {
  outline: 3px solid rgba(42, 171, 238, 0.22);
  outline-offset: 3px;
}

body.design-preview button:focus-visible,
body.design-preview input:focus-visible,
body.design-preview .copy-field:focus-within {
  outline: 3px solid rgba(42, 171, 238, 0.24);
  outline-offset: 4px;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 18px) 16px calc(env(safe-area-inset-bottom) + 90px);
}

.app-shell.auth-mode {
  padding-bottom: calc(env(safe-area-inset-bottom) + 18px);
}

[data-private-app].trial-choice-mode > .topbar,
[data-private-app].trial-choice-mode > .account-menu,
[data-private-app].trial-choice-mode > .screen,
[data-private-app].trial-choice-mode > .tabbar {
  display: none;
}

.trial-choice-gate {
  display: grid;
  min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 108px);
  align-content: center;
  gap: 14px;
}

.trial-choice-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 2px;
}

.trial-choice-brand > span:last-child {
  display: grid;
  gap: 1px;
}

.trial-choice-brand small {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.trial-choice-brand strong {
  font-size: 21px;
  line-height: 1.15;
}

.trial-choice-intro {
  text-align: center;
}

.trial-choice-kicker {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trial-choice-intro h1 {
  margin: 0;
  font-size: clamp(25px, 7vw, 31px);
  line-height: 1.08;
}

.trial-choice-intro p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.trial-choice-options {
  display: grid;
  gap: 12px;
}

.trial-choice-option {
  position: relative;
  display: grid;
  gap: 13px;
  overflow: hidden;
}

.trial-choice-option.is-recommended {
  border-color: rgba(42, 171, 238, 0.38);
  background:
    radial-gradient(circle at 100% 0, rgba(42, 171, 238, 0.12), transparent 42%),
    var(--surface);
  box-shadow: 0 14px 34px rgba(30, 117, 172, 0.13);
}

.trial-choice-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(42, 171, 238, 0.12);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 850;
}

.trial-choice-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.trial-choice-option.is-recommended .trial-choice-price {
  padding-right: 86px;
}

.trial-choice-price strong {
  font-size: 29px;
  line-height: 1;
}

.trial-choice-price span {
  color: var(--accent-strong);
  font-size: 17px;
  font-weight: 850;
}

.trial-choice-option > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.trial-choice-renewal-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: left;
}

.trial-choice-renewal-note summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-weight: 750;
}

.trial-choice-renewal-note summary::-webkit-details-marker {
  display: none;
}

.trial-choice-renewal-note summary::after {
  content: "›";
  color: var(--accent-strong);
  font-size: 18px;
  line-height: 1;
  transition: transform 160ms ease;
}

.trial-choice-renewal-note[open] summary::after {
  transform: rotate(90deg);
}

.trial-choice-renewal-note p {
  margin: 8px 0 0;
}

.trial-choice-note {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
}

.trial-choice-note:empty {
  display: none;
}

.trial-choice-note.is-error {
  color: var(--danger);
  font-weight: 750;
}

.trial-choice-note.is-success {
  color: #23825f;
  font-weight: 750;
}

.trial-choice-logout {
  justify-self: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

@media (max-width: 360px) {
  .trial-choice-gate {
    align-content: start;
  }

  .trial-choice-intro,
  .trial-choice-option {
    padding: 17px;
  }

  .trial-choice-price strong {
    font-size: 26px;
  }

  .trial-choice-badge {
    top: 12px;
    right: 12px;
  }
}

body.design-preview .app-shell {
  padding-inline: 18px;
}

.auth-screen {
  display: grid;
  min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 36px);
  align-content: center;
  gap: 18px;
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 0 4px;
}

.auth-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  color: var(--accent-strong);
  font-weight: 800;
}

.auth-brand-label {
  min-width: 0;
  line-height: 1.2;
  white-space: normal;
}

.auth-service-status {
  white-space: nowrap;
}

.auth-brand-apps {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
}

.auth-brand-app-icon {
  display: block;
  width: 38px;
  height: 38px;
  border: 2px solid #fff;
  border-radius: 11px;
  box-shadow: 0 6px 16px rgba(26, 43, 66, 0.14);
  object-fit: cover;
}

.auth-brand-app-icon + .auth-brand-app-icon {
  margin-left: -8px;
}

.auth-brand small {
  display: block;
  margin-top: 2px;
  color: #536579;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.auth-logo {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #35c7a4 0%, #2aabee 100%);
  color: #fff;
}

.auth-card {
  text-align: center;
}

.auth-card h1 {
  margin-bottom: 12px;
  font-size: 26px;
}

.auth-service-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #536579;
  font-size: 11px;
  font-weight: 700;
}

.auth-service-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.34);
  animation: service-status-pulse 2.2s ease-out infinite;
}

.auth-card .text-input,
.auth-card .primary-button,
.auth-card .secondary-button {
  margin-top: 10px;
}

.auth-card .primary-button {
  min-height: 44px;
}

.auth-card .primary-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.auth-delivery-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid #c9e6d6;
  border-radius: 10px;
  background: #effaf4;
  color: #32644e;
  font-size: 13px;
  line-height: 1.45;
  text-align: left;
}

.auth-version {
  margin: -4px 0 0;
  color: #536579;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.auth-code-row {
  margin-top: 12px;
}

.campaign-auth-notice {
  margin: 0 0 16px;
  border: 1px solid rgba(29, 174, 120, 0.28);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(36, 193, 139, 0.1);
  color: #157553;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.35;
}

.campaign-auth-notice.is-error {
  border-color: rgba(213, 65, 65, 0.24);
  background: rgba(213, 65, 65, 0.08);
  color: var(--danger);
}

.campaign-offer {
  margin-bottom: 10px;
  border: 1px solid rgba(32, 175, 121, 0.24);
  border-radius: 16px;
  padding: 12px;
  background: linear-gradient(145deg, rgba(232, 255, 245, 0.96), rgba(244, 250, 255, 0.96));
}

.campaign-offer-heading {
  display: grid;
  gap: 3px;
  margin-bottom: 5px;
}

.campaign-offer-label {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: #1dad78;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.campaign-offer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.campaign-offer.is-balance-bonus .campaign-offer-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.campaign-offer.is-balance-bonus .campaign-offer-card {
  min-height: 92px;
  padding: 20px 7px 8px;
}

.campaign-offer-card {
  --campaign-tier-accent: #344454;
  --campaign-tier-border: #d7e0e8;
  --campaign-tier-surface: #fff;
  --campaign-tier-badge: #eef2f6;
  --campaign-tier-ring: rgba(52, 68, 84, 0.12);
  position: relative;
  display: grid;
  min-height: 98px;
  align-content: center;
  gap: 2px;
  border: 1px solid var(--campaign-tier-border);
  border-radius: 14px;
  padding: 10px 9px 8px;
  background: var(--campaign-tier-surface);
  color: var(--text);
  text-align: left;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    box-shadow 150ms ease;
}

.campaign-offer-card.is-selected.is-entry-tier {
  --campaign-tier-accent: #a43a3a;
  --campaign-tier-border: #edbcbc;
  --campaign-tier-surface: #fff7f7;
  --campaign-tier-badge: #ffe2e2;
  --campaign-tier-ring: rgba(190, 63, 63, 0.14);
}

.campaign-offer-card.is-selected.is-middle-tier {
  --campaign-tier-accent: #81610e;
  --campaign-tier-border: #e7cf89;
  --campaign-tier-surface: #fffaf0;
  --campaign-tier-badge: #fff0bf;
  --campaign-tier-ring: rgba(176, 131, 15, 0.16);
}

.campaign-offer-card.is-selected.is-max-tier {
  --campaign-tier-accent: #17704a;
  --campaign-tier-border: #a7d8b9;
  --campaign-tier-surface: #f3fbf6;
  --campaign-tier-badge: #daf3e3;
  --campaign-tier-ring: rgba(29, 173, 120, 0.15);
}

.campaign-offer-card.is-selected {
  border-color: var(--campaign-tier-accent);
  box-shadow: 0 0 0 2px var(--campaign-tier-ring);
}

.campaign-offer-card.is-selected .campaign-offer-badge::before {
  content: "✓ ";
}

.campaign-offer-card:disabled {
  opacity: 0.58;
}

.campaign-offer-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  border-radius: 999px;
  padding: 2px 6px;
  background: var(--campaign-tier-badge);
  color: var(--campaign-tier-accent);
  font-size: 10px;
  font-weight: 800;
}

.campaign-offer-card small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.campaign-offer-card strong {
  color: var(--campaign-tier-accent);
  font-size: 16px;
  line-height: 1.15;
}

.campaign-regular-price {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  text-decoration: line-through;
}

.campaign-pay-price {
  color: var(--campaign-tier-accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.campaign-bonus-credit {
  color: var(--campaign-tier-accent);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

@media (max-width: 360px) {
  .campaign-offer-grid {
    grid-template-columns: 1fr;
  }

  .campaign-offer.is-balance-bonus .campaign-offer-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .campaign-offer.is-balance-bonus .campaign-offer-card strong {
    font-size: 14px;
  }

  .campaign-offer.is-balance-bonus .campaign-bonus-credit {
    font-size: 9px;
  }
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.title-block {
  flex: 1;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: 0;
}

body.design-preview h1 {
  font-size: 30px;
  line-height: 1.05;
  text-wrap: balance;
}

h2 {
  margin-bottom: 14px;
  font-size: 20px;
  letter-spacing: 0;
}

body.design-preview h2 {
  font-size: 21px;
  line-height: 1.12;
  text-wrap: balance;
}

h3 {
  margin: 20px 0 10px;
  font-size: 15px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

body.design-preview .icon-button,
body.design-preview .avatar {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.78),
    0 12px 30px rgba(38, 77, 113, 0.12);
}

.avatar-button {
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #35c7a4 0%, #2aabee 100%);
  background-position: center;
  background-size: cover;
  color: #fff;
  font-weight: 800;
  overflow: hidden;
}

.avatar.big {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.avatar.has-photo {
  color: transparent;
}

.account-menu {
  position: absolute;
  z-index: 5;
  top: calc(env(safe-area-inset-top) + 74px);
  right: 16px;
  left: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 44px rgba(34, 67, 98, 0.18);
  backdrop-filter: blur(18px);
}

.account-menu button {
  display: flex;
  width: 100%;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 0 16px;
  background: transparent;
  color: var(--text);
  text-align: left;
  font-weight: 700;
}

.account-menu .account-summary {
  justify-content: flex-start;
  gap: 12px;
  min-height: 72px;
  border-top: 0;
}

.logout-link {
  color: var(--danger) !important;
}

.screen {
  display: none;
  animation: appear 160ms ease-out;
}

body.design-preview .screen {
  animation: appear 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.screen.is-active {
  display: block;
}

.card,
.balance-panel {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

body.design-preview .card,
body.design-preview .balance-panel {
  margin-bottom: 16px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(42, 171, 238, 0.04),
    var(--shadow);
  backdrop-filter: blur(18px);
}

.card {
  padding: 16px;
}

.connection-feedback-head h2 {
  margin: 0 0 5px;
}

.connection-feedback-head .note {
  margin: 0;
}

.connection-feedback-statuses,
.connection-feedback-networks,
.connection-feedback-server-check {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.connection-feedback-status,
.connection-feedback-networks button,
.connection-feedback-server-check button,
.connection-feedback-issues button {
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 7px 5px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.2;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.connection-feedback-statuses {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.connection-feedback-status.is-selected {
  box-shadow: inset 0 0 0 1px currentColor;
}

.connection-feedback-status.is-not-working.is-selected {
  border-color: rgba(229, 91, 100, 0.55);
  background: rgba(229, 91, 100, 0.1);
  color: #bd3944;
}

.connection-feedback-status.is-poor.is-selected {
  border-color: rgba(217, 154, 33, 0.58);
  background: rgba(217, 154, 33, 0.12);
  color: #9a6810;
}

.connection-feedback-status.is-working.is-selected {
  border-color: rgba(22, 121, 76, 0.5);
  background: rgba(22, 121, 76, 0.1);
  color: #16794c;
}

.connection-feedback-form {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.connection-feedback-networks {
  margin: 0 0 14px;
}

.connection-feedback-networks button.is-selected,
.connection-feedback-server-check button.is-selected {
  border-color: var(--accent);
  background: rgba(42, 171, 238, 0.12);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.connection-feedback-server-check {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 14px;
}

.connection-feedback-issues {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0 0 14px;
}

.connection-feedback-issues button.is-selected {
  border-color: rgba(217, 154, 33, 0.64);
  background: rgba(217, 154, 33, 0.12);
  color: #8a5c08;
  box-shadow: inset 0 0 0 1px rgba(217, 154, 33, 0.5);
}

[data-feedback-comment-wrap] {
  margin-top: 2px;
}

.connection-feedback-comment {
  width: 100%;
  font: inherit;
}

.connection-feedback-comment {
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--bg);
  color: var(--text);
}

.connection-feedback-note {
  min-height: 18px;
  margin: 11px 0 0;
  font-weight: 700;
}

.connection-feedback-note:empty {
  min-height: 0;
  margin-top: 0;
}

.connection-feedback-note.is-success {
  color: #16794c;
}

.connection-feedback-note.is-error {
  color: var(--danger);
}

body.design-preview .card {
  padding: 18px;
}

.balance-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  background: linear-gradient(135deg, #ffffff 0%, #e8f6ff 100%);
}

body.design-preview .balance-panel {
  position: relative;
  overflow: hidden;
  min-height: 152px;
  border-color: rgba(42, 171, 238, 0.18);
  padding: 24px 22px 28px;
  background:
    radial-gradient(circle at 96% 8%, rgba(42, 171, 238, 0.3), transparent 34%),
    radial-gradient(circle at 78% 82%, rgba(53, 199, 164, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(226, 246, 255, 0.92) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 22px 52px rgba(38, 77, 113, 0.17);
}

body.design-preview .balance-panel::after {
  content: "";
  position: absolute;
  left: 22px;
  bottom: 18px;
  width: calc((100% - 44px) * var(--subscription-progress, 1));
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #35c7a4 0%, #2aabee 100%);
  opacity: 0.95;
  transition: width 220ms ease, background 220ms ease;
}

body.design-preview .balance-panel::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  height: 5px;
  border-radius: 999px;
  background: rgba(123, 153, 184, 0.16);
}

body.design-preview .balance-panel.is-warning::after {
  background: linear-gradient(90deg, #f5c44d 0%, #d99a21 100%);
}

body.design-preview .balance-panel.is-danger::after {
  background: linear-gradient(90deg, #ff8a8a 0%, #e55b64 100%);
}

body.design-preview .balance-panel.is-expired::after {
  background: linear-gradient(90deg, #b89cff 0%, #7e57c2 100%);
}

.balance-panel.is-ok {
  border-color: #d9edf9;
  background: linear-gradient(135deg, #ffffff 0%, #e8f6ff 100%);
}

.balance-panel.is-warning {
  border-color: #f3dca9;
  background: linear-gradient(135deg, #ffffff 0%, #fff5dc 100%);
}

.balance-panel.is-danger {
  border-color: #f0c4c8;
  background: linear-gradient(135deg, #ffffff 0%, #fff0f1 100%);
}

.balance-panel.is-expired {
  border-color: #d8caf3;
  background: linear-gradient(135deg, #ffffff 0%, #f4f0ff 100%);
}

.balance-panel.is-warning strong {
  color: var(--warning);
}

.balance-panel.is-danger strong {
  color: var(--danger);
}

.balance-panel.is-expired strong {
  color: #7e57c2;
}

.balance-panel strong {
  display: block;
  margin: 3px 0;
  font-size: 38px;
  line-height: 1;
}

body.design-preview .balance-panel strong {
  position: relative;
  z-index: 1;
  margin: 8px 0 8px;
  font-size: 48px;
  letter-spacing: 0;
}

body.design-preview [data-daily-cost] {
  position: relative;
  z-index: 1;
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.64);
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(42, 171, 238, 0.12);
}

body.design-preview .balance-panel strong,
body.design-preview [data-balance],
body.design-preview [data-daily-cost],
body.design-preview [data-device-rate],
body.design-preview [data-balance-note],
body.design-preview .amount-grid button {
  font-variant-numeric: tabular-nums;
}

.subscription-status {
  display: none;
}

body.design-preview .balance-card {
  border-color: rgba(123, 153, 184, 0.16);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(250, 253, 255, 0.78));
}

body.design-preview .balance-card .section-head {
  align-items: flex-start;
}

body.design-preview .balance-card [data-balance] {
  margin: 0 0 2px;
  font-size: 28px;
  line-height: 1;
}

body.design-preview .balance-card > .muted {
  display: inline-flex;
  margin-bottom: 10px;
}

body.design-preview .balance-card .note {
  position: relative;
  margin: 8px 0 0;
  border-radius: 14px;
  padding: 11px 12px 11px 38px;
  background: rgba(244, 248, 252, 0.82);
  color: #54677b;
  box-shadow: inset 0 0 0 1px rgba(123, 153, 184, 0.12);
}

body.design-preview .balance-card .note::before {
  position: absolute;
  top: 50%;
  left: 12px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 6px;
  transform: translateY(-50%);
  background: rgba(42, 171, 238, 0.1);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
}

body.design-preview .balance-card [data-balance-note]::before {
  content: "₽";
}

body.design-preview .balance-card [data-device-rate]::before {
  content: "/";
}

body.design-preview .subscription-status {
  display: none;
}

.muted,
small {
  color: var(--muted);
}

small {
  display: block;
  font-size: 12px;
}

.primary-button,
.secondary-button,
.small-button,
.danger-button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  padding: 0 16px;
  font-weight: 700;
}

body.design-preview .primary-button,
body.design-preview .secondary-button,
body.design-preview .small-button,
body.design-preview .danger-button {
  border-radius: 15px;
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.primary-button {
  background: var(--accent);
  color: #fff;
}

body.design-preview .primary-button {
  box-shadow: 0 12px 24px rgba(42, 171, 238, 0.24);
}

body.design-preview .primary-button:hover {
  background: #32b6f4;
  box-shadow: 0 14px 28px rgba(42, 171, 238, 0.28);
}

.primary-button:active {
  background: var(--accent-strong);
}

.secondary-button,
.small-button {
  background: var(--surface-soft);
  color: var(--accent-strong);
}

.danger-button {
  margin-top: 10px;
  background: #fff0f1;
  color: var(--danger);
}

.full {
  width: 100%;
}

.section-head,
.device-row,
.list button,
.copy-field,
.store-grid {
  display: flex;
  align-items: center;
}

.section-head {
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  margin-bottom: 0;
}

.device-section-head {
  padding-bottom: 14px;
}

body.design-preview .device-section-head {
  padding-bottom: 10px;
}

body.design-preview [data-device-list] {
  position: relative;
  margin-top: 10px;
  padding-top: 2px;
}

body.design-preview [data-device-list]::before {
  content: "";
  position: absolute;
  top: 0;
  right: 2px;
  left: 54px;
  height: 1px;
  background: var(--line);
}

.device-counter {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.device-counter strong {
  text-align: center;
}

.device-counter button {
  min-width: 0;
  padding: 0;
  font-size: 20px;
}

.device-row,
.list button {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.list button {
  border-top: 1px solid var(--line);
}

.device-row {
  position: relative;
  gap: 12px;
  padding: 14px 0 14px;
}

body.design-preview .device-row {
  min-height: 62px;
  border-radius: 16px;
  padding: 10px 10px;
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.design-preview .device-row:hover {
  background: rgba(244, 248, 252, 0.72);
}

body.design-preview .device-row:active {
  transform: scale(0.985);
}

.device-row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 50px;
  height: 1px;
  background: var(--line);
}

.device-row:first-child::before {
  left: 0;
}

body.design-preview .device-row:first-child::before {
  display: none;
}

.device-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-soft);
}

body.design-preview .device-icon,
body.design-preview .payment-icon {
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

body.design-preview .device-icon {
  width: 42px;
  height: 42px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(229, 244, 255, 0.86));
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 8px 18px rgba(42, 171, 238, 0.08);
}

.device-row span:nth-child(2) {
  flex: 1;
}

body.design-preview .device-row strong {
  display: block;
  margin-bottom: 2px;
  font-size: 16px;
  line-height: 1.18;
}

body.design-preview .device-row small {
  font-size: 12px;
}

.device-active-label {
  color: #16794c;
  font-weight: 800;
}

.device-status-summary {
  display: grid;
  gap: 3px;
  margin: 4px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(22, 121, 76, 0.18);
  border-radius: 14px;
  background: rgba(22, 121, 76, 0.07);
}

.device-status-summary strong {
  color: #16794c;
  font-size: 14px;
}

.device-status-summary span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

body.design-preview .devices-card {
  padding-bottom: 14px;
}

body.design-preview .devices-card [data-device-list] {
  margin-top: 14px;
}

body.design-preview .devices-card .section-head {
  padding-bottom: 4px;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 12px 8px;
  text-align: center;
}

.empty-state strong {
  font-size: 17px;
}

.empty-state span:not(.empty-icon) {
  max-width: 260px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.empty-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
}

.empty-state .secondary-button {
  margin-top: 4px;
}

body.design-preview .empty-state {
  margin-top: 4px;
  border-radius: 18px;
  padding: 18px 14px;
  background: rgba(244, 248, 252, 0.64);
  box-shadow: inset 0 0 0 1px rgba(42, 171, 238, 0.1);
}

body.design-preview .empty-icon {
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(229, 244, 255, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 8px 18px rgba(42, 171, 238, 0.08);
}

.chevron {
  color: var(--muted);
  font-size: 24px;
}

.referral-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.social-card h2 {
  margin-bottom: 12px;
}

.social-grid,
.support-grid,
.profile-actions {
  display: grid;
  gap: 10px;
}

.social-grid {
  grid-template-columns: repeat(3, 1fr);
}

.social-grid button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.transfer-promo-card {
  display: grid;
  gap: 14px;
}

.transfer-promo-card h2 {
  margin-bottom: 6px;
}

.transfer-promo-card .note {
  margin-bottom: 0;
}

body.design-preview .social-grid button {
  min-height: 48px;
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.profile-card {
  background: linear-gradient(135deg, #ffffff 0%, #eaf7ff 100%);
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.profile-head h2,
.profile-head p {
  margin-bottom: 2px;
}

.profile-head p {
  color: var(--muted);
}

.profile-meta {
  margin: 0 0 16px;
}

.profile-meta div,
.verified-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.profile-meta dt,
.verified-row span {
  color: var(--muted);
}

.profile-meta dd {
  margin: 0;
  text-align: right;
  font-weight: 700;
}

.profile-actions {
  grid-template-columns: 1fr 1fr;
}

.profile-actions .danger-button {
  margin-top: 0;
}

.note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

body.design-preview .note {
  line-height: 1.48;
  text-wrap: pretty;
}

.note.center {
  text-align: center;
}

[data-topup-note]:empty {
  display: none;
}

.auth-card .note {
  color: #536579;
}

.referral-card p,
.hero-card p,
details p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.timeline {
  display: grid;
  gap: 10px;
}

.timeline p {
  margin: 0;
  border-top: 1px solid var(--line);
  padding: 12px 0 2px;
}

.timeline p:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.hero-card {
  text-align: center;
}

.hero-icon {
  margin-bottom: 8px;
  font-size: 42px;
}

.hero-badge {
  display: inline-grid;
  min-width: 54px;
  min-height: 38px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 14px;
  padding: 0 13px;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
}

.list {
  overflow: hidden;
  margin: 0 -16px 16px;
}

.list button {
  justify-content: space-between;
  min-height: 48px;
  padding: 0 16px;
}

.list button.is-selected {
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.list.compact {
  margin-bottom: 16px;
}

.section-subtitle {
  margin-top: 18px;
}

.app-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0 16px;
}

.app-options button {
  min-height: 72px;
  align-items: flex-start;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.app-options button.is-selected {
  border-color: var(--accent);
  background: rgba(42, 171, 238, 0.12);
  color: var(--accent-strong);
}

.app-options small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.copy-field {
  gap: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  background: var(--bg);
}

.copy-field input,
.text-input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
}

.copy-field button {
  border: 0;
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--surface);
  color: var(--accent-strong);
  font-weight: 700;
}

.text-input {
  min-height: 46px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--bg);
}

.date-input-wrap {
  position: relative;
  margin-bottom: 14px;
}

.date-input-wrap .text-input {
  margin-bottom: 0;
}

.date-placeholder {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa8b6;
  pointer-events: none;
}

.date-input-wrap.has-value .date-placeholder,
.date-input-wrap:focus-within .date-placeholder {
  display: none;
}

.date-input-wrap input[type="date"] {
  color: transparent;
}

.date-input-wrap.has-value input[type="date"],
.date-input-wrap:focus-within input[type="date"] {
  color: var(--text);
}

body.design-preview .text-input,
body.design-preview .copy-field,
body.design-preview .payment-list {
  background: rgba(244, 248, 252, 0.76);
}

body.design-preview .amount-grid button {
  background: rgba(244, 248, 252, 0.76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-color 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

body.design-preview .amount-grid button.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 22px rgba(42, 171, 238, 0.22);
}

body.design-preview .amount-grid button:not(.is-selected):hover {
  border-color: rgba(42, 171, 238, 0.34);
  background: rgba(234, 247, 255, 0.9);
  color: var(--accent-strong);
}

.store-grid,
.amount-grid {
  display: grid;
  gap: 10px;
}

.store-grid {
  grid-template-columns: 1fr 1fr;
  margin-top: 10px;
}

.amount-grid {
  grid-template-columns: repeat(3, 1fr);
}

.amount-grid button {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
}

.amount-grid .is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.topup-duration-card {
  --duration-border: #f0d38f;
  --duration-glow: rgba(245, 196, 77, 0.2);
  --duration-start: #fffdf7;
  --duration-end: #fff5dc;
  --duration-shadow: rgba(134, 96, 20, 0.1);
  --duration-lead: #7d6327;
  --duration-strong: #96620a;
  --duration-support: #526579;
  --duration-divider: rgba(150, 98, 10, 0.18);
  margin-top: 14px;
  border: 1px solid var(--duration-border);
  border-radius: 18px;
  padding: 18px;
  background:
    radial-gradient(circle at 94% 8%, var(--duration-glow), transparent 34%),
    linear-gradient(135deg, var(--duration-start) 0%, var(--duration-end) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 12px 28px var(--duration-shadow);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.topup-duration-card.is-short {
  --duration-border: #efb6ae;
  --duration-glow: rgba(230, 92, 100, 0.18);
  --duration-start: #fffaf9;
  --duration-end: #ffe9e6;
  --duration-shadow: rgba(151, 55, 49, 0.1);
  --duration-lead: #803b38;
  --duration-strong: #9d302c;
  --duration-support: #5f5151;
  --duration-divider: rgba(157, 48, 44, 0.18);
}

.topup-duration-card.is-long {
  --duration-border: #a9d9b4;
  --duration-glow: rgba(69, 171, 103, 0.18);
  --duration-start: #f9fffa;
  --duration-end: #e8f7eb;
  --duration-shadow: rgba(39, 116, 65, 0.1);
  --duration-lead: #356b49;
  --duration-strong: #216a3d;
  --duration-support: #4d6053;
  --duration-divider: rgba(33, 106, 61, 0.18);
}

.topup-duration-card.is-campaign {
  --duration-border: rgba(29, 173, 120, 0.24);
  --duration-lead: #356b49;
  --duration-strong: #176f4d;
  --duration-support: #4d6053;
  --duration-divider: rgba(29, 173, 120, 0.18);
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 12px;
  background: #f5fbf8;
  box-shadow: none;
}

.topup-duration-card.is-campaign .topup-duration-lead,
.topup-duration-card.is-campaign .topup-duration-disclaimer {
  display: none;
}

.topup-duration-card.is-campaign strong {
  margin: 0 0 2px;
  font-size: 18px;
  line-height: 1.15;
}

.topup-duration-card.is-campaign .topup-duration-details {
  color: var(--duration-support);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.3;
}

.topup-duration-card p {
  margin-bottom: 0;
}

.topup-duration-lead {
  color: var(--duration-lead);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.topup-duration-card strong {
  display: block;
  margin: 7px 0 10px;
  color: var(--duration-strong);
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.topup-duration-details {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

.topup-duration-disclaimer {
  margin: 14px 0 0;
  border-top: 1px solid var(--duration-divider);
  padding-top: 12px;
  color: var(--duration-support);
  font-size: 13px;
  line-height: 1.45;
}

.amount-grid button:active,
.payment-list button:active,
.social-grid button:active,
.secondary-button:active,
.small-button:active {
  transform: translateY(1px);
}

body.design-preview .primary-button:active,
body.design-preview .amount-grid button:active,
body.design-preview .payment-list button:active,
body.design-preview .social-grid button:active,
body.design-preview .secondary-button:active,
body.design-preview .small-button:active {
  transform: scale(0.975);
}

body.design-preview .amount-grid button.is-selected:active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px rgba(42, 171, 238, 0.22);
}

body.design-preview .payment-list button,
body.design-preview .social-grid button,
body.design-preview .tabbar button {
  transition:
    transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform;
}

.payment-list {
  overflow: hidden;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.payment-list button {
  display: flex;
  width: 100%;
  min-height: 66px;
  align-items: center;
  gap: 12px;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 10px 12px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.payment-list button:first-child {
  border-top: 0;
}

.payment-list .is-selected {
  background: var(--surface-soft);
}

.payment-list button > span:nth-child(2) {
  flex: 1;
}

.payment-icon {
  display: grid;
  position: relative;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 0 0 1px rgba(42, 171, 238, 0.08),
    0 6px 16px rgba(42, 171, 238, 0.08);
}

.payment-icon img {
  display: block;
  width: 25px;
  height: 25px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.promo-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

body.design-preview .promo-box {
  margin-top: 20px;
  padding-top: 18px;
}

body.design-preview .promo-box h3 {
  margin-top: 0;
  margin-bottom: 12px;
}

.promo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

body.design-preview .promo-row {
  gap: 8px;
}

.promo-row .text-input {
  margin-bottom: 0;
  text-transform: uppercase;
}

body.design-preview .promo-row .text-input {
  min-height: 48px;
  border-radius: 14px;
  background: rgba(244, 248, 252, 0.86);
}

.promo-row .secondary-button {
  min-height: 46px;
  white-space: nowrap;
}

.textarea-input {
  min-height: 104px;
  resize: vertical;
  line-height: 1.45;
}

.file-input {
  padding: 13px 14px;
}

.file-input::file-selector-button {
  margin-right: 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  font-weight: 800;
  padding: 10px 12px;
}

body.design-preview .promo-row .secondary-button {
  min-height: 48px;
  border-radius: 14px;
}

[data-promo-note] {
  color: var(--muted);
}

body.design-preview [data-promo-note] {
  min-height: 36px;
  margin-top: 12px;
  border-radius: 14px;
  padding: 9px 12px;
  background: rgba(244, 248, 252, 0.7);
  color: var(--muted);
  text-align: center;
}

body.design-preview [data-promo-note].is-loading {
  color: var(--accent-strong);
}

[data-promo-note].is-success {
  color: #18a957 !important;
  font-weight: 700;
}

[data-transfer-note].is-success {
  color: #18a957 !important;
  font-weight: 700;
}

.transfer-status {
  display: grid;
  gap: 4px;
  margin: 12px 0;
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(42, 171, 238, 0.18);
  background: rgba(42, 171, 238, 0.08);
  color: var(--text);
}

.transfer-status strong {
  font-size: 15px;
}

.transfer-status span,
.transfer-status small {
  color: var(--muted);
  line-height: 1.35;
}

.transfer-status.is-pending {
  border-color: rgba(216, 157, 27, 0.24);
  background: rgba(216, 157, 27, 0.1);
}

.transfer-status.is-approved {
  border-color: rgba(24, 169, 87, 0.22);
  background: rgba(24, 169, 87, 0.1);
}

.transfer-status.is-approved strong {
  color: #18a957;
}

.transfer-status.is-rejected {
  border-color: rgba(229, 91, 100, 0.22);
  background: rgba(229, 91, 100, 0.1);
}

.transfer-status.is-rejected strong {
  color: var(--danger);
}

body.design-preview [data-promo-note].is-success {
  background: rgba(24, 169, 87, 0.1);
  box-shadow: inset 0 0 0 1px rgba(24, 169, 87, 0.16);
}

[data-promo-note].is-error {
  color: var(--danger) !important;
}

[data-transfer-note].is-error {
  color: var(--danger) !important;
}

body.design-preview [data-promo-note].is-error {
  background: rgba(229, 91, 100, 0.1);
  box-shadow: inset 0 0 0 1px rgba(229, 91, 100, 0.16);
}

.radio-dot {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 50%;
}

.is-selected .radio-dot {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 42%, transparent 47%);
}

.timeline p {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

body.design-preview .timeline p {
  border-top-color: rgba(123, 153, 184, 0.18);
}

body.design-preview .history-state {
  border-top: 0;
  border-radius: 16px;
  padding: 14px;
  background: rgba(244, 248, 252, 0.72);
}

body.design-preview .history-state.is-empty {
  box-shadow: inset 0 0 0 1px rgba(42, 171, 238, 0.12);
}

body.design-preview .history-state.is-error {
  box-shadow: inset 0 0 0 1px rgba(229, 91, 100, 0.16);
}

.history-skeleton {
  display: grid;
  gap: 10px;
}

.history-skeleton span {
  display: block;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(244, 248, 252, 0.92), rgba(229, 244, 255, 0.82), rgba(244, 248, 252, 0.92));
  background-size: 220% 100%;
  animation: skeleton-shimmer 1.25s ease-in-out infinite;
}

.timeline span {
  color: var(--muted);
  font-size: 13px;
}

details {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

summary {
  cursor: pointer;
  font-weight: 700;
  line-height: 1.35;
}

.help-intro {
  margin: 4px 0 20px;
  color: var(--muted);
  line-height: 1.45;
}

.help-section-title {
  margin: 22px 0 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.3;
}

.help-section-title:first-of-type {
  margin-top: 0;
}

.help-card details p {
  padding-right: 4px;
  font-size: 15px;
}

.support-grid {
  grid-template-columns: 1fr;
  margin-top: 12px;
}

/* Legal links only. Application behavior is unchanged. */
.auth-legal-links,
.auth-consent-copy,
.payment-legal-copy {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-consent-copy {
  margin: 7px 8px 0;
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.auth-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 9px;
  margin-top: -4px;
}

.payment-legal-copy {
  margin: 2px 4px 12px;
  text-align: center;
}

.auth-legal-links a,
.auth-consent-copy a,
.payment-legal-copy a {
  color: var(--accent-strong);
  font-weight: 750;
  text-decoration: none;
}

.legal-document-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(42, 171, 238, 0.18);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
}

.legal-document-entry > span:first-child {
  display: grid;
  gap: 4px;
}

.legal-document-entry strong {
  color: var(--accent-strong);
  font-size: 15px;
}

.legal-document-entry small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.auth-legal-links a:focus-visible,
.auth-consent-copy a:focus-visible,
.payment-legal-copy a:focus-visible,
.legal-document-entry:focus-visible {
  border-radius: 6px;
  outline: 3px solid rgba(42, 171, 238, 0.22);
  outline-offset: 3px;
}

.tabbar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 10px 10px calc(env(safe-area-inset-bottom) + 10px);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}

body.design-preview .tabbar {
  right: 8px;
  bottom: 8px;
  left: 8px;
  width: min(calc(100% - 16px), 414px);
  border: 1px solid rgba(123, 153, 184, 0.18);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 46px rgba(38, 77, 113, 0.16);
}

.tabbar button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.tabbar .is-active {
  background: var(--surface-soft);
  color: var(--accent-strong);
}

body.design-preview .tabbar .is-active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 8px 18px rgba(42, 171, 238, 0.08);
}

body.design-preview .tabbar button:active {
  transform: scale(0.96);
}

@keyframes appear {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skeleton-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: -100% 0;
  }
}

@keyframes service-status-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.34);
  }
  65%,
  100% {
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-service-status-dot,
  .topup-duration-card {
    animation: none;
    transition: none;
  }
}

/* First-run onboarding pilot. Kept behind a server-side email feature flag. */
.app-shell.first-run-shell {
  padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
}

[data-private-app].first-run-mode > .topbar,
[data-private-app].first-run-mode > .account-menu,
[data-private-app].first-run-mode > .tabbar {
  display: none;
}

.first-run-screen.is-active {
  display: grid;
  min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 56px);
  align-content: center;
  gap: 14px;
}

.first-run-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 5px;
}

.first-run-brand > span:last-child {
  display: grid;
  gap: 1px;
}

.first-run-brand small {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.first-run-brand strong {
  font-size: 21px;
  line-height: 1.15;
}

.first-run-card {
  position: relative;
  overflow: hidden;
  padding: 26px 20px 20px;
  border-color: rgba(224, 167, 48, 0.38);
  background:
    radial-gradient(circle at 96% 4%, rgba(255, 204, 92, 0.3), transparent 34%),
    linear-gradient(145deg, #fffdf7 0%, #fff8df 100%);
  box-shadow: 0 18px 42px rgba(144, 108, 29, 0.14);
  text-align: center;
}

.first-run-kicker {
  display: inline-block;
  margin-bottom: 9px;
  color: #9d6c08;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.first-run-preview-badge {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(42, 171, 238, 0.12);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 850;
}

.first-run-card h1 {
  max-width: 310px;
  margin: 0 auto;
  font-size: clamp(28px, 8vw, 35px);
  line-height: 1.08;
}

.first-run-card h1 strong {
  display: block;
  color: #c18308;
  font-size: clamp(46px, 14vw, 62px);
  letter-spacing: -0.045em;
}

.first-run-card > p {
  max-width: 290px;
  margin: 13px auto 18px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}

.first-run-device,
.first-run-device-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 66px;
  padding: 11px 13px;
  border: 1px solid rgba(42, 171, 238, 0.18);
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.72);
  text-align: left;
}

.first-run-device {
  margin-bottom: 14px;
}

.first-run-device-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
  background: var(--surface-soft);
  font-size: 22px;
}

.first-run-device span:nth-child(2),
.first-run-device-summary span:nth-child(2) {
  display: grid;
  flex: 1;
  gap: 2px;
}

.first-run-device small,
.first-run-device-summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.first-run-device strong,
.first-run-device-summary strong {
  font-size: 16px;
  line-height: 1.25;
}

.first-run-primary {
  box-shadow: 0 12px 24px rgba(42, 171, 238, 0.22);
}

.first-run-card .secondary-button {
  margin-top: 10px;
}

.first-run-skip {
  margin-top: 5px;
  padding: 11px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
}

.first-run-footnote {
  margin: 0;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
}

.first-run-device-summary {
  margin: 6px 0 16px;
  background: var(--surface-soft);
}

.first-run-device-summary button {
  padding: 8px 0 8px 8px;
  border: 0;
  background: transparent;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.first-run-guided-exit {
  display: none;
  margin-top: 14px;
}

[data-private-app].first-run-guided .first-run-guided-exit {
  display: block;
}

[data-private-app].first-run-guided .app-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

[data-private-app].first-run-guided .app-choice {
  min-height: 116px;
  align-items: stretch;
  padding: 13px;
}

[data-private-app].first-run-guided .app-choice-main {
  align-items: flex-start;
  flex-direction: column;
  gap: 9px;
}

[data-private-app].first-run-guided .app-choice-check {
  position: absolute;
  top: 13px;
  right: 13px;
}

[data-private-app].first-run-guided .app-choice {
  position: relative;
}

.first-run-complete-panel {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(49, 170, 119, 0.25);
  border-radius: 18px;
  background: rgba(49, 170, 119, 0.08);
  text-align: center;
}

.first-run-complete-panel > strong {
  font-size: 17px;
}

.first-run-complete-panel > p {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

@media (max-width: 360px) {
  .first-run-card {
    padding: 22px 16px 17px;
  }

  .first-run-card h1 strong {
    font-size: 48px;
  }

  [data-private-app].first-run-guided .app-choice-grid {
    gap: 9px;
  }

  [data-private-app].first-run-guided .app-choice {
    min-height: 108px;
    padding: 11px;
  }

  [data-private-app].first-run-guided .app-choice small {
    font-size: 11px;
  }
}

@media (max-width: 360px) {
  .auth-header {
    gap: 8px;
    padding-inline: 2px;
  }

  .auth-brand {
    gap: 8px;
  }

  .auth-brand-label {
    font-size: 14px;
  }

  .auth-brand-app-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
  }

  .auth-brand-app-icon + .auth-brand-app-icon {
    margin-left: -7px;
  }

  .auth-service-status {
    gap: 5px;
    font-size: 10px;
  }
}

@media (max-height: 620px) {
  .auth-screen {
    gap: 16px;
  }
}

/* Optional design preview styles, enabled via body.design-preview. */
body.design-preview .app-shell {
  padding-top: calc(env(safe-area-inset-top) + 20px);
}

body.design-preview .topbar {
  position: relative;
  margin-bottom: 22px;
}

body.design-preview .topbar h1 {
  letter-spacing: 0;
}

body.design-preview .card,
body.design-preview .balance-panel {
  border-color: rgba(255, 255, 255, 0.74);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(250, 253, 255, 0.72));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 16px 34px rgba(41, 73, 105, 0.09);
}

body.design-preview .balance-panel {
  min-height: 168px;
  padding: 26px 24px 32px;
  background:
    radial-gradient(circle at 88% 18%, rgba(42, 171, 238, 0.34), transparent 31%),
    radial-gradient(circle at 74% 82%, rgba(34, 197, 150, 0.18), transparent 32%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(229, 247, 255, 0.9));
}

body.design-preview .balance-panel::before {
  left: 24px;
  right: 24px;
  bottom: 20px;
  background: rgba(104, 137, 166, 0.14);
}

body.design-preview .balance-panel::after {
  left: 24px;
  bottom: 20px;
  width: calc((100% - 48px) * var(--subscription-progress, 1));
  height: 6px;
  box-shadow: 0 5px 12px rgba(42, 171, 238, 0.18);
}

body.design-preview .balance-panel .muted {
  font-size: 15px;
  font-weight: 700;
}

body.design-preview .balance-panel strong {
  margin: 9px 0 7px;
  font-size: 52px;
}

body.design-preview [data-daily-cost] {
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: #5e7185;
  font-size: 14px;
}

body.design-preview .balance-card,
body.design-preview .devices-card,
body.design-preview .social-card {
  padding: 20px;
}

body.design-preview .balance-card .small-button,
body.design-preview .devices-card .small-button {
  min-height: 48px;
  padding-inline: 18px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(237, 248, 255, 0.96), rgba(223, 242, 255, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 8px 18px rgba(42, 171, 238, 0.08);
}

body.design-preview .balance-card .note {
  padding-left: 14px;
}

body.design-preview .balance-card .note::before {
  display: none;
}

body.design-preview .device-row::before {
  left: 64px;
  right: 2px;
}

body.design-preview .device-icon {
  width: 44px;
  height: 44px;
  font-size: 21px;
  text-transform: none;
}

body.design-preview .social-grid button {
  min-height: 52px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(237, 248, 255, 0.96), rgba(224, 243, 255, 0.82));
}

body.design-preview .amount-grid button {
  min-height: 52px;
  border-radius: 18px;
}

body.design-preview .amount-grid button.is-selected,
body.design-preview .primary-button {
  background: linear-gradient(180deg, #34b8f3 0%, #239fde 100%);
}

body.design-preview .payment-list {
  border-radius: 22px;
}

body.design-preview .payment-list button {
  min-height: 76px;
  padding: 14px;
}

body.design-preview .tabbar {
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 16px 36px rgba(41, 73, 105, 0.14);
}

body.design-preview .tabbar .is-active {
  background:
    linear-gradient(180deg, rgba(237, 248, 255, 0.96), rgba(222, 243, 255, 0.86));
}

.install-hero p {
  max-width: 420px;
  margin-inline: auto;
}

.install-card {
  display: grid;
  gap: 14px;
}

.install-step {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
}

.install-step h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.install-step .note {
  margin: 0;
}

.step-badge {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: rgba(42, 171, 238, 0.12);
  color: var(--accent-strong);
  font-weight: 800;
}

.app-step {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid rgba(120, 140, 160, 0.16);
}

.app-step h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.app-choice-grid {
  display: grid;
  gap: 12px;
  margin: 14px 0 20px;
}

.app-choice {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(120, 140, 160, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  text-align: left;
  box-shadow: none;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.app-choice-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.app-choice strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}

.app-choice small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.app-choice-check {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border: 2px solid rgba(120, 140, 160, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.app-choice.is-selected {
  border-color: rgba(42, 171, 238, 0.55);
  background: rgba(42, 171, 238, 0.1);
  box-shadow: 0 10px 24px rgba(42, 171, 238, 0.08);
}

.app-choice.is-selected .app-choice-check {
  border-color: var(--accent);
  background: radial-gradient(circle at center, var(--accent) 0 38%, rgba(255, 255, 255, 0.86) 42%);
}

.install-step-connect {
  padding-top: 8px;
  border-top: 1px solid rgba(120, 140, 160, 0.16);
}

.store-links {
  display: grid;
  gap: 8px;
}

.store-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(42, 171, 238, 0.12);
  border-radius: 14px;
  background: rgba(247, 251, 255, 0.72);
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.store-link span:last-child {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.store-link:active {
  transform: scale(0.985);
}

.apple-install-help {
  overflow: hidden;
  border: 1px solid rgba(42, 171, 238, 0.16);
  border-radius: 14px;
  padding: 0;
  background: rgba(247, 251, 255, 0.78);
}

.apple-install-help[hidden] {
  display: none;
}

.apple-install-help summary {
  min-height: 46px;
  padding: 12px 14px;
  color: var(--accent-strong);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.apple-install-help summary::marker {
  color: var(--accent-strong);
}

.apple-install-help-body {
  display: grid;
  gap: 12px;
  padding: 0 12px 12px;
}

.apple-install-help-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.apple-install-help-actions {
  display: grid;
  gap: 8px;
}

.apple-install-help-actions .secondary-button {
  min-height: 44px;
}

.secondary-button.install-client-button.is-apple-install {
  border: 1px solid rgba(62, 75, 91, 0.1);
  background: #f1f3f6;
  color: #283646;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

body.design-preview .secondary-button.install-client-button.is-apple-install:hover {
  background: #e9edf2;
  color: #1f2c3a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.manual-key-card {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(120, 140, 160, 0.16);
  padding-top: 14px;
}

.manual-key-card h3 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.25;
}

.manual-key-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.copy-key-button {
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: rgba(42, 171, 238, 0.1);
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 850;
  cursor: pointer;
}

.copy-key-button:active {
  transform: scale(0.985);
}

.device-transfer-button {
  margin-top: 10px;
}

.device-transfer-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(42, 171, 238, 0.24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(237, 245, 255, 0.82), rgba(255, 255, 255, 0.98));
}

.device-transfer-panel[aria-busy="true"] .device-transfer-qr-frame {
  opacity: 0.58;
}

.device-transfer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.device-transfer-heading h3 {
  margin: 0 0 5px;
  font-size: 18px;
  line-height: 1.2;
}

.device-transfer-heading .note {
  margin: 0;
}

.device-transfer-close {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(23, 33, 43, 0.06);
  color: var(--muted);
  font-size: 23px;
  line-height: 1;
}

.device-transfer-qr-frame {
  width: min(100%, 244px);
  margin-inline: auto;
  padding: 12px;
  border-radius: 18px;
  background:
    linear-gradient(var(--accent), var(--accent)) left 6px top 6px / 28px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left 6px top 6px / 3px 28px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right 6px top 6px / 28px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right 6px top 6px / 3px 28px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left 6px bottom 6px / 28px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left 6px bottom 6px / 3px 28px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right 6px bottom 6px / 28px 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right 6px bottom 6px / 3px 28px no-repeat,
    #ffffff;
  box-shadow: 0 12px 28px rgba(28, 82, 123, 0.12);
  transition: opacity 160ms ease;
}

.device-transfer-qr {
  min-height: 216px;
}

.device-transfer-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.device-transfer-timer {
  width: fit-content;
  margin: -2px auto 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(42, 171, 238, 0.1);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.device-transfer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.device-transfer-actions.is-single {
  grid-template-columns: 1fr;
}

[data-device-transfer-status]:empty {
  display: none;
}

[data-device-transfer-status].is-error {
  color: var(--danger);
}

[data-device-transfer-status].is-success {
  color: #16794c;
}

.happ-tv-pairing {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.happ-tv-heading {
  display: flex;
  align-items: center;
  gap: 11px;
}

.happ-tv-logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(30, 75, 115, 0.12);
}

.happ-tv-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.happ-tv-title-row h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.happ-tv-heading .note {
  margin: 4px 0 0;
}

.happ-tv-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(42, 171, 238, 0.11);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.happ-tv-steps {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  counter-reset: happ-tv-step;
  list-style: none;
}

.happ-tv-steps li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  counter-increment: happ-tv-step;
}

.happ-tv-steps li::before {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--accent-strong);
  content: counter(happ-tv-step);
  font-size: 12px;
  font-weight: 900;
}

.happ-tv-code-label {
  margin: 2px 0 -4px;
}

.happ-tv-code-input {
  min-height: 58px;
  margin-bottom: 0;
  padding-inline: 18px 10px;
  border-color: rgba(42, 171, 238, 0.35);
  background: linear-gradient(180deg, #ffffff, rgba(237, 245, 255, 0.7));
  color: var(--text);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0.34em;
  text-align: center;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

[data-happ-tv-submit]:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.happ-tv-code-input::placeholder {
  color: #9aabba;
  opacity: 0.62;
}

.happ-tv-status {
  margin: 0;
}

.happ-tv-status:empty {
  display: none;
}

.happ-tv-status.is-error {
  color: var(--danger);
}

.happ-tv-status.is-success {
  color: #16794c;
}

@media (max-width: 360px) {
  .device-transfer-actions {
    grid-template-columns: 1fr;
  }

  .device-transfer-qr {
    min-height: 200px;
  }

  .happ-tv-code-input {
    font-size: 22px;
    letter-spacing: 0.28em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .device-transfer-qr-frame {
    transition: none;
  }
}

.payment-fallback-link {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  border: 1px solid rgba(42, 171, 238, 0.3);
  border-radius: 14px;
  background: rgba(42, 171, 238, 0.08);
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.payment-fallback-link:active {
  transform: scale(0.985);
}

body.balance-required-dialog-open {
  overflow: hidden;
}

.balance-required-dialog {
  width: min(calc(100% - 32px), 398px);
  max-width: 398px;
  max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 32px);
  margin: auto;
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(123, 153, 184, 0.24);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: 0 24px 70px rgba(20, 48, 75, 0.28);
  animation: balance-required-dialog-in 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.balance-required-dialog::backdrop {
  background: rgba(18, 38, 58, 0.48);
  backdrop-filter: blur(4px);
  animation: balance-required-backdrop-in 160ms ease-out;
}

.balance-required-dialog-content {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
}

.balance-required-dialog-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(42, 171, 238, 0.16), rgba(53, 199, 164, 0.18));
  color: var(--accent-strong);
  font-size: 27px;
  font-weight: 800;
}

.balance-required-dialog h2 {
  margin: 2px 0 0;
  font-size: 24px;
  line-height: 1.15;
}

.balance-required-dialog p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
  text-wrap: balance;
}

.balance-required-dialog-actions {
  display: grid;
  width: 100%;
  gap: 10px;
  margin-top: 6px;
}

.balance-required-dialog-actions button {
  min-height: 50px;
}

@keyframes balance-required-dialog-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes balance-required-backdrop-in {
  from {
    background: rgba(18, 38, 58, 0);
  }
}

@media (max-width: 520px) {
  .balance-required-dialog {
    width: calc(100% - 24px);
    max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 24px);
    margin: auto 12px calc(env(safe-area-inset-bottom) + 12px);
    border-radius: 24px 24px 20px 20px;
  }

  .balance-required-dialog-content {
    padding: 22px 20px 20px;
  }
}

.app-toast {
  position: fixed;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 92px);
  left: 16px;
  z-index: 100;
  display: grid;
  width: min(calc(100% - 32px), 398px);
  gap: 3px;
  margin: 0 auto;
  padding: 13px 15px;
  border: 1px solid rgba(22, 121, 76, 0.2);
  border-radius: 16px;
  background: rgba(239, 252, 246, 0.98);
  box-shadow: 0 14px 36px rgba(30, 75, 115, 0.2);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.app-toast.is-error {
  border-color: rgba(229, 91, 100, 0.24);
  background: rgba(255, 244, 245, 0.98);
}

.app-toast strong {
  color: #16794c;
  font-size: 14px;
}

.app-toast.is-error strong {
  color: var(--danger);
}

.app-toast span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .app-toast,
  .balance-required-dialog,
  .balance-required-dialog::backdrop {
    animation: none;
    transition: none;
  }
}

.payment-fallback-link[hidden] {
  display: none;
}

/* Connection-copy refinement: preserve the existing cabinet visual language. */
[data-subscription-title] { color: var(--text); font-weight: 600; }
.balance-panel.has-no-duration [data-subscription-title] { display: block; font-size: 23px; line-height: 1.2; font-weight: 700; }
.subscription-hint { display: block; margin-top: 10px; color: #5b6676; font-size: 14px; line-height: 1.45; }
.subscription-heading { display: flex; align-items: center; gap: 8px; }
.subscription-inactive-icon { flex: 0 0 22px; color: #b4232c; }
.balance-panel.is-inactive,
body.design-preview .balance-panel.is-inactive { border-color: #ecc6ca; background: #fff2f3; }
.balance-panel.is-inactive [data-subscription-title],
body.design-preview .balance-panel.is-inactive [data-subscription-title] { color: #b4232c; }
.balance-panel.is-inactive .subscription-hint { color: #8a3c44; }
.devices-card .device-section-head { flex-wrap: nowrap; align-items: center; gap: 12px; }
.devices-card .device-section-head h2 { display: flex; align-items: center; gap: 8px; flex: 1 1 0; min-width: 0; font-size: 18px; line-height: 1.25; white-space: normal; }
.device-section-label { min-width: 0; }
.devices-card .device-section-hint {
  margin: 0 0 14px;
  color: #536478;
  font-size: 14px;
  line-height: 20px;
}
.device-count-badge { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; min-width: 24px; min-height: 24px; padding: 3px 7px; border-radius: 8px; background: #e9eef4; color: #536478; font-size: 13px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
/* Shared geometry for the two cabinet actions; other buttons are unchanged. */
body [data-screen="home"] :is(.balance-card [data-go="topup"], .devices-card [data-device-action]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 124px;
  width: 124px;
  min-height: 52px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: #edf5ff;
  color: #155f8a;
  box-shadow: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
  text-transform: none;
  white-space: normal;
  transform: none;
}

body [data-screen="home"] .devices-card [data-device-action] {
  border: 2px solid #1676aa;
  padding: 6px 8px;
}

body [data-screen="home"] :is(.balance-card [data-go="topup"], .devices-card [data-device-action]):focus-visible {
  outline: 3px solid #155f8a;
  outline-offset: 3px;
}

/* The existing subscription state controls emphasis without changing behavior. */
body [data-screen="home"] .balance-panel.is-inactive + .balance-card [data-go="topup"] {
  background: #1676aa;
  color: #fff;
}

@media (hover: hover) {
  body [data-screen="home"] :is(.balance-card [data-go="topup"], .devices-card [data-device-action]):hover {
    background: #e2eefb;
  }

  body [data-screen="home"] .balance-panel.is-inactive + .balance-card [data-go="topup"]:hover {
    background: #116796;
  }
}

body [data-screen="home"] :is(.balance-card [data-go="topup"], .devices-card [data-device-action]):active {
  background: #d5e6f6;
  transform: none;
}

body [data-screen="home"] .balance-panel.is-inactive + .balance-card [data-go="topup"]:active {
  background: #0d567f;
}

body [data-screen="home"] :is(.balance-card [data-go="topup"], .devices-card [data-device-action]):disabled {
  background: #e9eef4;
  color: #536478;
  cursor: not-allowed;
}

body [data-screen="home"] .balance-panel.is-inactive + .balance-card [data-go="topup"]:disabled {
  background: #e9eef4;
  color: #536478;
}

[data-subscription-duration] { overflow-wrap: anywhere; }
@media (max-width: 360px) {
  .devices-card .device-section-head { gap: 8px; }
  .devices-card .device-section-head h2 { font-size: 16px; }
}
