/* xRay Rabbit — cabinet v2 visual skin (indigo/violet, glass, soft gradients).
   Loaded on top of /shared/styles.css. Preserves all existing class hooks and IDs
   (JS contract unchanged); only restyles the cyan/cyber look into the calm SaaS palette
   that matches public landing v2. */

/* ===== v2 design tokens (override the cyan defaults from shared/styles.css) ===== */
:root {
  --xr-bg:       #0a0a14;
  --xr-card:     rgba(28, 22, 56, 0.42);
  --xr-card-2:   rgba(40, 32, 72, 0.55);
  --xr-border:   rgba(167, 139, 250, 0.18);
  --xr-border-2: rgba(167, 139, 250, 0.10);
  --xr-accent:   #a78bfa;
  --xr-accent-2: #7c5cff;
  --xr-accent-d: rgba(167, 139, 250, 0.45);
  --xr-accent-bg: rgba(124, 92, 255, 0.14);
  --xr-green:    #34d399;
  --xr-warn:     #f5b942;
  --xr-danger:   #f87171;
  --xr-hint:     rgba(210, 205, 235, 0.58);
  --xr-text:     #ece9f8;
  --xr-text-2:   #c9c4e0;
  --xr-font:     'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --xr-font-mono: ui-monospace, 'SF Mono', Menlo, Monaco, Consolas, 'JetBrains Mono', 'Roboto Mono', monospace;
  --font:        var(--xr-font);
  --xr-r-xs:  8px;
  --xr-r-sm:  10px;
  --xr-r:     14px;
  --xr-r-lg:  18px;
  --xr-r-xl:  24px;
  --xr-r-pill: 999px;
  --xr-sh-1:  0 1px 2px rgba(8, 6, 24, 0.6);
  --xr-sh-2:  0 8px 24px -10px rgba(8, 6, 24, 0.75), 0 2px 8px -2px rgba(8, 6, 24, 0.5);
  --xr-sh-3:  0 24px 56px -20px rgba(8, 6, 24, 0.85), 0 8px 18px -8px rgba(8, 6, 24, 0.55);
  --xr-sh-brand: 0 14px 36px -14px rgba(124, 92, 255, 0.55);
}

/* ===== base/atmosphere overrides ===== */
html, body {
  background: var(--xr-bg);
  color: var(--xr-text);
  font-family: var(--xr-font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
body {
  min-height: 100vh;
  overflow-x: hidden;
}
/* Replace cyan grid+scanlines with calm aurora wash. */
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(45% 38% at 12% 4%,  rgba(124, 92, 255, 0.30), transparent 62%),
    radial-gradient(40% 34% at 90% 8%,  rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(60% 42% at 50% 100%, rgba(124, 92, 255, 0.14), transparent 70%);
  background-size: auto;
  filter: blur(40px) saturate(1.1);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .35 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: .22;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
}

main { position: relative; z-index: 1; }

/* ===== page layout / container width ===== */
.xr-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 0 48px;
}
@media (min-width: 980px) {
  .xr-main { max-width: 880px; }
}
.xr-content { padding: 0 20px; }
.xr-content > * + * { margin-top: 18px; }

/* cabinet view — flatten the outer card, lay out children with stronger rhythm */
.xr-cabinet-view {
  display: grid;
  gap: 18px;
}
.xr-cabinet-view > * { order: 60; }
.xr-cabinet-view > .xr-account-hero { order: 0; }
.xr-cabinet-view > .xr-subscription-card { order: 20; }
.xr-cabinet-view > .xr-plans-card { order: 30; }
.xr-cabinet-view > .xr-selfcheck-card { order: 35; }
.xr-cabinet-view > .xr-devices-card { order: 40; }
.xr-cabinet-view > .xr-payments-card { order: 60; }
.xr-cabinet-view > .xr-locations-card { order: 70; }
.xr-cabinet-view > .xr-docs-card { order: 78; }
.xr-cabinet-view > .xr-support-card { order: 85; }
.xr-cabinet-view > .xr-profile-footer { order: 92; }
.xr-cabinet-view > #btn-logout { order: 100; }

.xr-cabinet-view.xr-dashboard-state-active > .xr-subscription-card { order: 10; }
.xr-cabinet-view.xr-dashboard-state-active > .xr-selfcheck-card { order: 18; }
.xr-cabinet-view.xr-dashboard-state-active > .xr-devices-card { order: 20; }
.xr-cabinet-view.xr-dashboard-state-active > .xr-plans-card { order: 50; }

.xr-cabinet-view.xr-dashboard-state-needs-payment > .xr-plans-card,
.xr-cabinet-view.xr-dashboard-state-payment-pending > .xr-plans-card { order: 20; }
.xr-cabinet-view.xr-dashboard-state-needs-payment > .xr-subscription-card,
.xr-cabinet-view.xr-dashboard-state-payment-pending > .xr-subscription-card { order: 30; }

@media (min-width: 980px) {
  .xr-payment-support-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .xr-cabinet-view {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 20px;
  }
  .xr-cabinet-view > .xr-account-hero,
  .xr-cabinet-view > .xr-subscription-card,
  .xr-cabinet-view > .xr-plans-card,
  .xr-cabinet-view > .xr-profile-footer {
    grid-column: 1 / -1;
  }
  .xr-cabinet-view > #btn-logout { grid-column: 1 / -1; justify-self: end; max-width: 220px; }
}

/* ===== header (brand row) ===== */
.xr-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px 14px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--xr-border-2);
  background: linear-gradient(180deg, rgba(10, 10, 20, 0.78) 0%, rgba(10, 10, 20, 0.55) 100%);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.xr-logo {
  display: flex; align-items: center; gap: 12px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-transform: none;
  text-decoration: none;
  color: var(--xr-text);
}
.xr-logo svg {
  width: 26px; height: 26px;
  color: var(--xr-accent);
}
.xr-logo-mark {
  width: 30px; height: 30px;
  object-fit: contain;
  display: block;
  /* recolor violet brand mark to electric neon cyan (grayscale-first chain) */
  filter:
    grayscale(100%) brightness(0.95) sepia(100%) saturate(6) hue-rotate(155deg) brightness(1.05)
    drop-shadow(0 0 10px rgba(0, 200, 255, 0.55));
}
.xr-logo span {
  background: linear-gradient(120deg, var(--xr-text) 0%, var(--xr-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ===== account hero (state-aware) ===== */
.xr-account-hero {
  position: relative;
  padding: 28px 26px 24px;
  border-radius: var(--xr-r-xl);
  border: 1px solid rgba(167, 139, 250, 0.28);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(124, 92, 255, 0.30), transparent 60%),
    radial-gradient(80% 80% at 100% 0%, rgba(34, 211, 238, 0.10), transparent 65%),
    linear-gradient(180deg, rgba(28, 22, 56, 0.65) 0%, rgba(40, 32, 72, 0.75) 100%);
  box-shadow: var(--xr-sh-3), 0 0 0 1px rgba(167, 139, 250, 0.10);
  overflow: hidden;
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.xr-account-hero::before {
  content: '';
  position: absolute;
  inset: -1px 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.65), transparent);
  pointer-events: none;
}
.xr-account-hero-orbit {
  position: absolute;
  right: -120px; top: -120px;
  width: 280px; height: 280px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(124, 92, 255, 0.35), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}
.xr-account-hero-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}
.xr-account-hero-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}
.xr-account-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.xr-hero-eyebrow {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--xr-accent);
}
.xr-account-hero-mark {
  flex-shrink: 0;
  width: 64px; height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: linear-gradient(140deg, rgba(124, 92, 255, 0.35), rgba(34, 211, 238, 0.15));
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: var(--xr-accent);
  box-shadow: var(--xr-sh-brand), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.xr-account-hero-mark svg { width: 36px; height: 36px; }
.xr-account-hero-title {
  position: relative;
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--xr-text);
  background: linear-gradient(120deg, #ffffff 0%, var(--xr-accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.xr-account-hero-lead {
  position: relative;
  margin: 0 0 14px;
  font-size: 13.5px;
  color: var(--xr-text-2);
  line-height: 1.5;
  max-width: 58ch;
}
.xr-account-hero-identity {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--xr-text-2);
}
.xr-account-hero-identity-label {
  color: var(--xr-hint);
}
.xr-account-hero-identity-value {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}
.xr-account-hero-name {
  font-weight: 600;
  color: var(--xr-text);
}
.xr-account-hero-name:empty { display: none; }
.xr-account-hero-name:not(:empty)::after {
  content: '·';
  margin-left: 6px;
  color: var(--xr-hint);
}
.xr-account-hero-email {
  color: var(--xr-text-2);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.xr-account-hero-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.xr-account-hero-stat {
  padding: 12px 14px;
  border-radius: var(--xr-r);
  background: rgba(8, 6, 24, 0.48);
  border: 1px solid var(--xr-border-2);
}
.xr-account-hero-stat .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--xr-hint);
  margin-bottom: 6px;
}
.xr-account-hero-stat .val {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--xr-text);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
#account-days-stat .val { color: var(--xr-accent); }
#account-days-stat.xr-account-days-warn {
  border-color: rgba(245, 185, 66, 0.35);
}
#account-days-stat.xr-account-days-warn .val { color: #fcd9a0; }
#account-days-stat.xr-account-days-danger {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}
#account-days-stat.xr-account-days-danger .val { color: #fca5a5; }

.xr-account-hero-actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.xr-account-hero-actions .xr-btn { margin-top: 0; }
.xr-hero-primary-btn {
  flex: 1 1 220px;
  min-width: 200px;
}
.xr-hero-secondary-btn {
  flex: 0 1 auto;
}
.xr-account-hero-hint {
  position: relative;
  margin-top: 14px;
}

/* status badge variants */
.xr-account-status-badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}
.xr-account-status-badge--active {
  border-color: rgba(52, 211, 153, 0.42);
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.12);
}
.xr-account-status-badge--warn {
  border-color: rgba(245, 185, 66, 0.42);
  color: #fcd9a0;
  background: rgba(245, 185, 66, 0.12);
}
.xr-account-status-badge--danger {
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.10);
}
.xr-account-status-badge--muted {
  border-color: var(--xr-border-2);
  color: var(--xr-text-2);
  background: rgba(8, 6, 24, 0.45);
}
.xr-account-status-badge--pending {
  border-color: rgba(167, 139, 250, 0.45);
  color: #c8b8ff;
  background: rgba(124, 92, 255, 0.15);
}

@media (max-width: 640px) {
  .xr-account-hero { padding: 22px 18px 20px; }
  .xr-account-hero-title { font-size: 24px; }
  .xr-account-hero-mark { width: 52px; height: 52px; }
  .xr-account-hero-mark svg { width: 30px; height: 30px; }
  .xr-account-hero-stats { grid-template-columns: 1fr; }
  .xr-hero-primary-btn,
  .xr-hero-secondary-btn { flex: 1 1 100%; }
}

/* ===== profile footer card ===== */
.xr-profile-form {
  margin-top: 6px;
}
.xr-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.xr-profile-field {
  min-width: 0;
}
.xr-profile-field-wide,
.xr-profile-actions {
  grid-column: 1 / -1;
}
.xr-profile-form .xr-profile-telegram-label {
  margin-top: 0;
}
.xr-profile-actions {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 2px;
}
.xr-profile-actions .xr-banner {
  flex: 1 1 auto;
  margin-top: 0;
}
.xr-profile-actions #btn-save-profile {
  flex: 0 0 auto;
  margin-top: 0;
  min-width: 148px;
}
@media (max-width: 640px) {
  .xr-profile-grid { grid-template-columns: 1fr; }
  .xr-profile-actions { flex-direction: column; align-items: stretch; }
  .xr-profile-actions #btn-save-profile { min-width: 0; width: 100%; }
}

.xr-chip-ok {
  border-color: rgba(52, 211, 153, 0.42);
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.10);
}

/* ===== section heads (icon + label) ===== */
.xr-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.xr-section-head .xr-label { margin: 0; }
.xr-section-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--xr-accent-bg);
  border: 1px solid rgba(167, 139, 250, 0.32);
  color: var(--xr-accent);
}
.xr-section-icon svg { width: 18px; height: 18px; }
.xr-section-head .xr-label {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--xr-text);
}

/* ===== stat cards (subscription summary, can be used elsewhere) ===== */
.xr-stats-grid {
  margin-bottom: 18px;
}
.xr-stat-card {
  padding: 14px 14px;
  border-radius: var(--xr-r);
  background: linear-gradient(180deg, rgba(15, 12, 32, 0.6) 0%, rgba(28, 22, 56, 0.5) 100%);
  border: 1px solid var(--xr-border-2);
  position: relative;
}
.xr-stat-card .lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--xr-hint);
  margin-bottom: 6px;
}
.xr-stat-card .val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--xr-text);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.xr-stat-card-accent {
  border-color: rgba(167, 139, 250, 0.32);
  background:
    radial-gradient(80% 100% at 0% 0%, rgba(124, 92, 255, 0.20), transparent 60%),
    linear-gradient(180deg, rgba(28, 22, 56, 0.65) 0%, rgba(40, 32, 72, 0.6) 100%);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.08);
}
.xr-stat-card-accent .val { color: var(--xr-accent); }
.xr-stat-card-accent .val.xr-days-left--warn   { color: #fcd9a0; }
.xr-stat-card-accent .val.xr-days-left--danger { color: #fca5a5; }

/* ===== cards ===== */
.xr-card {
  background: linear-gradient(180deg, var(--xr-card) 0%, var(--xr-card-2) 100%);
  border: 1px solid var(--xr-border);
  border-radius: var(--xr-r-lg);
  position: relative;
  box-shadow: var(--xr-sh-2);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
}
/* Drop the cyan corner ticks — they belong to the old aesthetic. */
.xr-card::before, .xr-card::after { content: none; }

.xr-section { padding: 22px 22px 22px; }
.xr-section.center { padding: 36px 24px; text-align: center; }
.xr-section.loader { padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 16px; }

.xr-compact-card {
  overflow: hidden;
}
.xr-compact-summary {
  cursor: pointer;
  list-style: none;
  margin-bottom: 0;
  user-select: none;
}
.xr-compact-summary::-webkit-details-marker { display: none; }
.xr-compact-summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--xr-hint);
  font-size: 13px;
  line-height: 1;
  transform: rotate(-90deg);
  transition: transform .16s, color .16s;
}
.xr-compact-card[open] > .xr-compact-summary {
  margin-bottom: 12px;
}
.xr-compact-card[open] > .xr-compact-summary::after {
  transform: rotate(0deg);
  color: var(--xr-accent);
}
.xr-compact-card:not([open]) {
  background: rgba(28, 22, 56, 0.34);
  box-shadow: var(--xr-sh-1);
}
.xr-compact-card:not([open]) .xr-section-icon {
  background: rgba(124, 92, 255, 0.10);
}

/* spinner — recolour */
.xr-spinner {
  width: 40px; height: 40px;
  border: 2.5px solid rgba(167, 139, 250, 0.18);
  border-top-color: var(--xr-accent);
}

/* ===== text/labels ===== */
.xr-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--xr-accent);
}
.xr-hint {
  color: var(--xr-hint);
  font-size: 13.5px;
  line-height: 1.55;
}
.xr-field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.005em;
  text-transform: none;
  color: var(--xr-text-2);
  margin-bottom: 8px;
}
.xr-row-between {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

/* ===== inputs ===== */
.xr-input {
  width: 100%;
  background: rgba(15, 12, 32, 0.55);
  border: 1px solid var(--xr-border);
  border-radius: var(--xr-r-sm);
  color: var(--xr-text);
  font-family: var(--xr-font);
  font-size: 15px;
  padding: 12px 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.xr-input::placeholder { color: rgba(210, 205, 235, 0.32); }
.xr-input:focus {
  border-color: var(--xr-accent);
  background: rgba(28, 22, 56, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.22);
}
.xr-input:disabled { opacity: .55; cursor: not-allowed; }
.xr-input-readonly {
  color: var(--xr-text-2);
  background: rgba(8, 6, 24, 0.42);
  cursor: default;
}
.xr-input-readonly:focus {
  border-color: var(--xr-border);
  background: rgba(8, 6, 24, 0.42);
  box-shadow: none;
}

#input-code {
  font-family: var(--xr-font-mono);
  letter-spacing: 0.4em;
  text-align: center;
  font-size: 19px;
  font-weight: 600;
}

/* ===== banners ===== */
.xr-banner {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--xr-border);
  border-radius: var(--xr-r);
  font-size: 13px;
  color: var(--xr-text-2);
  background: rgba(28, 22, 56, 0.4);
  line-height: 1.55;
}
.xr-banner.info {
  border-color: rgba(167, 139, 250, 0.40);
  background: rgba(124, 92, 255, 0.10);
  color: var(--xr-text);
}
.xr-banner.warn {
  border-color: rgba(245, 185, 66, 0.4);
  background: rgba(245, 185, 66, 0.08);
  color: #fcd9a0;
}
.xr-banner.danger {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.10);
  color: #fca5a5;
}

/* ===== buttons ===== */
.xr-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  background: linear-gradient(180deg, var(--xr-accent) 0%, var(--xr-accent-2) 100%);
  border: 1px solid transparent;
  border-radius: var(--xr-r-pill);
  color: #14102b;
  font-family: var(--xr-font);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--xr-sh-brand), inset 0 1px 0 rgba(255, 255, 255, 0.20);
  transition: transform .15s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.xr-btn:hover {
  background: linear-gradient(180deg, #b9a4ff 0%, #8e6dff 100%);
  box-shadow: 0 18px 40px -14px rgba(124, 92, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.xr-btn:active { transform: translateY(0.5px) scale(.99); }
.xr-btn.full { width: 100%; }
.xr-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
  box-shadow: none;
  background: rgba(124, 92, 255, 0.18);
  color: rgba(220, 215, 245, 0.5);
}

.xr-btn-muted {
  background: rgba(40, 32, 72, 0.55);
  color: var(--xr-text);
  border: 1px solid var(--xr-border);
  box-shadow: none;
}
.xr-btn-muted:hover {
  background: rgba(60, 48, 100, 0.7);
  border-color: rgba(167, 139, 250, 0.32);
  box-shadow: none;
  color: var(--xr-text);
}

/* ===== chip ===== */
.xr-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--xr-border);
  border-radius: var(--xr-r-pill);
  font-size: 12px;
  color: var(--xr-text-2);
  background: rgba(28, 22, 56, 0.45);
}

/* ===== sub grid / fields ===== */
.xr-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.xr-sub-field {
  padding: 10px 12px;
  border-radius: var(--xr-r-sm);
  background: rgba(15, 12, 32, 0.4);
  border: 1px solid var(--xr-border-2);
}
.xr-sub-field .lbl {
  font-size: 11px;
  color: var(--xr-hint);
  letter-spacing: 0.005em;
  text-transform: none;
  margin-bottom: 4px;
}
.xr-sub-field .val {
  font-size: 14px;
  font-weight: 500;
  color: var(--xr-text);
}
.xr-sub-field-wide { grid-column: 1 / -1; }

/* ===== section heading helpers ===== */
.xr-section-heading {
  margin-bottom: 12px;
  font-size: 13px;
}
.xr-section-intro {
  margin-bottom: 16px;
  color: var(--xr-hint);
}

/* OTP echo */
#otp-email-echo { margin-bottom: 14px; }

/* form action spacing */
.xr-form-submit    { margin-top: 16px; }
.xr-form-secondary { margin-top: 8px; }

/* ===== cabinet view layout ===== */
.xr-cabinet-grid       { margin-bottom: 16px; }
#view-cabinet .xr-row-between { gap: 12px; flex-wrap: wrap; }
#view-cabinet .xr-btn {
  white-space: normal;
  line-height: 1.3;
  text-align: center;
  min-height: 40px;
}
#view-cabinet .xr-sub-field .val {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ===== subscription card ===== */
.xr-subscription-card     { margin-bottom: 0; }
.xr-subscription-label    { margin-bottom: 8px; }
.xr-subscription-header   { margin-bottom: 14px; }
.xr-subscription-state-hint { margin-bottom: 14px; line-height: 1.6; color: var(--xr-text-2); }
.xr-subscription-state-hint--warn   { color: #fcd9a0; }
.xr-subscription-state-hint--danger { color: #fca5a5; }

#subscription-days-left.xr-days-left--warn   { color: #f5b942; font-weight: 600; }
#subscription-days-left.xr-days-left--danger { color: #f87171; font-weight: 700; }

.xr-subscription-workflow { display: grid; gap: 14px; margin-top: 4px; }
.xr-sub-block {
  padding: 14px 14px;
  border: 1px solid var(--xr-border);
  border-radius: var(--xr-r);
  background: rgba(15, 12, 32, 0.5);
}

/* subscription status pill */
.subscription-status-active,
.subscription-status-inactive,
.subscription-status-expired {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 5px 12px;
}
.subscription-status-active::before,
.subscription-status-inactive::before,
.subscription-status-expired::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 2px;
}
.subscription-status-active::before {
  background: #34d399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.7);
}
.subscription-status-inactive::before { background: #f5b942; }
.subscription-status-expired::before  { background: #f87171; }
.subscription-status-active   {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
}
.subscription-status-inactive {
  border-color: rgba(245, 185, 66, 0.4);
  background: rgba(245, 185, 66, 0.10);
  color: #fcd9a0;
}
.subscription-status-expired  {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.10);
  color: #fca5a5;
}

/* private subscription link block */
.xr-sub-link-block,
.xr-sub-qr-block {
  background: rgba(15, 12, 32, 0.6);
}
.xr-sub-link {
  font-family: var(--xr-font-mono);
  font-size: 11.5px;
  color: var(--xr-text);
  background: rgba(8, 6, 24, 0.7);
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: var(--xr-r-sm);
  padding: 10px 12px;
  margin: 6px 0 10px;
  max-height: 132px;
  overflow: auto;
  line-height: 1.55;
  word-break: break-all;
  overflow-wrap: anywhere;
  user-select: all;
  white-space: normal;
}
.xr-subscription-copy {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--xr-hint);
}

/* QR */
.xr-qr-wrap {
  margin: 10px auto 0;
  display: flex;
  justify-content: center;
  max-width: 260px;
  background: #fff;
  border: 1px solid var(--xr-border);
  border-radius: var(--xr-r);
  padding: 14px;
  box-sizing: border-box;
  box-shadow: var(--xr-sh-2);
}
.xr-qr-wrap img {
  display: block;
  max-width: 232px;
  width: 100%;
  height: auto;
}
.xr-qr-helper {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--xr-hint);
}

#btn-copy-sub-url.is-copied {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.4);
  color: #6ee7b7;
}

.xr-sub-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.xr-sub-link-action {
  flex: 1 1 200px;
  min-width: 0;
  text-align: center;
  text-decoration: none;
}
.xr-sub-link-action[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
}
@media (max-width: 480px) {
  .xr-sub-link-actions { flex-direction: column; }
  .xr-sub-link-action { flex: 1 1 auto; width: 100%; }
}

.xr-anchor {
  display: inline-block;
  width: 0;
  height: 0;
  overflow: hidden;
  vertical-align: top;
  scroll-margin-top: 96px;
  pointer-events: none;
}

/* Renew anchor on plans-card summary — keep clear of sticky header */
#renew-subscription { scroll-margin-top: 96px; }

/* Setup steps */
.xr-setup-warning {
  margin: 0 0 14px;
  line-height: 1.55;
}
.xr-setup-heading { margin: 4px 0 8px; }
.xr-connection-guide {
  padding: 0;
  overflow: hidden;
}
.xr-connection-guide-summary {
  display: grid;
  gap: 4px;
  padding: 14px;
  cursor: pointer;
  user-select: none;
}
.xr-connection-guide[open] .xr-connection-guide-summary {
  border-bottom: 1px solid var(--xr-border-2);
}
.xr-connection-guide-summary-hint {
  font-size: 12.5px;
  line-height: 1.45;
}
.xr-connection-guide > .xr-setup-warning,
.xr-connection-guide > .xr-connection-platform-label,
.xr-connection-guide > .xr-connection-platforms,
.xr-connection-guide > .xr-connection-guide-title,
.xr-connection-guide > .xr-connection-guide-steps,
.xr-connection-guide > .xr-setup-hint {
  margin-left: 14px;
  margin-right: 14px;
}
.xr-connection-guide > .xr-setup-warning { margin-top: 14px; }
.xr-connection-platform-label { margin-bottom: 8px; }
.xr-connection-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.xr-connection-platform {
  appearance: none;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r-pill);
  background: rgba(15, 12, 32, 0.52);
  color: var(--xr-text-2);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  padding: 8px 11px;
}
.xr-connection-platform:hover,
.xr-connection-platform.is-active {
  border-color: rgba(167, 139, 250, 0.46);
  background: rgba(124, 92, 255, 0.16);
  color: var(--xr-text);
}
.xr-connection-guide-title {
  color: var(--xr-text);
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 8px;
}
.xr-connection-guide > .xr-setup-hint {
  margin-bottom: 14px;
}
.xr-setup-steps {
  margin: 0 0 12px;
  padding-left: 22px;
  font-size: 13.5px;
  color: var(--xr-text);
  line-height: 1.6;
}
.xr-setup-steps li         { margin-bottom: 6px; }
.xr-setup-steps li::marker { color: var(--xr-accent); }
.xr-setup-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--xr-hint);
  line-height: 1.55;
}

/* ===== plans ===== */
.xr-plans-card     { margin-bottom: 0; }
.xr-plans-label    { margin-bottom: 8px; }
.xr-plans-list {
  list-style: none;
  margin: 4px 0 10px;
  padding: 0;
  display: grid;
  gap: 8px;
}
.xr-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--xr-r);
  border: 1px solid var(--xr-border-2);
  background: rgba(15, 12, 32, 0.5);
  font-size: 14px;
  color: var(--xr-text);
  transition: border-color .15s, background .15s;
}
.xr-plan-row:hover { border-color: rgba(167, 139, 250, 0.32); background: rgba(28, 22, 56, 0.6); }
.xr-plan-row--selected {
  border-color: rgba(167, 139, 250, 0.58);
  background:
    radial-gradient(80% 140% at 0% 0%, rgba(124, 92, 255, 0.20), transparent 70%),
    rgba(15, 12, 32, 0.62);
}
.xr-plan-row--secondary {
  border-color: var(--xr-border-2);
  background: rgba(15, 12, 32, 0.42);
}
.xr-plan-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 500;
}
.xr-plan-price {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--xr-text);
  white-space: nowrap;
  line-height: 1.2;
}
.xr-plan-price-main {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--xr-text);
}
.xr-plan-price-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--xr-hint);
  letter-spacing: 0.01em;
}
.xr-plan-pay-btn--unavailable {
  opacity: 0.65;
  cursor: not-allowed;
}
.xr-plan-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--xr-r-pill);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--xr-accent);
  background: var(--xr-accent-bg);
  border: 1px solid rgba(167, 139, 250, 0.30);
}
.xr-plan-badge--selected {
  color: #6ee7b7;
  background: rgba(52, 211, 153, 0.10);
  border-color: rgba(52, 211, 153, 0.34);
}
.xr-plans-hint { margin-bottom: 6px; color: var(--xr-hint); }
.xr-plans-cta  { font-weight: 500; color: var(--xr-text); margin-bottom: 10px; }
.xr-plan-row .xr-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  font-size: 12px;
  margin-left: 8px;
}

.xr-plans-result          { margin-top: 14px; display: grid; gap: 10px; }
.xr-plans-result-msg      { margin: 0; }
.xr-plans-result-hint     { margin: 4px 0 0; font-size: 12.5px; color: var(--xr-hint); line-height: 1.55; }
.xr-payment-status-card {
  margin: 12px 0 0;
  padding: 14px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r);
  background: rgba(15, 12, 32, 0.46);
}
.xr-payment-status-card--ok {
  border-color: rgba(52, 211, 153, 0.34);
  background: rgba(52, 211, 153, 0.08);
}
.xr-payment-status-card--warn {
  border-color: rgba(245, 185, 66, 0.36);
  background: rgba(245, 185, 66, 0.08);
}
.xr-payment-status-card--danger {
  border-color: rgba(248, 113, 113, 0.38);
  background: rgba(248, 113, 113, 0.08);
}
.xr-payment-status-card--info {
  border-color: rgba(167, 139, 250, 0.34);
}
.xr-payment-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.xr-payment-status-badge {
  flex-shrink: 0;
  font-size: 11px;
}
.xr-payment-status-summary {
  color: var(--xr-text);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
}
.xr-payment-status-list {
  margin: 10px 0 0;
  padding-left: 22px;
  color: var(--xr-text-2);
  font-size: 12.8px;
  line-height: 1.55;
}
.xr-payment-status-list li { margin-bottom: 5px; }
.xr-payment-status-list li:last-child { margin-bottom: 0; }
.xr-payment-status-list li::marker { color: var(--xr-accent); font-weight: 700; }
.xr-payment-support-rules {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--xr-border-2);
}
.xr-payment-support-title { margin-bottom: 8px; }
.xr-payment-support-grid {
  display: grid;
  gap: 10px;
}
.xr-payment-support-col {
  padding: 10px 12px;
  border-radius: var(--xr-r);
  border: 1px solid rgba(52, 211, 153, 0.20);
  background: rgba(52, 211, 153, 0.06);
}
.xr-payment-support-col--danger {
  border-color: rgba(248, 113, 113, 0.24);
  background: rgba(248, 113, 113, 0.06);
}
.xr-payment-support-subtitle {
  margin-bottom: 6px;
  color: var(--xr-text);
  font-size: 12.5px;
  font-weight: 600;
}
.xr-payment-support-col ul {
  margin: 0;
  padding-left: 18px;
  color: var(--xr-hint);
  font-size: 12px;
  line-height: 1.5;
}
.xr-payment-support-col li { margin-bottom: 4px; }
.xr-payment-support-col li:last-child { margin-bottom: 0; }
.xr-payment-recovery-steps {
  margin: 0;
  padding: 12px 14px 12px 36px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r);
  background: rgba(15, 12, 32, 0.5);
  color: var(--xr-text-2);
  font-size: 13px;
  line-height: 1.55;
}
.xr-payment-recovery-steps li { margin-bottom: 6px; }
.xr-payment-recovery-steps li:last-child { margin-bottom: 0; }
.xr-payment-recovery-steps li::marker {
  color: var(--xr-accent);
  font-weight: 700;
}

.xr-payment-secondary {
  margin-top: 4px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r);
  background: rgba(15, 12, 32, 0.5);
}
.xr-payment-secondary-summary {
  padding: 10px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--xr-text-2);
  cursor: pointer;
  user-select: none;
}
.xr-payment-secondary[open] .xr-payment-secondary-summary { color: var(--xr-text); }
.xr-payment-secondary-hint {
  padding: 0 14px 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--xr-hint);
}
.xr-payment-secondary .xr-btn {
  margin: 0 14px 14px;
  width: calc(100% - 28px);
}

/* ===== support handoff (do / don't) ===== */
.xr-support-handoff {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 14px;
}
.xr-support-handoff-col {
  padding: 12px 14px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r);
  background: rgba(15, 12, 32, 0.5);
}
.xr-support-handoff-title {
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.xr-support-handoff-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--xr-text-2);
}
.xr-support-handoff-list li {
  position: relative;
  padding-left: 18px;
  overflow-wrap: anywhere;
}
.xr-support-handoff-list li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
}
.xr-support-handoff-col--do {
  border-color: rgba(52, 211, 153, 0.32);
  background: rgba(52, 211, 153, 0.06);
}
.xr-support-handoff-col--do .xr-support-handoff-title { color: #6ee7b7; }
.xr-support-handoff-col--do .xr-support-handoff-list li::before {
  content: '✓';
  color: #6ee7b7;
}
.xr-support-handoff-col--dont {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.06);
}
.xr-support-handoff-col--dont .xr-support-handoff-title { color: #fca5a5; }
.xr-support-handoff-col--dont .xr-support-handoff-list li::before {
  content: '✗';
  color: #fca5a5;
}
@media (max-width: 560px) {
  .xr-support-handoff { grid-template-columns: 1fr; }
}

/* ===== self-check card ===== */
.xr-selfcheck-card     { margin-bottom: 0; }
.xr-selfcheck-label    { margin-bottom: 8px; }
.xr-selfcheck-intro    { margin-bottom: 14px; line-height: 1.55; }
.xr-selfcheck-list {
  display: grid;
  gap: 0;
  margin-bottom: 14px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r);
  overflow: hidden;
  background: rgba(15, 12, 32, 0.5);
}
.xr-selfcheck-row {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 14px;
  border-bottom: 1px solid var(--xr-border-2);
  font-size: 13px;
  line-height: 1.5;
}
.xr-selfcheck-row:last-child { border-bottom: none; }
.xr-selfcheck-row-label { color: var(--xr-hint); overflow-wrap: anywhere; }
.xr-selfcheck-row-value { color: var(--xr-text); font-weight: 500; overflow-wrap: anywhere; word-break: break-word; }
.xr-selfcheck-value--ok     { color: #6ee7b7; }
.xr-selfcheck-value--warn   { color: #fcd9a0; }
.xr-selfcheck-value--danger { color: #fca5a5; }
.xr-selfcheck-value--muted  { color: var(--xr-hint); }
.xr-selfcheck-actions { display: grid; gap: 10px; }
.xr-selfcheck-next-step { margin-top: 14px; line-height: 1.6; }

/* ===== recovery ===== */
.xr-recovery-card   { margin-bottom: 0; }
.xr-recovery-label  { margin-bottom: 8px; }
.xr-recovery-intro  { margin-bottom: 12px; line-height: 1.6; }
.xr-recovery-list {
  margin: 0 0 14px;
  padding-left: 22px;
  font-size: 13.5px;
  color: var(--xr-text);
  line-height: 1.6;
}
.xr-recovery-list li         { margin-bottom: 8px; overflow-wrap: anywhere; }
.xr-recovery-list li:last-child { margin-bottom: 0; }
.xr-recovery-list li::marker { color: var(--xr-accent); }
.xr-recovery-actions {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}
.xr-recovery-support-btn { display: block; text-align: center; }
.xr-recovery-privacy {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--xr-hint);
  line-height: 1.55;
}

/* devices */
.xr-devices-card    { margin-bottom: 0; }
.xr-devices-label   { margin-bottom: 8px; }
.xr-devices-summary { margin-bottom: 6px; line-height: 1.55; color: var(--xr-text-2); }
.xr-devices-policy {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r);
  font-size: 12.5px;
  line-height: 1.55;
  background: rgba(15, 12, 32, 0.5);
  color: var(--xr-hint);
}
.xr-devices-cooldown {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 185, 66, 0.35);
  border-radius: var(--xr-r);
  font-size: 13px;
  color: #fcd9a0;
  background: rgba(245, 185, 66, 0.08);
}
.xr-devices-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.xr-device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r);
  background: rgba(15, 12, 32, 0.5);
  font-size: 14px;
  color: var(--xr-text);
  line-height: 1.4;
  word-break: break-word;
}
.xr-device-row:last-child { border-bottom: none; }
.xr-device-label { min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.xr-device-delete-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 11.5px;
}

.xr-devices-howto {
  margin: 10px 0 0;
  padding-left: 22px;
  font-size: 13px;
  color: var(--xr-text-2);
  line-height: 1.55;
}
.xr-devices-howto li { margin-bottom: 5px; }
.xr-devices-howto li:last-child { margin-bottom: 0; }
.xr-devices-howto li::marker { color: var(--xr-accent); }

/* ===== locations ===== */
.xr-locations-card  { margin-bottom: 0; }
.xr-locations-label { margin-bottom: 8px; }
.xr-locations-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.xr-location-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r);
  background: rgba(15, 12, 32, 0.5);
  font-size: 14px;
  color: var(--xr-text);
}
.xr-location-label {
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 0;
  font-weight: 500;
}
.xr-location-status {
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  font-size: 12.5px;
  color: var(--xr-hint);
  white-space: nowrap;
}
.xr-location-status--online  { color: #6ee7b7; }
.xr-location-status--offline { color: #fca5a5; }
.xr-location-status--unknown { color: var(--xr-hint); }
.xr-status-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.xr-status-dot--online  { background: #34d399; box-shadow: 0 0 8px rgba(52, 211, 153, 0.5); }
.xr-status-dot--offline { background: #f87171; }
.xr-status-dot--unknown { background: var(--xr-hint); opacity: .7; }

/* ===== payments ===== */
.xr-payments-card  { margin-bottom: 0; }
.xr-payments-label { margin-bottom: 8px; }
.xr-payments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.xr-payment-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r);
  background: rgba(15, 12, 32, 0.5);
  font-size: 13.5px;
  color: var(--xr-text);
}
.xr-payment-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.xr-payment-plan { font-size: 13px; color: var(--xr-text); font-weight: 500; }
.xr-payment-meta { font-size: 11.5px; color: var(--xr-hint); }
.xr-payment-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}
.xr-payment-amount { font-size: 14px; color: var(--xr-text); font-weight: 600; white-space: nowrap; }
.xr-payment-badge {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: var(--xr-r-pill);
  border: 1px solid var(--xr-border);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}
.xr-payment-badge--paid    {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(52, 211, 153, 0.10);
  color: #6ee7b7;
}
.xr-payment-badge--pending {
  border-color: rgba(245, 185, 66, 0.42);
  background: rgba(245, 185, 66, 0.10);
  color: #fcd9a0;
}
.xr-payment-badge--failed  {
  border-color: rgba(248, 113, 113, 0.42);
  background: rgba(248, 113, 113, 0.10);
  color: #fca5a5;
}
.xr-payment-note {
  font-size: 11.5px;
  color: var(--xr-hint);
  line-height: 1.55;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.xr-payment-note--warn { color: #fcd9a0; }
.xr-payments-hint { margin-top: 10px; font-size: 12px; line-height: 1.55; color: var(--xr-hint); }
.xr-payment-action { margin-top: 6px; }
.xr-payment-action-btn { padding: 5px 12px; font-size: 11px; }

/* ===== error view ===== */
#error-text {
  font-size: 14px;
  color: #fca5a5;
  margin-bottom: 16px;
}
.xr-state-icon {
  width: 44px; height: 44px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  color: var(--xr-accent);
  background: var(--xr-accent-bg);
  border: 1px solid var(--xr-border);
  border-radius: 50%;
}
.xr-state-icon svg { width: 22px; height: 22px; }
.xr-state-icon.warn   { color: #fcd9a0; background: rgba(245, 185, 66, 0.10); border-color: rgba(245, 185, 66, 0.32); }
.xr-state-icon.danger { color: #fca5a5; background: rgba(248, 113, 113, 0.10); border-color: rgba(248, 113, 113, 0.32); }

/* ===== profile form hints (hero card) ===== */
.xr-profile-telegram-label { margin-top: 14px; }
.xr-profile-name-hint { margin-top: 6px; font-size: 12px; color: var(--xr-hint); }
.xr-profile-username-hint { margin-top: 6px; font-size: 12px; color: var(--xr-hint); }

/* ===== support card ===== */
.xr-support-card    { margin-bottom: 0; }
.xr-support-label   { margin-bottom: 10px; }
.xr-support-hint    { margin: 10px 0 12px; line-height: 1.6; color: var(--xr-hint); }
.xr-support-action-btn { margin-bottom: 12px; display: block; text-align: center; }
.xr-support-link    { color: var(--xr-accent); text-decoration: none; }
.xr-support-link:hover { text-decoration: underline; }

.xr-diag-accordion {
  margin: 0 0 12px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r);
  overflow: hidden;
  background: rgba(15, 12, 32, 0.5);
}
.xr-diag-summary {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
  color: var(--xr-text-2);
  user-select: none;
  list-style: none;
}
.xr-diag-summary::-webkit-details-marker { display: none; }
.xr-diag-summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  color: var(--xr-accent);
  transition: transform .15s;
}
.xr-diag-accordion[open] .xr-diag-summary::before { transform: rotate(90deg); }
.xr-diag-accordion[open] .xr-diag-summary {
  border-bottom: 1px solid var(--xr-border-2);
  color: var(--xr-text);
}
.xr-diag-list { list-style: none; margin: 0; padding: 6px 14px 10px; }
.xr-diag-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--xr-border-2);
  font-size: 12.5px;
  color: var(--xr-text-2);
  line-height: 1.5;
}
.xr-diag-item:last-child { border-bottom: none; }
.xr-diag-marker {
  flex-shrink: 0;
  min-width: 14px;
  font-size: 14px;
  color: var(--xr-accent);
  line-height: 1.5;
}

.xr-email-verified   { color: #6ee7b7; }
.xr-email-unverified { color: #fcd9a0; }

/* ===== footer ===== */
.xr-footer {
  text-align: center;
  padding: 24px 18px;
  font-size: 12.5px;
  color: var(--xr-hint);
}
.xr-footer-copy { display: block; }
.xr-footer-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  justify-content: center;
  font-size: 12.5px;
}
.xr-footer-links a {
  color: var(--xr-text-2);
  text-decoration: none;
  transition: color .15s;
}
.xr-footer-links a:hover { color: var(--xr-text); }
.xr-footer-links span[aria-hidden="true"] { color: var(--xr-hint); }
.xr-footer-safety {
  margin-top: 12px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  font-size: 12px;
  line-height: 1.55;
  color: var(--xr-hint);
}
.xr-footer-safety strong { color: var(--xr-text-2); font-weight: 500; }

/* ===== logout button — soften ===== */
#btn-logout {
  background: rgba(40, 32, 72, 0.55);
  color: var(--xr-text-2);
  border: 1px solid var(--xr-border);
  box-shadow: none;
}
#btn-logout:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

/* ===== breakpoints ===== */
@media (min-width: 560px) {
  .xr-selfcheck-actions,
  .xr-recovery-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .xr-content { padding: 0 16px; }
  .xr-section { padding: 20px 18px; }
  .xr-hero { padding: 22px 18px 18px; border-radius: var(--xr-r-lg); }
  .xr-hero-title { font-size: 24px; }
  .xr-hero-mark { width: 52px; height: 52px; border-radius: 14px; }
  .xr-hero-mark svg { width: 28px; height: 28px; }
  .xr-hero-profile-grid { grid-template-columns: 1fr; gap: 10px; }
  .xr-hero-profile-actions { flex-direction: column; align-items: stretch; }
  .xr-hero-profile-actions #btn-save-profile { width: 100%; }
}

@media (max-width: 420px) {
  .xr-header { padding: 18px 18px 14px; }
  .xr-content { padding: 0 14px; }
  .xr-section { padding: 18px 16px; }
  .xr-hero { padding: 20px 16px 16px; }
  .xr-hero-top { flex-direction: column-reverse; align-items: flex-start; gap: 12px; }
  .xr-hero-mark { width: 48px; height: 48px; border-radius: 12px; }
  .xr-hero-mark svg { width: 26px; height: 26px; }
  .xr-hero-title { font-size: 22px; }
  .xr-hero-meta { grid-template-columns: 1fr; gap: 8px; margin-top: 14px; }
  .xr-stat-card .val { font-size: 19px; }

  .xr-cabinet-grid {
    grid-template-columns: 1fr;
  }

  .xr-plan-row,
  .xr-device-row,
  .xr-payment-row,
  .xr-location-row {
    align-items: stretch;
    flex-wrap: wrap;
  }
  .xr-plan-row .xr-btn,
  .xr-device-delete-btn,
  .xr-payment-action-btn {
    width: 100%;
    margin-left: 0;
    min-height: 38px;
  }

  .xr-plan-price,
  .xr-payment-amount,
  #subscription-days-left {
    font-variant-numeric: tabular-nums;
  }

  .xr-payment-info,
  .xr-payment-right {
    width: 100%;
    align-items: flex-start;
  }

  .xr-payment-amount,
  .xr-payment-badge,
  .xr-location-status {
    white-space: normal;
  }

  .xr-plan-label,
  .xr-location-label {
    flex-wrap: wrap;
  }

  .xr-selfcheck-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 10px 14px;
  }

  .xr-recovery-list,
  .xr-devices-howto,
  .xr-setup-steps {
    padding-left: 20px;
  }

  .xr-sub-link {
    font-size: 10.5px;
    padding: 10px;
    max-height: 116px;
  }

  .xr-sub-block { padding: 12px; }

  .xr-payment-secondary .xr-btn {
    margin-left: 10px;
    margin-right: 10px;
    width: calc(100% - 20px);
  }

  .xr-qr-wrap { max-width: 100%; padding: 12px; }
  .xr-qr-wrap img { max-width: min(100%, 220px); }
}

@media (max-width: 360px) {
  .xr-selfcheck-row-label,
  .xr-selfcheck-row-value { font-size: 12px; }

  .xr-sub-link { font-size: 10px; max-height: 96px; }

  .xr-setup-steps,
  .xr-recovery-list,
  .xr-devices-howto { font-size: 12.5px; }

  #view-cabinet .xr-btn { font-size: 12px; }
}

/* ===== first-run helper card (static, after subscription) ===== */
.xr-firstrun-card .xr-firstrun-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; margin-top: 12px;
}
.xr-firstrun-step {
  background: var(--xr-bg-2, rgba(255,255,255,0.02));
  border: 1px solid var(--xr-border, rgba(255,255,255,0.08));
  border-radius: 14px;
  padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 0;
}
.xr-firstrun-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(167, 139, 250, 0.18);
  color: var(--xr-accent, #a78bfa);
  font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
}
.xr-firstrun-title {
  font-size: 14.5px; font-weight: 600; letter-spacing: -0.005em;
}
.xr-firstrun-body {
  font-size: 13px; line-height: 1.55;
  color: var(--xr-hint, rgba(255,255,255,0.6));
}
.xr-firstrun-foot {
  margin-top: 14px;
  font-size: 12.5px; color: var(--xr-hint, rgba(255,255,255,0.6));
  line-height: 1.55;
}
@media (max-width: 720px) {
  .xr-firstrun-card .xr-firstrun-grid { grid-template-columns: 1fr; }
}

/* ===== help-docs grid (used inline in support card) ===== */
.xr-helpdocs-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-top: 12px;
}
.xr-support-docs { margin-bottom: 12px; }
.xr-helpdocs-grid a {
  display: block; padding: 12px 14px;
  background: var(--xr-bg-2, rgba(255,255,255,0.02));
  border: 1px solid var(--xr-border, rgba(255,255,255,0.08));
  border-radius: 12px;
  color: inherit; text-decoration: none;
  transition: border-color .15s, background .15s;
}
.xr-helpdocs-grid a:hover {
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.06);
}
.xr-helpdocs-grid .rp-title {
  font-size: 13.5px; font-weight: 500;
  margin-bottom: 2px;
}
.xr-helpdocs-grid .rp-sub {
  font-size: 12px; color: var(--xr-hint, rgba(255,255,255,0.55));
}
@media (max-width: 520px) {
  .xr-helpdocs-grid { grid-template-columns: 1fr; }
}

/* ===== focus ring (cabinet view) ===== */
#view-cabinet .xr-btn:focus-visible,
#view-cabinet a.xr-btn:focus-visible,
#view-cabinet .xr-input:focus-visible,
#view-cabinet details > summary:focus-visible {
  outline: 2px solid var(--xr-accent);
  outline-offset: 3px;
  border-radius: var(--xr-r-pill);
}

/* ===== login stepper ===== */
.xr-login-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  counter-reset: xr-login-step;
}
.xr-login-stepper[data-step-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.xr-login-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px 8px;
  border: 1px solid var(--xr-border-2);
  border-radius: var(--xr-r-sm);
  background: rgba(15, 12, 32, 0.4);
  text-align: center;
}
.xr-login-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  background: rgba(28, 22, 56, 0.7);
  color: var(--xr-hint);
  border: 1px solid var(--xr-border);
}
.xr-login-step-label {
  font-size: 11.5px;
  color: var(--xr-hint);
  letter-spacing: 0.01em;
}
.xr-login-stepper[data-active="email"] .xr-login-step[data-step="email"],
.xr-login-stepper[data-active="code"]  .xr-login-step[data-step="code"] {
  border-color: var(--xr-accent);
  background: rgba(167, 139, 250, 0.12);
}
.xr-login-stepper[data-active="email"] .xr-login-step[data-step="email"] .xr-login-step-num,
.xr-login-stepper[data-active="code"]  .xr-login-step[data-step="code"]  .xr-login-step-num {
  background: var(--xr-accent);
  color: #0a0a16;
  border-color: var(--xr-accent);
}
.xr-login-stepper[data-active="email"] .xr-login-step[data-step="email"] .xr-login-step-label,
.xr-login-stepper[data-active="code"]  .xr-login-step[data-step="code"]  .xr-login-step-label {
  color: var(--xr-text);
  font-weight: 500;
}
.xr-login-stepper[data-active="code"] .xr-login-step[data-step="email"] .xr-login-step-num {
  background: rgba(167, 139, 250, 0.22);
  color: var(--xr-text-2);
}
@media (max-width: 420px) {
  .xr-login-stepper { gap: 6px; }
  .xr-login-step { padding: 8px 4px 6px; }
  .xr-login-step-label { font-size: 10.5px; }
}

/* ===== login plan hint ===== */
.xr-login-plan-hint {
  display: inline-flex;
  margin-bottom: 10px;
  background: rgba(167, 139, 250, 0.12);
  border-color: var(--xr-accent);
  color: var(--xr-text);
}

/* ===== subscription install-first reminder ===== */
.xr-sub-install-first { margin-bottom: 14px; }

/* ===== text-link button (used in hero identity) ===== */
.xr-link-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--xr-accent);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  padding: 4px 10px;
  border-radius: var(--xr-r-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color .15s, border-color .15s, color .15s;
}
.xr-link-btn:hover {
  background: var(--xr-accent-bg);
  border-color: rgba(167, 139, 250, 0.28);
  color: #d4c4ff;
}
.xr-link-btn:focus-visible {
  outline: 2px solid var(--xr-accent);
  outline-offset: 2px;
}
.xr-account-hero-name-btn {
  margin-left: 4px;
}

/* ===== payment method selector ===== */
.xr-payment-methods {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}
.xr-payment-methods-label {
  margin-bottom: 0;
}
.xr-payment-methods-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.xr-method-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--xr-r);
  background: rgba(15, 12, 32, 0.46);
  border: 1px solid var(--xr-border-2);
  color: var(--xr-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.xr-method-option:hover {
  border-color: rgba(167, 139, 250, 0.32);
  background: rgba(28, 22, 56, 0.6);
}
.xr-method-option.is-active {
  border-color: rgba(167, 139, 250, 0.55);
  background: rgba(124, 92, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.30);
}
.xr-method-option-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--xr-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.xr-method-option-sub {
  font-size: 11.5px;
  color: var(--xr-hint);
  letter-spacing: 0;
}
.xr-method-option-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: var(--xr-r-pill);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--xr-accent);
  background: var(--xr-accent-bg);
  border: 1px solid rgba(167, 139, 250, 0.32);
}
.xr-payment-method-notice {
  margin-top: 2px;
}
@media (max-width: 640px) {
  .xr-payment-methods-options { grid-template-columns: 1fr; }
}

/* ===== documents accordion ===== */
.xr-docs-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.xr-docs-list li { margin: 0; }
.xr-docs-list a {
  display: block;
  padding: 10px 14px;
  border-radius: var(--xr-r-sm);
  background: rgba(15, 12, 32, 0.46);
  border: 1px solid var(--xr-border-2);
  color: var(--xr-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: border-color .15s, background-color .15s, color .15s;
}
.xr-docs-list a:hover {
  border-color: rgba(167, 139, 250, 0.32);
  background: rgba(28, 22, 56, 0.6);
  color: var(--xr-accent);
}

/* ===== payment status compact note ===== */
.xr-payment-status-note {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--xr-hint);
  line-height: 1.5;
}
