* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #0d0a1a; --card: rgba(255,255,255,.035); --line: #2c2545; --line2: #4a3f6e;
  --text: #ece8f5; --muted: #9a90b8; --a: #a06bff; --b: #38c8ff;
}
body {
  font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text);
  min-height: 100vh; overflow-x: hidden;
}
.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(600px 400px at 20% 10%, rgba(120,80,255,.18), transparent),
    radial-gradient(700px 500px at 85% 80%, rgba(0,200,255,.12), transparent);
}
header { text-align: center; padding: 44px 16px 22px; position: relative; z-index: 1; }
h1 { font-size: 52px; letter-spacing: 4px; font-weight: 800; }
h1 .logo { background: linear-gradient(135deg, var(--a), var(--b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { color: var(--muted); margin-top: 8px; font-size: 17px; }
main { max-width: 960px; margin: 0 auto; padding: 16px; position: relative; z-index: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.hidden { display: none !important; }

/* загрузка */
.dropzone { border: 2px dashed var(--line2); padding: 72px 24px; text-align: center; cursor: pointer; transition: .2s; }
.dropzone:hover, .dropzone.over { border-color: var(--a); background: rgba(160,107,255,.06); transform: translateY(-2px); }
.dz-icon { font-size: 52px; margin-bottom: 12px; }
.dz-title { font-size: 24px; font-weight: 700; }
.dz-sub { color: var(--muted); margin-top: 6px; }
.dz-hint { color: #6f6690; margin-top: 16px; font-size: 13px; }

/* генерация */
.working { display: flex; gap: 24px; align-items: center; padding: 28px; }
.thumb { width: 150px; height: 150px; object-fit: contain; border-radius: 12px; background: #16122a; flex: none; }
.work-body { flex: 1; min-width: 0; }
.work-title { font-size: 20px; font-weight: 700; }
.bar { height: 10px; border-radius: 99px; background: rgba(255,255,255,.07); margin: 16px 0 10px; overflow: hidden; }
.bar-fill { height: 100%; width: 3%; border-radius: 99px; background: linear-gradient(90deg, var(--a), var(--b)); transition: width .6s; }
.work-text { color: var(--text); }
.work-note { color: var(--muted); font-size: 13px; margin-top: 10px; }

/* результат */
.result { overflow: hidden; }
#viewer { height: 520px; }
.viewer-bar { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.res-info { margin-left: auto; color: var(--muted); font-size: 13px; }
.btn {
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,.05);
  color: var(--text); cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block; transition: .2s; font-family: inherit;
}
.btn:hover { border-color: var(--a); }
.btn-main { background: linear-gradient(135deg, var(--a), var(--b)); border: none; font-weight: 700; color: #fff; }
.error { text-align: center; padding: 44px 20px; color: #ff8a8a; }
.error .btn { margin-top: 16px; }
footer { text-align: center; color: #5a5078; padding: 28px 16px 90px; font-size: 13px; position: relative; z-index: 1; }

/* верхняя панель и тарифы */
.topbar { position: relative; z-index: 2; display: flex; justify-content: flex-end; align-items: center; gap: 16px; padding: 14px 22px 0; }
.top-link { color: var(--muted); text-decoration: none; font-size: 15px; }
.top-link:hover { color: var(--text); }
.top-buy { padding: 9px 16px; }
.tariffs { margin-top: 40px; scroll-margin-top: 20px; }
.sec-title { text-align: center; font-size: 30px; margin-bottom: 20px; }
.tariff-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tariff { position: relative; padding: 26px 24px; text-align: center; display: flex; flex-direction: column; }
.tariff-main { border-color: var(--a); box-shadow: 0 0 0 1px var(--a), 0 14px 40px rgba(120,80,255,.25); }
.t-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); padding: 4px 14px; border-radius: 99px;
  font-size: 12px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--a), var(--b)); }
.t-name { font-size: 20px; font-weight: 700; }
.t-price { font-size: 44px; font-weight: 800; margin-top: 8px; }
.tariff-main .t-price { background: linear-gradient(135deg, var(--a), var(--b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.t-period { color: var(--muted); margin-bottom: 16px; }
.tariff .plan-list { margin-bottom: 20px; flex: 1; }
.t-btn { width: 100%; text-align: center; padding: 13px; }
.t-note { text-align: center; color: #6f6690; font-size: 13px; margin-top: 16px; }
.btn:disabled { opacity: .55; cursor: default; }

/* баланс и подписка */
.balance { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); color: var(--muted); }
.balance .btn { padding: 8px 16px; }
.modal { position: fixed; inset: 0; z-index: 30; background: rgba(5,3,12,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { position: relative; width: 100%; max-width: 400px; background: #151126; border: 1px solid var(--line2); border-radius: 20px; padding: 28px 24px; text-align: center; }
.modal-x { position: absolute; right: 14px; top: 12px; }
.modal-box h2 { font-size: 22px; margin-bottom: 18px; }
.plan-price { font-size: 46px; font-weight: 800; background: linear-gradient(135deg, var(--a), var(--b)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan-days { color: var(--muted); margin-bottom: 16px; }
.plan-list { list-style: none; text-align: left; margin: 0 auto 20px; max-width: 300px; }
.plan-list li { padding: 7px 0 7px 26px; position: relative; border-bottom: 1px solid rgba(255,255,255,.06); }
.plan-list li::before { content: '✓'; position: absolute; left: 4px; color: var(--b); font-weight: 700; }
.plan-btn { width: 100%; padding: 14px; font-size: 16px; }
.plan-note { color: #6f6690; font-size: 12px; margin-top: 12px; }

/* вопросы и ответы */
.faq { margin-top: 40px; }
.faq-item { padding: 0; margin-bottom: 10px; }
.faq-item summary { cursor: pointer; padding: 16px 18px; font-weight: 600; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; color: var(--b); font-weight: 700; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { padding: 0 18px 16px; color: #cfc8e4; line-height: 1.55; }

/* cookie и подвал */
.foot-link { color: #7a70a0; }
.cookie-bar { position: fixed; left: 16px; right: 96px; bottom: 16px; z-index: 25; display: flex; gap: 14px; align-items: center;
  padding: 12px 16px; border-radius: 14px; background: #1b1630; border: 1px solid var(--line2); font-size: 13px; color: var(--muted);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.cookie-bar a { color: var(--b); }
.cookie-bar .btn { flex: none; padding: 8px 16px; }
/* Telegram-бот */
.tg-ico { width: 1em; height: 1em; vertical-align: -0.12em; margin-right: 6px; }
.tg-link { color: #7fc8ff; }
.bot { margin-top: 28px; display: flex; align-items: center; gap: 24px; padding: 20px 24px; }
.bot-qr { width: 140px; height: auto; border-radius: 12px; flex: none; }
.bot-body { flex: 1; min-width: 0; }
.bot-title { font-size: 20px; margin-bottom: 6px; }
.bot-title .tg-ico { color: #38c8ff; }
.bot-text { color: var(--muted); line-height: 1.45; margin-bottom: 14px; }

/* техподдержка — плашка слева внизу */
.support {
  position: fixed; left: 18px; bottom: 22px; z-index: 19; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px 9px 10px; border-radius: 14px; text-decoration: none; color: var(--text);
  background: rgba(21,17,38,.92); border: 1px solid var(--line2); box-shadow: 0 8px 24px rgba(0,0,0,.35); transition: .2s;
}
.support:hover { border-color: var(--a); transform: translateY(-2px); }
.support-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; color: #fff;
  background: linear-gradient(135deg, var(--a), var(--b)); flex: none; }
.support-text { display: flex; flex-direction: column; font-size: 12px; line-height: 1.35; }
.support-text b { font-weight: 600; color: var(--muted); }
.support-text span { color: var(--b); font-size: 13px; }
@media (max-width: 1100px) { .support { display: none; } }

/* регистрация и вход */
.top-auth { padding: 8px 14px; white-space: nowrap; max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
.auth-tabs { display: flex; gap: 6px; margin-bottom: 18px; background: rgba(255,255,255,.04); padding: 4px; border-radius: 12px; }
.auth-tab { flex: 1; padding: 9px; border: none; border-radius: 9px; background: none; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; }
.auth-tab.active { background: rgba(160,107,255,.22); color: var(--text); }
.auth-form { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.auth-input { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line2); background: #0f0c1e; color: var(--text); font: inherit; font-size: 15px; }
.auth-input:focus { outline: none; border-color: var(--a); }
.auth-agree { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); font-size: 13px; line-height: 1.4; }
.auth-agree a { color: var(--b); }
.auth-agree input { margin-top: 2px; }
.auth-error { color: #ff8a8a; font-size: 14px; }
.auth-done-text { color: var(--muted); line-height: 1.5; margin-bottom: 18px; }

@media (max-width: 700px) { .cookie-bar { right: 16px; bottom: 86px; flex-direction: column; align-items: stretch; } }

/* чат */
.chat-toggle {
  position: fixed; right: 22px; bottom: 22px; z-index: 20; width: 58px; height: 58px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 26px; color: #fff;
  background: linear-gradient(135deg, var(--a), var(--b)); box-shadow: 0 8px 26px rgba(120,80,255,.45);
}
.chat {
  position: fixed; right: 22px; bottom: 92px; z-index: 21; width: 370px; height: 520px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column; background: #151126; border: 1px solid var(--line2); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0,0,0,.55); overflow: hidden;
}
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-weight: 700;
  background: linear-gradient(135deg, rgba(160,107,255,.25), rgba(56,200,255,.15)); border-bottom: 1px solid var(--line); }
.chat-x { background: none; border: none; color: var(--text); font-size: 18px; cursor: pointer; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; line-height: 1.45; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { background: rgba(255,255,255,.06); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.me { background: linear-gradient(135deg, var(--a), #6f7dff); align-self: flex-end; border-bottom-right-radius: 4px; color: #fff; }
.msg.wait { color: var(--muted); font-style: italic; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form textarea {
  flex: 1; resize: none; border-radius: 10px; border: 1px solid var(--line2); background: #0f0c1e; color: var(--text);
  padding: 10px; font: inherit; font-size: 14px; max-height: 110px;
}
.chat-form .btn { padding: 0 16px; }

/* скелет для модели */
.rig { margin-top: 16px; padding: 20px 22px; }
.rig-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.rig-head h2 { font-size: 20px; }
.rig-sub { color: var(--text); margin-bottom: 14px; line-height: 1.45; }
.rig-sub span { color: var(--muted); }
.rig-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rig-tpl {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px; text-align: center;
  border-radius: 14px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); color: var(--text);
  cursor: pointer; font-family: inherit; transition: .2s;
}
.rig-tpl:hover { border-color: var(--a); background: rgba(160,107,255,.08); transform: translateY(-2px); }
.rig-ico { font-size: 40px; }
.rig-tt { font-weight: 700; font-size: 16px; }
.rig-tn { color: var(--muted); font-size: 13px; line-height: 1.4; }
.rig-tip { color: #6f6690; font-size: 13px; margin-top: 14px; line-height: 1.45; }
.rig-hint { color: var(--muted); font-size: 14px; margin-bottom: 12px; min-height: 20px; }
.rig-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.rig-check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-right: 12px; }
.rig-num { width: 80px; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line2); background: #0f0c1e; color: var(--text); font: inherit; }

/* готовые скелеты */
.ready-sec { margin-top: 40px; scroll-margin-top: 20px; }
.ready-lead { text-align: center; color: var(--muted); margin: -8px auto 20px; max-width: 620px; line-height: 1.45; }
.ready-grid { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px 2px 8px; }
.ready-grid::-webkit-scrollbar { display: none; }
.ready { overflow: hidden; display: flex; flex-direction: column; transition: .2s; flex: 0 0 calc((100% - 32px) / 3); scroll-snap-align: start; }
.ready-view { position: relative; }
.ready-anim { position: absolute; left: 10px; bottom: 10px; max-width: calc(100% - 20px); padding: 6px 8px; border-radius: 8px;
  border: 1px solid var(--line2); background: rgba(15,12,30,.85); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.ready-nav { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.ready-arrow { padding: 6px 14px; font-size: 20px; line-height: 1; }
.ready-range { flex: 1; accent-color: var(--a); cursor: pointer; height: 24px; }
.rig-select { padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line2); background: #0f0c1e; color: var(--text); font: inherit; }
.ready.chosen { border-color: var(--a); box-shadow: 0 0 0 1px var(--a), 0 14px 40px rgba(120,80,255,.25); }
.ready-view { height: 220px; background: radial-gradient(circle at 50% 40%, rgba(160,107,255,.12), transparent 70%); }
.ready-view canvas { display: block; }
.ready-body { padding: 14px 16px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ready-title { font-weight: 700; font-size: 17px; }
.ready-note { color: var(--muted); font-size: 13px; line-height: 1.4; flex: 1; }
.ready-count { color: #6f6690; font-size: 12px; }
.ready-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ready-btns .btn { width: 100%; text-align: center; }
.ready-chosen { margin-bottom: 14px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--a);
  background: rgba(160,107,255,.1); color: var(--text); font-size: 14px; line-height: 1.45; }

@media (max-width: 700px) {
  .tariff-grid { grid-template-columns: 1fr; gap: 24px; }
  h1 { font-size: 36px; }
  .working { flex-direction: column; text-align: center; }
  #viewer { height: 400px; }
  .res-info { margin-left: 0; width: 100%; }
  .chat { right: 8px; left: 8px; width: auto; bottom: 86px; }
  .rig-grid { grid-template-columns: 1fr; }
  .ready { flex-basis: 85%; }
  .topbar { flex-wrap: wrap; justify-content: center; gap: 8px 14px; padding: 12px 12px 0; }
  .top-auth { max-width: 170px; }
  .bot-qr { display: none; }
  .bot { padding: 18px; }
  .bot-btn { width: 100%; text-align: center; }
  .rig { padding: 16px; }
}
