#rub-tab {
  position: relative;
  isolation: isolate;
  padding-top: 8px;
}

#rub-tab[hidden] {
  display: none;
}

#rub-tab .rub-service-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 13, 18, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#rub-tab .rub-service-overlay[hidden] {
  display: none;
}

#rub-tab .rub-service-overlay-message {
  width: min(100%, 340px);
  padding: 20px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--bg-elevated);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

#rub-tab .rub-tab-heading {
  margin: 0 0 20px;
}

#rub-tab .rub-tab-heading h1 {
  margin: 0;
  color: var(--ink);
  font-family: 'Sora', sans-serif;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.2;
}

#rub-tab .rub-tab-heading p {
  margin: 7px 0 0;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

#rub-tab .rub-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#rub-tab .rub-field-label {
  display: block;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

#rub-tab .rub-amount-card,
#rub-tab .rub-rate-card,
#rub-tab .rub-bank-field,
#rub-tab .rub-text-field,
#rub-tab .rub-conditions {
  width: 100%;
  border: 1.5px solid var(--line);
  background: var(--bg-card);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

#rub-tab .rub-amount-card {
  min-height: 136px;
  border-radius: var(--radius-card);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

#rub-tab .rub-amount-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 230, 118, 0.3), transparent);
}

#rub-tab .rub-amount-card:focus-within,
#rub-tab .rub-text-field:focus-within {
  border-color: rgba(0, 230, 118, 0.4);
  background: var(--bg-elevated);
}

#rub-tab .rub-amount-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-top: 12px;
}

#rub-tab #rubAmount {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--accent);
  font-family: 'Sora', sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  outline: none;
}

#rub-tab #rubAmount::placeholder {
  color: var(--ink);
  opacity: 1;
}

#rub-tab .rub-currency {
  padding-bottom: 4px;
  color: var(--accent);
  font-family: 'Sora', sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

#rub-tab .rub-amount-hint {
  display: block;
  margin-top: 10px;
  color: var(--ink-3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.2;
}

#rub-tab .rub-rate-card {
  min-height: 70px;
  border-radius: 16px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

#rub-tab .rub-rate-icon,
#rub-tab .rub-bank-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

#rub-tab .rub-rate-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #00c853, #00e676);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 230, 118, 0.22);
}

#rub-tab .rub-rate-icon .icon {
  width: 27px;
  height: 27px;
}

#rub-tab .rub-rate-copy {
  min-width: 0;
  display: grid;
  gap: 5px;
}

#rub-tab .rub-rate-copy > span {
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#rub-tab .rub-rate-copy strong {
  color: var(--ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 600;
  line-height: 1;
  transition: color 180ms ease;
}

#rub-tab .rub-rate-copy strong.rate-up {
  color: #ff6b6b;
}

#rub-tab .rub-rate-copy strong.rate-down {
  color: var(--accent);
}

#rub-tab .rub-rate-status {
  max-width: 80px;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.25;
  text-align: right;
}

#rub-tab .rub-rate-status.is-error {
  color: var(--red);
}

#rub-tab .rub-bank-field {
  min-height: 82px;
  border-radius: 16px;
  padding: 12px 14px 10px;
  position: relative;
  z-index: 5;
}

#rub-tab .rub-bank-field.is-open {
  z-index: 50;
  border-color: rgba(0, 230, 118, 0.4);
  background: var(--bg-elevated);
}

#rub-tab .rub-bank-trigger {
  width: 100%;
  min-height: 48px;
  border: 0;
  padding: 5px 0 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

#rub-tab .rub-bank-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--bank-color, var(--bg-elevated));
  color: #fff;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--bank-color, var(--accent)) 28%, transparent);
}

#rub-tab .rub-bank-icon--empty {
  color: var(--ink-3);
  box-shadow: none;
}

#rub-tab .rub-bank-icon .icon {
  width: 22px;
  height: 22px;
}

#rub-tab .rub-bank-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#rub-tab .rub-bank-placeholder {
  color: var(--ink-3);
  font-weight: 400;
}

#rub-tab .rub-bank-arrow {
  width: 26px;
  height: 26px;
  color: var(--accent);
  justify-self: end;
  transition: transform 180ms ease;
}

#rub-tab .rub-bank-field.is-open .rub-bank-arrow {
  transform: rotate(180deg);
}

#rub-tab .rub-bank-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  left: 0;
  z-index: 40;
  max-height: 250px;
  border: 1.5px solid rgba(0, 230, 118, 0.22);
  border-radius: 16px;
  padding: 6px;
  background: rgba(14, 26, 34, 0.99);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.48);
  overflow-y: auto;
}

#rub-tab .rub-bank-option {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 11px;
  padding: 6px 10px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  font-family: 'Sora', sans-serif;
  font-size: 15px;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

#rub-tab .rub-bank-option:hover,
#rub-tab .rub-bank-option[aria-selected="true"] {
  background: var(--accent-faint);
}

#rub-tab .rub-bank-option-check {
  width: 22px;
  height: 22px;
  color: transparent;
}

#rub-tab .rub-bank-option[aria-selected="true"] .rub-bank-option-check {
  color: var(--accent);
}

#rub-tab .rub-text-field {
  min-height: 72px;
  border-radius: 16px;
  padding: 0 15px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
}

#rub-tab .rub-text-field-icon {
  width: 25px;
  height: 25px;
  color: var(--accent);
  justify-self: center;
  opacity: 0.85;
}

#rub-tab .rub-text-control {
  min-width: 0;
  display: grid;
  gap: 6px;
}

#rub-tab .rub-text-control input {
  width: 100%;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  caret-color: var(--accent);
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.2;
  outline: none;
}

#rub-tab .rub-text-control input::placeholder {
  color: var(--ink-3);
  font-weight: 300;
  opacity: 1;
}

#rub-tab .rub-phone-control {
  min-width: 0;
  display: flex;
  align-items: center;
}

#rub-tab .rub-phone-prefix {
  color: var(--ink-2);
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
}

#rub-tab #rubPhone {
  font-family: 'JetBrains Mono', monospace;
}

#rub-tab .rub-conditions {
  min-width: 0;
  margin: 2px 0 0;
  border-radius: 16px;
  padding: 14px;
  display: grid;
  gap: 12px;
}

#rub-tab .rub-conditions legend {
  padding: 0 6px;
  color: var(--ink-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

#rub-tab .rub-condition {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  color: var(--ink-2);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}

#rub-tab .rub-condition-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

#rub-tab .rub-checkbox {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ink-3);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: transparent;
  display: grid;
  place-items: center;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
}

#rub-tab .rub-checkbox .icon {
  width: 16px;
  height: 16px;
}

#rub-tab .rub-condition-input:focus-visible + .rub-checkbox {
  outline: 2px solid rgba(0, 230, 118, 0.45);
  outline-offset: 2px;
}

#rub-tab .rub-condition-input:checked + .rub-checkbox {
  border-color: var(--accent);
  background: var(--accent);
  color: #071210;
}

#rub-tab .rub-submit {
  width: 100%;
  min-height: 60px;
  margin-top: 10px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #071210;
  cursor: pointer;
  font-family: 'Sora', sans-serif;
  font-size: 17px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 24px rgba(0, 230, 118, 0.28), 0 1px 0 rgba(255, 255, 255, 0.15) inset;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
  -webkit-tap-highlight-color: transparent;
}

#rub-tab .rub-submit:active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 2px 12px rgba(0, 230, 118, 0.2);
}

#rub-tab .rub-submit.is-loading {
  background: var(--bg-elevated);
  color: var(--ink-2);
  box-shadow: none;
}

#rub-tab .rub-amount-card.field-error,
#rub-tab .rub-bank-field.field-error,
#rub-tab .rub-text-field.field-error,
#rub-tab .rub-conditions.field-error {
  border-color: var(--red);
  background: rgba(255, 61, 110, 0.05);
  box-shadow: 0 0 0 3px var(--red-dim);
  animation: rubFieldShake 240ms ease;
}

#rub-tab .rub-conditions.field-error .rub-checkbox {
  border-color: var(--red);
}

@keyframes rubFieldShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@media (max-width: 360px) {
  #rub-tab .rub-tab-heading h1 {
    font-size: 22px;
  }

  #rub-tab #rubAmount {
    font-size: 42px;
  }

  #rub-tab .rub-rate-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  #rub-tab .rub-rate-status {
    display: none;
  }

  #rub-tab .rub-text-control input,
  #rub-tab .rub-phone-prefix {
    font-size: 14px;
  }
}
