:root {
  color-scheme: light;
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1a1a20;
  background: #e6e6ea;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #e6e6ea;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: #e6e6ea;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(75, 69, 201, 0.3);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  padding-bottom: max(40px, env(safe-area-inset-bottom));
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 68px;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(230, 230, 234, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  background: #f7f7f9;
  color: #5f5bea;
  font-family: Outfit, sans-serif;
  font-size: 18px;
  font-weight: 700;
}

.brand-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mode-switch {
  display: flex;
  min-height: 44px;
  flex: none;
  align-items: center;
  gap: 9px;
  padding: 7px 10px 7px 12px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 999px;
  background: #f7f7f9;
  color: #3f3f4a;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.mode-switch:hover {
  border-color: rgba(75, 69, 201, 0.26);
  background: #fff;
}

.mode-switch__label {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mode-switch__track {
  position: relative;
  display: block;
  width: 40px;
  height: 24px;
  flex: none;
  border-radius: 999px;
  background: #5f5bea;
}

.mode-switch__knob {
  position: absolute;
  top: 3px;
  left: 19px;
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}

.content {
  padding: 16px;
}

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: enter 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

.balance-panel,
.support-panel,
.tariffs-panel,
.action-row,
.state-panel {
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  background: #f7f7f9;
}

.balance-panel {
  padding: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

#balance-heading {
  margin: 0;
  color: #6f6f7a;
  font-size: 13px;
  font-weight: 700;
}

.balance-value {
  display: flex;
  min-height: 56px;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

#balance-value {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: Outfit, sans-serif;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
}

.balance-currency {
  color: #8a8a96;
  font-size: 22px;
  font-weight: 600;
}

.tariffs-panel {
  padding: 18px;
}

.tariffs-panel h2 {
  margin: 0;
  font-size: 16px;
}

.tariffs-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tariff-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  font-size: 14px;
}

.tariffs-list > .tariff-item:first-child {
  padding-top: 0;
  border-top: none;
}

.tariff-item__name {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
  color: #5c5c68;
}

.tariff-item__expiry {
  overflow-wrap: anywhere;
  color: #1a1a20;
  text-align: right;
}

.tariff-item__empty {
  margin: 0;
  color: #7a7a86;
  font-size: 13px;
}

.tariff-item__dot {
  display: block;
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #22a35e;
}

.tariff-item__dot--expired {
  background: #dc3545;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.primary-button {
  padding: 0 22px;
  background: #5f5bea;
  color: #fff;
  box-shadow: 0 6px 18px -8px rgba(75, 69, 201, 0.8);
  transition: background-color 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: #4b45c9;
}

.primary-button:active {
  transform: translateY(1px);
}

.primary-button--pay {
  width: 100%;
  margin-top: 14px;
  font-size: 16px;
}

.secondary-button {
  padding: 0 22px;
  border: 1px solid rgba(75, 69, 201, 0.25);
  background: #fff;
  color: #4b45c9;
}

.action-row {
  display: flex;
  width: 100%;
  min-height: 72px;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.action-row:hover,
.support-row:hover {
  border-color: rgba(75, 69, 201, 0.3);
  background: #fff;
}

.action-icon,
.support-icon,
.state-icon {
  display: grid;
  flex: none;
  place-items: center;
  color: #4b45c9;
}

.action-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(111, 107, 240, 0.12);
}

.action-icon svg,
.support-icon svg,
.state-icon svg,
.chevron {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.action-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 2px;
}

.action-copy strong {
  font-size: 15px;
}

.action-copy span {
  color: #7a7a86;
  font-size: 13px;
}

.chevron {
  flex: none;
  color: #a3a3ad;
}

.support-panel {
  padding: 18px;
}

.support-panel h2 {
  margin: 0;
  font-size: 16px;
}

.support-panel > p {
  margin: 4px 0 0;
  color: #7a7a86;
  font-size: 13px;
  line-height: 1.45;
}

.support-actions {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}

.support-row {
  display: flex;
  min-height: 52px;
  align-items: center;
  gap: 11px;
  padding: 0 13px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: border-color 160ms ease;
}

.support-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(111, 107, 240, 0.12);
}

.support-icon--telegram {
  background: rgba(41, 161, 219, 0.12);
  color: #1e8bbd;
}

.support-icon svg {
  width: 16px;
  height: 16px;
}

.support-row strong {
  min-width: 0;
  flex: 1;
  font-size: 14px;
}

.support-meta {
  color: #8a8a96;
  font-size: 12px;
}

.state-panel {
  display: flex;
  min-height: 300px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 28px 22px;
  text-align: center;
}

.state-panel h1 {
  margin: 16px 0 0;
  font-size: 20px;
}

.state-panel p {
  max-width: 300px;
  margin: 8px 0 20px;
  color: #6f6f7a;
  font-size: 14px;
  line-height: 1.5;
}

.state-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: rgba(111, 107, 240, 0.12);
}

.state-icon--error {
  background: rgba(190, 55, 55, 0.1);
  color: #a72d2d;
  font-size: 24px;
  font-weight: 800;
}

.connection {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: enter 280ms cubic-bezier(0.16, 1, 0.3, 1);
}

.page-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title-row h1 {
  margin: 0;
  font-size: 20px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: #f7f7f9;
  color: #3f3f4a;
  cursor: pointer;
}

.icon-button:hover {
  background: #fff;
}

.icon-button svg,
.outline-button svg,
.step-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.platform-banner {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(111, 107, 240, 0.35);
  border-radius: 14px;
  background: rgba(111, 107, 240, 0.14);
  color: #4b45c9;
  font-size: 14px;
}

.platform-banner__dot {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: #5f5bea;
}

.platform-banner strong {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.platform-banner button {
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: #4b45c9;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

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

.app-option {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  background: #f7f7f9;
  color: #3f3f4a;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.app-option.is-active {
  border: 1.5px solid rgba(111, 107, 240, 0.6);
  background: rgba(111, 107, 240, 0.16);
  color: #4b45c9;
}

.app-option__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
}

.app-option.is-active .app-option__dot {
  background: #c08f11;
}

.video-row {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  background: #f7f7f9;
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.video-row:hover {
  border-color: rgba(111, 107, 240, 0.4);
  background: #fff;
}

.video-preview {
  position: relative;
  display: block;
  width: 96px;
  height: 62px;
  flex: none;
  overflow: hidden;
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, #e9e9ef 0 6px, #e0e0e8 6px 12px);
}

.video-play {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: #6f6bf0;
  box-shadow: 0 4px 12px -4px rgba(111, 107, 240, 0.7);
  transform: translate(-50%, -50%);
}

.video-play svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

.video-copy {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.video-copy strong {
  font-size: 15px;
}

.video-copy > span {
  color: #7a7a86;
  font-size: 13px;
  line-height: 1.4;
}

.step-panel {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 16px;
  background: #f7f7f9;
}

.step-icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: none;
  place-items: center;
  border-radius: 12px;
  background: rgba(111, 107, 240, 0.14);
  color: #5f5bea;
}

.step-icon--download {
  background: rgba(41, 161, 219, 0.14);
  color: #1e8bbd;
}

.step-icon--done {
  background: rgba(34, 163, 94, 0.14);
  color: #178048;
}

.step-copy {
  min-width: 0;
  flex: 1;
}

.step-label {
  color: #8a8a96;
  font-size: 12px;
  font-weight: 700;
}

.step-copy h2 {
  margin: 3px 0 0;
  font-size: 16px;
}

.step-copy p {
  margin: 5px 0 0;
  color: #6f6f7a;
  font-size: 14px;
  line-height: 1.45;
}

.outline-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 12px;
  border: 1.5px solid rgba(111, 107, 240, 0.5);
  border-radius: 14px;
  background: #fff;
  color: #4b45c9;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.outline-button:hover {
  background: rgba(111, 107, 240, 0.08);
}

.connection-action {
  width: 100%;
  margin-top: 12px;
}

.connection-action + .connection-action {
  margin-top: 8px;
}

.connection-action.is-disabled,
.connection-action.is-loading,
.connection-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.connection-error {
  color: #a72d2d !important;
  font-size: 13px !important;
}

.help-button {
  width: 100%;
  color: #3f3f4a;
  text-decoration: none;
}

.qr-sheet {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.qr-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 26, 0.45);
}

.qr-sheet__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  padding: 20px 20px max(28px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: #f7f7f9;
  animation: enter 240ms cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
}

.qr-sheet__handle {
  width: 44px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.15);
}

.qr-sheet h2 {
  margin: 0;
  font-size: 18px;
}

.qr-sheet p {
  margin: 4px auto 0;
  color: #6f6f7a;
  font-size: 13px;
  line-height: 1.4;
}

.qr-code {
  display: grid;
  width: 230px;
  min-height: 230px;
  margin: 18px auto 0;
  padding: 10px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: #fff;
}

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

.qr-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.qr-link {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: #8a8a96;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qr-copy {
  display: grid;
  width: 34px;
  height: 34px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: #fff;
  color: #4b45c9;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.qr-copy svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qr-copy:hover {
  border-color: rgba(111, 107, 240, 0.4);
}

.qr-copy.is-copied {
  border-color: rgba(34, 163, 94, 0.35);
  background: rgba(34, 163, 94, 0.12);
  color: #178048;
}

.qr-link-row.is-empty {
  display: none;
}

.qr-close {
  width: 100%;
  margin-top: 16px;
}

body.has-dialog {
  overflow: hidden;
}

.spinner {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(75, 69, 201, 0.17);
  border-top-color: #5f5bea;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

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

.text-field {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: #fff;
  color: #1a1a20;
  font: inherit;
  font-size: 14px;
}

.text-field:focus-visible {
  border-color: rgba(111, 107, 240, 0.5);
}

.textarea-field {
  min-height: 96px;
  resize: vertical;
}

.amount-field {
  position: relative;
  display: block;
  margin-top: 14px;
}

.amount-field input {
  width: 100%;
  height: 56px;
  padding: 0 40px 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  background: #fff;
  color: #1a1a20;
  font: inherit;
  font-family: Outfit, sans-serif;
  font-size: 22px;
  font-weight: 700;
}

.amount-field input:focus-visible {
  border-color: rgba(111, 107, 240, 0.5);
}

.amount-field__suffix {
  position: absolute;
  top: 50%;
  right: 16px;
  color: #8a8a96;
  font-size: 16px;
  font-weight: 600;
  transform: translateY(-50%);
}

.quick-amounts,
.options-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.options-row {
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
}

.quick-amount,
.option-chip {
  min-height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: #fff;
  color: #3f3f4a;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.quick-amount.is-active,
.option-chip.is-active {
  border-color: rgba(111, 107, 240, 0.6);
  background: rgba(111, 107, 240, 0.14);
  color: #4b45c9;
}

.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.tickets-empty {
  margin-top: 14px;
  color: #7a7a86;
  font-size: 13px;
  text-align: center;
}

.ticket-item {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  background: #f7f7f9;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.ticket-item:hover {
  border-color: rgba(111, 107, 240, 0.3);
  background: #fff;
}

.ticket-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ticket-item__title {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-item__status {
  flex: none;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(111, 107, 240, 0.14);
  color: #4b45c9;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ticket-item__status--closed {
  background: rgba(0, 0, 0, 0.06);
  color: #6f6f7a;
}

.ticket-item__preview {
  overflow: hidden;
  color: #7a7a86;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
}

.ticket-messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.ticket-message {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  background: #f7f7f9;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ticket-message--admin {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: #f7f7f9;
}

.ticket-message--user {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: rgba(111, 107, 240, 0.14);
}

.ticket-message time {
  display: block;
  margin-top: 4px;
  color: #8a8a96;
  font-size: 11px;
}

.ticket-reply textarea {
  margin-top: 0;
}

.ticket-reply .primary-button {
  margin-top: 10px;
}

@media (max-width: 370px) {
  .brand-name {
    display: none;
  }

  .support-meta {
    display: none;
  }
}

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