:root {
  --bg: #030303;
  --bg2: #080808;
  --card: #111;
  --card-hover: #1a1a1a;
  --card-gold: #17130b;
  --line: #222;
  --gold: #d4af37;
  --gold2: #f0c850;
  --gold-dim: rgba(212, 175, 55, 0.12);
  --gold-glow: rgba(212, 175, 55, 0.25);
  --text: #f0f0f0;
  --text2: #aaa;
  --green: #4ade80;
  --red: #ef4444;
  --radius: 16px;
  --radius-sm: 10px;
  --max: 1200px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold2); text-decoration: none; }
img { max-width: 100%; display: block; height: auto; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font: inherit; color: var(--text); background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; width: 100%; outline: none; transition: border-color .2s; }
input:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 100px; }

/* ========== MOBILE FIRST (базовые стили) ========== */

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(3,3,3,.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--gold-dim);
  padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 20px var(--gold-glow); }
.brand-title { font-weight: 800; font-size: 15px; letter-spacing: -.2px; }
.brand-sub { font-size: 10px; color: var(--text2); margin-top: 1px; text-transform: uppercase; letter-spacing: .5px; }
.nav { display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav button {
  padding: 8px 10px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap;
  background: rgba(255,255,255,.04); border: 1px solid transparent; transition: all .2s; color: var(--text2);
}
.nav button.active { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #000; border-color: var(--gold); }
.nav button:not(.active):active { background: rgba(255,255,255,.08); }

.mobilebar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  background: rgba(3,3,3,.92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--gold-dim);
  display: flex; justify-content: space-around; padding: 6px 0 calc(6px + var(--safe-bottom));
}
.mobilebar button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 10px; font-size: 10px; color: var(--text2); transition: color .2s; min-width: 48px;
}
.mobilebar button.active { color: var(--gold2); }
.mobilebar button::before { font-size: 18px; line-height: 1; }

.shell { padding: 12px; padding-bottom: 80px; }
.sidebar { display: none; }
.content { width: 100%; }

/* Карточки */
.card {
  background: var(--card); border-radius: var(--radius); padding: 18px;
  border: 1px solid var(--line); transition: all .2s;
}
.card:active { transform: scale(.98); }
.card.gold { background: var(--card-gold); border-color: rgba(212,175,55,.2); }
.panel { margin-bottom: 16px; }
.panel h1 { font-size: 22px; font-weight: 800; letter-spacing: -.5px; margin-bottom: 4px; }
.panel h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px;
  background: var(--gold-dim); color: var(--gold2); margin-bottom: 8px;
}
.muted { color: var(--text2); font-size: 14px; }
.section-lead { color: var(--text2); font-size: 15px; margin-bottom: 16px; line-height: 1.5; }
.grad { background: linear-gradient(135deg, var(--gold), var(--gold2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* Кнопки */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px;
  transition: all .2s; min-height: 44px; white-space: nowrap;
}
.btn.primary { background: linear-gradient(135deg, var(--gold), var(--gold2)); color: #000; }
.btn.primary:active { transform: scale(.96); }
.btn.secondary { background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--line); }
.btn.secondary:active { background: rgba(255,255,255,.1); }
.btn.ghost { background: transparent; color: var(--text2); padding: 8px 12px; min-height: auto; }
.btn.danger { background: rgba(239,68,68,.12); color: var(--red); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* Прогресс */
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold2)); border-radius: 999px; transition: width .5s ease; }

/* Дашборд */
.dashboard-hero { margin-bottom: 16px; }
.dashboard-hero h1 { font-size: 24px; margin: 8px 0 4px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 16px 0; }
.kpi { background: var(--card); border-radius: var(--radius-sm); padding: 14px; border: 1px solid var(--line); }
.kpi b { display: block; font-size: 24px; font-weight: 800; }
.kpi span { font-size: 12px; color: var(--text2); }

/* Сетки */
.grid { display: grid; gap: 12px; }
.grid.two, .grid.three, .pricing, .gen-grid { grid-template-columns: 1fr; }

/* Хедер */
.hero { border: 1px solid var(--gold-dim); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; background: linear-gradient(180deg, rgba(5,5,5,.95), rgba(5,5,5,.7)), url('assets/brand/hero-rocket.png'); background-size: cover; background-position: center; }
.hero-content { padding: 28px 20px; }
.eyebrow { font-size: 12px; color: var(--gold2); margin-bottom: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.hero h1 { font-size: 28px; font-weight: 900; letter-spacing: -1px; line-height: 1.15; margin-bottom: 12px; }
.hero .lead { font-size: 15px; color: var(--text2); line-height: 1.5; margin-bottom: 20px; }
.hero-panel { padding: 20px; }
.glass { background: rgba(255,255,255,.03); border-radius: var(--radius); padding: 20px; border: 1px solid rgba(255,255,255,.05); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { text-align: center; }
.stat b { display: block; font-size: 28px; font-weight: 900; }
.stat span { font-size: 12px; color: var(--text2); }

/* Промпты */
.prompt { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; border: 1px solid var(--line); }
.prompt h3 { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.prompt pre {
  background: rgba(0,0,0,.4); border-radius: var(--radius-sm); padding: 14px;
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; color: #ccc; max-height: 300px; overflow-y: auto;
  margin-bottom: 12px;
}
.pro-lock { text-align: center; padding: 24px; }

/* Шаги */
.step-card {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center;
  background: var(--card); border-radius: var(--radius-sm); padding: 12px 14px;
  border: 1px solid var(--line); transition: all .2s; cursor: pointer;
}
.step-card:active { transform: scale(.98); border-color: var(--gold-dim); }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--gold-dim); color: var(--gold2); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.step-card b { font-size: 14px; display: block; margin-bottom: 2px; }
.step-card .muted { font-size: 12px; }
.badge { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: var(--gold-dim); color: var(--gold2); white-space: nowrap; }

/* Уровни */
.level-card {
  background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
  border: 1px solid var(--line);
}
.level-card img { width: 100%; height: 140px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 12px; }
.level-card h3 { font-size: 18px; font-weight: 700; margin: 4px 0; }

/* Чек-лист */
.checklist { display: flex; flex-direction: column; gap: 6px; }
.checkitem { padding: 10px 14px; background: rgba(255,255,255,.03); border-radius: var(--radius-sm); font-size: 14px; border-left: 3px solid var(--gold); }

/* Поле ввода */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text2); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }

/* Сообщения */
.msg { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-top: 8px; }
.msg.ok { background: rgba(74,222,128,.1); color: var(--green); border: 1px solid rgba(74,222,128,.2); }
.msg.bad { background: rgba(239,68,68,.1); color: var(--red); border: 1px solid rgba(239,68,68,.2); }

/* Поиск */
.search input { margin-bottom: 12px; }

/* Аксесс-бокс */
.access-box { max-width: 400px; margin: 40px auto; text-align: center; }
.access-box h2 { margin: 12px 0 8px; }
.access-box .field { text-align: left; }

/* Футер */
.footer { text-align: center; padding: 24px 16px; font-size: 12px; color: var(--text2); }
.legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }

/* Копи-тост */
.copy-toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--gold); color: #000; padding: 10px 20px; border-radius: 999px; font-weight: 600; font-size: 13px; opacity: 0; transition: all .3s ease; z-index: 100; pointer-events: none; }
.copy-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Тарифы */
.pricing { display: grid; gap: 12px; }
.price-card { text-align: center; padding: 24px; }
.price { font-size: 36px; font-weight: 900; margin: 12px 0; }
.price-card .list { text-align: left; margin: 12px 0; }
.price-card .list div { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.price-card .list div::before { content: '✓ '; color: var(--green); }

/* Сайдбар на десктопе */
.side-card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; border: 1px solid var(--line); }

/* Визуальные карточки */
.visual-card img { width: 100%; border-radius: var(--radius-sm); margin-bottom: 12px; }
.visual-card .body { padding: 0; }

/* Результатбокс */
.resultbox { min-height: 120px; margin: 8px 0; }

/* Анимации */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.hero, .card, .step-card, .level-card, .prompt { animation: fadeIn .4s ease both; }
.card:nth-child(2) { animation-delay: .05s; }
.card:nth-child(3) { animation-delay: .1s; }
.card:nth-child(4) { animation-delay: .15s; }

/* ========== TABLET (768px+) ========== */
@media (min-width: 768px) {
  body { font-size: 16px; }
  .topbar { padding: 12px 24px; }
  .brand img { width: 40px; height: 40px; }
  .brand-title { font-size: 17px; }
  .nav button { padding: 10px 16px; font-size: 13px; }
  .mobilebar { display: none; }
  .shell { padding: 24px; padding-bottom: 24px; display: grid; grid-template-columns: 240px 1fr; gap: 24px; max-width: var(--max); margin: 0 auto; }
  .sidebar { display: block; position: sticky; top: 74px; height: fit-content; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 12px; }
  .side-nav button { text-align: left; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text2); transition: all .2s; }
  .side-nav button.active { background: var(--gold-dim); color: var(--gold2); font-weight: 600; }
  .side-nav button:active { background: rgba(255,255,255,.05); }
  .hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; min-height: 480px; }
  .hero-content { padding: 48px; }
  .hero h1 { font-size: 42px; }
  .hero-panel { padding: 48px 48px 48px 0; }
  .grid.two { grid-template-columns: repeat(2, 1fr); }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
  .pricing { grid-template-columns: repeat(2, 1fr); }
  .gen-grid { grid-template-columns: repeat(2, 1fr); }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .level-card { display: grid; grid-template-columns: 160px 1fr auto; gap: 20px; align-items: center; }
  .level-card img { height: 100px; margin-bottom: 0; }
  .dashboard-hero h1 { font-size: 32px; }
}

/* ========== DESKTOP (1024px+) ========== */
@media (min-width: 1024px) {
  .shell { grid-template-columns: 280px 1fr; padding: 32px; gap: 32px; }
  .nav button { padding: 10px 20px; }
  .hero h1 { font-size: 52px; }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
}

/* Анимация прогрузки */
.skeleton { background: linear-gradient(90deg, var(--card) 25%, var(--card-hover) 50%, var(--card) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
