:root {
  --bg: #090914;
  --bg-elevated: rgba(17, 17, 31, 0.86);
  --bg-soft: rgba(24, 24, 44, 0.78);
  --line: rgba(168, 154, 255, 0.18);
  --line-strong: rgba(168, 154, 255, 0.34);
  --text: #f5f7ff;
  --text-muted: #a6acd1;
  --primary: #9a7cff;
  --primary-strong: #7a5cff;
  --success: #2cd79a;
  --warning: #ffb54d;
  --danger: #ff6e87;
  --shadow: 0 24px 80px rgba(5, 8, 20, 0.45);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 1240px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(154, 124, 255, 0.75) rgba(255, 255, 255, 0.06);
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(181, 154, 255, 0.92), rgba(122, 92, 255, 0.92));
  border-radius: 999px;
  border: 2px solid rgba(9, 9, 20, 0.55);
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(196, 174, 255, 0.98), rgba(138, 108, 255, 0.98));
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(122, 92, 255, 0.22), transparent 26%),
    radial-gradient(circle at top right, rgba(44, 215, 154, 0.12), transparent 22%),
    linear-gradient(180deg, #0a0b17 0%, #070811 100%);
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overflow-y: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
  overflow-y: visible;
}

.page-shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(circle at center, black 45%, transparent 85%);
}

.container {
  width: min(calc(100% - 32px), var(--max-width));
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 0;
}

.topbar-welcome {
  justify-content: flex-end;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-badge img {
  display: block;
  width: 38px;
  height: 38px;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-button svg {
  width: 22px;
  height: 22px;
}

.topbar-actions,
.lang-switch {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-select,
.chip,
.tab-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 10px 16px;
  transition: 180ms ease;
  cursor: pointer;
}

.chip.is-active,
.tab-button.is-active,
.lang-select:hover,
.chip:hover,
.tab-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(154, 124, 255, 0.16);
}

.lang-select {
  min-width: 78px;
  appearance: none;
  color: var(--text);
}

.lang-select,
.select,
select {
  appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f5f7ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

select option {
  color: var(--text);
  background: #111321;
}

.hero {
  padding: 56px 0 112px;
}

.hero-welcome {
  min-height: calc(100vh - 96px);
}

.hero-centered {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0 96px;
}

.hero-focus {
  width: min(100%, 900px);
  display: grid;
  justify-items: center;
  gap: 24px;
  text-align: center;
}

.hero-focus-wide {
  width: 100%;
  gap: 30px;
}

.hero-title-line {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.hero-title-logo {
  width: clamp(72px, 8vw, 122px);
  height: clamp(72px, 8vw, 122px);
  flex: 0 0 auto;
}

.hero-title-text {
  font-size: clamp(46px, 6.25vw, 118px);
  line-height: 0.94;
  letter-spacing: -0.055em;
  white-space: nowrap;
}

.hero-subtitle {
  margin-top: 0;
}

.hero-logo {
  width: 96px;
  height: 96px;
}

.hero-actions {
  justify-content: center;
}

.hero-grid,
.two-column {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: stretch;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  background: linear-gradient(180deg, rgba(19, 20, 38, 0.92), rgba(10, 11, 22, 0.92));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel.soft {
  background: linear-gradient(180deg, rgba(24, 26, 46, 0.88), rgba(14, 16, 29, 0.88));
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(40px, 7vw, 82px);
  line-height: 0.96;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 28px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h3 {
  font-size: 18px;
  line-height: 1.2;
}

.lead,
.muted {
  color: var(--text-muted);
  line-height: 1.7;
}

.lead {
  margin-top: 24px;
  max-width: 52ch;
  font-size: 18px;
}

.stack,
.metric-grid,
.card-grid,
.list-stack {
  display: grid;
  gap: 16px;
}

.cta-row,
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cta-row {
  margin-top: 28px;
}

.button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 14px 22px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #0e1023;
  background: linear-gradient(135deg, #b59aff, #7a5cff);
  box-shadow: 0 18px 40px rgba(122, 92, 255, 0.35);
}

.button-secondary {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.tab-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

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

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

.metric,
.table-card,
.status-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background: var(--bg-soft);
}

.metric-value {
  font-size: 34px;
  font-weight: 700;
  margin-top: 12px;
  letter-spacing: -0.04em;
}

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

.table th,
.table td {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  text-align: left;
}

.table th {
  color: var(--text-muted);
  font-weight: 500;
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  outline: none;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0 8px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}

input[type="checkbox"]:focus-visible {
  outline: 2px solid rgba(181, 154, 255, 0.9);
  outline-offset: 2px;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(154, 124, 255, 0.14);
}

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

.copy-box,
.accent-box {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  padding: 18px;
}

.copy-value {
  word-break: break-all;
  font-family: "Consolas", "Courier New", monospace;
}

.status-success {
  color: var(--success);
}

.status-warning {
  color: var(--warning);
}

.status-danger {
  color: var(--danger);
}

.footer-note {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.workspace-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  min-height: calc(100vh - 120px);
  padding-bottom: 32px;
  align-items: start;
}

.workspace-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.workspace-content {
  min-width: 0;
  max-height: none;
  overflow: visible;
  padding-right: 8px;
}

.workspace-section {
  scroll-margin-top: 24px;
}

.api-docs-main {
  padding-bottom: 56px;
}

.api-docs-layout {
  display: grid;
  gap: 24px;
}

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

.api-docs-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  line-height: 1.7;
}

.api-docs-list li + li {
  margin-top: 10px;
}

.swagger-panel {
  overflow: hidden;
}

#swagger-ui {
  margin-top: 12px;
}

#swagger-ui .swagger-ui {
  color: var(--text);
}

#swagger-ui .topbar {
  display: none;
}

#swagger-ui .info .title,
#swagger-ui .opblock-tag,
#swagger-ui .opblock-summary-path,
#swagger-ui .response-col_status {
  color: #11131f;
}

#swagger-ui .scheme-container,
#swagger-ui .information-container,
#swagger-ui .opblock,
#swagger-ui .responses-inner,
#swagger-ui .response,
#swagger-ui .model-box,
#swagger-ui .microlight,
#swagger-ui .highlight-code {
  border-radius: 18px;
}

#swagger-ui .scheme-container,
#swagger-ui .opblock,
#swagger-ui .model-box,
#swagger-ui .responses-inner {
  box-shadow: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 6, 14, 0.72);
  backdrop-filter: blur(14px);
}

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

.modal-card {
  width: min(680px, 100%);
  max-height: min(90vh, 860px);
  overflow: auto;
}

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

.modal-close-button {
  flex: 0 0 auto;
}

.modal-close-button svg {
  width: 20px;
  height: 20px;
}

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

.modal-metric-value {
  font-size: clamp(24px, 3vw, 32px);
}

.pricing-plan-card {
  position: relative;
  display: grid;
  gap: 22px;
  text-align: center;
  padding: 6px;
}

.pricing-plan-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--radius-xl) - 2px);
  background: radial-gradient(circle at top, rgba(154, 124, 255, 0.22), transparent 48%);
  pointer-events: none;
}

.pricing-plan-head {
  justify-items: center;
  gap: 10px;
}

.pricing-plan-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(181, 154, 255, 0.34);
  background: rgba(154, 124, 255, 0.16);
  color: #efe9ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.pricing-plan-title-group {
  display: grid;
  gap: 8px;
  justify-items: center;
}

.pricing-plan-title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.pricing-plan-subtitle {
  max-width: 42ch;
  color: var(--text-muted);
  line-height: 1.65;
}

.pricing-plan-price {
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  text-shadow: 0 0 24px rgba(154, 124, 255, 0.18);
}

.pricing-plan-price-note {
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.pricing-plan-features {
  display: grid;
  gap: 12px;
}

.pricing-plan-feature {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(154, 124, 255, 0.05));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.pricing-plan-check {
  color: var(--success);
  font-size: 18px;
  line-height: 1;
}

.pricing-plan-meta {
  display: grid;
  gap: 10px;
  text-align: left;
}

.pricing-plan-note {
  color: var(--text-muted);
  line-height: 1.7;
}

.pricing-plan-link {
  text-align: left;
}

.pricing-plan-action {
  display: flex;
  justify-content: center;
}

.pricing-plan-pay-button {
  min-width: 220px;
  padding-inline: 34px;
  min-height: 54px;
  font-size: 15px;
  letter-spacing: 0.16em;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 980px) {
  .hero-grid,
  .two-column,
  .metric-grid,
  .card-grid,
  .field-grid,
  .workspace-shell,
  .api-docs-grid,
  .modal-summary {
    grid-template-columns: 1fr;
  }

  .workspace-sidebar,
  .workspace-content {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .hero-title-line {
    flex-direction: column;
    gap: 16px;
  }

  .hero-title-text {
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 680px) {
  .container {
    width: min(calc(100% - 20px), var(--max-width));
  }

  .panel {
    padding: 22px;
    border-radius: 22px;
  }

  .topbar {
    padding: 18px 0;
  }

  .button,
  .lang-select,
  .chip,
  .tab-button {
    width: 100%;
    justify-content: center;
  }

  .cta-row,
  .row,
  .topbar-actions,
  .lang-switch {
    width: 100%;
  }
}

.profile-menu {
  position: relative;
}

.profile-menu > summary {
  list-style: none;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: 180ms ease;
}

.profile-menu > summary::-webkit-details-marker {
  display: none;
}

.profile-menu > summary:hover,
.profile-menu[open] > summary {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(154, 124, 255, 0.16);
}

.profile-menu > summary svg {
  width: 22px;
  height: 22px;
}

.profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 40;
  width: min(288px, calc(100vw - 32px));
  padding: 14px;
  gap: 4px;
}

.profile-dropdown-head {
  padding: 6px 12px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}

.profile-dropdown-head h3 {
  margin-top: 4px;
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: 160ms ease;
}

.profile-menu-item:hover {
  color: var(--text);
  background: rgba(154, 124, 255, 0.16);
}

button.profile-menu-item {
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

@media (max-width: 680px) {
  .profile-menu {
    width: auto;
  }
}

.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: end;
}

.grid-two .stack > span {
  color: var(--text-muted);
  font-size: 14px;
}

.admin-login-modal {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at top, rgba(122, 92, 255, 0.2), transparent 55%),
    rgba(5, 6, 14, 0.9);
  backdrop-filter: blur(12px);
}

body:has([data-admin-secured]:not([style*="none"])) .admin-login-modal {
  display: none;
}

.admin-login-card {
  width: min(440px, 100%);
}

.admin-login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

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

.api-docs-content {
  display: grid;
  gap: 24px;
  align-content: start;
}

.endpoint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 14px;
  color: var(--text-muted);
  word-break: break-all;
}

.method-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--line-strong);
  background: rgba(154, 124, 255, 0.16);
  color: var(--primary);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
}

.code-block {
  margin: 0;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: rgba(10, 11, 22, 0.6);
  overflow-x: auto;
  font-family: "Consolas", "Courier New", monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.code-block code {
  font-family: inherit;
  white-space: pre;
}
