:root {
  --bg: #050505;
  --bg-soft: #0a0a0b;
  --bg-card: #101012;
  --bg-card-strong: #151519;
  --bg-code: #070708;
  --text: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --accent: #7c3aed;
  --accent-blue: #2563eb;
  --accent-cyan: #22d3ee;
  --accent-green: #34d399;
  --warning: #fbbf24;
  --danger: #fb7185;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
  --radius: 14px;
  --radius-lg: 24px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --max-width: 1180px;
  --transition: 160ms ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -10%, rgba(124, 58, 237, 0.24), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(34, 211, 238, 0.14), transparent 28%),
    linear-gradient(180deg, #08080a 0%, var(--bg) 42%, #030303 100%);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body::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: 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

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

button, input, select {
  font: inherit;
}

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

section {
  position: relative;
  padding: 96px 0;
}

.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: rgba(5, 5, 5, 0.76);
  backdrop-filter: blur(22px) saturate(160%);
}

.nav-container {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.nav-logo-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #050505;
  background: linear-gradient(135deg, #fff, #a5f3fc);
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.nav-links a:hover {
  color: var(--text);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.lang-toggle button {
  border: 0;
  padding: 7px 12px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 700;
}

.lang-toggle button.active {
  color: #050505;
  background: var(--text);
}

.nav-burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-burger span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-secondary);
}

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

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
  gap: 56px;
  align-items: center;
}

.eyebrow, .section-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-bottom: 18px;
  padding: 6px 12px;
  border: 1px solid rgba(124, 58, 237, 0.32);
  border-radius: 999px;
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.1);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  font-size: clamp(3rem, 7vw, 5.7rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
  font-weight: 800;
}

.gradient-text {
  background: linear-gradient(135deg, #fff 0%, #a5f3fc 45%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  max-width: 690px;
  margin-top: 26px;
  color: var(--text-secondary);
  font-size: clamp(1.03rem, 2vw, 1.22rem);
  line-height: 1.72;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  font-size: 0.92rem;
  transition: transform var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
}

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

.btn-primary {
  color: #050505;
  background: linear-gradient(135deg, #fff 0%, #a5f3fc 100%);
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.18);
}

.btn-secondary {
  color: var(--text);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.045);
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.075);
}

.btn-large {
  min-height: 52px;
  padding: 13px 22px;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.trust-row span {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.82rem;
}

.hero-panel {
  position: relative;
}

.hero-panel::before {
  content: '';
  position: absolute;
  inset: -36px;
  z-index: -1;
  border-radius: 42px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.28), transparent 58%);
  filter: blur(18px);
}

.terminal-card, .generator-card, .summary-card, .manual-card, .step-card, .faq-list {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  box-shadow: var(--shadow);
}

.terminal-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: rgba(10, 10, 11, 0.82);
}

.terminal-dots {
  display: flex;
  gap: 7px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}

.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.terminal-dots span:nth-child(1) { background: #fb7185; }
.terminal-dots span:nth-child(2) { background: #fbbf24; }
.terminal-dots span:nth-child(3) { background: #34d399; }

.terminal-card pre, .mini-preview pre, .code-block pre {
  overflow-x: auto;
  color: #e4e4e7;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.75;
}

.terminal-card pre {
  padding: 24px;
}

.section-header {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}

.section-header.compact {
  margin-bottom: 36px;
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.06;
  letter-spacing: -0.05em;
}

.section-header p {
  margin-top: 14px;
  color: var(--text-secondary);
  font-size: 1rem;
}

.generator-section {
  padding-top: 36px;
}

.generator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(330px, 0.84fr);
  gap: 22px;
  align-items: start;
}

.generator-card, .summary-card {
  border-radius: var(--radius-lg);
  padding: 28px;
  backdrop-filter: blur(16px);
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.form-row.full {
  margin-bottom: 22px;
}

.form-row label {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 750;
}

input, select, .file-name {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  background: rgba(5, 5, 5, 0.58);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

input, select {
  padding: 0 15px;
}

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a1a1aa'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
}

input:focus, select:focus {
  border-color: rgba(34, 211, 238, 0.62);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.1);
  background: rgba(5, 5, 5, 0.78);
}

select option[value="opencode"] {
  background: rgba(124, 58, 237, 0.18);
  color: #ede9fe;
  font-weight: 700;
}

select option[value="opencode"]:checked {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.32), rgba(124, 58, 237, 0.18));
  color: #fff;
}

.secret-field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.field-action {
  min-width: 100px;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.045);
  cursor: pointer;
}

.field-action:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.field-help {
  color: var(--text-muted);
  font-size: 0.84rem;
}

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

.file-name {
  display: flex;
  align-items: center;
  padding: 0 15px;
  color: #a5f3fc;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
}

.notice.warning {
  border: 1px solid rgba(251, 191, 36, 0.24);
  color: #fde68a;
  background: rgba(251, 191, 36, 0.08);
}

.notice strong {
  margin-right: 4px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.form-error {
  min-height: 24px;
  margin-top: 12px;
  color: var(--danger);
  font-weight: 700;
  font-size: 0.9rem;
}

.post-download {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(56, 189, 248, 0.10));
  animation: postDownloadIn 0.35s ease-out;
}

.post-download[hidden] {
  display: none;
}

.post-download-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
}

.post-download-body {
  flex: 1;
  min-width: 0;
}

.post-download-body strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
  color: #fff;
}

.post-download-body p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(226, 232, 240, 0.78);
}

.post-download .btn {
  flex-shrink: 0;
}

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

/* Подсветка раздела "Как запустить" при переходе из генератора */
#how-to-run.flash .run-card {
  animation: howToRunFlash 1.6s ease-out;
}

@keyframes howToRunFlash {
  0%   { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.55); }
  40%  { box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.25); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0); }
}

.packs-card {
  position: sticky;
  top: 92px;
}

.packs-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.packs-card-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.16);
  border: 1px solid rgba(124, 58, 237, 0.28);
  font-size: 1.15rem;
  flex-shrink: 0;
  line-height: 1;
}

.packs-card-titles {
  flex: 1;
  min-width: 0;
}

.packs-card-titles h3 {
  margin: 0 0 2px;
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.packs-card-titles p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.packs-card-badge {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.32);
  background: rgba(34, 211, 238, 0.10);
  color: #67e8f9;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  align-self: flex-start;
}

/* Body wrapper — holds both the blur layer (cards+details) and the lock
   overlay as siblings. Positioned relative so the absolutely-positioned lock
   overlay can size itself to the body's content box. */
.packs-card-body {
  position: relative;
}

/* Blur layer — wraps just the cards + skills list. When locked, only this
   layer gets blurred, leaving the lock overlay (a sibling) sharp and crisp.
   Without this separation, `filter` on the parent would propagate to ALL
   descendants including the overlay text/icon/button. */
.packs-card-blur-layer {
  transition: filter var(--transition);
}

.packs-card-body.is-locked .packs-card-blur-layer {
  filter: blur(6px) saturate(0.85);
  pointer-events: none;
  user-select: none;
}

/* Lock overlay — centered card with lock icon, message and CTA.
   Sits ABOVE the blurred content; pointer-events enabled so the button works
   even though the rest of .packs-card-body has them disabled.

   Note: .packs-card-lock sets display:flex below which would otherwise
   override the browser's [hidden] { display: none } default (class beats
   attribute selector in specificity). The [hidden] override here makes
   toggle from JS via el.hidden = true|false actually work. */
.packs-card-lock {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 22px;
  text-align: center;
  pointer-events: none;
  /* Backdrop only on the inner pill so the blur underneath still reads as
     "hidden content" rather than a solid panel. */
}

.packs-card-lock[hidden] {
  display: none;
}

.packs-card-lock > * {
  pointer-events: auto;
}

.packs-card-lock-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.30), rgba(124, 58, 237, 0.10));
  border: 1px solid rgba(124, 58, 237, 0.55);
  font-size: 1.5rem;
  line-height: 1;
  margin-bottom: 4px;
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.30);
  animation: lockPulse 2.6s ease-in-out infinite;
}

@keyframes lockPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(124, 58, 237, 0.30), 0 0 0 0 rgba(124, 58, 237, 0.45); }
  50%      { box-shadow: 0 6px 24px rgba(124, 58, 237, 0.30), 0 0 0 14px rgba(124, 58, 237, 0); }
}

.packs-card-lock-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  line-height: 1.25;
}

.packs-card-lock-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 280px;
}

.packs-card-lock-btn {
  margin-top: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(124, 58, 237, 0.55);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.32), rgba(124, 58, 237, 0.16));
  color: #ede9fe;
  font-size: 0.84rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: background var(--transition), border-color var(--transition),
              transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.30);
}

.packs-card-lock-btn:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.48), rgba(124, 58, 237, 0.28));
  border-color: rgba(124, 58, 237, 0.85);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.45);
}

.packs-card-lock-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.30), 0 8px 20px rgba(124, 58, 237, 0.45);
}

/* Pack cards — clickable tiles with a stylized "cover" + meta */
.pack-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.pack-card {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: border-color var(--transition), background var(--transition),
              transform var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.pack-card:hover {
  border-color: rgba(124, 58, 237, 0.36);
  background: rgba(124, 58, 237, 0.04);
  transform: translateY(-1px);
}

.pack-card:focus-visible {
  outline: none;
  border-color: rgba(124, 58, 237, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.18);
}

.pack-card[aria-pressed="true"] {
  border-color: rgba(124, 58, 237, 0.7);
  background: linear-gradient(180deg, rgba(124, 58, 237, 0.12), rgba(124, 58, 237, 0.04));
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.20);
}

.pack-card-image {
  position: relative;
  height: 84px;
  border-radius: 9px;
  overflow: hidden;
  display: grid;
  place-items: center;
  font-size: 2rem;
  line-height: 1;
  color: white;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.pack-card-image[data-pack="none"] {
  background:
    radial-gradient(circle at 30% 30%, rgba(113, 113, 122, 0.65), transparent 60%),
    linear-gradient(135deg, rgba(63, 63, 70, 0.85), rgba(39, 39, 42, 0.85));
  color: rgba(228, 228, 231, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-shadow: none;
}

.pack-card-image[data-pack="web"] {
  background:
    radial-gradient(circle at 30% 25%, rgba(196, 181, 253, 0.45), transparent 55%),
    linear-gradient(135deg, rgba(99, 102, 241, 0.92), rgba(168, 85, 247, 0.92));
}

/* Code-window decoration: thin horizontal stripes to evoke "editor" */
.pack-card-image[data-pack="web"]::before {
  content: "";
  position: absolute;
  inset: 8px 10px auto 10px;
  height: 12px;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0)),
    rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255,255,255,0.10);
  pointer-events: none;
}

.pack-card-image[data-pack="web"]::after {
  content: "";
  position: absolute;
  inset: 28px 10px 8px 10px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(0deg,
      transparent 0,
      transparent 5px,
      rgba(255,255,255,0.18) 5px,
      rgba(255,255,255,0.18) 6px);
  opacity: 0.55;
  pointer-events: none;
}

.pack-card-image[data-pack="minecraft"] {
  background:
    radial-gradient(circle at 30% 25%, rgba(190, 242, 100, 0.45), transparent 55%),
    linear-gradient(180deg, rgba(132, 204, 22, 0.85) 0%, rgba(132, 204, 22, 0.85) 35%, rgba(120, 53, 15, 0.85) 35%, rgba(120, 53, 15, 0.95) 100%);
}

/* Block-grid decoration: subtle 12px pixel grid like Minecraft blocks */
.pack-card-image[data-pack="minecraft"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg,
      transparent 0,
      transparent 11px,
      rgba(0, 0, 0, 0.18) 11px,
      rgba(0, 0, 0, 0.18) 12px),
    repeating-linear-gradient(90deg,
      transparent 0,
      transparent 11px,
      rgba(0, 0, 0, 0.18) 11px,
      rgba(0, 0, 0, 0.18) 12px);
  pointer-events: none;
}

.pack-card-image[data-pack="minecraft"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 65% 18%, rgba(255, 255, 255, 0.18), transparent 25%);
  pointer-events: none;
}

/* Mobile: signature element = 4×3 app-icon grid inside a phone-bezel.
   Cross-platform gradient (iOS sky → Android green) evokes the dual-platform
   coverage. Spends its boldness in ONE place per frontend-design
   ("spend your boldness in one place") — the 12-cell grid maps 1:1 to the
   12 skills in the pack. Decorative only — parent .pack-card-image has
   aria-hidden="true" in script.js so screen readers skip it. WCAG: gradient
   is purely decorative; contrast-bearing content lives outside this element. */
.skill-card[data-pack="mobile"] .skill-icon {
  /* Default state inherits .skill-icon background (var(--wizard-surface-0)),
     matching the neutral card chrome of every other collection card. The
     cross-platform gradient only fires when the card is .selected (rule
     below) so unselected cards stay visually consistent across the row. */
}
.skill-card.selected[data-pack="mobile"] .skill-icon {
  /* Default .skill-card.selected .skill-icon (line 2096-2098) sets BG to
     var(--wizard-accent) = rgb(91, 108, 255). Re-declared here literally
     so the mobile card is visually identical to web/code/minecraft/roblox
     in selected state — matches Vadim's request "как у остальных".

     If --wizard-accent changes and you want mobile to stay consistent,
     update BOTH this literal AND any .pack-card-image[data-pack=...] CSS. */
  background: rgb(91, 108, 255);
  color: #fff;
}

.pack-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 4px 4px 4px 0;
}

.pack-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 3px;
}

.pack-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.pack-card-count {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

.pack-card[aria-pressed="true"] .pack-card-count {
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(124, 58, 237, 0.42);
  color: #c4b5fd;
}

.pack-card-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.pack-card-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity var(--transition), transform var(--transition);
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.45);
}

.pack-card[aria-pressed="true"] .pack-card-check {
  opacity: 1;
  transform: scale(1);
}

/* Pack details — skill list inside selected pack */
.pack-details {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pack-details-title {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pack-skills {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pack-skill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
}

.pack-skill-mark {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: #67e8f9;
  font-size: 0.7rem;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-weight: 700;
}

.pack-skill-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pack-skill-src {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  text-transform: lowercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 50%;
}

.pack-empty {
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-style: italic;
  text-align: center;
}

.mini-preview {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-code);
}

.mini-preview-header, .code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.mini-preview pre {
  max-height: 260px;
  padding: 16px;
}

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

.step-card {
  border-radius: 20px;
  padding: 24px;
  box-shadow: none;
}

.step-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: #a5f3fc;
  font-weight: 800;
}

.step-card h3 {
  margin-bottom: 8px;
  font-size: 1rem;
}

.step-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.manual-paths {
  margin: 14px 18px 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-code);
}

.manual-paths-label {
  display: block;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.manual-path {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  min-width: 0;
}

.manual-path + .manual-path {
  border-top: 1px solid var(--border);
}

.manual-path code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.os-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 72px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(124, 58, 237, 0.12);
  color: #c4b5fd;
  border: 1px solid rgba(124, 58, 237, 0.22);
  flex-shrink: 0;
}

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

.manual-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: none;
  min-width: 0;
}

.manual-tips {
  margin: 0 18px 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-code);
}

.manual-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.manual-tip + .manual-tip {
  border-top: 1px solid var(--border);
}

.manual-tip code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--accent-cyan);
}

.manual-tip-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-style: italic;
}

.manual-card-header {
  padding: 20px 20px 0;
}

.manual-card-header h3 {
  font-size: 1.05rem;
}

.code-block {
  overflow: hidden;
  margin: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-code);
}

.code-block pre {
  max-height: 430px;
  padding: 16px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 750;
}

.copy-btn:hover, .copy-btn.copied {
  color: var(--accent-cyan);
  border-color: rgba(34, 211, 238, 0.45);
}

.inline-code {
  display: inline;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  font-family: var(--font-mono);
  font-size: 0.86em;
}

.faq-list {
  max-width: 820px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.faq-item + .faq-item {
  border-top: 1px solid var(--border);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px;
  border: 0;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-weight: 750;
}

.faq-question::after {
  content: '+';
  color: var(--text-muted);
  font-size: 1.1rem;
}

.faq-item.open .faq-question::after {
  content: '−';
  color: var(--text);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 260ms ease;
}

.faq-answer-inner {
  padding: 0 22px 20px;
  color: var(--text-secondary);
  font-size: 0.93rem;
}

.footer {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.86rem;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
}

@media (max-width: 980px) {
  .hero-grid, .generator-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    padding-bottom: 70px;
  }

  .hero-panel {
    max-width: 640px;
  }

  .summary-card {
    position: static;
  }

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

@media (max-width: 720px) {
  .container {
    width: min(100% - 28px, var(--max-width));
  }

  section {
    padding: 70px 0;
  }

  .hero {
    padding: 122px 0 54px;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    padding: 22px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(5, 5, 5, 0.96);
    backdrop-filter: blur(18px);
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-burger {
    display: flex;
  }

  .hero h1 {
    font-size: clamp(2.55rem, 15vw, 4.2rem);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .terminal-card pre, .mini-preview pre, .code-block pre {
    font-size: 0.78rem;
  }

  .generator-card, .summary-card {
    padding: 20px;
  }

  .form-grid, .secret-field, .steps-grid, .manual-grid {
    grid-template-columns: 1fr;
  }

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

  .post-download {
    flex-wrap: wrap;
  }

  .post-download .btn {
    width: 100%;
  }

  .summary-list div {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (max-width: 430px) {
  .nav-logo span:last-child {
    display: none;
  }

  .trust-row span {
    width: 100%;
  }
}

::selection {
  color: white;
  background: rgba(124, 58, 237, 0.45);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.run-card {
  max-width: 720px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.run-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.run-tab {
  flex: 1;
  border: 0;
  padding: 14px 16px;
  color: var(--text-muted);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.run-tab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
}

.run-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.04);
}

.run-panel {
  display: none;
  padding: 24px 28px;
}

.run-panel.active {
  display: block;
}

ol.run-steps {
  list-style: none;
  counter-reset: run-step;
  padding: 0;
  margin: 0;
}

ol.run-steps li {
  counter-increment: run-step;
  position: relative;
  padding-left: 28px;
  margin-bottom: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

ol.run-steps li::before {
  content: counter(run-step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(124, 58, 237, 0.2);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

ol.run-steps li code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-code);
  color: var(--accent-cyan);
}

kbd {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-card-strong);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

@media (max-width: 720px) {
  .run-card {
    max-width: 100%;
  }

  .run-tab {
    font-size: 0.82rem;
    padding: 12px 10px;
  }

  .run-panel {
    padding: 20px;
  }
}

/* ============================================================
   skills.sh section — separate from curated packs above.
   Reuses .packs-card / .pack-card primitives; only adds
   section-specific styling for visual distinction and the
   per-skill "via skills.sh" provenance line.
   ============================================================ */

.skills-sh-card {
  /* Subtle top separator so the eye groups the two sections
     visually but they read as siblings, not nested. */
  margin-top: 18px;
  border-top: 1px dashed rgba(124, 58, 237, 0.18);
  padding-top: 18px;
}

/* Source line at the bottom of each skills.sh card. Smaller
   than the description, monospaced to read as a path/ref. */
.pack-card-source {
  margin-top: 6px;
  font-family: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0;
  color: var(--text-tertiary, rgba(161, 161, 170, 0.85));
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.pack-card-source::before {
  content: "↗";
  font-family: inherit;
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Brainstorming cover — soft purple/blue gradient + tiny
   chat-bubble dots to evoke "dialogue before code". The dot
   pattern sits below the emoji so it can't bleed on top. */
.pack-card-image[data-skill="brainstorming"] {
  background:
    radial-gradient(circle at 30% 25%, rgba(167, 139, 250, 0.45), transparent 55%),
    linear-gradient(135deg, rgba(79, 70, 229, 0.92), rgba(124, 58, 237, 0.92));
  isolation: isolate;
}
.pack-card-image[data-skill="brainstorming"]::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 28% 72%, rgba(255, 255, 255, 0.55) 1.6px, transparent 2px),
    radial-gradient(circle at 50% 72%, rgba(255, 255, 255, 0.55) 1.6px, transparent 2px),
    radial-gradient(circle at 72% 72%, rgba(255, 255, 255, 0.55) 1.6px, transparent 2px);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.85;
  pointer-events: none;
  z-index: 0;
}
.pack-card-image[data-skill="brainstorming"] > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   Wizard — 5-step setup flow (replaces the old single-form
   generator). Dark theme matching the design mockup.

   Structure:
     .wizard
       .step-bar (5 dots connected by lines, clickable for past steps)
       .wizard-card (one step visible at a time)
         .wizard-step[data-step]  (one of 5 sections)
           .step-head (h2 + p)
           .step-body (the actual content — input/cards/chips/etc)
       .wizard-nav (Назад / Далее / Скачать)

   Step navigation lives in script.js: wizardState.currentStep drives
   which .wizard-step is visible and which button is shown.
   ============================================================ */

:root {
  --wizard-bg: #0a0a0b;
  --wizard-surface-1: #141417;
  --wizard-surface-2: #1c1c20;
  --wizard-surface-3: #232328;
  --wizard-border: #2a2a30;
  --wizard-border-strong: #38383f;
  --wizard-text-primary: #f5f5f7;
  --wizard-text-secondary: #a4a4ad;
  --wizard-text-muted: #6b6b75;
  --wizard-accent: #5b6cff;
  --wizard-accent-hover: #6f80ff;
  --wizard-accent-soft: rgba(91, 108, 255, 0.12);
  --wizard-accent-soft-2: rgba(91, 108, 255, 0.22);
  --wizard-success: #34d399;
  --wizard-warn: #f59e0b;
  --wizard-radius: 12px;
  --wizard-radius-lg: 16px;
}

.wizard {
  max-width: 720px;
  margin: 1.5rem auto 2.5rem;
  padding: 0 1rem;
}

/* --- Step bar (top progress indicator) --- */
.step-bar {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin-bottom: 1.5rem;
  padding: 0 8px;
}
.step-dot {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  cursor: default;
}
.step-dot.is-clickable { cursor: pointer; }
.step-dot.is-clickable:hover .dot-circle.pending { border-color: var(--wizard-accent); color: var(--wizard-text-primary); }

.dot-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
  background: var(--wizard-surface-2);
  border: 1px solid var(--wizard-border-strong);
  color: var(--wizard-text-muted);
}
.dot-circle.done {
  background: var(--wizard-accent);
  border-color: var(--wizard-accent);
  color: #fff;
}
.dot-circle.active {
  background: var(--wizard-accent);
  border-color: var(--wizard-accent);
  color: #fff;
  box-shadow: 0 0 0 4px var(--wizard-accent-soft);
}
.dot-label {
  font-size: 11px;
  color: var(--wizard-text-muted);
  margin-top: 6px;
  white-space: nowrap;
  letter-spacing: 0.02em;
}
.dot-label.active-label { color: var(--wizard-text-primary); font-weight: 600; }
.dot-label.done-label   { color: var(--wizard-text-secondary); }

/* Lines between dots. The line is a child of step-bar, sits next to the
   dot column. We use margin-top to vertically align with dot centers. */
.step-line {
  flex: 1;
  height: 1px;
  background: var(--wizard-border-strong);
  margin: 14px -2px 0 -2px;
  transition: background 0.2s ease;
}
.step-line.done-line { background: var(--wizard-accent); }

/* --- Wizard card (the active step's container) --- */
.wizard-card {
  background: var(--wizard-surface-1);
  border: 1px solid var(--wizard-border);
  border-radius: var(--wizard-radius-lg);
  padding: 1.25rem 1.5rem 1.5rem;
  /* No fixed min-height — card sizes to its content so sparse steps (API key,
     OS/Client) don't sit in 280px of empty air. Dense steps (skills grid,
     config preview) grow naturally. */
}

.wizard-step { display: block; padding: 0; }
/* The global section{ padding: 96px 0 } rule would otherwise inflate each
   step by 192px (96+96) of empty space — wizard-step is a <section> for
   semantics but we don't want the global section spacing here. */
.wizard-step[hidden] { display: none; }

.step-head { margin-bottom: 1rem; }
.step-head h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--wizard-text-primary);
  letter-spacing: -0.01em;
  margin: 0 0 4px 0;
}
.step-head p {
  font-size: 13px;
  color: var(--wizard-text-secondary);
  margin: 0;
  line-height: 1.5;
}
.step-body { display: flex; flex-direction: column; gap: 0.75rem; }

/* Step 3 (Environment) — OS + Client as a 2-column grid so the chips fill the
   card width instead of leaving horizontal air. Below 560px the columns stack. */
.wizard-step[data-step="3"] .step-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}
@media (max-width: 560px) {
  .wizard-step[data-step="3"] .step-body {
    grid-template-columns: 1fr;
  }
}
.wizard-step[data-step="3"] .field { margin: 0; }
.wizard-step[data-step="3"] .chip-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
.wizard-step[data-step="3"] .chip {
  justify-content: flex-start;
  padding: 10px 14px;
  height: auto;
  font-size: 14px;
}

/* Field (label + control) — used inside steps */
.wizard-step .field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--wizard-text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.wizard-step .field input[type=text],
.wizard-step .field input[type=password] {
  width: 100%;
  padding: 0 12px;
  height: 42px;
  border-radius: var(--wizard-radius);
  border: 1px solid var(--wizard-border-strong);
  font-size: 14px;
  background: var(--wizard-surface-2);
  color: var(--wizard-text-primary);
  font-family: ui-monospace, "JetBrains Mono", "SF Mono", monospace;
  letter-spacing: 0.04em;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.wizard-step .field input:focus {
  outline: none;
  border-color: var(--wizard-accent);
  box-shadow: 0 0 0 3px var(--wizard-accent-soft);
}
.secret-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.secret-field input { flex: 1; }
.field-action {
  flex: 0 0 auto;
  padding: 0 14px;
  height: 42px;
  border-radius: var(--wizard-radius);
  border: 1px solid var(--wizard-border-strong);
  background: var(--wizard-surface-2);
  color: var(--wizard-text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.field-action:hover {
  border-color: var(--wizard-accent);
  color: var(--wizard-text-primary);
}
.field-help {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: var(--wizard-text-muted);
  line-height: 1.5;
}

/* --- Chip group (OS, Client) --- */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--wizard-border-strong);
  background: var(--wizard-surface-2);
  color: var(--wizard-text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.chip:hover:not(.selected):not(:disabled) {
  border-color: var(--wizard-border-strong);
  color: var(--wizard-text-primary);
  background: var(--wizard-surface-3);
}
.chip.selected {
  background: var(--wizard-accent-soft);
  border-color: var(--wizard-accent);
  color: var(--wizard-text-primary);
}
.chip-icon {
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.chip-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* --- Model grid (Step 2) --- */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  grid-auto-rows: 1fr; /* equalize row heights — short tags don't shrink cards */
  gap: 10px;
}
.model-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 12px;
  border: 1.5px solid var(--wizard-border-strong);
  border-radius: var(--wizard-radius);
  background: var(--wizard-surface-2);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  font-family: inherit;
  color: inherit;
}
.model-card:hover:not(.selected) {
  background: var(--wizard-surface-3);
  border-color: var(--wizard-border-strong);
}
.model-card.selected {
  border-color: var(--wizard-accent);
  background: var(--wizard-accent-soft);
}
/* Locked model — not available on the client's tariff. Greyscale + badge. */
.model-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.6);
}
.model-card.locked:hover {
  /* Override the interactive hover — locked cards don't lift. */
  background: var(--wizard-surface-2);
  border-color: var(--wizard-border-strong);
}
.model-card.locked .model-name {
  text-decoration: line-through;
  text-decoration-color: var(--wizard-text-muted);
  text-decoration-thickness: 1.5px;
}
.model-lock-badge {
  display: inline-block;
  margin-top: 6px;
  margin-right: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--wizard-text-muted);
  background: var(--wizard-surface-3);
  border: 1px solid var(--wizard-border-strong);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}
/* Per-model info badges (Beta / Extended context etc.) — same pill grammar as
   .model-lock-badge but coloured so they stand out as informational, not a
   lock state. Badges are defined per-model via MODELS[].badges. */
.model-badge {
  display: inline-block;
  margin-top: 6px;
  margin-right: 4px;
  font-size: 10px;
  font-weight: 600;
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}
.model-badge-beta {
  color: #b45309;            /* amber-700 — "work in progress" without alarm */
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.model-badge-extended-context {
  color: #6d28d9;            /* violet-700 — premium context tier */
  background: rgba(124, 58, 237, 0.10);
  border: 1px solid rgba(124, 58, 237, 0.30);
}
.model-badge-prepay {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.10);
  border: 1px solid rgba(14, 165, 233, 0.30);
}
.model-badge-time-plan {
  color: #047857;
  background: rgba(16, 185, 129, 0.10);
  border: 1px solid rgba(16, 185, 129, 0.30);
}
.model-card.selected .model-badge {
  /* Lift badge opacity against the selected-state accent background so the
     pills don't visually disappear when the card is highlighted. */
  opacity: 0.95;
}
.model-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--wizard-text-primary);
}
.model-card.selected .model-name { color: var(--wizard-text-primary); }
.model-tag {
  font-size: 11px;
  color: var(--wizard-text-muted);
  font-family: ui-monospace, "JetBrains Mono", monospace;
}

/* --- Skill grid (Step 4) — two stacked sections, no tabs ---
   Each .skill-section wraps an h3.section-title and a .skill-grid of
   .skill-card buttons. The must-have section comes first, then the
   curated-pack collection. Spacing between sections is handled by the
   .step-body flex gap (0.75rem), so .skill-section itself has no margin. */
.skill-section {
  margin: 0;
  /* The global `section { padding: 96px 0 }` rule (added for marketing
     sections higher in the file) leaks in here and inflates each step-4
     skill section by ~192px of vertical air — between the two card groups
     that's why Vadim saw a huge gap. Override explicitly (pitfall #21). */
  padding: 0;
}

.skill-section .section-title {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
  padding: 0 2px;
}

/* Variant B — both section titles are equal-weight, equal-size, white
   (text-primary) so "Must have" doesn't visually out-shout "Collection".
   Hierarchy comes from the "★ " prefix on must-have only. */
.skill-section.must-have    .section-title,
.skill-section.collection  .section-title {
  color: var(--wizard-text-primary);
  font-size: 14px;
}
.skill-section .section-title > span {
  /* setLang walks [data-ru][data-en] elements and swaps textContent on
     the leaves, never on the parent — so data-* lives on the inner <span>
     (pitfall #41). The wrapper .section-title keeps heading semantics. */
}

/* The 2-column grid that holds skill cards in each section. Two columns
   on desktop, single-column on narrow viewports (mobile media query near
   the end of the file). grid-auto-rows: 1fr equalizes card heights
   across the row so a 4-line description doesn't break alignment. */
.skill-section .skill-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  /* LOCKED-IN 2026-06-30: 150px row + 4-line clamp was user-approved (variant A).
     After a 5-commit flip-flop at 130/150/200/180/180, user reported
     "~36% empty space below" at 180/4-line — tightened to 150/4-line which
     keeps all description text fully visible and trims the band from
     ~65px to ~33px (~22%). Don't change without explicit user ask. */
  grid-auto-rows: 150px;
  gap: 10px;
  margin-top: 10px;
}

.skill-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 0.5px solid var(--wizard-border-strong);
  border-radius: var(--wizard-radius);
  background: var(--wizard-surface-1);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  font-family: inherit;
  color: inherit;
  position: relative;
  /* No explicit width: in a grid context, `width: 100%` makes the item span
     both columns (entire row). Grid auto-width lets each card sit in its
     1-column slot — pair with `repeat(2, 1fr)` for the 2-per-row layout.
     min-width: 0 prevents the default `auto` from forcing the card wider
     than its column when the description text would overflow otherwise. */
  min-width: 0;
  min-height: 150px;
  /* matches the pinned grid-auto-rows (= 150px, see @skill-section .skill-grid
     LOCKED-IN block). Combined with -webkit-line-clamp: 4 in .skill-desc,
     accommodates up to 4 description lines and trims the breathing-room
     band to ~33px below text. overflow hidden clips wide single-word
     strings past the row budget. */
  overflow: hidden;
}
.skill-card:hover:not(.selected) {
  background: var(--wizard-surface-3);
  border-color: var(--wizard-border-stronger);
}
.skill-card.selected {
  /* Keep border-width identical to default (0.5px) — changing width would
     shrink the content box by +1px each side under border-box and bump
     the text reflow on selection, even though the words themselves are
     unchanged. Only colour flips: border → accent-purple, bg → accent-soft. */
  border-color: var(--wizard-accent);
  background: var(--wizard-accent-soft);
}
.skill-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--wizard-surface-0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.skill-card.selected .skill-icon {
  background: var(--wizard-accent);
  color: #fff;
}
.skill-card.selected .skill-icon svg {
  fill: #fff;
}
.skill-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.skill-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--wizard-text-primary);
  line-height: 1.3;
}
.skill-card.selected .skill-title { color: var(--wizard-text-accent); }
.skill-desc {
  font-size: 12px;
  color: var(--wizard-text-muted);
  line-height: 1.4;
  /* Cap at 4 lines. LOCKED-IN @ 4 lines together with grid row 150px
     (.skill-section .skill-grid LOCKED-IN block) — keeps all 4-line
     description text visible while removing ~30px of empty band at
     the bottom of every card. */
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.skill-card.selected .skill-desc { color: var(--wizard-text-secondary); }
.skill-source {
  /* Source (e.g. "obra/superpowers") is for power users — hidden in the
     compact horizontal card. Data is still in the DOM for screen readers
     and the install plan. Bump `display` to `inline` to bring it back. */
  display: none;
}

/* --- Step 5 summary --- */
.summary-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--wizard-border);
}
.summary-row:last-of-type { border-bottom: none; }
.summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--wizard-text-muted);
}
.summary-value {
  font-size: 14px;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  color: var(--wizard-text-primary);
  background: var(--wizard-surface-2);
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-block;
  align-self: flex-start;
  word-break: break-all;
}
.summary-list {
  margin: 0;
  padding: 0 0 0 18px;
  list-style: disc;
  color: var(--wizard-text-primary);
  font-size: 13px;
  line-height: 1.65;
}
.summary-list li { margin: 2px 0; }
.summary-list li.is-empty {
  list-style: none;
  margin-left: -18px;
  color: var(--wizard-text-muted);
  font-style: italic;
}
.summary-preview {
  margin-top: 4px;
  border: 1px solid var(--wizard-border);
  border-radius: var(--wizard-radius);
  background: var(--wizard-surface-2);
  overflow: hidden;
}
.summary-preview summary {
  padding: 10px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--wizard-text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.summary-preview summary::-webkit-details-marker { display: none; }
.summary-preview summary::before {
  content: "▶";
  font-size: 9px;
  margin-right: 6px;
  display: inline-block;
  transition: transform 0.15s;
}
.summary-preview[open] summary::before { transform: rotate(90deg); }
.summary-preview pre {
  margin: 0;
  padding: 12px 14px;
  background: #050507;
  font-family: ui-monospace, "JetBrains Mono", monospace;
  font-size: 11.5px;
  color: var(--wizard-text-secondary);
  line-height: 1.55;
  max-height: 280px;
  overflow: auto;
  border-top: 1px solid var(--wizard-border);
}
.notice.warning {
  padding: 10px 14px;
  border-radius: var(--wizard-radius);
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--wizard-text-secondary);
  font-size: 12.5px;
  line-height: 1.55;
}
.notice.warning strong { color: var(--wizard-warn); margin-right: 6px; }

/* Step 4 — static Node.js requirement notice. Reuses .notice.warning palette;
   the link is the actionable emphasis. Reset margin-top so step-body flex gap
   (0.75rem) governs spacing instead of the generic .notice 22px top margin. */
.skill-requirement { margin-top: 0; }
.skill-requirement .notice-link {
  color: var(--wizard-warn);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
  margin-left: 4px;
}
.skill-requirement .notice-link:hover { color: #fbbf24; }

/* Post-download card inside wizard step 5 — same gradient vibe as the old
   form version but darker, fits the wizard surface. */
.post-download {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 1rem;
  padding: 14px 16px;
  border-radius: var(--wizard-radius);
  border: 1px solid var(--wizard-accent-soft-2);
  background: var(--wizard-accent-soft);
  animation: postDownloadIn 0.35s ease-out;
}
.post-download[hidden] { display: none; }
.post-download-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}
.post-download-body { flex: 1; min-width: 0; }
.post-download-body strong {
  display: block;
  font-size: 13px;
  margin-bottom: 2px;
  color: var(--wizard-text-primary);
}
.post-download-body p {
  margin: 0;
  font-size: 12px;
  color: var(--wizard-text-secondary);
  line-height: 1.4;
}
@keyframes postDownloadIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- Wizard nav (back/next/download buttons) --- */
.wizard-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 1.25rem;
  padding: 0 4px;
}
.wizard-nav-spacer { flex: 1; }

.btn-back, .btn-next {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: var(--wizard-radius);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  border: 1px solid var(--wizard-border-strong);
}
.btn-back {
  background: transparent;
  color: var(--wizard-text-secondary);
}
.btn-back:hover {
  color: var(--wizard-text-primary);
  border-color: var(--wizard-border-strong);
  background: var(--wizard-surface-2);
}
.btn-next {
  background: var(--wizard-accent);
  border-color: var(--wizard-accent);
  color: #fff;
}
.btn-next:hover { background: var(--wizard-accent-hover); border-color: var(--wizard-accent-hover); }
.btn-next:disabled, .btn-next[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-next.btn-generate {
  background: var(--wizard-accent);
}
.btn-next.btn-generate:hover { background: var(--wizard-accent-hover); }

/* Force [hidden] attribute to actually hide buttons that share .btn-next/.btn-back classes.
   Otherwise .btn-next { display: inline-flex } (specificity 0,1,0) silently beats the
   [hidden] attribute (also 0,1,0, but cascade order / class-rule wins), so wizardDownload
   and wizardBack stay visible when the JS toggles their `hidden` property.
   Class+attribute selector bumps specificity to (0,2,0) → reliably display:none.
   See pitfall #30 in neutralbeats-docs-site SKILL.md. */
.btn-back[hidden], .btn-next[hidden] { display: none; }

/* Next (Далее) uses the same outline/transparent "Back" style — only the Download
   button (also class btn-next, plus .btn-generate modifier) keeps the accent fill.
   Shared .btn-next sizing/border still applies; we only override color + bg here. */
.btn-next:not(.btn-generate) {
  background: transparent;
  color: var(--wizard-text-secondary);
}
.btn-next:not(.btn-generate):hover {
  color: var(--wizard-text-primary);
  background: var(--wizard-surface-2);
  border-color: var(--wizard-border-strong);
}

/* Form error message (red text below cards) */
.form-error {
  margin: 12px 4px 0;
  color: #ef4444;
  font-size: 13px;
  min-height: 1.2em;
}

/* Validation error highlight on text inputs inside the wizard. Sits inside
   the dark wizard card so we use a soft red ring instead of an outline. */
.wizard-card input.is-error,
.wizard-card input.is-error:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

/* Mobile: keep cards usable but stack on narrow viewports */
@media (max-width: 640px) {
  .wizard-card { padding: 1.25rem 1rem 1.5rem; }
  .step-bar { padding: 0 4px; }
  .dot-label { font-size: 10px; }
  .step-line { margin: 14px -4px 0; }
  /* `.skill-section .skill-grid` (0,2,0) has higher specificity than the
     desktop `.skill-section .skill-grid { repeat(2, 1fr) }` would imply if
     we used bare `.skill-grid`, but since both share the same selector here
     the cascade order resolves it. Use the more specific selector to match
     what the desktop rule already targets. */
  .model-grid { grid-template-columns: 1fr; }
  .skill-section .skill-grid { grid-template-columns: 1fr; }
  /* On mobile, cards stack 1-per-row. Drop the square aspect-ratio or they
     become full-width squares (e.g. 350x350 on iPhone) — too tall to read. */
  .skill-card { aspect-ratio: auto; }
  .chip-group { gap: 6px; }
  .chip { padding: 7px 12px; font-size: 12px; }
}

/* Step 4 — breathing room. The skill step has 4 stacked children
   (notice + must-have section + collection section). At step-body
   gap: 0.4rem (~6px) Vadim felt the Node-requirement banner and the
   two card groups all crammed together — easy to miss the visual
   boundary between sections. Bump the gap to 0.85rem (~13.6px) so
   the notice-to-must-have and must-have-to-collection transitions
   read as deliberate pauses, while still keeping the step compact
   vs other long pages on the site. Other steps still use the
   default 0.75rem and feel right. Title→grid is 6px to keep each
   section's internals tight. */
.wizard-step[data-step="4"] .step-body { gap: 0.85rem; }
.skill-section .skill-grid { margin-top: 6px; }
