:root {
  --bg: #03050d;
  --panel: rgba(8, 18, 34, 0.82);
  --panel-strong: rgba(10, 24, 46, 0.94);
  --text: #f4f8ff;
  --muted: #8fa3bd;
  --cyan: #24e7ff;
  --pink: #ff54e4;
  --green: #9dff46;
  --blue: #4c74ff;
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.075);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 22% 18%, rgba(36, 231, 255, 0.15), transparent 28rem),
    radial-gradient(circle at 78% 32%, rgba(255, 84, 228, 0.13), transparent 30rem),
    radial-gradient(circle at 70% 78%, rgba(157, 255, 70, 0.12), transparent 22rem),
    linear-gradient(135deg, #010208 0%, #061020 46%, #02040c 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 100% 3px;
  opacity: 0.22;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

@keyframes glass-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

button,
input {
  font: inherit;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-shell {
  width: min(1120px, 100%);
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 420px;
  gap: 28px;
  align-items: stretch;
}

.brand-panel,
.auth-card,
.panel,
.hero-band {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.025)),
    linear-gradient(145deg, rgba(8, 18, 34, 0.7), rgba(3, 7, 18, 0.82));
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.46),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 44px rgba(36, 231, 255, 0.04);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
}

.brand-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 48px;
}

.brand-panel::after {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(36, 231, 255, 0.12);
  border-radius: 28px;
}

.neon-shield {
  position: relative;
  width: min(58vw, 430px);
  aspect-ratio: 1;
  filter: drop-shadow(0 0 28px rgba(36, 231, 255, 0.42));
}

.shield-frame {
  position: absolute;
  inset: 8% 12% 12%;
  clip-path: polygon(50% 0, 100% 20%, 88% 76%, 50% 100%, 12% 76%, 0 20%);
  background:
    linear-gradient(135deg, var(--cyan), #f7fbff 28%, var(--pink) 53%, var(--green) 82%, var(--blue));
  padding: 16px;
}

.shield-frame::after {
  content: "";
  position: absolute;
  inset: 16px;
  clip-path: inherit;
  background: linear-gradient(145deg, #09182f, #040811);
  box-shadow: inset 0 0 42px rgba(36, 231, 255, 0.2);
}

.lock-body {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: 27%;
  transform: translate(-50%, -33%);
  border: 2px solid rgba(255, 255, 255, 0.42);
  background: linear-gradient(135deg, rgba(36, 231, 255, 0.85), rgba(4, 11, 23, 0.95) 45%, rgba(255, 84, 228, 0.78));
  box-shadow: 0 0 28px rgba(255, 84, 228, 0.42), inset 0 0 24px rgba(0, 0, 0, 0.6);
  z-index: 2;
}

.lock-arc {
  position: absolute;
  left: 50%;
  bottom: 82%;
  width: 78%;
  height: 78%;
  transform: translateX(-50%);
  border: 16px solid #eaf6ff;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  box-shadow: 0 0 22px rgba(36, 231, 255, 0.42);
}

.lock-core {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 28px;
  height: 58px;
  transform: translate(-50%, -35%);
  background: var(--cyan);
  clip-path: polygon(50% 0, 78% 35%, 68% 100%, 32% 100%, 22% 35%);
  filter: drop-shadow(0 0 10px rgba(36, 231, 255, 0.9));
}

.line,
.node {
  position: absolute;
  z-index: 3;
}

.line {
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--cyan), var(--pink), var(--green));
  box-shadow: 0 0 14px currentColor;
}

.line-a {
  left: 3%;
  top: 37%;
  width: 32%;
}

.line-b {
  right: 4%;
  top: 47%;
  width: 30%;
}

.line-c {
  left: 9%;
  top: 62%;
  width: 28%;
}

.node {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #dffcff;
  box-shadow: 0 0 0 5px rgba(36, 231, 255, 0.34), 0 0 22px var(--cyan);
}

.node-a {
  left: 0;
  top: calc(37% - 11px);
}

.node-b {
  right: 0;
  top: calc(47% - 11px);
  box-shadow: 0 0 0 5px rgba(255, 84, 228, 0.28), 0 0 22px var(--pink);
}

.node-c {
  left: 6%;
  top: calc(62% - 11px);
  box-shadow: 0 0 0 5px rgba(157, 255, 70, 0.28), 0 0 22px var(--green);
}

.brand-copy {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 44px;
  z-index: 4;
}

.brand-copy p,
.card-header p,
.panel-head p,
.hero-band p,
.accent-panel p {
  margin: 0 0 8px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 800;
}

.brand-copy h1 {
  margin: 0;
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.95;
  background: linear-gradient(90deg, #fff, var(--cyan), var(--pink), var(--green));
  -webkit-background-clip: text;
  color: transparent;
}

.brand-copy span,
.hero-band span,
.accent-panel span {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  max-width: 520px;
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
}

.card-header h2,
.panel h2,
.hero-band h1 {
  margin: 0;
}

.card-header h2 {
  font-size: 32px;
}

.form-stack {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

input {
  width: 100%;
  border: 1px solid rgba(36, 231, 255, 0.22);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

select {
  width: 100%;
  border: 1px solid rgba(36, 231, 255, 0.22);
  border-radius: var(--radius-md);
  background: rgba(5, 14, 28, 0.82);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
}

input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(36, 231, 255, 0.12);
}

button,
.small-action,
.button-link {
  border: 1px solid rgba(36, 231, 255, 0.42);
  border-radius: 999px;
  color: #dffcff;
  background: rgba(36, 105, 180, 0.18);
  padding: 14px 20px;
  font-weight: 900;
  font-size: 15px;
  cursor: pointer;
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px rgba(36, 231, 255, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

button:not(.danger-button):hover,
.small-action:hover,
.button-link:hover,
.ghost-button:hover,
.key-open-button:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 231, 255, 0.72);
  background: rgba(36, 135, 215, 0.28);
  box-shadow: 0 0 24px rgba(36, 231, 255, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.alert {
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 84, 228, 0.35);
  border-radius: var(--radius-md);
  color: #ffd8f8;
  background: rgba(255, 84, 228, 0.08);
}

.success-alert {
  border-color: rgba(157, 255, 70, 0.35);
  color: #eaffd6;
  background: rgba(157, 255, 70, 0.09);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px clamp(18px, 5vw, 64px);
  background: rgba(1, 3, 10, 0.58);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(145%);
  -webkit-backdrop-filter: blur(24px) saturate(145%);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 900;
}

.brand-mark span {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  background: url("/static/favicon.svg") center / contain no-repeat;
  filter: drop-shadow(0 0 14px rgba(36, 231, 255, 0.32));
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.nav-pill {
  min-width: 130px;
  border: 1px solid rgba(255, 84, 228, 0.24);
  border-radius: 999px;
  color: var(--text);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.035);
  padding: 11px 20px;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.nav-pill:hover,
.nav-pill.active {
  border-color: rgba(36, 231, 255, 0.5);
  box-shadow: 0 0 28px rgba(36, 231, 255, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.back-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 13px 22px 13px 44px;
  border-radius: 999px;
  border-color: rgba(36, 231, 255, 0.34);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(36, 231, 255, 0.1);
  color: #f4f8ff;
  font-weight: 900;
  overflow: hidden;
  box-shadow:
    0 0 26px rgba(36, 231, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.back-button::before {
  content: "<";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-53%);
  color: var(--cyan);
  font-weight: 900;
}

.dashboard {
  width: min(1180px, calc(100% - 32px));
  margin: 28px auto 56px;
}

.dashboard.narrow {
  width: min(760px, calc(100% - 32px));
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.32fr);
  gap: 22px;
  align-items: center;
  padding: clamp(24px, 4vw, 42px);
}

.hero-band.single {
  grid-template-columns: 1fr;
}

.key-hero {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.48fr);
  align-items: start;
}

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

.key-hero .status-grid article {
  min-width: 0;
}

.key-hero .status-grid strong {
  overflow-wrap: normal;
  word-break: normal;
}

.hero-band h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1;
}

.status-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.status-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035));
  padding: 16px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.status-grid span,
.key-row p,
.key-row em,
.payment-list span,
.payment-list time,
.identity-list dt,
.empty-state span {
  color: var(--muted);
  font-size: 13px;
}

.status-grid strong {
  display: block;
  margin-top: 12px;
  font-size: 28px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: 18px;
  margin-top: 18px;
}

.content-grid.single-column {
  grid-template-columns: 1fr;
}

.panel {
  padding: 24px;
}

.panel,
.hero-band,
.key-row,
.payment-list article,
.identity-list div,
.management-card {
  animation: glass-rise 520ms ease both;
}

.content-grid > *:nth-child(2) {
  animation-delay: 70ms;
}

.content-grid > *:nth-child(3) {
  animation-delay: 140ms;
}

.content-grid > *:nth-child(4) {
  animation-delay: 210ms;
}

.panel-wide {
  grid-row: span 2;
}

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

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.panel-actions form {
  margin: 0;
}

.small-action {
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 950;
}

.free-action {
  border-color: rgba(157, 255, 70, 0.36);
  background: rgba(157, 255, 70, 0.08);
  color: #eaffd6;
}

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

.hero-actions .small-action {
  border-color: rgba(36, 231, 255, 0.68);
  background:
    linear-gradient(145deg, rgba(36, 231, 255, 0.22), rgba(76, 116, 255, 0.12)),
    rgba(36, 105, 180, 0.24);
  color: #effbff;
  padding: 13px 18px;
  font-size: 15px;
  box-shadow:
    0 0 28px rgba(36, 231, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.hero-actions .small-action:hover {
  border-color: rgba(36, 231, 255, 0.95);
  background:
    linear-gradient(145deg, rgba(36, 231, 255, 0.32), rgba(76, 116, 255, 0.18)),
    rgba(36, 135, 215, 0.3);
  box-shadow:
    0 0 34px rgba(36, 231, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.key-list,
.payment-list,
.identity-list {
  display: grid;
  gap: 10px;
}

.key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 240px) minmax(180px, 0.7fr);
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.025));
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.key-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.key-row strong {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.key-row p {
  margin: 6px 0 0;
}

.key-meta {
  text-align: right;
}

.key-row em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  text-transform: uppercase;
}

.key-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 1px solid rgba(36, 231, 255, 0.46);
  border-radius: 999px;
  color: #dffcff;
  background: rgba(36, 105, 180, 0.2);
  font-size: 17px;
  font-weight: 900;
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px rgba(36, 231, 255, 0.08);
}

.support-card {
  display: grid;
  gap: 18px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(36, 231, 255, 0.2);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(145deg, rgba(36, 231, 255, 0.08), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.support-card p {
  margin: 0 0 8px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 800;
}

.support-card h2 {
  margin: 0;
}

.support-links {
  display: grid;
  gap: 10px;
}

.support-contact-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #dffcff;
  font-weight: 850;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
}

.support-contact-row span {
  color: var(--muted);
  font-weight: 900;
  flex: 0 0 auto;
}

.support-contact-row strong,
.support-contact-row a {
  color: #dffcff;
  font: inherit;
  overflow-wrap: anywhere;
  user-select: text;
  -webkit-user-select: text;
}

.support-contact-row a:hover {
  color: var(--cyan);
}

.danger-button {
  color: #ffd8f8;
  background: rgba(255, 84, 228, 0.14);
  border: 1px solid rgba(255, 84, 228, 0.34);
  box-shadow: none;
}

.device-row form {
  margin: 0;
}

.device-row {
  align-items: center;
}

.device-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.device-info span {
  overflow-wrap: anywhere;
}

.device-info code {
  color: #dffcff;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.agreement-card {
  width: min(1180px, calc(100% - 32px));
  margin: -30px auto 42px;
}

.auth-page .agreement-card {
  margin-top: 18px;
}

.agreement-card details {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018)),
    rgba(4, 10, 22, 0.62);
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.agreement-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-weight: 850;
}

.agreement-card summary::-webkit-details-marker {
  display: none;
}

.agreement-card summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(36, 231, 255, 0.3);
  border-radius: 999px;
  color: var(--cyan);
  background: rgba(36, 231, 255, 0.06);
}

.agreement-card details[open] summary::after {
  content: "-";
}

.agreement-card summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.agreement-content {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.agreement-content p {
  margin: 0;
}

.error-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.error-shell {
  width: min(760px, 100%);
}

.error-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(28px, 6vw, 58px);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
    linear-gradient(145deg, rgba(8, 18, 34, 0.82), rgba(3, 7, 18, 0.9));
  box-shadow:
    0 24px 90px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 0 48px rgba(36, 231, 255, 0.05);
  backdrop-filter: blur(28px) saturate(145%);
  -webkit-backdrop-filter: blur(28px) saturate(145%);
  animation: glass-rise 520ms ease both;
}

.error-card::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -110px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(36, 231, 255, 0.18);
  box-shadow: 0 0 70px rgba(36, 231, 255, 0.14);
}

.error-brand {
  margin-bottom: 34px;
}

.error-code {
  color: transparent;
  font-size: clamp(74px, 18vw, 150px);
  font-weight: 950;
  line-height: 0.85;
  background: linear-gradient(90deg, #fff, var(--cyan), var(--pink), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
}

.error-card p {
  margin: 22px 0 8px;
  color: var(--cyan);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}

.error-card h1 {
  margin: 0;
  font-size: clamp(34px, 7vw, 66px);
  line-height: 0.98;
}

.error-card > span {
  display: block;
  max-width: 620px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.35;
}

.error-card small {
  display: block;
  margin-top: 16px;
  color: rgba(255, 216, 248, 0.92);
  word-break: break-word;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

.status-dot.expired {
  background: var(--pink);
  box-shadow: 0 0 14px var(--pink);
}

.status-dot.free {
  background: var(--cyan);
  box-shadow: 0 0 14px var(--cyan);
}

.identity-list {
  margin: 0;
}

.identity-list div,
.payment-list article {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.payment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}

.payment-actions form {
  margin: 0;
}

.identity-list dd {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
}

.identity-list dd > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-status {
  flex: 0 0 auto;
  min-width: 44px;
  border-radius: 999px;
  padding: 5px 9px;
  text-align: center;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.account-status.ok {
  color: #eaffd6;
  border: 1px solid rgba(157, 255, 70, 0.34);
  background: rgba(157, 255, 70, 0.1);
  box-shadow: 0 0 14px rgba(157, 255, 70, 0.12);
}

.account-status.bad {
  color: #ffd8f8;
  border: 1px solid rgba(255, 84, 100, 0.36);
  background: rgba(255, 84, 100, 0.1);
  box-shadow: 0 0 14px rgba(255, 84, 100, 0.1);
}

.empty-state {
  display: grid;
  gap: 8px;
  min-height: 180px;
  place-content: center;
  text-align: center;
  border: 1px dashed rgba(36, 231, 255, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(36, 231, 255, 0.04);
}

.empty-state.compact {
  min-height: 120px;
}

.accent-panel {
  display: flex;
  align-items: end;
  min-height: 220px;
  background:
    linear-gradient(145deg, rgba(36, 231, 255, 0.16), rgba(255, 84, 228, 0.12)),
    var(--panel-strong);
}

.inline-form {
  margin-top: 18px;
}

.buy-form {
  display: grid;
  gap: 18px;
}

.compact-form {
  margin-top: 22px;
  gap: 12px;
}

.check-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  padding: 12px 14px;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.check-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--cyan);
}

.check-row span {
  margin: 0;
  color: var(--text);
}

.check-row:has(input:checked) {
  border-color: rgba(36, 231, 255, 0.48);
  background: rgba(36, 105, 180, 0.16);
  box-shadow: 0 0 20px rgba(36, 231, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

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

.compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.plan-option {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
    rgba(255, 255, 255, 0.045);
  padding: 16px 14px 14px;
  cursor: pointer;
  overflow: hidden;
  text-align: center;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.plan-option input {
  position: relative;
  width: 24px;
  height: 24px;
  margin: 0 0 4px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(143, 163, 189, 0.5);
  border-radius: 999px;
  background: rgba(2, 8, 18, 0.64);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.03);
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.plan-option input::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: inherit;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(36, 231, 255, 0.75);
  opacity: 0;
  transform: scale(0.55);
  transition: opacity 180ms ease, transform 180ms ease;
}

.plan-option:hover {
  transform: translateY(-1px);
  border-color: rgba(36, 231, 255, 0.36);
  background:
    linear-gradient(145deg, rgba(36, 231, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.05);
}

.plan-option:has(input:checked) {
  border-color: rgba(36, 231, 255, 0.7);
  background:
    linear-gradient(145deg, rgba(36, 231, 255, 0.18), rgba(76, 116, 255, 0.08)),
    rgba(18, 62, 112, 0.22);
  box-shadow:
    0 0 26px rgba(36, 231, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.plan-option:has(input:checked)::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(36, 231, 255, 0.28), transparent 42%);
  opacity: 0.55;
}

.plan-option input:checked {
  border-color: rgba(36, 231, 255, 0.86);
  background: rgba(36, 105, 180, 0.28);
}

.plan-option input:checked::after {
  opacity: 1;
  transform: scale(1);
}

.plan-option strong {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-weight: 900;
  line-height: 1.05;
}

.plan-option span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  margin: 0;
  font-weight: 800;
  line-height: 1.1;
}

.plan-option:has(input:checked) span {
  color: #dffcff;
}

.code-box {
  overflow-wrap: anywhere;
  border: 1px solid rgba(36, 231, 255, 0.24);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.055);
  color: #dffcff;
  padding: 16px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.5;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  margin-top: 16px;
}

.telegram-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  border: 1px solid rgba(36, 231, 255, 0.62);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(36, 231, 255, 0.22), rgba(76, 116, 255, 0.14)),
    rgba(36, 105, 180, 0.24);
  color: #effbff;
  padding: 14px 20px;
  font-weight: 950;
  text-align: center;
  box-shadow:
    0 0 28px rgba(36, 231, 255, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background 180ms ease;
}

.telegram-open-button:hover {
  transform: translateY(-2px);
  border-color: rgba(36, 231, 255, 0.82);
  background:
    linear-gradient(145deg, rgba(36, 231, 255, 0.3), rgba(76, 116, 255, 0.18)),
    rgba(36, 135, 215, 0.32);
  box-shadow:
    0 0 32px rgba(36, 231, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.bot-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

.bot-link-row a {
  font-weight: 900;
}

.key-management {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.connection-key-list {
  display: grid;
  gap: 12px;
}

.connection-key-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.connection-key-title {
  color: var(--cyan);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.connection-key {
  display: block;
  max-width: 100%;
  border-radius: var(--radius-md);
  text-align: left;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: #dffcff;
  cursor: pointer;
  user-select: text;
  -webkit-user-select: text;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
}

.connection-key[data-expanded="1"] {
  white-space: normal;
}

.connection-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.connection-key-actions button {
  min-width: 88px;
}

.connection-key-actions .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  min-width: 88px;
  padding: 12px 20px;
  border-color: rgba(36, 231, 255, 0.42);
  color: #dffcff;
  background: rgba(36, 105, 180, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 18px rgba(36, 231, 255, 0.08);
}

.connection-key-actions .connection-xkeen-button {
  min-width: 104px;
}

.xkeen-config-list {
  display: grid;
  gap: 14px;
}

.xkeen-config-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.xkeen-config-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 32px;
  grid-template-areas: "text copy toggle";
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.xkeen-config-card summary::-webkit-details-marker {
  display: none;
}

.xkeen-config-card summary::after {
  content: "+";
  display: grid;
  grid-area: toggle;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(36, 231, 255, 0.28);
  border-radius: 50%;
  color: var(--cyan);
  font-weight: 900;
}

.xkeen-config-card[open] summary::after {
  content: "-";
}

.xkeen-config-card summary span {
  grid-area: text;
  display: grid;
  gap: 4px;
  min-width: 0;
}

.xkeen-config-card summary strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.2;
}

.xkeen-config-card summary em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}

.xkeen-config-body {
  display: grid;
  gap: 12px;
  padding: 0 18px 18px;
}

.xkeen-config-card .copy-xkeen-config {
  grid-area: copy;
  min-width: 160px;
  cursor: pointer;
}

.xkeen-code {
  max-height: 520px;
  margin: 0;
  overflow: auto;
  overflow-x: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}

.xkeen-code code {
  font: inherit;
}

.qr-box {
  display: grid;
  place-items: center;
  width: min(220px, 100%);
  aspect-ratio: 1;
  border-radius: 18px;
  background: #fff;
  padding: 12px;
}

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

.qr-box img {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

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

.qr-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 4, 12, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.qr-modal-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(460px, 100%);
  border: 1px solid rgba(36, 231, 255, 0.28);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(24, 44, 65, 0.92), rgba(14, 19, 34, 0.94));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 40px rgba(36, 231, 255, 0.12);
  padding: 24px;
}

.qr-modal-box {
  display: grid;
  place-items: center;
  width: min(360px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 24px;
  background: #fff;
  padding: 18px;
}

.qr-modal-box img {
  display: block;
  width: 100%;
  height: 100%;
}

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

.management-grid {
  display: grid;
  gap: 14px;
}

.management-card {
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.045);
  padding: 18px;
}

.muted-text {
  color: var(--muted);
}

.promo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.promo-list span {
  display: inline-flex;
  border: 1px solid rgba(157, 255, 70, 0.28);
  border-radius: 999px;
  background: rgba(157, 255, 70, 0.08);
  color: #eaffd6;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 900px) {
  .auth-shell,
  .hero-band,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .key-hero .status-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 12px;
  }

  .top-nav {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }

  .nav-pill {
    min-width: 0;
    width: 100%;
    padding: 9px 8px;
    font-size: 13px;
    white-space: nowrap;
  }

  .brand-panel {
    min-height: 560px;
  }
}

@media (max-width: 620px) {
  .auth-page {
    min-height: 100svh;
    place-items: stretch;
    padding: 10px;
  }

  .auth-shell {
    min-height: calc(100svh - 20px);
    gap: 10px;
    align-content: center;
  }

  .auth-card,
  .brand-panel,
  .panel,
  .hero-band {
    padding: 20px;
  }

  .hero-band {
    grid-template-columns: minmax(0, 1fr) 104px;
    gap: 12px;
    align-items: start;
  }

  .hero-band.single {
    grid-template-columns: 1fr;
  }

  .key-hero {
    grid-template-columns: 1fr;
    gap: 18px;
  }

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

  .key-hero .status-grid article {
    min-height: 96px;
    padding: 12px;
  }

  .key-hero .status-grid strong {
    font-size: clamp(20px, 5.7vw, 25px);
    line-height: 1.12;
    overflow-wrap: normal;
    word-break: normal;
  }

  .key-hero .hero-actions {
    margin-top: 18px;
  }

  .key-hero > div:first-child > span {
    font-size: 15px;
    line-height: 1.3;
  }

  .hero-band h1 {
    font-size: clamp(30px, 9vw, 40px);
    line-height: 1.02;
  }

  .hero-band span {
    font-size: 17px;
    margin-top: 10px;
  }

  .status-grid article {
    border-radius: 20px;
    padding: 10px;
    min-height: 104px;
  }

  .status-grid span {
    font-size: 10px;
    line-height: 1.15;
  }

  .status-grid strong {
    margin-top: 8px;
    font-size: 28px;
  }

  .auth-card {
    order: 1;
    justify-content: start;
    padding: 18px;
  }

  .brand-panel {
    order: 0;
    min-height: 0;
    place-items: center;
    padding: 8px 14px 4px;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .brand-panel::after {
    display: none;
  }

  .neon-shield {
    display: none;
  }

  .brand-copy {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    text-align: center;
  }

  .brand-copy p {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .brand-copy h1 {
    font-size: 34px;
    line-height: 1;
  }

  .brand-copy span {
    margin: 8px auto 0;
    max-width: none;
    font-size: 14px;
    line-height: 1.22;
  }

  .card-header p {
    margin-bottom: 5px;
    font-size: 11px;
  }

  .card-header h2 {
    font-size: 30px;
    line-height: 1;
  }

  .form-stack {
    gap: 12px;
    margin-top: 18px;
  }

  .plan-grid,
  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .plan-option {
    min-height: 116px;
    gap: 7px;
    padding: 13px 10px 12px;
  }

  .plan-option input {
    width: 21px;
    height: 21px;
    margin-bottom: 2px;
  }

  .plan-option input::after {
    inset: 4px;
  }

  .plan-option strong {
    font-size: 18px;
  }

  .plan-option span {
    font-size: 15px;
  }

  .hero-actions {
    gap: 8px;
  }

  .hero-actions .small-action {
    flex: 1 1 calc(50% - 8px);
    padding: 11px 12px;
    font-size: 13px;
    text-align: center;
  }

  input {
    padding: 12px 14px;
  }

  button,
  .small-action,
  .button-link {
    padding: 12px 16px;
  }

  .xkeen-config-card summary {
    grid-template-columns: minmax(0, 1fr) 34px;
    grid-template-areas:
      "text toggle"
      "copy copy";
    align-items: start;
    gap: 12px;
    padding: 14px;
  }

  .xkeen-config-card summary::after {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }

  .xkeen-config-card .copy-xkeen-config {
    justify-self: stretch;
    min-width: 0;
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    font-size: 13px;
  }

  .xkeen-config-body {
    padding: 0 14px 14px;
  }

  .alert {
    margin-top: 12px;
    padding: 10px 12px;
  }

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

  .key-row,
  .identity-list div,
  .payment-list article {
    display: grid;
    text-align: left;
  }

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

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

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

  .key-meta,
  .identity-list dd {
    text-align: left;
  }

  .identity-list dd {
    justify-content: space-between;
  }

  .agreement-card {
    width: min(100% - 20px, 560px);
    margin: -28px auto 28px;
  }

  .auth-page .agreement-card {
    margin-top: 12px;
  }

  .agreement-card summary {
    min-height: 50px;
    padding: 12px 14px;
    font-size: 14px;
  }

  .agreement-card summary small {
    display: none;
  }

  .agreement-content {
    padding: 0 14px 14px;
    font-size: 12px;
    line-height: 1.4;
  }

  .error-page {
    place-items: stretch;
    padding: 12px;
  }

  .error-card {
    min-height: calc(100svh - 24px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .error-card::after {
    width: 180px;
    height: 180px;
    right: -78px;
    top: -86px;
  }

  .error-brand {
    margin-bottom: 28px;
  }

  .error-card > span {
    font-size: 16px;
  }

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

  .error-actions .back-button,
  .error-actions .small-action {
    width: 100%;
  }
}
