:root {
  color-scheme: dark;
  --bg: #080a0f;
  --bg-elev: #0f131c;
  --bg-soft: #151a26;
  --bg-hover: #1b2130;
  --border: #232a3b;
  --border-strong: #313a50;
  --text: #e8ebf4;
  --muted: #98a3ba;
  --muted-strong: #b7c0d4;
  --accent: #6d8cff;
  --accent-hover: #8aa2ff;
  --accent-soft: rgba(109, 140, 255, 0.14);
  --ok: #3ecf8e;
  --ok-soft: rgba(62, 207, 142, 0.12);
  --warn: #f5a524;
  --warn-soft: rgba(245, 165, 36, 0.12);
  --danger: #ff5c72;
  --danger-soft: rgba(255, 92, 114, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 15% -10%, rgba(109, 140, 255, 0.12), transparent 60%),
              radial-gradient(900px 500px at 90% 0%, rgba(139, 92, 246, 0.1), transparent 55%),
              var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; }
p { margin: 0; }
img { max-width: 100%; }
.hidden { display: none !important; }
.mono { font-family: var(--mono); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--bg-hover); border-color: var(--border-strong); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.is-active { background: var(--accent-soft); border-color: rgba(109, 140, 255, 0.45); color: #c3cdff; }

.btn--primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  border-color: transparent;
  color: #fff;
}
.btn--primary:hover:not(:disabled) { filter: brightness(1.08); background: linear-gradient(135deg, var(--accent), #8b5cf6); }

.btn--ghost { background: transparent; border-color: transparent; color: var(--muted-strong); }
.btn--ghost:hover:not(:disabled) { background: var(--bg-soft); color: var(--text); }

.btn--danger { background: var(--danger-soft); border-color: rgba(255, 92, 114, 0.4); color: #ff92a2; }
.btn--danger:hover:not(:disabled) { background: rgba(255, 92, 114, 0.2); }

.btn--sm { padding: 7px 13px; font-size: 13px; }
.btn--block { width: 100%; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 16px clamp(20px, 5vw, 56px);
  background: rgba(8, 10, 15, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--text); font-weight: 700; letter-spacing: -0.02em; }
.brand:hover { color: var(--text); }
.brand__mark { width: 32px; height: 32px; border-radius: 9px; }
.brand__name { font-size: 16px; }

.site-nav { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
}
.site-nav a:hover { color: var(--text); background: var(--bg-soft); }
.site-nav a.is-active { color: var(--text); background: var(--bg-soft); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* ---------------------------------------------------------------- banner */

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px clamp(20px, 5vw, 56px);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.banner--warn { background: var(--warn-soft); color: #ffd27d; }
.banner--info { background: var(--accent-soft); color: #b9c6ff; }
.banner strong { font-weight: 700; }

/* ---------------------------------------------------------------- landing */

.shell { width: min(1160px, calc(100% - 48px)); margin: 0 auto; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: clamp(56px, 9vw, 112px) 0 clamp(48px, 7vw, 88px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}

.hero h1 {
  font-size: clamp(38px, 5.4vw, 62px);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin-bottom: 20px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), #b18cff 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__lead { font-size: clamp(16px, 1.6vw, 18px); color: var(--muted-strong); max-width: 54ch; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.hero__meta { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 26px; font-size: 13px; color: var(--muted); }
.hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.dot--warn { background: var(--warn); box-shadow: 0 0 10px var(--warn); }

.hero__panel {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(21, 26, 38, 0.9), rgba(12, 15, 22, 0.95));
  box-shadow: var(--shadow);
  padding: 24px;
}
.hero__panel h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 700; }
.release-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-top: 14px; }
.release-row strong { font-size: 26px; letter-spacing: -0.03em; }
.release-row span { font-size: 13px; color: var(--muted); }
.hero__panel hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.panel-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.panel-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted-strong); }
.panel-list b { color: var(--text); font-weight: 600; }

.section { padding: clamp(48px, 7vw, 88px) 0; border-top: 1px solid var(--border); }
.section__head { max-width: 62ch; margin-bottom: 36px; }
.section__head h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; margin-bottom: 12px; }
.section__head p { color: var(--muted); font-size: 16px; }

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

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 22px;
}
.card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 14px; }
.card__icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 18px;
  margin-bottom: 16px;
}

.price-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.price {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.price--featured { border-color: rgba(109, 140, 255, 0.55); box-shadow: 0 0 0 1px rgba(109, 140, 255, 0.2), var(--shadow); }
.price h3 { font-size: 15px; color: var(--muted-strong); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.price__amount { font-size: 32px; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 2px; }
.price__amount small { font-size: 14px; font-weight: 500; color: var(--muted); }
.price p { font-size: 13px; color: var(--muted); flex: 1; }
.price .btn { margin-top: 16px; }

.changelog { display: grid; gap: 14px; }
.entry {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 20px 22px;
}
.entry__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.entry__head h3 { font-size: 16px; }
.entry__body { color: var(--muted-strong); font-size: 14px; white-space: pre-wrap; word-break: break-word; max-height: 190px; overflow: hidden; position: relative; }
.entry--open .entry__body { max-height: none; }
.entry__toggle { margin-top: 10px; }

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(109, 140, 255, 0.14), rgba(139, 92, 246, 0.08));
  padding: clamp(28px, 4vw, 44px);
  margin: clamp(48px, 7vw, 80px) 0;
}
.cta h2 { font-size: clamp(24px, 3vw, 32px); margin-bottom: 8px; }
.cta p { color: var(--muted-strong); }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; gap: 18px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }

/* ---------------------------------------------------------------- badges */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge--ok { background: var(--ok-soft); color: #6ff0b4; border-color: rgba(62, 207, 142, 0.3); }
.badge--warn { background: var(--warn-soft); color: #ffce7a; border-color: rgba(245, 165, 36, 0.3); }
.badge--danger { background: var(--danger-soft); color: #ff92a2; border-color: rgba(255, 92, 114, 0.3); }
.badge--muted { background: var(--bg-soft); color: var(--muted); border-color: var(--border); }
.badge--accent { background: var(--accent-soft); color: #b9c6ff; border-color: rgba(109, 140, 255, 0.3); }

/* ---------------------------------------------------------------- auth */

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.auth-card {
  width: min(430px, 100%);
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  padding: 32px;
}

.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand img { width: 38px; height: 38px; border-radius: 10px; }
.auth-brand h1 { font-size: 20px; }
.auth-brand p { font-size: 13px; color: var(--muted); }

.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 22px;
}
.mode-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 9px;
  border-radius: 7px;
  cursor: pointer;
}
.mode-tab.is-active { background: var(--bg-elev); color: var(--text); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4); }

.auth-form { display: none; gap: 14px; }
.auth-form.is-active { display: grid; }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted-strong); }
.field input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.turnstile-frame { min-height: 66px; display: flex; justify-content: center; margin-top: 4px; }

.auth-status { min-height: 18px; font-size: 13px; color: var(--muted); margin: 14px 0 4px; }
.auth-status.is-success { color: var(--ok); }
.auth-status.is-error { color: var(--danger); }

.auth-footer { margin-top: 20px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- dashboard */

.dashboard {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.dashboard.is-sidebar-collapsed { grid-template-columns: 74px minmax(0, 1fr); }

.sidebar {
  border-right: 1px solid var(--border);
  background: rgba(10, 13, 19, 0.7);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.sidebar__brand img { width: 30px; height: 30px; border-radius: 8px; }
.sidebar__brand span { font-weight: 700; font-size: 15px; }
.dashboard.is-sidebar-collapsed .sidebar__brand span,
.dashboard.is-sidebar-collapsed .sidebar__user,
.dashboard.is-sidebar-collapsed .nav-pill span,
.dashboard.is-sidebar-collapsed .sidebar__logout span { display: none; }

.sidebar__user { padding: 0 8px; }
.sidebar__user strong { display: block; font-size: 14px; }
.sidebar__user span { display: block; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.sidebar__nav { display: grid; gap: 3px; }
.nav-pill {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 11px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
}
.nav-pill:hover { background: var(--bg-soft); color: var(--text); }
.nav-pill.is-active { background: var(--accent-soft); color: #c3cdff; }
.nav-pill .icon { width: 18px; text-align: center; opacity: 0.9; }
.nav-pill .count {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar__foot { margin-top: auto; display: grid; gap: 6px; }

.main { padding: 26px clamp(20px, 4vw, 40px) 60px; min-width: 0; }

.topbar { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 26px; }
.topbar h1 { font-size: 26px; font-weight: 800; }
.topbar p { color: var(--muted); font-size: 14px; margin-top: 4px; }
.topbar__actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.stack { display: grid; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.spacer { flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 18px 20px;
}
.stat span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
.stat strong { display: block; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; }

.key-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 20px 22px;
  display: grid;
  gap: 16px;
}
.key-card__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.key-card__head h3 { font-size: 15px; }
.key-string {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-strong);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  overflow-x: auto;
  white-space: nowrap;
}
.key-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.key-meta div span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 700; }
.key-meta div strong { font-size: 14px; font-weight: 600; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td .btn { padding: 5px 10px; font-size: 12px; }

.empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 34px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.notice {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--muted-strong);
}
.notice--warn { border-left-color: var(--warn); }
.notice--danger { border-left-color: var(--danger); }
.notice strong { color: var(--text); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(3px);
}
.modal {
  width: min(460px, 100%);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  padding: 24px;
}
.modal h2 { font-size: 19px; margin-bottom: 8px; }
.modal p { color: var(--muted); font-size: 14px; }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------------------------------------------------------------- toasts */

.toast-viewport {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 120;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 36px));
}
.toast {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  animation: toast-in 0.18s ease;
}
.toast strong { font-size: 12px; text-transform: uppercase; letter-spacing: 0.07em; }
.toast span { font-size: 13.5px; color: var(--muted-strong); }
.toast--error { border-color: rgba(255, 92, 114, 0.45); }
.toast--error strong { color: var(--danger); }
.toast--success { border-color: rgba(62, 207, 142, 0.45); }
.toast--success strong { color: var(--ok); }
.toast--info strong { color: var(--accent); }
.toast.is-leaving { opacity: 0; transform: translateY(-4px); transition: all 0.18s ease; }

@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .grid--4, .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .key-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 840px) {
  .site-nav { display: none; }
  .dashboard, .dashboard.is-sidebar-collapsed { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
  .sidebar__nav { display: flex; gap: 4px; }
  .sidebar__user, .sidebar__foot { display: none; }
  .nav-pill { width: auto; white-space: nowrap; }
  .main { padding: 20px 16px 48px; }
}

@media (max-width: 620px) {
  .grid--3, .grid--4, .price-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
  .hero__actions .btn { flex: 1; }
  .topbar { flex-direction: column; }
  .topbar__actions { margin-left: 0; }
  .key-meta { grid-template-columns: 1fr 1fr; }
}
