:root {
  --bg: #080612;
  --bg-2: #0e0a1c;
  --surface: #151027;
  --surface-2: #1d1534;
  --surface-3: #261a43;
  --text: #f6f1ff;
  --muted: #b9abd6;
  --line: #342750;
  --violet: #9b4dff;
  --violet-2: #6f32d6;
  --cyan: #37d7ff;
  --green: #4ade80;
  --amber: #f7c948;
  --danger: #fb7185;
  --shadow: 0 18px 60px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(155, 77, 255, .14), transparent 420px),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-2) 48%, #080b16 100%);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.page-bg-grid {
  position: absolute;
  inset: 0;
  opacity: .13;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  width: min(1180px, calc(100% - 24px));
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 8px auto 0;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(13, 8, 27, .88);
  backdrop-filter: blur(18px);
  transition: transform .24s ease, opacity .2s ease, border-color .2s ease;
  will-change: transform;
}

.topbar.is-hidden {
  transform: translateY(calc(-100% - 12px));
  opacity: 0;
  pointer-events: none;
}

.brand {
  font-size: 24px;
  font-weight: 900;
  color: #d16cff;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  color: #ded5f1;
  font-size: 14px;
  font-weight: 700;
}

.nav a {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
}

.nav a:hover {
  background: rgba(255, 255, 255, .07);
}

.nav-toggle {
  display: none;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .07);
  font-weight: 900;
}

.autopay-check {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(155, 77, 255, .28);
  border-radius: 8px;
  color: #d9c3ff;
  background: rgba(155, 77, 255, .08);
  font-size: 14px;
  font-weight: 800;
}

.autopay-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--violet);
}

.page {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto;
}

.hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: 26px;
  align-items: center;
  padding: 44px 0 34px;
}

.hero-copy {
  max-width: 720px;
}

.hero-badge,
.eyebrow {
  color: #d9c3ff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  text-transform: none;
}

.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(74, 222, 128, .13);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
}

h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  max-width: 720px;
  margin: 18px 0 16px;
  font-size: clamp(44px, 6vw, 76px);
  line-height: .95;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 10px;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: 0;
}

.lead {
  max-width: 660px;
  margin: 0;
  color: #d7cdec;
  font-size: 18px;
  line-height: 1.55;
}

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

.btn,
.icon-btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--text);
  background: var(--surface-2);
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
  font-weight: 850;
}

.btn:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  border-color: #674a98;
  background: var(--surface-3);
}

.btn.primary {
  border-color: #b875ff;
  background: linear-gradient(135deg, var(--violet), var(--violet-2));
  color: white;
}

.btn.ghost {
  background: rgba(255,255,255,.06);
}

.btn.danger {
  border-color: rgba(251, 113, 133, .42);
  background: rgba(251, 113, 133, .12);
  color: #fecdd3;
}

.icon-btn {
  width: 40px;
  min-height: 40px;
  padding: 0;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.trust-row span,
.label,
.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  color: #e6dcf8;
  font-size: 13px;
  font-weight: 850;
}

.hero-device,
.panel,
.tool-card,
.tariff,
.checkout-panel,
.promo-card,
.step-card,
.support-panel,
.auth-card {
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03)),
    rgba(21, 16, 39, .92);
  box-shadow: var(--shadow);
}

.hero-device {
  position: relative;
  overflow: hidden;
  padding: 20px;
  background:
    linear-gradient(145deg, rgba(155, 77, 255, .18), rgba(55, 215, 255, .05)),
    rgba(21, 16, 39, .94);
}

.hero-device::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  pointer-events: none;
}

.device-top,
.panel-title,
.section-head,
.tariff-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.device-heading {
  display: grid;
  gap: 2px;
}

.device-heading small {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.server-chip {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(55, 215, 255, .3);
  border-radius: 8px;
  color: #e8f9ff;
  background: rgba(55, 215, 255, .1);
  font-weight: 950;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 6px rgba(247, 201, 72, .13);
}

.status-dot.is-active {
  background: var(--green);
  box-shadow: 0 0 0 6px rgba(74, 222, 128, .13);
}

.vpn-button {
  width: min(210px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  margin: 26px auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #130b22 0 49%, transparent 50%),
    conic-gradient(var(--violet) 0 76%, rgba(55, 215, 255, .9) 76% 86%, rgba(255,255,255,.13) 86% 100%);
  box-shadow: inset 0 0 28px rgba(155, 77, 255, .2), 0 0 48px rgba(155, 77, 255, .18);
}

.vpn-button span {
  font-size: 38px;
  font-weight: 950;
}

.vpn-button small {
  color: var(--cyan);
  font-weight: 850;
}

.metric-list,
.history-list,
.smart-list {
  display: grid;
  gap: 9px;
}

.metric-list div,
.history-item,
.smart-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0,0,0,.16);
}

.metric-list span,
.history-item span,
.section-note,
.tiny,
.panel p,
.step-card p,
.feature-card p,
.support-panel p,
.tariff p,
.clean-list {
  color: var(--muted);
}

.section {
  padding: 52px 0;
  border-top: 1px solid rgba(255,255,255,.08);
}

.compact-section {
  padding-top: 18px;
}

.section-head {
  align-items: end;
  margin-bottom: 22px;
}

.section-note {
  max-width: 420px;
  margin: 0;
  line-height: 1.45;
}

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

.step-card,
.feature-card {
  min-height: 170px;
  padding: 18px;
}

.step-card span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 8px;
  color: #130723;
  background: var(--cyan);
  font-weight: 950;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr) minmax(260px, .8fr);
  gap: 14px;
}

.telegram-recommendation {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(155, 77, 255, .42);
  border-left: 4px solid var(--cyan);
  border-radius: 8px;
  background: rgba(38, 26, 67, .82);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .2);
}

.telegram-recommendation[hidden] {
  display: none;
}

.telegram-recommendation-mark {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #07101a;
  background: var(--cyan);
  font-size: 15px;
  font-weight: 950;
}

.telegram-recommendation-copy {
  min-width: 0;
}

.telegram-recommendation-copy h3 {
  margin: 5px 0;
  font-size: 20px;
}

.telegram-recommendation-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.telegram-benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.telegram-benefits span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  color: #e9dfff;
  background: rgba(0, 0, 0, .14);
  font-size: 12px;
  font-weight: 750;
}

.telegram-recommendation-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.telegram-dismiss {
  flex: 0 0 auto;
  font-size: 22px;
}

.instant-connect-page {
  min-height: calc(100vh - 86px);
  display: grid;
  place-items: center;
  padding: 36px 0;
}

.instant-connect-panel {
  width: min(680px, 100%);
  text-align: center;
}

.instant-connect-panel h1 {
  max-width: 620px;
  margin: 12px auto 16px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1;
}

.instant-connect-panel .lead {
  margin-inline: auto;
}

.instant-connect-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border: 1px solid rgba(55, 215, 255, .3);
  border-radius: 50%;
  color: #07101a;
  background: var(--cyan);
  font-size: 30px;
  box-shadow: 0 0 0 10px rgba(55, 215, 255, .08);
}

.connect-status {
  margin-top: 22px;
  padding: 12px;
  border: 1px solid rgba(74, 222, 128, .25);
  border-radius: 8px;
  color: #dfffe9;
  background: rgba(74, 222, 128, .08);
  font-weight: 800;
}

.connect-status.is-waiting {
  color: #fff1c2;
  border-color: rgba(250, 204, 21, .25);
  background: rgba(250, 204, 21, .08);
}

.instant-connect-actions {
  justify-content: center;
}

.instant-connect-panel .tiny {
  margin: 18px 0 0;
}

.instant-connect-panel .tiny a {
  color: var(--cyan);
  font-weight: 850;
}

.connect-panel.is-bound {
  border-color: rgba(74, 222, 128, .26);
}

.connect-panel.is-bound .label {
  color: #dfffe9;
  border-color: rgba(74, 222, 128, .24);
  background: rgba(74, 222, 128, .08);
}

.panel {
  padding: 18px;
}

.tool-card {
  padding: 18px;
}

.key-box {
  min-height: 150px;
  max-height: 230px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 16px 0 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0818;
  color: #e9dfff;
  font-size: 13px;
  line-height: 1.5;
}

.tight-actions {
  gap: 8px;
}

.vertical-actions {
  display: grid;
  align-items: stretch;
}

.download-link {
  display: inline-flex;
  margin-top: 14px;
  color: var(--cyan);
  font-weight: 850;
}

.smart-note {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(55, 215, 255, .18);
  border-radius: 8px;
  background: rgba(55, 215, 255, .06);
}

.smart-note span {
  color: var(--muted);
  line-height: 1.45;
}

.smart-note a {
  color: var(--cyan);
  font-weight: 850;
}

.devices-panel {
  margin-top: 14px;
}

.device-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.device-summary div,
.device-row {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0,0,0,.16);
}

.device-summary span,
.device-row span {
  color: var(--muted);
}

.devices-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
  color: var(--muted);
}

.device-row div {
  display: grid;
  gap: 4px;
}

.device-row strong {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  color: #dfffe9;
  background: rgba(74, 222, 128, .12);
}

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

.history-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.compare-card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.compare-card.is-featured {
  border-color: rgba(155, 77, 255, .42);
  box-shadow: 0 20px 58px rgba(155, 77, 255, .16);
}

.compare-card h3 {
  margin: 0;
  font-size: 26px;
}

.clean-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.clean-list li::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: var(--cyan);
}

.history-list {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.history-item {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .16);
}

.history-item div {
  display: grid;
  gap: 4px;
}

.history-item span {
  color: var(--muted);
}

.history-item strong {
  text-align: right;
}

.history-item.is-paid strong {
  color: #dfffe9;
}

.history-item.is-pending strong,
.history-item.is-waiting_for_capture strong {
  color: #ffe9a8;
}

.diagnostics-box {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, .18);
}

.diagnostics-box[hidden] {
  display: none;
}

.diagnostics-box.is-ok {
  border-color: rgba(74, 222, 128, .38);
}

.diagnostics-box.is-warn {
  border-color: rgba(250, 204, 21, .38);
}

.diagnostics-box.is-bad {
  border-color: rgba(248, 113, 113, .46);
}

.diagnostics-head,
.diagnostics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.diagnostics-head span {
  color: var(--muted);
  font-weight: 800;
}

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

.diagnostics-row {
  justify-content: flex-start;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.035);
}

.diagnostics-row > strong {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
}

.diagnostics-row.is-ok > strong {
  color: #86efac;
  background: rgba(34, 197, 94, .14);
}

.diagnostics-row.is-warn > strong {
  color: #fde68a;
  background: rgba(234, 179, 8, .14);
}

.diagnostics-row.is-bad > strong {
  color: #fecaca;
  background: rgba(239, 68, 68, .18);
}

.diagnostics-row div {
  display: grid;
  gap: 3px;
}

.diagnostics-row span,
.diagnostics-box p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.vpn-status-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.vpn-status-item,
.vpn-status-loading {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.vpn-status-loading {
  grid-column: 1 / -1;
  color: var(--muted);
}

.vpn-status-indicator {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(251, 113, 133, .1);
}

.vpn-status-item.is-online .vpn-status-indicator {
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(74, 222, 128, .1);
}

.vpn-status-item.is-degraded .vpn-status-indicator {
  background: var(--amber);
  box-shadow: 0 0 0 5px rgba(247, 201, 72, .1);
}

.vpn-status-item div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.vpn-status-item span,
.vpn-status-item strong {
  color: var(--muted);
  font-size: 12px;
}

.vpn-status-item strong {
  margin-left: auto;
  color: var(--cyan);
}

.connection-recommendation {
  padding: 14px;
  border: 1px solid rgba(55, 215, 255, .25);
  border-radius: 8px;
  background: rgba(55, 215, 255, .06);
}

.connection-recommendation h4 {
  margin: 8px 0 5px;
  font-size: 20px;
}

.connection-recommendation ol {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.55;
}

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

.network-test-page {
  padding-top: 44px;
}

.network-test-card {
  max-width: 860px;
}

.network-test-card p,
.client-network-box p {
  max-width: 760px;
}

.client-network-box .diagnostics-row span {
  overflow-wrap: anywhere;
}

.has-modal {
  overflow: hidden;
}

.repair-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(5, 3, 11, .72);
  backdrop-filter: blur(12px);
}

.repair-modal[hidden] {
  display: none;
}

.repair-dialog {
  width: min(100%, 880px);
  max-height: min(86vh, 860px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(139, 92, 246, .34);
  border-radius: 10px;
  background: rgba(20, 10, 35, .97);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .52);
}

.repair-dialog-head,
.repair-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.repair-dialog-head h3,
.repair-panel-head h4,
.repair-result-card h4 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.repair-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.repair-tab {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.repair-tab.is-active {
  color: #fff;
  background: rgba(139, 92, 246, .42);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.repair-panel {
  display: none;
  gap: 12px;
}

.repair-panel.is-active {
  display: grid;
}

.repair-muted,
.repair-empty,
.repair-result-card p,
.autopick-row span {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.repair-empty {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.repair-empty.is-error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, .35);
  background: rgba(248, 113, 113, .08);
}

.server-list,
.autopick-list,
.repair-result,
.repair-stages {
  display: grid;
  gap: 8px;
}

.server-choice {
  width: 100%;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, .035);
  text-align: left;
  cursor: pointer;
}

.server-choice:hover,
.server-choice.is-selected {
  border-color: rgba(139, 92, 246, .6);
  background: rgba(139, 92, 246, .16);
}

.server-choice.is-special {
  background: rgba(255, 255, 255, .055);
}

.server-choice:disabled {
  cursor: default;
  opacity: .78;
}

.server-choice:disabled:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, .055);
}

.server-choice span,
.autopick-row div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.server-choice small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.server-choice strong {
  flex: 0 0 auto;
  color: var(--cyan);
  font-size: 12px;
  text-transform: uppercase;
}

.repair-stages {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.repair-stages span {
  min-height: 40px;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, .035);
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.repair-stages .is-ok {
  color: #dfffe9;
  border-color: rgba(74, 222, 128, .28);
  background: rgba(74, 222, 128, .1);
}

.repair-stages .is-warn {
  color: #fff1c2;
  border-color: rgba(250, 204, 21, .28);
  background: rgba(250, 204, 21, .1);
}

.repair-stages .is-bad {
  color: #ffd6d6;
  border-color: rgba(248, 113, 113, .28);
  background: rgba(248, 113, 113, .1);
}

.repair-result-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
}

.repair-result-card.is-ok {
  border-color: rgba(74, 222, 128, .36);
  background: rgba(22, 101, 52, .13);
}

.repair-result-card.is-warn {
  border-color: rgba(250, 204, 21, .34);
  background: rgba(113, 63, 18, .15);
}

.repair-result-card.is-bad {
  border-color: rgba(248, 113, 113, .36);
  background: rgba(127, 29, 29, .14);
}

.repair-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.autopick-results {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.autopick-row {
  min-height: 58px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
}

.autopick-row > strong {
  width: 28px;
  flex: 0 0 auto;
  text-align: center;
}

.autopick-row.is-ok {
  border-color: rgba(74, 222, 128, .22);
}

.autopick-row.is-warn {
  border-color: rgba(250, 204, 21, .24);
}

.autopick-row.is-bad {
  border-color: rgba(248, 113, 113, .24);
}

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

.stack-actions .btn {
  width: 100%;
}

.compact-head {
  margin-bottom: 12px;
}

.admin-diagnostics-result {
  margin-top: 14px;
}

.qr-frame {
  min-height: 250px;
  display: grid;
  place-items: center;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: #25113f;
  overflow: hidden;
}

.qr-frame img {
  display: none;
  width: min(230px, 92%);
  height: auto;
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(21, 16, 39, .75);
}

.tab {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.tab.is-active {
  color: white;
  background: var(--violet);
}

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

.tariff {
  min-height: 285px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  padding: 18px;
}

.tariff.selected {
  border-color: #b875ff;
  box-shadow: 0 18px 70px rgba(155, 77, 255, .2);
}

.tariff-head strong {
  color: var(--cyan);
  font-size: 20px;
}

.tariff h3 {
  min-height: 50px;
  margin: 0;
}

.tariff-price {
  font-size: 42px;
  line-height: 1;
  font-weight: 950;
}

.tariff-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.tariff-btn {
  width: 100%;
}

.checkout-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 16px;
  padding: 20px;
}

.checkout-price {
  margin: 12px 0;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1;
  font-weight: 950;
}

.spec-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.spec-row span {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.05);
  color: var(--muted);
}

.promo-card {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0818;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
}

textarea {
  resize: vertical;
  font: inherit;
}

.tiny {
  margin: 12px 0 0;
  line-height: 1.45;
}

.tiny.is-error {
  color: var(--danger);
}

.support-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .7fr) auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
}

.support-workspace {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.ticket-thread[hidden],
.ticket-create-form[hidden],
.ticket-empty-state[hidden] {
  display: none !important;
}

.ticket-sidebar {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: rgba(8, 5, 17, .42);
}

.ticket-sidebar-head,
.ticket-thread-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.ticket-sidebar-head p,
.support-footnote {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.ticket-list {
  display: grid;
  max-height: 460px;
  overflow-y: auto;
}

.ticket-list-item {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 15px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.ticket-list-item:hover,
.ticket-list-item.is-active {
  background: rgba(143, 64, 255, .13);
}

.ticket-list-item.is-active {
  box-shadow: inset 3px 0 var(--violet);
}

.ticket-list-title,
.ticket-list-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ticket-list-item span,
.ticket-list-item small {
  color: var(--muted);
}

.ticket-list-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--amber);
}

.ticket-status-dot.is-answered { background: var(--green); }
.ticket-status-dot.is-closed { background: var(--muted); }

.ticket-conversation {
  min-width: 0;
  min-height: 520px;
}

.ticket-empty,
.ticket-empty-state {
  color: var(--muted);
  text-align: center;
}

.ticket-empty {
  padding: 28px 18px;
}

.ticket-empty-state {
  min-height: 520px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
}

.ticket-empty-state h3,
.ticket-empty-state p,
.ticket-thread-head h3 {
  margin: 0;
}

.ticket-empty-state p {
  max-width: 520px;
  line-height: 1.55;
}

.ticket-empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(66, 211, 255, .35);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 24px;
  font-weight: 800;
}

.ticket-thread,
.ticket-create-form {
  min-height: 520px;
}

.ticket-thread {
  display: grid;
  grid-template-rows: auto minmax(260px, 1fr) auto;
}

.ticket-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 460px;
  padding: 20px;
  overflow-y: auto;
}

.ticket-bubble {
  width: fit-content;
  max-width: min(78%, 680px);
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
}

.ticket-bubble.is-user {
  align-self: flex-end;
  border-color: rgba(143, 64, 255, .38);
  background: rgba(143, 64, 255, .14);
}

.ticket-bubble.is-admin {
  align-self: flex-start;
  border-color: rgba(66, 211, 255, .32);
  background: rgba(66, 211, 255, .08);
}

.ticket-bubble-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.ticket-bubble p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ticket-message-form {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}

.ticket-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.ticket-form-actions .tiny {
  flex: 1;
  margin: 0;
}

.ticket-create-form {
  padding-bottom: 20px;
}

.ticket-create-form label {
  display: grid;
  gap: 7px;
  margin: 16px 18px 0;
  color: var(--muted);
  font-size: 13px;
}

.ticket-create-form .ticket-form-actions {
  margin: 16px 18px 0;
}

.support-footnote {
  text-align: right;
}

.support-footnote a {
  color: var(--cyan);
}

.gpt-panel {
  display: grid;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
}

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

.gpt-head h3,
.gpt-head p {
  margin: 0;
}

.gpt-head h3 {
  margin-top: 6px;
}

.gpt-head p {
  max-width: 760px;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.gpt-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
  max-height: 420px;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 5, 17, .38);
}

.gpt-message {
  width: fit-content;
  max-width: min(780px, 84%);
  padding: 12px 14px;
  border: 1px solid rgba(66, 211, 255, .28);
  border-radius: 8px;
  background: rgba(66, 211, 255, .08);
}

.gpt-message.is-user {
  align-self: flex-end;
  border-color: rgba(143, 64, 255, .42);
  background: rgba(143, 64, 255, .16);
}

.gpt-message b {
  display: block;
  margin-bottom: 6px;
}

.gpt-message p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.gpt-form {
  display: grid;
  gap: 10px;
}

.gpt-actions[hidden] {
  display: none !important;
}

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

.clean-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
}

.auth-shell {
  min-height: calc(100vh - 86px);
  display: grid;
  place-items: center;
  padding: 42px 0;
}

.auth-card {
  width: min(460px, 100%);
  padding: 28px;
}

.auth-card h1 {
  margin: 0 0 22px;
  font-size: 42px;
}

.form {
  display: grid;
  gap: 12px;
}

.wide { width: 100%; }

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

.admin-hero {
  padding-top: 10px;
}

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

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

.admin-notice {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid rgba(74, 222, 128, .28);
  border-radius: 8px;
  color: #dfffe9;
  background: rgba(74, 222, 128, .1);
}

.metric-card {
  min-height: 118px;
}

.metric-card h3 {
  margin: 8px 0 4px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1;
}

.metric-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.compact-metrics {
  margin-top: 14px;
}

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

.mini-form {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.ticket-reply-form {
  min-width: 260px;
  display: grid;
  gap: 8px;
}

.ticket-reply-form textarea {
  min-height: 84px;
  resize: vertical;
}

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

.section-head.compact {
  margin-bottom: 10px;
}

.admin-search {
  width: min(420px, 100%);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 2px 4px 2px 0;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  font-size: 12px;
  font-weight: 850;
}

.status-pill.ok {
  color: #dfffe9;
  border-color: rgba(74, 222, 128, .28);
  background: rgba(74, 222, 128, .1);
}

.status-pill.warn {
  color: #fff1c2;
  border-color: rgba(250, 204, 21, .28);
  background: rgba(250, 204, 21, .1);
}

.status-pill.danger {
  color: #ffd6d6;
  border-color: rgba(248, 113, 113, .28);
  background: rgba(248, 113, 113, .1);
}

.copy-chip,
.btn.tiny {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
}

.copy-chip {
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255,255,255,.04);
  cursor: pointer;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-table th,
.admin-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-table code {
  color: var(--cyan);
}

.table-wrap { overflow: auto; }

@media (max-width: 1080px) {
  .hero,
  .dashboard-grid,
  .checkout-panel,
  .support-panel {
    grid-template-columns: 1fr;
  }

  .hero-device {
    max-width: 520px;
  }

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

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

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

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

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

  .admin-two-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .telegram-recommendation {
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 14px;
  }

  .telegram-recommendation-mark {
    width: 44px;
    height: 44px;
  }

  .telegram-recommendation-actions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .telegram-recommendation-actions .btn {
    width: 100%;
  }

  .vpn-status-strip {
    grid-template-columns: 1fr;
  }

  .repair-modal {
    padding: 10px;
    align-items: end;
  }

  .repair-dialog {
    max-height: 92vh;
    padding: 14px;
    border-radius: 10px 10px 0 0;
  }

  .repair-tabs,
  .repair-stages {
    grid-template-columns: 1fr;
  }

  .repair-dialog-head,
  .repair-panel-head,
  .server-choice {
    align-items: stretch;
  }

  .server-choice {
    flex-direction: column;
  }

  .server-choice strong {
    align-self: flex-start;
  }

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

  .repair-result-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .repair-result-actions .btn {
    width: 100%;
  }

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

  .ticket-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .ticket-list {
    max-height: 250px;
  }

  .ticket-conversation,
  .ticket-empty-state,
  .ticket-thread,
  .ticket-create-form {
    min-height: 460px;
  }

  .ticket-bubble {
    max-width: 92%;
  }

  .ticket-form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ticket-form-actions .btn {
    width: 100%;
  }

  .support-footnote {
    text-align: left;
  }

  .topbar {
    min-height: 58px;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
    padding: 10px 12px;
  }

  .brand {
    font-size: 22px;
  }

  .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height .22s ease, opacity .2s ease, transform .2s ease, padding .2s ease;
  }

  .topbar.is-nav-open {
    border-color: rgba(155, 77, 255, .38);
  }

  .topbar.is-nav-open .nav {
    max-height: 260px;
    padding-top: 6px;
    opacity: 1;
    transform: translateY(0);
  }

  .nav a {
    min-height: 42px;
    justify-content: center;
    padding: 10px 8px;
    border: 1px solid rgba(255, 255, 255, .08);
    background: rgba(255, 255, 255, .045);
    text-align: center;
  }

  .page,
  .topbar {
    width: min(100% - 20px, 1180px);
  }

  .hero {
    min-height: auto;
    padding-top: 30px;
  }

  .section-head {
    display: block;
  }

  .section-head .status,
  .section-head .btn {
    margin-top: 12px;
  }

  .steps-grid,
  .feature-grid,
  .device-summary,
  .tariff-grid,
  .compare-grid,
  .history-grid,
  .admin-grid,
  .admin-actions-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    display: grid;
  }

  .actions,
  .tight-actions,
  .vertical-actions {
    display: grid;
  }

  .actions .btn,
  .tight-actions .btn,
  .vertical-actions .btn {
    width: 100%;
  }

  .tariff {
    min-height: auto;
  }

  .tariff h3 {
    min-height: auto;
  }
}
