/* ============================================
   MODERN VPN DASHBOARD - Commercial Quality v3
   ============================================ */

/* ========== LOADING ANIMATIONS ========== */
@keyframes skeleton-loading {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

@keyframes fade-slide-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 174, 87, 0.25), 0 0 0 rgba(244, 174, 87, 0.15); }
  50% { box-shadow: 0 0 0 2px rgba(244, 174, 87, 0.28), 0 0 24px rgba(244, 174, 87, 0.28); }
}

@keyframes cta-sweep {
  0% { transform: translateX(-140%); }
  100% { transform: translateX(170%); }
}

:root {
  --bg: #0d1925;
  --surface: #122537;
  --surface-elevated: #193146;
  --surface-hover: #23435c;
  --ink: #fae8c1;
  --muted: rgba(250, 232, 193, 0.72);
  --line: rgba(244, 174, 87, 0.22);
  --accent: #f4ae57;
  --accent-hover: #e5901c;
  --accent-light: rgba(244, 174, 87, 0.16);
  --accent-contrast: #0d1925;
  --accent-soft: #fae8c1;
  --cream: #fee6b6;
  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.15);
  --danger: #97220c;
  --danger-light: rgba(151, 34, 12, 0.16);
  --shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
  --shadow-lg: 0 24px 48px rgba(0, 0, 0, 0.42);
  --shadow-success: 0 0 20px rgba(16, 185, 129, 0.3);
  --shadow-glow: 0 0 28px rgba(244, 174, 87, 0.22);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-xs: 4px;

  /* Status colors */
  --status-online: #10b981;
  --status-degraded: #f59e0b;
  --status-offline: #b23a2b;
  --status-checking: #6b7280;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Lato", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(244, 174, 87, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(151, 34, 12, 0.18), transparent 22%),
    linear-gradient(180deg, #112131 0%, #0d1925 100%);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
  font-family: "Montserrat", "Lato", sans-serif;
  letter-spacing: 0.01em;
}

.site-shell {
  padding: 22px 16px 48px;
}

.site-brandbar {
  max-width: 1280px;
  margin: 0 auto 18px;
}

.site-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.site-brand-logo {
  width: 88px;
  min-width: 88px;
  height: auto;
  display: block;
}

.site-brand-copy {
  display: grid;
  gap: 2px;
}

.site-brand-name {
  font-family: "Montserrat", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-soft);
}

.site-brand-tagline {
  font-family: "Oswald", sans-serif;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border: none;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--surface-elevated);
  color: var(--ink);
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface-hover);
  color: var(--muted);
  box-shadow: none;
}

.btn.primary:disabled {
  background: var(--surface-hover);
  color: var(--muted);
  box-shadow: none;
}

.btn.primary:disabled:hover {
  transform: none;
}

.btn svg {
  flex-shrink: 0;
}

.btn.primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow-glow);
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.34);
}

.btn.secondary {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
}

.btn.secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--ink);
}

.btn.ghost {
  background: transparent;
  color: var(--muted);
}

.btn.text {
  background: transparent;
  color: var(--accent);
  padding: 0 12px;
  font-weight: 600;
}

.btn.text:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.btn.large {
  min-height: 44px;
  padding: 0 20px;
  font-size: 1rem;
  width: 100%;
  border-radius: var(--radius);
}

.btn.small {
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.84rem;
  width: auto;
}

.cta-attention {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn.cta-attention {
  animation: cta-pulse 2.3s ease-in-out infinite;
}

.subscription-rail-link.cta-attention {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(244, 174, 87, 0.24);
  background: rgba(244, 174, 87, 0.12);
  animation: cta-pulse 2.3s ease-in-out infinite;
}

.cta-attention::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255, 255, 255, 0.26) 48%, transparent 76%);
  transform: translateX(-140%);
  animation: cta-sweep 2.8s ease-in-out infinite;
  pointer-events: none;
}

.btn.cta-attention:disabled,
.btn.cta-attention:disabled::after {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .cta-attention,
  .cta-attention::after {
    animation: none !important;
  }
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]),
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  color: var(--ink);
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"])::placeholder,
textarea::placeholder {
  color: #afb0b1;
}

input:not([type="range"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="color"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ========== SECTIONS ========== */
.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.section-title.small {
  font-size: 1rem;
}

.section-title.center {
  text-align: center;
}

.section-subtitle {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 24px;
}

.section-subtitle.center {
  text-align: center;
}

.section-header {
  margin-bottom: 20px;
}

.section-hint {
  color: var(--muted);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

/* ========== AUTH ========== */
.auth-card {
  max-width: 440px;
  margin: clamp(36px, 7vh, 84px) auto 0;
  padding: clamp(22px, 4vw, 30px);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(22, 39, 54, 0.98) 0%, rgba(14, 28, 41, 0.99) 100%);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.auth-copy {
  display: grid;
  gap: 10px;
  margin-bottom: 24px;
}

.auth-card h1 {
  color: var(--accent-soft);
  font-size: 2rem;
  line-height: 1.2;
  margin: 0;
}

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

.auth-brand-logo {
  width: 96px;
  min-width: 96px;
  display: block;
}

.auth-brand-copy {
  display: grid;
  gap: 4px;
}

.auth-brand-tagline {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  font-family: "Oswald", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}

.lead {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 34rem;
}

.stack {
  display: grid;
}

.gap-md {
  gap: 16px;
}

.gap-sm {
  gap: 12px;
}

.auth-submit {
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  margin-top: 2px;
  border-radius: var(--radius-sm);
  font-family: "Montserrat", "Lato", sans-serif;
  font-size: 0.94rem;
  font-weight: 800;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.25;
  padding: 10px 14px;
}

.auth-submit.auth-submit-compact {
  min-height: 44px;
  font-size: 0.9rem;
}

.auth-helper-text {
  margin: -2px 0 0;
  color: rgba(169, 175, 181, 0.92);
  font-size: 0.82rem;
  line-height: 1.55;
}

.auth-helper-text strong {
  color: rgba(234, 218, 190, 0.94);
  font-weight: 700;
}

.legacy-auth {
  margin-top: 22px;
  border-top: 1px solid rgba(244, 174, 87, 0.16);
  padding-top: 18px;
  text-align: start;
}

.legacy-auth-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.small-link {
  color: var(--accent);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 700;
}

.small-link:hover {
  text-decoration: underline;
}

.help-text {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
}

.auth-form-compact label span {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.auth-form-compact,
.telegram-auth-state,
.registration-flow {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.auth-form-compact > *,
.telegram-auth-state > * {
  min-width: 0;
}

.registration-state-card {
  border: 1px solid rgba(244, 174, 87, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(18, 37, 55, 0.38);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.registration-state-card .section-title {
  margin-bottom: 0;
}

.registration-copy {
  margin: 0;
}

.registration-secondary-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.registration-secondary-links .small-link {
  overflow-wrap: anywhere;
}

.small-link.small-link-muted {
  color: var(--muted);
  font-weight: 600;
}

.small-link.small-link-muted:hover {
  color: var(--accent);
}

.intl-phone-shell {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-elevated);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  cursor: text;
  overflow: hidden;
  position: relative;
}

.intl-phone-shell:hover {
  border-color: rgba(244, 174, 87, 0.36);
}

.intl-phone-shell:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.intl-phone-shell.has-error {
  border-color: rgba(178, 58, 43, 0.65);
}

.intl-phone-country-trigger {
  flex: 0 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 102px;
  gap: 8px;
  padding: 0 12px;
  border-right: 1px solid rgba(212, 215, 218, 0.18);
  border-top: 0;
  border-left: 0;
  border-bottom: 0;
  background: transparent;
  color: var(--accent-soft);
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1;
  cursor: pointer;
}

.intl-phone-country-trigger:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.02);
}

.intl-phone-country-flag {
  font-size: 1rem;
  line-height: 1;
}

.intl-phone-country-dial {
  font-size: 0.88rem;
  color: var(--ink);
  font-weight: 700;
}

.intl-phone-country-caret {
  font-size: 0.74rem;
  color: var(--muted);
}

.intl-phone-input {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  border-radius: 0 !important;
  flex: 1 1 auto;
  width: auto !important;
  min-width: 0;
  padding: 10px 12px !important;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.intl-phone-input::placeholder {
  color: #afb0b1;
  opacity: 1;
}

.intl-phone-input:disabled {
  cursor: not-allowed;
  color: rgba(169, 175, 181, 0.82);
}

.intl-country-popover {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, rgba(22, 39, 54, 0.98) 0%, rgba(14, 28, 41, 0.99) 100%);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.34);
  padding: 8px;
}

.intl-country-search {
  margin-bottom: 8px;
  font-size: 0.88rem;
}

.intl-country-list {
  max-height: 220px;
  overflow: auto;
  display: grid;
  gap: 4px;
}

.intl-country-option {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
}

.intl-country-option:hover,
.intl-country-option.is-selected {
  border-color: rgba(244, 174, 87, 0.26);
  background: rgba(244, 174, 87, 0.08);
}

.intl-country-option-name {
  font-size: 0.85rem;
}

.intl-country-option-code {
  color: var(--muted);
  font-size: 0.82rem;
}

.telegram-auth-state {
  text-align: left;
  display: grid;
  gap: 10px;
}

.telegram-pending-copy {
  margin-top: -2px;
  margin-bottom: 2px;
}

.telegram-pending-actions .auth-submit {
  margin-top: 0;
}

.telegram-open-btn {
  width: 100%;
}

.telegram-timer {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.86rem;
}

.telegram-state-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.error,
.success {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
}

.error {
  border: 1px solid rgba(178, 58, 43, 0.5);
  background: rgba(178, 58, 43, 0.15);
  color: #d98a80;
}

.success {
  border: 1px solid rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.12);
  color: #76dfbc;
}

/* ========== HEADER ========== */
.dashboard-header {
  margin-bottom: 28px;
  padding: 0;
}

.header-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.header-copy {
  max-width: 480px;
}

.dashboard-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 0.98;
  color: var(--accent-soft);
}

.dashboard-subtitle {
  margin-top: 10px;
  color: var(--muted);
  max-width: 420px;
}

@media (max-width: 640px) {
  .site-brand-link,
  .auth-brand {
    align-items: flex-start;
  }

  .site-brand-logo,
  .auth-brand-logo {
    width: 80px;
    min-width: 80px;
  }

  .site-brand-tagline {
    font-size: 0.82rem;
  }
}

.back-link {
  color: var(--muted);
  font-size: 0.875rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--ink);
}

.logout-form-inline {
  display: inline-flex;
}

.back-link.button-reset {
  border: 1px solid rgba(244, 174, 87, 0.24);
  border-radius: 999px;
  background: rgba(244, 174, 87, 0.08);
  padding: 8px 12px;
  cursor: pointer;
}

.back-link.button-reset:hover {
  border-color: rgba(244, 174, 87, 0.44);
  background: rgba(244, 174, 87, 0.14);
}

/* ========== SUBSCRIPTION CARD ========== */
.subscription-prominent {
  margin-bottom: 20px;
}

.subscription-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 16px;
  align-items: start;
}

.subscription-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  opacity: 0;
  transition: opacity 0.3s;
}

.subscription-card.active {
  border-color: rgba(244, 174, 87, 0.42);
  box-shadow: var(--shadow), 0 0 24px rgba(244, 174, 87, 0.14);
}

.subscription-card.active::before {
  opacity: 1;
}

.subscription-card.expired {
  border-color: var(--danger);
  background: linear-gradient(135deg, var(--surface) 0%, rgba(178, 58, 43, 0.2) 100%);
  opacity: 0.95;
}

.sub-status-large {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
  grid-column: 1;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(244, 174, 87, 0.65);
  animation: pulse 2s infinite;
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(244, 174, 87, 0.65);
  opacity: 0;
  animation: pulse-ring 2s infinite;
}

.subscription-card.expired .status-dot {
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
  animation: none;
}

.subscription-card.expired .status-dot::after {
  display: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.status-text-large {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.sub-days-remaining {
  display: flex;
  align-items: baseline;
  gap: 10px;
  grid-column: 1;
}

.sub-user-summary {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 230px;
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.2);
  background: rgba(13, 25, 37, 0.28);
}

.sub-user-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.sub-user-label {
  color: var(--muted);
  font-size: 0.75rem;
}

.sub-user-value {
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.days-number {
  font-family: "Oswald", "Montserrat", sans-serif;
  font-size: 3rem;
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
}

.days-label {
  font-size: 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.sub-warning {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--danger-light);
  border: 1px solid rgba(178, 58, 43, 0.4);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: #d98a80;
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
}

.sub-warning a {
  color: var(--accent);
  text-decoration: underline;
}

.sub-message {
  color: var(--muted);
  font-size: 0.95rem;
  padding: 8px 0;
  grid-column: 1 / -1;
}

.button-reset {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.subscription-header-compact {
  margin-bottom: 18px;
}

.subscription-workspace {
  display: grid;
  grid-template-columns: minmax(220px, 248px) minmax(0, 1.22fr) minmax(300px, 0.94fr);
  gap: 20px;
  margin-bottom: 28px;
  align-items: start;
  padding: 24px;
  border: 1px solid rgba(244, 174, 87, 0.24);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, rgba(13, 27, 40, 0.96) 0%, rgba(11, 24, 37, 0.96) 100%);
  box-shadow: var(--shadow);
}

.overview-shell {
  position: relative;
}

.subscription-rail {
  border: 1px solid rgba(244, 174, 87, 0.14);
  border-radius: var(--radius);
  background: rgba(18, 37, 55, 0.38);
  padding: 16px;
  box-shadow: none;
}

.subscription-rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.subscription-rail-title {
  font-size: 2rem;
  line-height: 0.95;
  color: var(--accent-soft);
}

.subscription-rail-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
}

.subscription-stack {
  display: grid;
  gap: 10px;
}

.subscription-summary-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.14);
  background: rgba(13, 25, 37, 0.36);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.subscription-summary-card:hover {
  border-color: rgba(244, 174, 87, 0.35);
  background: rgba(18, 37, 55, 0.72);
  transform: translateY(-1px);
}

.subscription-summary-card.is-selected {
  border-color: rgba(244, 174, 87, 0.42);
  background: linear-gradient(135deg, rgba(36, 67, 92, 0.92) 0%, rgba(18, 37, 55, 0.94) 100%);
  box-shadow: 0 0 0 1px rgba(244, 174, 87, 0.14) inset;
}

.subscription-summary-top,
.subscription-summary-main {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.subscription-summary-code {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}

.subscription-summary-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.subscription-summary-status.tone-active {
  background: rgba(44, 160, 95, 0.18);
  color: #75d79e;
}

.subscription-summary-status.tone-expiring {
  background: rgba(244, 174, 87, 0.18);
  color: var(--accent-soft);
}

.subscription-summary-days,
.subscription-summary-main span,
.subscription-summary-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.subscription-summary-meta {
  display: grid;
  gap: 4px;
}

.subscription-summary-main strong {
  color: var(--accent-soft);
  font-size: 1rem;
}

.selected-slot-panel {
  min-width: 0;
  grid-column: 2 / 4;
  display: grid;
}

.expired-slot-block {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(244, 174, 87, 0.12);
}

.selected-slot-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(244, 174, 87, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(18, 37, 55, 0.72) 0%, rgba(24, 49, 70, 0.78) 100%);
  box-shadow: none;
}

.selected-slot-card-head,
.selected-slot-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.selected-slot-actions {
  justify-content: flex-end;
}

.overview-status-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.expired-slot-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.14);
  background: rgba(13, 25, 37, 0.42);
  color: var(--ink);
  cursor: pointer;
}

.expired-slot-toggle-icon {
  font-size: 1.1rem;
  color: var(--accent);
}

.expired-slot-drawer {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.expired-slot-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(13, 25, 37, 0.28);
  border: 1px solid rgba(244, 174, 87, 0.1);
}

.expired-slot-card.is-expired {
  opacity: 0.78;
  border-color: rgba(151, 34, 12, 0.34);
  background: rgba(30, 26, 28, 0.46);
}

.expired-slot-copy {
  display: grid;
  gap: 4px;
}

.expired-slot-copy strong {
  color: var(--ink);
}

.expired-slot-copy span {
  color: var(--muted);
  font-size: 0.82rem;
}

.expired-slot-copy .expired-slot-label {
  color: #d98a80;
  font-weight: 700;
}

.selected-slot-copy {
  min-width: 0;
}

.selected-slot-title {
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  line-height: 1;
  color: var(--accent-soft);
}

.selected-slot-subtitle {
  margin-top: 8px;
  color: var(--muted);
}

.selected-slot-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.selected-slot-stat {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(13, 25, 37, 0.42);
  border: 1px solid rgba(244, 174, 87, 0.14);
}

.selected-slot-empty {
  display: grid;
  gap: 12px;
  padding: 28px;
  border: 1px dashed rgba(244, 174, 87, 0.24);
  border-radius: var(--radius);
  background: rgba(13, 25, 37, 0.35);
}

.selected-slot-empty h2 {
  margin: 0;
  color: var(--accent-soft);
}

.selected-slot-stat-label {
  color: var(--muted);
  font-size: 0.74rem;
}

.selected-slot-stat-value {
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-slot-stat-value.is-stale {
  color: #f7ca73;
}

.overview-card {
  width: 100%;
  gap: 14px;
  padding: 22px;
}

.overview-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.overview-card-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.overview-card-subtitle {
  color: var(--muted);
  font-size: 0.96rem;
}

.overview-connection-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(244, 174, 87, 0.12);
  border-radius: 12px;
  background: rgba(13, 25, 37, 0.34);
}

.overview-connection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.overview-connection-title {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}

.overview-endpoint-line {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 600;
}

.overview-action-bar {
  gap: 8px;
}

.overview-secondary-actions {
  display: flex;
  justify-content: flex-end;
}

.overview-card-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: start;
  padding-top: 18px;
  border-top: 1px solid rgba(244, 174, 87, 0.12);
}

.overview-card-layout.is-empty {
  grid-template-columns: 1fr;
}

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

.overview-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.account-mini-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(13, 25, 37, 0.28);
  border: 1px solid rgba(244, 174, 87, 0.12);
}

.account-mini-item {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.overview-active-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding-left: 20px;
  border-left: 1px solid rgba(244, 174, 87, 0.12);
}

.overview-location {
  align-items: center;
  gap: 12px;
  margin-bottom: 0;
}

.overview-location-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.overview-location-primary,
.overview-location-secondary {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-location-primary {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-soft);
}

.overview-location-secondary {
  font-size: 0.92rem;
  color: var(--muted);
}


.overview-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.overview-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.overview-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-actions {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.overview-hint {
  font-size: 0.875rem;
  color: var(--muted);
}

/* ========== CONNECTION STATUS ========== */
.connection-status {
  margin-bottom: 28px;
}

.connection-status.compact {
  margin-bottom: 0;
  grid-column: 3;
  min-width: 0;
  display: grid;
}

.connection-card {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.connection-card.compact {
  height: 100%;
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 20px;
  border-color: rgba(244, 174, 87, 0.2);
  background: linear-gradient(135deg, rgba(18, 37, 55, 0.72) 0%, rgba(24, 49, 70, 0.78) 100%);
  box-shadow: none;
}

.connection-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), rgba(212, 175, 55, 0.2));
}

.conn-header {
  text-align: center;
  margin-bottom: 24px;
}

.conn-header.compact {
  text-align: left;
  margin-bottom: 0;
}

.conn-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(244, 174, 87, 0.35);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

.conn-badge .status-dot {
  width: 10px;
  height: 10px;
  box-shadow: none;
  animation: none;
}

.conn-badge .status-dot::after {
  display: none;
}

.conn-badge-live .status-dot {
  box-shadow: 0 0 12px rgba(244, 174, 87, 0.65);
  animation: pulse 2s infinite;
}

.conn-badge-live .status-dot::after {
  display: block;
  border: 2px solid rgba(244, 174, 87, 0.65);
  animation: pulse-ring 2s infinite;
}

.conn-protocol-main {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--ink) 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.conn-protocol-main.compact {
  font-size: 2rem;
  margin-bottom: 6px;
}

.conn-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.conn-location.compact {
  justify-content: flex-start;
  margin-bottom: 16px;
}

.conn-flag {
  background: var(--surface-hover);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 1.15rem;
  line-height: 1;
  font-weight: 700;
  color: var(--muted);
}

.conn-server {
  color: var(--muted);
  font-size: 1rem;
}

.conn-endpoint-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.conn-endpoint-grid.compact {
  max-width: none;
  margin: 0;
}

.conn-endpoint-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.conn-endpoint-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.conn-endpoint-value {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conn-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 24px;
}

@media (max-width: 500px) {
  .conn-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .conn-endpoint-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }
}

.conn-qr {
  appearance: none;
  background: white;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.28);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.conn-qr:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.conn-qr svg {
  width: 120px;
  height: 120px;
  display: block;
}

.conn-qr img {
  width: 120px;
  height: 120px;
  display: block;
}

.qr-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(7, 18, 28, 0.82);
  z-index: 1100;
}

.qr-modal-card {
  position: relative;
  width: min(92vw, 560px);
  padding: 24px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: white;
  box-shadow: var(--shadow-lg);
}

.qr-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 999px;
  background: rgba(13, 25, 37, 0.08);
  color: #0d1925;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.qr-modal-image {
  width: 100%;
  height: auto;
  display: block;
}

/* Instructions Tabs */
.conn-instructions {
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.instr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

.instr-tab {
  flex: 1 1 92px;
  min-width: 92px;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.instr-tab:hover {
  color: var(--ink);
}

.instr-tab.active {
  background: var(--surface-elevated);
  color: var(--ink);
}

.instr-content {
  min-height: 120px;
  display: block;
  visibility: visible;
  opacity: 1;
}

.instr-content:empty::before {
  content: 'Загрузка инструкции...';
  color: var(--muted);
  font-size: 0.875rem;
  display: block;
  text-align: center;
  padding: 24px;
}

.instr-loading {
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
  padding: 24px;
}

.instr-platform {
  animation: fadeIn 0.3s ease;
}

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

.instr-app-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--accent-contrast);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding: 0 14px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-glow);
  transition: all 0.2s;
}

.instr-app-link:hover {
  background: var(--accent-hover);
  color: var(--accent-contrast);
}

.instr-steps {
  list-style: none;
}

.instr-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.875rem;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.instr-steps li:last-child {
  border-bottom: none;
}

.instr-steps a {
  color: var(--accent-soft);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.instr-steps a:hover {
  color: #ffe8bf;
}

.step-num {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 50%;
  font-size: 0.6875rem;
  font-weight: 700;
  flex-shrink: 0;
}

.instr-error {
  color: var(--danger);
  text-align: center;
  padding: 24px;
}

.conn-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.conn-actions.compact {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.inline-action-form {
  display: inline-flex;
}

.connection-empty {
  display: grid;
  gap: 10px;
}

.connection-empty-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--accent-soft);
}

.connection-empty-copy {
  color: var(--muted);
}

/* ========== SERVER SELECTION ========== */
.server-selection {
  display: grid;
  gap: 24px;
  margin-bottom: 32px;
  padding: 24px;
  border: 1px solid rgba(244, 174, 87, 0.18);
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(180deg, rgba(16, 31, 46, 0.96) 0%, rgba(12, 25, 38, 0.96) 100%);
  box-shadow: var(--shadow);
}

.server-selection-collapsible {
  padding-top: 14px;
}

.server-selection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(18, 37, 55, 0.72);
  color: var(--ink);
  font-weight: 700;
}

.server-selection-summary::-webkit-details-marker {
  display: none;
}

.server-selection-summary-hint {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.server-selection .section-header {
  display: grid;
  gap: 8px;
  margin-bottom: 0;
}

.server-selection .section-title,
.server-selection .section-subtitle {
  margin-bottom: 0;
}

.server-state-stack {
  display: grid;
  gap: 20px;
}

/* Server Search */
.server-search-wrapper {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.search-input-container {
  flex: 1 1 320px;
  min-width: min(100%, 260px);
  position: relative;
}

.search-input-container::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23bca889' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E")
    center/16px 16px no-repeat;
  pointer-events: none;
  opacity: 0.8;
}

.search-input-container .search-input {
  width: 100%;
  min-height: 44px;
  padding: 0 46px 0 42px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  font-size: 0.9375rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.search-input-container .search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light), 0 2px 8px rgba(212, 175, 55, 0.22);
  background: var(--surface);
}

.search-input-container .search-input::placeholder {
  color: var(--muted);
}

.search-input.searching {
  background-image: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.08) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  border: none;
  border-radius: 50%;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.search-clear:hover {
  background: var(--danger);
  color: #f6d7d2;
}

.btn-best-server {
  min-height: 44px;
  padding: 0 18px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: var(--accent-contrast);
  border: none;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-best-server::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn-best-server:hover::before {
  opacity: 1;
}

.btn-best-server:hover:not(:disabled) {
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.38);
  transform: translateY(-1px);
}

.btn-best-server svg {
  width: 18px;
  height: 18px;
}

/* Best Server sparkle animation */
.btn-best-server.sparking::after {
  content: '✨';
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  animation: sparkle 1.5s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.5; transform: translateY(-50%) scale(0.9); }
  50% { opacity: 1; transform: translateY(-50%) scale(1.1); }
}

/* Server List Container */
.server-list-container {
  display: grid;
  gap: 16px;
  min-width: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
  border: none;
}

.server-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  .server-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1040px) {
  .server-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1360px) {
  .server-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Server Card - Enhanced */
.server-card {
  min-width: 0;
  height: 100%;
  background: linear-gradient(180deg, rgba(18, 37, 55, 0.98) 0%, rgba(15, 31, 47, 0.98) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: grid;
  grid-template-rows: auto auto auto auto;
  gap: 14px;
  position: relative;
}

.server-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius);
  padding: 1px;
  background: linear-gradient(135deg, transparent 0%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.25s;
}

.server-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(244, 174, 87, 0.48), 0 12px 28px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

.server-card:hover::before {
  background: linear-gradient(135deg, var(--accent) 0%, transparent 50%);
  opacity: 0.28;
}

/* Selected State */
.server-card.selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(22, 42, 61, 0.98) 0%, rgba(18, 37, 55, 0.98) 100%);
  box-shadow: 0 0 0 2px rgba(244, 174, 87, 0.54), 0 16px 32px rgba(0, 0, 0, 0.22);
}

.server-card.current {
  border-color: rgba(16, 185, 129, 0.42);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.24);
}

.server-card.current:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(244, 174, 87, 0.42), 0 12px 28px rgba(0, 0, 0, 0.24);
}

.server-card.hidden {
  display: none;
}

.server-card.highlighted {
  animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
  0%, 100% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-light); }
  50% { box-shadow: 0 0 0 1px var(--accent), 0 0 0 8px var(--accent-light); }
}

.server-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.server-location {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.server-flag {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--surface-hover) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.server-name-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.server-city {
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-country {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Server Badges */
.server-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-current {
  justify-content: center;
  gap: 0;
  min-width: 42px;
  padding: 5px 10px;
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-recommended {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(212, 175, 55, 0.28);
}

.badge-new {
  background: rgba(212, 175, 55, 0.1);
  color: var(--accent);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

/* Server Status Row */
.server-status-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-pill.status-online,
.status-pill.status-low {
  background: var(--success-light);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.25);
}

.status-pill.status-degraded,
.status-pill.status-medium {
  background: var(--warning-light);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.25);
}

.status-pill.status-offline,
.status-pill.status-high {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(178, 58, 43, 0.36);
}

.status-pill.status-checking {
  background: var(--surface-elevated);
  color: var(--muted);
  border-color: var(--line);
}

.status-pill.status-unknown {
  background: var(--surface-elevated);
  color: var(--muted);
  border-color: var(--line);
}

.status-pill .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: none;
  animation: none;
}

.status-pill.status-online .status-dot,
.status-pill.status-low .status-dot {
  box-shadow: 0 0 6px currentColor;
}

.status-pill.status-checking .status-dot.pulse {
  animation: statusPulse 1.5s infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

.status-pill .status-value {
  font-weight: 700;
}

.status-pill .status-label {
  font-weight: 500;
  opacity: 0.9;
}

.server-connectable-count {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(244, 174, 87, 0.12);
  border: 1px solid rgba(244, 174, 87, 0.18);
  color: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.server-protocols {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
}

.protocol-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 78px;
  width: 78px;
  min-width: 78px;
  min-height: 40px;
  padding: 0 12px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  color: var(--muted);
}

.protocol-chip * {
  cursor: inherit;
}

.protocol-chip:hover:not(.disabled):not(.unavailable):not(.full) {
  border-color: var(--accent);
  background: rgba(212, 175, 55, 0.08);
  transform: translateY(-1px);
}

.protocol-chip:active:not(.disabled):not(.unavailable):not(.full) {
  transform: translateY(0);
}

.protocol-chip.selected {
  border-color: var(--accent);
  background: rgba(244, 174, 87, 0.14);
  color: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(244, 174, 87, 0.34);
}

.protocol-chip.active {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.14);
  color: #9fe8c9;
}

.protocol-chip.active.selected {
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.24);
}

.protocol-chip.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--surface);
}

.protocol-chip.unavailable {
  opacity: 0.56;
  cursor: not-allowed;
  background: rgba(13, 25, 37, 0.46);
  border-style: dashed;
}

.protocol-chip.full {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.14);
  color: #f7ca73;
  cursor: not-allowed;
}

.protocol-chip.disabled *,
.protocol-chip.unavailable *,
.protocol-chip.full * {
  cursor: inherit;
}

.protocol-chip-marker {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.72;
  flex-shrink: 0;
}

.protocol-chip-name {
  font-weight: 700;
  font-size: 0.79rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.server-card-footer {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(244, 174, 87, 0.14);
  border-radius: 12px;
  background: rgba(13, 25, 37, 0.32);
}

.server-endpoint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.server-endpoint-label,
.server-endpoint-protocol {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.server-endpoint-label {
  color: var(--muted);
}

.server-endpoint-protocol {
  color: var(--accent-soft);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.server-endpoint-value {
  min-width: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn.disabled,
.btn[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.6;
}

.instruction-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(7, 18, 28, 0.72);
  z-index: 1000;
}

.instruction-modal-card {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 18px;
}

.instruction-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.instruction-modal-body {
  display: grid;
  gap: 14px;
}

.instruction-modal-steps {
  margin-left: 18px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Empty State */
/* Hidden attribute support - must override all display rules */
[hidden] {
  display: none !important;
}

/* Loading overlay hidden state */
#loading-overlay[hidden] {
  display: none !important;
}

.empty-state-block {
  text-align: center;
  padding: 64px 24px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-elevated) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  box-shadow: var(--shadow);
}

.empty-state-icon {
  margin-bottom: 24px;
  color: var(--muted);
  opacity: 0.4;
  width: 64px;
  height: 64px;
}

.empty-state-icon svg {
  width: 100%;
  height: 100%;
}

.empty-state-title {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.empty-state-subtitle {
  font-size: 0.9375rem;
  margin-bottom: 28px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

#server-offline-state .empty-state-icon {
  color: var(--warning);
  opacity: 0.7;
}

#server-offline-state .empty-state-title {
  color: var(--ink);
}

/* Price display fix - prevent broken layout */
.price-value, .price-total {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-amount {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.price-currency {
  font-size: 0.75em;
  font-weight: 500;
  opacity: 0.8;
  white-space: nowrap;
}

/* Payment unavailable - hide billing section */
.billing-section.hidden {
  display: none;
}

.billing-disabled {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  text-align: center;
}

.billing-disabled .section-title {
  margin-bottom: 12px;
}

.billing-disabled .disabled-message {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 8px;
}

/* ========== BILLING ========== */
.billing-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
}

.billing-section.prominent {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-light) 100%);
}

.billing-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 11, 18, 0.72);
  backdrop-filter: blur(10px);
}

.billing-modal-card {
  width: min(100%, 760px);
  max-height: min(88vh, 900px);
  overflow: auto;
  border-radius: 28px;
  border: 1px solid rgba(244, 174, 87, 0.16);
  background: linear-gradient(180deg, rgba(18, 37, 55, 0.98), rgba(12, 28, 42, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34);
  padding: 24px;
}

.billing-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.billing-modal-head h2 {
  margin: 0;
  color: var(--accent-soft);
}

.billing-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.billing-mode-card {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.14);
  background: rgba(13, 25, 37, 0.4);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.billing-mode-card span {
  color: var(--muted);
  font-size: 0.84rem;
}

.billing-mode-card:hover,
.billing-mode-card.is-active {
  border-color: rgba(244, 174, 87, 0.42);
  background: rgba(24, 49, 70, 0.82);
  transform: translateY(-1px);
}

.billing-mode-card[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.billing-target-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.billing-target-chip {
  display: grid;
  gap: 2px;
  min-width: 150px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.14);
  background: rgba(13, 25, 37, 0.32);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.billing-target-chip small {
  color: var(--muted);
}

.billing-target-chip.is-active {
  border-color: rgba(244, 174, 87, 0.42);
  background: rgba(24, 49, 70, 0.82);
}

.billing-target-summary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.14);
  background: rgba(13, 25, 37, 0.42);
}

.billing-target-label {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.plan-slider-container {
  margin-bottom: 20px;
}

.plan-slider-container input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 0%, var(--surface-elevated) 0%, var(--surface-elevated) 100%);
  border-radius: 3px;
  outline: none;
  margin-bottom: 12px;
}

.plan-slider-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.45);
  transition: transform 0.2s;
}

.plan-slider-container input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.plan-marks {
  display: flex;
  justify-content: space-between;
}

.plan-marks .mark {
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.plan-marks .mark:hover,
.plan-marks .mark.active {
  background: var(--accent);
  color: var(--accent-contrast);
}

.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.plan-card {
  background: var(--surface-elevated);
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.plan-card:hover {
  border-color: var(--line);
}

.plan-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
}

.plan-duration {
  font-weight: 600;
  margin-bottom: 8px;
}

.plan-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.plan-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  background: var(--success);
  color: #ecfff8;
  font-size: 0.6875rem;
  font-weight: 600;
  border-radius: 4px;
}

.price-summary {
  background: var(--surface-elevated);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

.price-row.center {
  justify-content: center;
}

.price-summary.center {
  text-align: center;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}

.price-row.small {
  font-size: 0.875rem;
  color: var(--success);
}

.price-label {
  color: var(--muted);
}

.price-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.price-value-discount {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
  white-space: normal;
  text-align: right;
  max-width: 72%;
}

.price-row.center .price-value-discount {
  text-align: center;
  max-width: 100%;
}

.price-total {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent);
}

.network-select-row {
  margin-bottom: 20px;
}

.network-select-row label {
  display: block;
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: 8px;
}

.network-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9375rem;
  cursor: pointer;
}

.network-select:focus {
  outline: none;
  border-color: var(--accent);
}

.payment-instructions-card {
  margin: 6px 0 20px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.18);
  background: rgba(13, 25, 37, 0.35);
  display: grid;
  gap: 14px;
}

.payment-instructions-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.payment-recommended-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #7df3cf;
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.payment-selected-route {
  display: grid;
  gap: 4px;
}

.payment-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-warning-box {
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.payment-warning-strong {
  border: 1px solid rgba(151, 34, 12, 0.34);
  background: rgba(151, 34, 12, 0.14);
  color: #ffd6c9;
}

.payment-warning-soft {
  border: 1px solid rgba(245, 158, 11, 0.26);
  background: rgba(245, 158, 11, 0.12);
  color: #f8d9a2;
}

.payment-method-item {
  border: 1px solid rgba(244, 174, 87, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(18, 37, 55, 0.56);
}

.payment-method-item + .payment-method-item {
  margin-top: 10px;
}

.payment-method-summary {
  list-style: none;
  cursor: pointer;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.payment-method-summary::-webkit-details-marker {
  display: none;
}

.payment-method-role {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(244, 174, 87, 0.16);
  color: #ffd08f;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.payment-method-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.payment-method-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.payment-method-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: flex-start;
  font-size: 0.9rem;
}

.payment-method-steps .step-num {
  color: var(--accent);
  font-weight: 700;
}

.payment-after-send p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.payment-transfer-card {
  display: grid;
  gap: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.12);
  background: rgba(13, 25, 37, 0.34);
  padding: 12px;
}

.payment-transfer-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.payment-transfer-card-head strong {
  display: block;
  margin-top: 2px;
}

.payment-technical-note {
  max-width: 300px;
  font-size: 0.8125rem;
  color: #f8d9a2;
  text-align: right;
}

.payment-address-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.payment-address-row input {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(244, 174, 87, 0.16);
  background: rgba(18, 37, 55, 0.82);
  color: var(--ink);
}

.payment-copy-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.payment-qr-inline {
  display: grid;
  gap: 8px;
}

.payment-qr-inline-preview {
  width: 120px;
  height: 120px;
  padding: 6px;
  border-radius: 10px;
  background: #ffffff;
}

.payment-qr-inline-preview svg,
.payment-qr-inline-preview img {
  width: 100%;
  height: 100%;
  display: block;
}

.payment-unavailable {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--danger-light);
  border-radius: var(--radius-sm);
  color: #fca5a5;
  font-size: 0.875rem;
  text-align: center;
}

/* ========== EMAIL ========== */
.email-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
}

.account-secondary-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 10px;
}

.account-secondary-summary::-webkit-details-marker {
  display: none;
}

.account-secondary-content {
  display: grid;
  gap: 8px;
}

.account-settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 10px;
  align-items: start;
}

.account-settings-column {
  display: grid;
  gap: 10px;
}

.settings-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.settings-card {
  border: 1px solid rgba(244, 174, 87, 0.16);
  border-radius: 12px;
  padding: 14px;
  background: rgba(9, 20, 31, 0.32);
  display: grid;
  gap: 12px;
}

.settings-cards-grid-account {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.settings-card-security {
  align-content: start;
}

.settings-card.settings-card-danger {
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(127, 29, 29, 0.18);
}

.settings-methods-stack {
  display: grid;
  gap: 12px;
}

.email-subsection {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(226, 183, 96, 0.16);
}

.email-subsection:first-child {
  padding-top: 0;
  border-top: none;
}

.email-subsection-head {
  display: grid;
  gap: 4px;
}

.email-subsection-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--accent-soft);
}

.email-subsection-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.email-subsection-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.backup-email-form-wrap {
  margin-top: 2px;
}

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

.phone-update-field {
  position: relative;
  min-width: 0;
}

.phone-update-field .intl-country-popover {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  z-index: 6;
}

.phone-update-form .phone-update-submit {
  width: auto;
  min-height: 44px;
  height: 44px;
  align-self: flex-start;
  white-space: nowrap;
}

.phone-change-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.phone-telegram-link {
  text-decoration: none;
}

.phone-telegram-link:hover {
  text-decoration: none;
}

.email-status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.email-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.email-status-badge.pending {
  border: 1px solid rgba(226, 183, 96, 0.4);
  color: #e5c98e;
  background: rgba(226, 183, 96, 0.12);
}

.email-status-badge.verified {
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #83e2c1;
  background: rgba(16, 185, 129, 0.12);
}

.email-section.attached {
  border-color: var(--success);
  background: linear-gradient(135deg, var(--surface) 0%, var(--success-light) 100%);
}

.email-form-compact {
  display: flex;
  gap: 12px;
}

.email-form-compact input {
  flex: 1;
  padding: 12px 16px;
  background: var(--surface-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.9375rem;
}

.email-form-compact input:focus {
  outline: none;
  border-color: var(--accent);
}

.email-attached-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.email-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.email-label {
  font-size: 0.8125rem;
  color: var(--muted);
}

.email-value {
  font-family: monospace;
  font-size: 0.9375rem;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.danger-text {
  color: #e1a7a1;
}

.danger-text:hover {
  color: #f1bbb5;
}

.email-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.email-msg.success {
  background: var(--success-light);
  color: var(--success);
}

.email-msg.error {
  background: var(--danger-light);
  color: var(--danger);
}

/* ========== PAYMENTS ========== */
.payments-section {
  margin-bottom: 24px;
}

.payments-history-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25, 49, 70, 0.96) 0%, rgba(18, 37, 55, 0.98) 100%);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.payments-history-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.payments-history-summary::-webkit-details-marker {
  display: none;
}

.payments-history-title {
  color: var(--accent-soft);
  font-weight: 700;
  font-size: 1rem;
}

.payments-history-count {
  min-width: 30px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(244, 174, 87, 0.4);
  background: rgba(244, 174, 87, 0.12);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.payments-history-chevron {
  width: 10px;
  height: 10px;
  border-inline-end: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.payments-history-panel[open] .payments-history-chevron {
  transform: rotate(225deg);
}

.payments-history-body {
  display: grid;
  gap: 12px;
  padding-top: 2px;
}

.benefits-panel {
  --benefits-space-xs: 8px;
  --benefits-space-sm: 12px;
  --benefits-space-md: 18px;
  --benefits-space-lg: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25, 49, 70, 0.96) 0%, rgba(18, 37, 55, 0.98) 100%);
  box-shadow: var(--shadow);
  padding: var(--benefits-space-md);
  display: grid;
  gap: var(--benefits-space-md);
}

.benefits-panel-summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--benefits-space-sm);
  margin: 0;
}

.benefits-panel-summary::-webkit-details-marker {
  display: none;
}

.benefits-panel-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-soft);
}

.benefits-panel-summary-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.85rem;
}

.benefits-panel-chevron {
  width: 10px;
  height: 10px;
  border-inline-end: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
  justify-self: end;
}

.benefits-panel[open] .benefits-panel-chevron {
  transform: rotate(225deg);
}

.benefits-panel-body {
  display: grid;
  gap: var(--benefits-space-lg);
  padding-top: var(--benefits-space-xs);
}

.benefits-section {
  display: grid;
  gap: var(--benefits-space-sm);
}

.benefits-section-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-soft);
}

.benefits-copy-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--benefits-space-sm);
}

.benefits-copy-item {
  display: grid;
  gap: var(--benefits-space-xs);
}

.benefits-copy-input {
  font-family: "SFMono-Regular", "JetBrains Mono", "Fira Code", monospace;
  text-overflow: ellipsis;
}

.benefits-inline-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--benefits-space-xs);
  align-items: center;
}

.benefits-inline-action-row .btn {
  min-height: 42px;
}

.benefits-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--benefits-space-sm);
}

.benefits-metric-card {
  border: 1px solid rgba(244, 174, 87, 0.2);
  border-radius: 12px;
  padding: var(--benefits-space-sm);
  background: rgba(9, 20, 31, 0.28);
  display: grid;
  gap: 6px;
}

.benefits-metric-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.benefits-metric-value {
  font-size: 1.2rem;
  color: var(--accent-soft);
  line-height: 1.2;
}

.benefits-action-stack {
  display: grid;
  gap: var(--benefits-space-xs);
}

.benefits-status-note {
  border: 1px solid rgba(244, 174, 87, 0.24);
  border-radius: 12px;
  padding: var(--benefits-space-sm);
  background: rgba(244, 174, 87, 0.1);
  color: var(--accent-soft);
  font-size: 0.88rem;
}

.benefits-feedback {
  min-height: 20px;
  margin: 0;
}

.benefits-feedback.is-error {
  color: #fca5a5;
}

.benefits-feedback.is-success {
  color: var(--success);
}

.benefits-feedback.is-info {
  color: var(--muted);
}

.benefits-summary-card {
  border: 1px solid rgba(244, 174, 87, 0.24);
  border-radius: 12px;
  padding: var(--benefits-space-sm);
  background: rgba(9, 20, 31, 0.28);
  display: grid;
  gap: var(--benefits-space-xs);
}

.benefits-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--benefits-space-sm);
  color: var(--muted);
  font-size: 0.85rem;
}

.benefits-summary-row strong {
  color: var(--accent-soft);
  font-size: 0.9rem;
  text-align: end;
}

.benefits-summary-row-total {
  padding-top: var(--benefits-space-xs);
  border-top: 1px solid rgba(244, 174, 87, 0.2);
}

.benefits-summary-row-total strong {
  color: var(--accent);
  font-size: 1rem;
}

.benefits-section-history .payment-row {
  padding: 10px 12px;
}

.benefits-section-history .payment-row-summary {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  cursor: default;
}

.account-delete-modal-card {
  display: grid;
  gap: 12px;
  position: relative;
}

.account-delete-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  cursor: pointer;
}

.account-delete-modal-close:hover {
  color: var(--ink);
}

.payments-list-compact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.payment-row {
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
}

.payment-row-details[open] {
  border-color: rgba(31, 59, 250, 0.18);
  box-shadow: 0 10px 30px rgba(20, 28, 58, 0.06);
}

.payment-row-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  list-style: none;
  cursor: pointer;
}

.payment-row-summary::-webkit-details-marker {
  display: none;
}

.payment-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.payment-plan {
  font-weight: 500;
}

.payment-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.payment-amount {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.payment-summary-meta {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.payment-network {
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.payment-status-short {
  font-size: 0.78rem;
  color: var(--accent-soft);
}

.payment-status-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.payment-status-icon.success { background: var(--success); }
.payment-status-icon.pending { background: var(--warning); }
.payment-status-icon.expired { background: var(--danger); }

.payment-details-toggle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.payment-details-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.payment-detail-result strong {
  display: block;
  margin-top: 4px;
}

.payment-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.payment-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  background: rgba(20, 28, 58, 0.03);
  border-radius: var(--radius-sm);
}

.payment-detail-item-wide {
  grid-column: 1 / -1;
}

.payment-detail-mono {
  font-family: "SFMono-Regular", "JetBrains Mono", "Fira Code", monospace;
  font-size: 0.875rem;
  word-break: break-all;
}

.payment-detail-error {
  background: var(--danger-light);
}

.payment-details-actions {
  display: flex;
  justify-content: flex-end;
}

.empty-state-compact {
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-sm);
}

@media (max-width: 720px) {
  .benefits-panel {
    --benefits-space-md: 14px;
    --benefits-space-lg: 18px;
  }

  .benefits-panel-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title chevron"
      "summary summary";
    align-items: start;
  }

  .benefits-panel-title {
    grid-area: title;
  }

  .benefits-panel-summary-text {
    grid-area: summary;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .benefits-panel-chevron {
    grid-area: chevron;
    margin-top: 4px;
  }

  .benefits-copy-grid,
  .benefits-metrics-grid {
    grid-template-columns: 1fr;
  }

  .benefits-inline-action-row {
    grid-template-columns: 1fr;
  }

  .benefits-inline-action-row .btn {
    width: 100%;
  }

  .payment-row-summary {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .payment-summary-meta {
    justify-items: start;
  }

  .payment-amount {
    justify-content: flex-start;
  }

  .payment-details-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== TOAST ========== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--surface);
  color: var(--ink);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent);
  transform: translateX(120%);
  opacity: 0;
  transition: all 0.3s ease;
  min-width: 280px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

/* ========== LOADING SKELETON CONTAINER ========== */
.loading-skeleton-container {
  padding: 24px 0;
}

.skeleton-header {
  margin-bottom: 20px;
}

.skeleton-title {
  height: 32px;
  width: 200px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
  margin-bottom: 8px;
}

.skeleton-subtitle {
  height: 20px;
  width: 280px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
  opacity: 0.6;
}

.skeleton-search {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.skeleton-search-bar {
  flex: 1;
  height: 48px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-best-btn {
  width: 140px;
  height: 48px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

@media (max-width: 480px) {
  .skeleton-grid {
    grid-template-columns: 1fr;
  }
}

.skeleton-card {
  height: 180px;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-elevated) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-flag {
  width: 40px;
  height: 40px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

.skeleton-text {
  height: 20px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
  width: 60%;
}

.skeleton-status {
  height: 28px;
  width: 100px;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 999px;
}

.skeleton-chips {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.skeleton-chip {
  height: 48px;
  flex: 1;
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

.loading-spinner-inline {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--surface-elevated);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* ========== LOADING STATES ========== */

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, var(--surface-elevated) 0%, var(--surface-hover) 50%, var(--surface-elevated) 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-xs);
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  margin-bottom: 0;
}

.skeleton-title {
  height: 1.5em;
  width: 60%;
  margin-bottom: 0.75em;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius);
}

.skeleton-chip {
  height: 40px;
  border-radius: var(--radius-xs);
}

/* Pulse Loading */
.pulse-loading {
  animation: pulse-loading 1.5s ease-in-out infinite;
}

@keyframes pulse-loading {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Checking Status Animation */
.checking-pulse {
  animation: checking-pulse 1.5s ease-in-out infinite;
}

@keyframes checking-pulse {
  0%, 100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(107, 114, 128, 0.4);
  }
  50% {
    opacity: 0.7;
    box-shadow: 0 0 0 8px rgba(107, 114, 128, 0);
  }
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 28, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--surface-elevated);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.loading-spinner.success {
  border-top-color: var(--success);
}

.loading-spinner.error {
  border-top-color: var(--danger);
}

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

.loading-text {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

.loading-text::after {
  content: '...';
  animation: loading-dots 1.5s steps(4, end) infinite;
}

@keyframes loading-dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1180px) {
  .subscription-workspace {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .selected-slot-panel,
  .connection-status.compact {
    grid-column: auto;
  }

  .overview-card-layout {
    grid-template-columns: 1fr;
  }

  .overview-active-panel {
    padding-left: 0;
    padding-top: 18px;
    border-left: 0;
    border-top: 1px solid rgba(244, 174, 87, 0.12);
  }

  .dashboard-header {
    padding: 0;
  }

  .account-settings-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 16px 12px 32px;
  }

  .subscription-workspace {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .server-selection {
    gap: 18px;
    padding: 18px;
  }

  .selected-slot-card-head,
  .selected-slot-actions,
  .selected-slot-meta-grid,
  .subscription-summary-top,
  .subscription-summary-main {
    flex-direction: column;
    align-items: flex-start;
  }

  .selected-slot-meta-grid {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .overview-summary-grid,
  .account-mini-card,
  .overview-status-grid {
    grid-template-columns: 1fr;
  }

  /* Mobile Subscription Card */
  .subscription-card {
    padding: 20px;
    grid-template-columns: minmax(0, 1fr);
  }

  .sub-days-remaining {
    align-items: center;
    gap: 8px;
  }

  .sub-user-summary {
    grid-column: 1;
    grid-row: auto;
    min-width: 0;
  }

  .days-number {
    font-size: 2.2rem;
  }

  /* Mobile Server Grid */
  .server-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .server-card {
    padding: 16px;
  }

  .server-card-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .server-badges {
    width: 100%;
    justify-content: flex-start;
  }

  .protocol-chip {
    flex: 1 1 calc(50% - 5px);
    width: auto;
    min-width: 88px;
    padding: 0 14px;
  }

  .protocol-chip-name {
    font-size: 0.875rem;
  }

  /* Mobile Connection Section */
  .conn-body {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .conn-protocol-main {
    font-size: 2rem;
  }

  .overview-card {
    padding: 18px;
  }

  .overview-card-head {
    align-items: flex-start;
  }

  .overview-secondary-actions {
    justify-content: flex-start;
  }

  /* Mobile Forms */
  .email-form-compact {
    flex-direction: column;
  }

  .phone-update-form {
    grid-template-columns: 1fr;
  }

  .phone-update-form .phone-update-submit {
    width: 100%;
  }

  .phone-prefix {
    min-width: 50px;
    padding: 0 10px;
  }

  .phone-input-control {
    font-size: 16px;
    padding: 11px 12px !important;
  }

  /* Mobile Search */
  .server-search-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .btn-best-server {
    width: 100%;
    justify-content: center;
  }

  .instr-tab {
    flex: 1 1 calc(50% - 4px);
  }

  /* Mobile Status Row */
  .server-status-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Mobile Empty State */
  .empty-state-block {
    padding: 48px 20px;
  }

  .empty-state-icon {
    width: 48px;
    height: 48px;
  }

  .empty-state-title {
    font-size: 1.125rem;
  }
}

/* Tablet Adjustments */
@media (min-width: 641px) and (max-width: 1023px) {
  .server-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== CONNECTED INDICATOR ========== */
.connected-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--success-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  color: var(--success);
  font-size: 0.8125rem;
  font-weight: 600;
}

.connected-indicator::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulse 2s infinite;
}

/* ========== UTILITY CLASSES ========== */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }

.bg-success-light { background: var(--success-light); }
.bg-warning-light { background: var(--warning-light); }
.bg-danger-light { background: var(--danger-light); }
.bg-accent-light { background: var(--accent-light); }

/* Fade animations */
.fade-in {
  animation: fadeIn 0.3s ease;
}

.fade-slide-up {
  animation: fade-slide-up 0.4s ease;
}

/* Focus styles */
.focus-ring:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Selection highlight */
::selection {
  background: var(--accent-light);
  color: var(--ink);
}

/* Scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--surface);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--surface-hover);
  border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ========== ADMIN UI ========== */
.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25, 49, 70, 0.96) 0%, rgba(18, 37, 55, 0.98) 100%);
  box-shadow: var(--shadow);
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1;
  color: var(--accent-soft);
}

.cards-grid.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

.slot-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(25, 49, 70, 0.96) 0%, rgba(18, 37, 55, 0.98) 100%);
  box-shadow: var(--shadow);
}

.slot-card h2 {
  margin: 0 0 16px;
  color: var(--accent-soft);
  font-size: 1.25rem;
}

.slot-card .eyebrow {
  margin-bottom: 10px;
}

.slot-card form + form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

.meta-grid div {
  padding: 14px;
  border: 1px solid rgba(244, 174, 87, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.meta-grid dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.meta-grid dd {
  margin: 0;
  color: var(--accent-soft);
  font-family: "Montserrat", "Lato", sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.payment-pending-card {
  margin-top: 12px;
  padding: 18px 20px;
}

.payment-pending-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.payment-pending-heading {
  display: grid;
  gap: 6px;
}

.pending-payment-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(244, 174, 87, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: var(--accent-soft);
  font-weight: 700;
  white-space: nowrap;
}

.pending-payment-status-confirming {
  border-color: rgba(244, 174, 87, 0.24);
}

.pending-payment-status-settled {
  border-color: rgba(91, 206, 151, 0.3);
  color: var(--success);
  background: rgba(91, 206, 151, 0.1);
}

.pending-payment-status-expired,
.pending-payment-status-cancelled {
  border-color: rgba(255, 122, 122, 0.28);
  color: #ffb0b0;
  background: rgba(255, 122, 122, 0.09);
}

.pending-payment-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.pending-payment-instructions-card {
  margin: 0 0 18px;
}

.pending-payment-summary-card,
.pending-payment-block,
.pending-payment-qr-card,
.pending-payment-help {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(244, 174, 87, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.pending-payment-summary-card {
  display: grid;
  gap: 10px;
}

.pending-payment-summary-card strong {
  color: var(--accent-soft);
  font-family: "Montserrat", "Lato", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
}

.pending-payment-amount-card {
  background: linear-gradient(180deg, rgba(24, 47, 69, 0.96), rgba(18, 36, 53, 0.96));
}

.pending-payment-amount-value {
  color: var(--ink);
  font-size: clamp(2rem, 3vw, 2.6rem) !important;
  line-height: 1;
}

.pending-payment-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.pending-payment-layout-single {
  grid-template-columns: 1fr;
}

.pending-payment-block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.pending-payment-block-head .section-hint {
  margin: 4px 0 0;
}

.pending-payment-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.pending-payment-address-row input {
  min-width: 0;
  width: 100%;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(244, 174, 87, 0.18);
  background: rgba(9, 20, 31, 0.4);
  color: var(--ink);
  font-family: "SFMono-Regular", "Consolas", "Monaco", monospace;
  font-size: 0.95rem;
  cursor: copy;
}

.pending-payment-copy-wrap {
  position: relative;
}

.pending-payment-copy-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(91, 206, 151, 0.16);
  color: var(--success);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.pending-payment-copy-tooltip.visible {
  opacity: 1;
}

.pending-payment-tx-hash {
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid rgba(244, 174, 87, 0.16);
  background: rgba(9, 20, 31, 0.34);
  color: var(--ink);
  font-family: "SFMono-Regular", "Consolas", "Monaco", monospace;
  font-size: 0.92rem;
  line-height: 1.45;
  word-break: break-all;
}

.pending-payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
  margin-top: 18px;
}

.pending-payment-actions form {
  margin: 0;
}

.pending-payment-check-button.is-loading,
#pending-payment-check-button.is-loading {
  cursor: wait;
}

.pending-payment-help {
  display: grid;
  gap: 10px;
}

.pending-payment-help-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.pending-payment-qr-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.pending-payment-qr-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(244, 174, 87, 0.24);
}

.pending-payment-qr-preview svg {
  width: min(100%, 220px);
  height: auto;
  display: block;
}

.pending-payment-qr-preview svg rect,
.pending-payment-qr-preview svg path {
  fill: #0f1b28;
}

.pending-payment-qr-preview svg rect:first-child {
  fill: #ffffff;
}

.pending-payment-qr-fallback {
  max-width: 260px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.table-card {
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(9, 20, 31, 0.3);
}

.table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.table-wrap thead {
  background: rgba(244, 174, 87, 0.08);
}

.table-wrap th,
.table-wrap td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(244, 174, 87, 0.1);
  vertical-align: middle;
}

.table-wrap th {
  color: var(--accent-soft);
  font-size: 0.78rem;
  font-family: "Montserrat", "Lato", sans-serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.table-wrap td {
  color: var(--muted);
  font-size: 0.92rem;
}

.table-wrap tbody tr {
  transition: background 0.2s ease;
}

.table-wrap tbody tr:hover {
  background: rgba(244, 174, 87, 0.04);
}

.table-wrap tbody tr:last-child td {
  border-bottom: none;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.filter-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 10px 16px;
  border: 1px solid rgba(244, 174, 87, 0.24);
  border-radius: 999px;
  background: rgba(25, 49, 70, 0.72);
  color: var(--muted);
  text-decoration: none;
  font-family: "Montserrat", "Lato", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.filter-tab:hover {
  color: var(--accent-soft);
  border-color: rgba(244, 174, 87, 0.5);
  background: rgba(244, 174, 87, 0.08);
}

.filter-tab.active {
  color: var(--accent-contrast);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(244, 174, 87, 0.24);
}

.server-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.server-status.online,
.server-status.degraded,
.server-status.unknown {
  background: rgba(16, 185, 129, 0.14);
  color: #55d6ae;
}

.server-status.offline {
  background: rgba(151, 34, 12, 0.18);
  color: #f2a38c;
}

.load-bar {
  width: 120px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.load-bar-fill {
  height: 100%;
  border-radius: inherit;
}

.load-bar-fill.low {
  background: linear-gradient(90deg, #22c55e 0%, #10b981 100%);
}

.load-bar-fill.medium {
  background: linear-gradient(90deg, #f59e0b 0%, #f4ae57 100%);
}

.load-bar-fill.high {
  background: linear-gradient(90deg, #e76f51 0%, #97220c 100%);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.status-active-badge {
  background: rgba(16, 185, 129, 0.14);
  color: #55d6ae;
}

.status-expired-badge {
  background: rgba(151, 34, 12, 0.18);
  color: #f2a38c;
}

@media (max-width: 640px) {
  .billing-mode-grid {
    grid-template-columns: 1fr;
  }

  .billing-modal {
    padding: 12px;
  }

  .billing-modal-card {
    padding: 18px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .meta-grid {
    grid-template-columns: 1fr;
  }

  .payment-pending-header {
    flex-direction: column;
    align-items: stretch;
  }

  .pending-payment-summary-grid {
    grid-template-columns: 1fr;
  }

  .pending-payment-layout {
    grid-template-columns: 1fr;
  }

  .pending-payment-address-row {
    grid-template-columns: 1fr;
  }

  .payment-instructions-head,
  .payment-transfer-card-head {
    flex-direction: column;
  }

  .payment-address-row {
    grid-template-columns: 1fr;
  }

  .payment-copy-grid {
    flex-direction: column;
  }

  .filter-tabs {
    width: 100%;
  }

  .filter-tab {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 0;
  }

  .subscription-workspace {
    grid-template-columns: 1fr;
  }
}

/* ========== ADMIN OPS UI V3 ========== */
.admin-ops-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(25, 49, 70, 0.96) 0%, rgba(18, 37, 55, 0.98) 100%);
  box-shadow: var(--shadow);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.admin-sidebar-head h1 {
  margin: 4px 0;
  font-size: 1.35rem;
  color: var(--accent-soft);
}

.admin-sidebar-subtle {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-nav {
  display: grid;
  gap: 8px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid rgba(244, 174, 87, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: "Montserrat", "Lato", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-nav-item:hover {
  border-color: rgba(244, 174, 87, 0.46);
  color: var(--accent-soft);
}

.admin-nav-item.is-active {
  color: var(--accent-contrast);
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  box-shadow: 0 10px 20px rgba(244, 174, 87, 0.22);
}

.admin-sidebar-actions {
  display: grid;
  gap: 10px;
}

.admin-content-shell {
  min-width: 0;
  display: grid;
  gap: 24px;
}

.admin-content-topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(25, 49, 70, 0.96) 0%, rgba(18, 37, 55, 0.98) 100%);
  box-shadow: var(--shadow);
}

.admin-content-topbar h2 {
  margin: 4px 0 0;
  color: var(--accent-soft);
}

.global-search-wrap {
  position: relative;
  width: min(540px, 100%);
}

.global-search-wrap input {
  width: 100%;
}

.global-search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #13263a;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.3);
}

.search-result-item {
  width: 100%;
  display: block;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid rgba(244, 174, 87, 0.12);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.search-result-item:hover {
  background: rgba(244, 174, 87, 0.08);
}

.ops-section {
  display: none;
  gap: 16px;
}

.ops-section.is-active {
  display: grid;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}

.section-head h3 {
  margin: 4px 0 0;
  color: var(--accent-soft);
  font-size: 1.45rem;
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.attention-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 14px;
  border: 1px solid rgba(244, 174, 87, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.attention-card:hover {
  border-color: rgba(244, 174, 87, 0.5);
  transform: translateY(-1px);
}

.attention-card strong {
  font-size: 1.8rem;
  color: var(--accent-soft);
}

.ops-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.ops-toolbar input,
.ops-toolbar select {
  min-width: 200px;
}

.table-wrap-sticky {
  max-height: min(68vh, 680px);
  overflow: auto;
}

.table-wrap-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.ops-table th[data-sort-key] {
  cursor: pointer;
}

.actions-col {
  width: 1%;
  white-space: nowrap;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.table-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 800;
}

.status-chip-green {
  background: rgba(16, 185, 129, 0.16);
  color: #5fe2bc;
}

.status-chip-yellow {
  background: rgba(245, 158, 11, 0.16);
  color: #ffcf76;
}

.status-chip-red {
  background: rgba(231, 111, 81, 0.18);
  color: #ffb3a0;
}

.status-chip-gray {
  background: rgba(148, 163, 184, 0.18);
  color: #d8dee8;
}

.mini-log-list {
  display: grid;
  gap: 8px;
}

.mini-log-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(244, 174, 87, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  text-align: left;
  color: var(--ink);
  cursor: pointer;
}

.mini-log-item span,
.mini-log-item small {
  color: var(--muted);
  font-size: 0.8rem;
}

.problem-queue {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.problem-queue article {
  border: 1px solid rgba(231, 111, 81, 0.26);
  border-radius: 12px;
  padding: 12px;
  background: rgba(151, 34, 12, 0.12);
  display: grid;
  gap: 8px;
}

.problem-queue strong {
  font-size: 1.6rem;
  color: #ffd7ce;
}

.infra-grid {
  display: grid;
  gap: 12px;
}

.infra-server-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.infra-server-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.infra-server-head strong {
  color: var(--accent-soft);
  font-size: 1.05rem;
}

.infra-server-head small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.infra-server-summary {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.infra-protocol-list {
  display: grid;
  gap: 10px;
}

.infra-protocol-item {
  border: 1px solid rgba(244, 174, 87, 0.14);
  border-radius: 10px;
  padding: 10px;
  background: rgba(9, 20, 31, 0.28);
  display: grid;
  gap: 8px;
}

.infra-protocol-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.infra-protocol-main strong {
  color: var(--ink);
}

.infra-protocol-main span {
  color: var(--muted);
  font-size: 0.82rem;
}

.capacity-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.capacity-fill {
  height: 100%;
}

.capacity-normal {
  background: linear-gradient(90deg, #22c55e 0%, #10b981 100%);
}

.capacity-warning {
  background: linear-gradient(90deg, #f59e0b 0%, #f4ae57 100%);
}

.capacity-danger {
  background: linear-gradient(90deg, #e76f51 0%, #97220c 100%);
}

.plan-cards-grid,
.payment-method-grid,
.operations-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.billing-hub {
  display: grid;
  gap: 14px;
}

.billing-subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-subtab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(244, 174, 87, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.billing-subtab:hover {
  border-color: rgba(244, 174, 87, 0.46);
  color: var(--accent-soft);
}

.billing-subtab.is-active {
  color: var(--accent-contrast);
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
}

.billing-pane {
  display: none;
}

.billing-pane.is-active {
  display: grid;
  gap: 12px;
}

.billing-mini-meta {
  margin: 0;
  display: grid;
  gap: 6px;
}

.billing-mini-meta div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.billing-mini-meta dt,
.billing-mini-meta dd {
  margin: 0;
  font-size: 0.82rem;
}

.billing-mini-meta dt {
  color: var(--muted);
}

.billing-mini-meta dd {
  color: var(--ink);
}

.billing-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.billing-quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.billing-quick-filters .btn.is-active {
  border-color: rgba(244, 174, 87, 0.6);
  background: rgba(244, 174, 87, 0.14);
  color: var(--accent-soft);
}

.payment-row-attention td {
  background: rgba(151, 34, 12, 0.08);
}

.payment-row-attention:hover td {
  background: rgba(151, 34, 12, 0.14);
}

.plan-card-form,
.payment-method-card,
.operation-form {
  border: 1px solid rgba(244, 174, 87, 0.14);
  border-radius: 12px;
  padding: 12px;
  background: rgba(9, 20, 31, 0.28);
  display: grid;
  gap: 10px;
}

.plan-card-head,
.payment-method-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.payment-method-card dl {
  margin: 0;
  display: grid;
  gap: 8px;
}

.payment-method-card dl div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.payment-method-card dt,
.payment-method-card dd {
  margin: 0;
  font-size: 0.82rem;
}

.payment-method-card dt {
  color: var(--muted);
}

.payment-method-card dd {
  color: var(--ink);
}

.inline-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.operation-card {
  margin-top: 2px;
}

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

.wizard-step {
  display: none;
  border: 1px solid rgba(244, 174, 87, 0.16);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.wizard-step.is-active {
  display: grid;
  gap: 10px;
}

.wizard-step legend {
  color: var(--accent-soft);
  font-family: "Montserrat", "Lato", sans-serif;
  font-weight: 700;
  margin-bottom: 6px;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.wizard-protocol-checks {
  display: grid;
  gap: 8px;
}

.provider-status-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.provider-status-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(244, 174, 87, 0.14);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.02);
}

.empty-block {
  border: 1px dashed rgba(244, 174, 87, 0.3);
  border-radius: 12px;
  padding: 16px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

.entity-drawer,
.confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 11, 17, 0.65);
  backdrop-filter: blur(2px);
  z-index: 80;
  display: grid;
  justify-items: end;
}

.confirm-modal {
  justify-items: center;
  align-items: center;
}

.entity-drawer-card,
.confirm-modal-card {
  width: min(560px, 92vw);
  height: 100%;
  border-left: 1px solid var(--line);
  background: #112638;
  padding: 18px;
  overflow: auto;
  box-shadow: -8px 0 26px rgba(0, 0, 0, 0.3);
}

.confirm-modal-card {
  width: min(420px, 92vw);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

.entity-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.entity-drawer-body {
  display: grid;
  gap: 12px;
}

.drawer-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.drawer-meta-grid > div {
  border: 1px solid rgba(244, 174, 87, 0.16);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.drawer-meta-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.drawer-meta-grid strong {
  color: var(--ink);
}

.drawer-list {
  display: grid;
  gap: 8px;
}

.drawer-list h5 {
  margin: 0;
  color: var(--accent-soft);
}

.drawer-link {
  width: 100%;
  display: block;
  text-align: left;
  border: 1px solid rgba(244, 174, 87, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink);
  padding: 10px;
}

.row-highlight {
  animation: rowPulse 1.1s ease;
}

@keyframes rowPulse {
  0% { background: rgba(244, 174, 87, 0.35); }
  100% { background: transparent; }
}

.btn.warning {
  border-color: rgba(245, 158, 11, 0.44);
  color: #f7cd7b;
}

.btn.destructive {
  border-color: rgba(231, 111, 81, 0.5);
  background: rgba(151, 34, 12, 0.3);
  color: #ffd8ce;
}

.btn.destructive:hover:not(:disabled) {
  background: rgba(151, 34, 12, 0.46);
  border-color: rgba(231, 111, 81, 0.7);
}

@media (max-width: 1200px) {
  .admin-ops-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    max-height: none;
  }

  .admin-nav {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

@media (max-width: 780px) {
  .admin-content-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .drawer-meta-grid {
    grid-template-columns: 1fr;
  }

  .entity-drawer {
    justify-items: stretch;
  }

  .entity-drawer-card {
    width: 100vw;
    border-left: none;
  }

  .billing-subtabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .billing-subtab {
    width: 100%;
  }

  .billing-quick-filters {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* ========== MAILINGS CENTER ========== */
.mailings-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.mailings-kpi-grid .signal-card {
  min-height: 96px;
}

.mailings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mailings-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid rgba(244, 174, 87, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  font-family: "Montserrat", "Lato", sans-serif;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.mailings-tab:hover {
  border-color: rgba(244, 174, 87, 0.46);
  color: var(--accent-soft);
}

.mailings-tab.is-active {
  color: var(--accent-contrast);
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
}

.mailings-pane {
  display: none;
  gap: 14px;
}

.mailings-pane.is-active {
  display: grid;
}

.inline-form {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.inline-email-input {
  min-width: 160px;
  max-width: 200px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(244, 174, 87, 0.18);
  background: rgba(9, 20, 31, 0.45);
  color: var(--ink);
  font-size: 0.82rem;
}

.mailing-sequence-list {
  display: grid;
  gap: 12px;
}

.mailing-sequence-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  border: 1px solid rgba(244, 174, 87, 0.2);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.mailing-sequence-order {
  min-width: 40px;
  height: 40px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: var(--accent-soft);
  background: rgba(244, 174, 87, 0.14);
}

.mailing-sequence-content {
  display: grid;
  gap: 6px;
}

.mailing-sequence-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.mailing-sequence-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.custom-mailing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr);
  gap: 14px;
}

.custom-mailing-editor,
.custom-mailing-preview {
  display: grid;
  gap: 12px;
}

.custom-mailing-editor {
  gap: 14px;
}

.mailing-block {
  border: 1px solid rgba(244, 174, 87, 0.2);
  border-radius: 12px;
  background: rgba(9, 20, 31, 0.28);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.mailing-block-head {
  display: grid;
  gap: 4px;
}

.mailing-block-head h5 {
  margin: 0;
  font-size: 1rem;
}

.custom-mailing-editor textarea {
  min-height: 160px;
}

.custom-mailing-segment-fields {
  display: grid;
  gap: 8px;
}

.summary-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.summary-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.summary-list span {
  color: var(--muted);
  font-size: 0.85rem;
}

.summary-list strong {
  color: var(--ink);
  font-size: 0.9rem;
  text-align: right;
}

#custom-preview-body {
  margin: 0;
  white-space: pre-wrap;
  font-family: "Lato", sans-serif;
  font-size: 0.9rem;
  color: var(--ink);
  max-height: 240px;
  overflow: auto;
}

@media (max-width: 980px) {
  .custom-mailing-layout {
    grid-template-columns: 1fr;
  }

  .custom-mailing-preview {
    order: -1;
  }
}

/* ========== GLOBAL FOOTER ========== */
.site-footer {
  max-width: 1280px;
  margin: 26px auto 0;
  padding: 0 0 6px;
}

.site-footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.site-footer-card {
  border: 1px solid rgba(244, 174, 87, 0.2);
  border-radius: 14px;
  background: rgba(10, 22, 33, 0.68);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.site-footer-title {
  margin: 0;
  font-size: 0.96rem;
  color: var(--accent-soft);
}

.site-footer-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.site-footer-inline {
  display: grid;
  gap: 6px;
}

.site-footer-label {
  color: var(--muted);
  font-size: 0.8rem;
}

.site-footer-mono {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 8px 10px;
  border: 1px solid rgba(244, 174, 87, 0.2);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--ink);
  font-size: 0.82rem;
}

.site-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-footer-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.site-footer-list li {
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.site-footer-list a,
.site-footer-list a:visited {
  color: #fbd99b;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer-list a:hover {
  color: #ffe8bf;
}

.domain-summary-lines {
  display: grid;
  gap: 8px;
}

.domain-summary-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.domain-summary-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
}

.domain-summary-sep {
  color: var(--muted);
  padding: 0 4px;
}

.domain-summary-line a,
.domain-summary-line a:visited {
  color: #fbd99b;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.domain-summary-line a:hover {
  color: #ffe8bf;
}

@media (max-width: 760px) {
  .site-footer-grid {
    grid-template-columns: 1fr;
  }
}

/* RTL support for Arabic/Urdu interfaces */
html[dir="rtl"] body,
html[dir="rtl"] .site-shell,
html[dir="rtl"] .page-shell {
  direction: rtl;
}

html[dir="rtl"] .back-link {
  direction: rtl;
}

html[dir="rtl"] .slot-card,
html[dir="rtl"] .subscription-summary-card,
html[dir="rtl"] .selected-slot-panel,
html[dir="rtl"] .ops-table th,
html[dir="rtl"] .ops-table td,
html[dir="rtl"] .section-head,
html[dir="rtl"] .admin-sidebar,
html[dir="rtl"] .admin-content-topbar {
  text-align: right;
}

html[dir="rtl"] .ops-table .actions-col,
html[dir="rtl"] .row-actions,
html[dir="rtl"] .conn-actions,
html[dir="rtl"] .selected-slot-actions,
html[dir="rtl"] .hero-actions {
  direction: rtl;
}

html[dir="rtl"] .billing-subtabs,
html[dir="rtl"] .billing-quick-filters {
  direction: rtl;
}

html[dir="rtl"] .benefits-copy-input,
html[dir="rtl"] #manual-referral-code,
html[dir="rtl"] #promo-code-input {
  direction: ltr;
  text-align: left;
}

/* Keep mixed technical snippets readable in RTL */
html[dir="rtl"] .mono,
html[dir="rtl"] code,
html[dir="rtl"] pre,
html[dir="rtl"] .endpoint,
html[dir="rtl"] .inline-code {
  direction: ltr;
  unicode-bidi: isolate;
}
